@powerhousedao/workflow 6.2.3-dev.29 → 6.2.3-dev.31

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 (374) hide show
  1. package/README.md +8 -8
  2. package/dist/browser/BlockSelector-BHJQOhie.js +3051 -0
  3. package/dist/browser/BlockSelector-BHJQOhie.js.map +1 -0
  4. package/dist/browser/{connection-form-D-NETdDQ.js → connection-form-CaduwBiu.js} +349 -50
  5. package/dist/browser/connection-form-CaduwBiu.js.map +1 -0
  6. package/dist/browser/{data-tree-DA4sc7B7.js → data-tree-8219PVfh.js} +2 -2
  7. package/dist/browser/{data-tree-DA4sc7B7.js.map → data-tree-8219PVfh.js.map} +1 -1
  8. package/dist/browser/document-models/index.js +2 -2
  9. package/dist/browser/document-models/workflow/index.js +3 -3
  10. package/dist/browser/{document-models-BohsduV4.js → document-models-C1ZgIZyV.js} +7 -2
  11. package/dist/browser/{document-models-BohsduV4.js.map → document-models-C1ZgIZyV.js.map} +1 -1
  12. package/dist/browser/{editor-B6N0PCuZ.js → editor-BHV1MZS8.js} +2437 -6283
  13. package/dist/browser/editor-BHV1MZS8.js.map +1 -0
  14. package/dist/{node/editor-StBssjcQ.mjs → browser/editor-C0C1eB0R.js} +385 -119
  15. package/dist/browser/editor-C0C1eB0R.js.map +1 -0
  16. package/dist/browser/{editor-BkdwuOC-.js → editor-CFcXlZY2.js} +14 -24
  17. package/dist/browser/editor-CFcXlZY2.js.map +1 -0
  18. package/dist/browser/editors/connection-editor/module.js +1 -1
  19. package/dist/browser/editors/workflow-editor/module.js +1 -1
  20. package/dist/browser/editors/workflow-studio/module.js +1 -1
  21. package/dist/browser/index.js +97 -43
  22. package/dist/browser/index.js.map +1 -1
  23. package/dist/browser/{module-Bkms70LV.js → module-DU2vb3FH.js} +574 -94
  24. package/dist/browser/module-DU2vb3FH.js.map +1 -0
  25. package/dist/browser/{piece-auth-Z4mZEOtL.js → piece-auth-BS5CtQOG.js} +45 -12
  26. package/dist/browser/piece-auth-BS5CtQOG.js.map +1 -0
  27. package/dist/browser/reactor/index.js +2 -2
  28. package/dist/browser/runtime-queries-Ds2kk-Ow.js +2535 -0
  29. package/dist/browser/runtime-queries-Ds2kk-Ow.js.map +1 -0
  30. package/dist/browser/trigger-text-BkcklsMX.js +5569 -0
  31. package/dist/browser/trigger-text-BkcklsMX.js.map +1 -0
  32. package/dist/browser/{upgrade-manifests-BLrv3cf2.js → upgrade-manifests-BpakVE9l.js} +2 -2
  33. package/dist/browser/{upgrade-manifests-BLrv3cf2.js.map → upgrade-manifests-BpakVE9l.js.map} +1 -1
  34. package/dist/browser/{workflow-CGtVlhr8.js → workflow-BxShRhVy.js} +3 -2
  35. package/dist/browser/workflow-BxShRhVy.js.map +1 -0
  36. package/dist/node/BlockSelector-lOcIiaqt.mjs +3055 -0
  37. package/dist/node/BlockSelector-lOcIiaqt.mjs.map +1 -0
  38. package/dist/node/{connection-form-C9vbfSnA.mjs → connection-form-DWt29kft.mjs} +349 -50
  39. package/dist/node/connection-form-DWt29kft.mjs.map +1 -0
  40. package/dist/node/{data-tree-CbqpF3lC.mjs → data-tree-Cdx85Y19.mjs} +2 -2
  41. package/dist/node/{data-tree-CbqpF3lC.mjs.map → data-tree-Cdx85Y19.mjs.map} +1 -1
  42. package/dist/node/document-models/index.mjs +2 -2
  43. package/dist/node/document-models/workflow/index.mjs +3 -3
  44. package/dist/{browser/editor-CZ5NvCyv.js → node/editor-CR823u-y.mjs} +385 -119
  45. package/dist/node/editor-CR823u-y.mjs.map +1 -0
  46. package/dist/node/{editor-DP36YDk5.mjs → editor-CwX-G2Jv.mjs} +2437 -7479
  47. package/dist/node/editor-CwX-G2Jv.mjs.map +1 -0
  48. package/dist/node/{editor-By9BHI8e.mjs → editor-D_t8OtZn.mjs} +14 -24
  49. package/dist/node/editor-D_t8OtZn.mjs.map +1 -0
  50. package/dist/node/editors/connection-editor/module.mjs +1 -1
  51. package/dist/node/editors/workflow-editor/module.mjs +1 -1
  52. package/dist/node/editors/workflow-studio/module.mjs +1 -1
  53. package/dist/node/index.mjs +102 -43
  54. package/dist/node/index.mjs.map +1 -1
  55. package/dist/node/{module-DuxxhgKs.mjs → module-Dhe5E-VA.mjs} +574 -94
  56. package/dist/node/module-Dhe5E-VA.mjs.map +1 -0
  57. package/dist/node/{piece-auth-Z4mZEOtL.mjs → piece-auth-BS5CtQOG.mjs} +45 -12
  58. package/dist/node/piece-auth-BS5CtQOG.mjs.map +1 -0
  59. package/dist/node/pieces/index.mjs +0 -1
  60. package/dist/node/pieces/index.mjs.map +1 -1
  61. package/dist/node/pieces/reactor/descriptor.json +85 -3
  62. package/dist/node/pieces/reactor/index.mjs +14843 -163
  63. package/dist/node/pieces/reactor/index.mjs.map +1 -1
  64. package/dist/node/pieces/reactor/package.json +1 -1
  65. package/dist/node/runtime-queries-D5EGaCrH.mjs +2544 -0
  66. package/dist/node/runtime-queries-D5EGaCrH.mjs.map +1 -0
  67. package/dist/node/trigger-text-DJIAQBWg.mjs +6765 -0
  68. package/dist/node/trigger-text-DJIAQBWg.mjs.map +1 -0
  69. package/dist/node/{upgrade-manifests-C1sl_M-H.mjs → upgrade-manifests-CmNd742Y.mjs} +2 -2
  70. package/dist/node/{upgrade-manifests-C1sl_M-H.mjs.map → upgrade-manifests-CmNd742Y.mjs.map} +1 -1
  71. package/dist/node/{workflow-C-uuQPnf.mjs → workflow-CGzYGZnr.mjs} +3 -2
  72. package/dist/node/workflow-CGzYGZnr.mjs.map +1 -0
  73. package/dist/powerhouse.manifest.json +6 -1
  74. package/dist/style.css +151 -19
  75. package/dist/types/ai/tools.d.ts +3 -1
  76. package/dist/types/ai/tools.d.ts.map +1 -1
  77. package/dist/types/ai/workflow-tools.d.ts.map +1 -1
  78. package/dist/types/document-models/document-models.d.ts +3 -0
  79. package/dist/types/document-models/document-models.d.ts.map +1 -1
  80. package/dist/types/document-models/workflow/v1/actions.d.ts +3 -0
  81. package/dist/types/document-models/workflow/v1/actions.d.ts.map +1 -1
  82. package/dist/types/document-models/workflow/v1/gen/actions.d.ts +3 -1
  83. package/dist/types/document-models/workflow/v1/gen/actions.d.ts.map +1 -1
  84. package/dist/types/document-models/workflow/v1/gen/creators.d.ts +2 -0
  85. package/dist/types/document-models/workflow/v1/gen/creators.d.ts.map +1 -1
  86. package/dist/types/document-models/workflow/v1/gen/document-model.d.ts.map +1 -1
  87. package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts +3 -0
  88. package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts.map +1 -1
  89. package/dist/types/document-models/workflow/v1/gen/index.d.ts +1 -0
  90. package/dist/types/document-models/workflow/v1/gen/index.d.ts.map +1 -1
  91. package/dist/types/document-models/workflow/v1/gen/ph-factories.d.ts.map +1 -1
  92. package/dist/types/document-models/workflow/v1/gen/publishing/actions.d.ts +16 -0
  93. package/dist/types/document-models/workflow/v1/gen/publishing/actions.d.ts.map +1 -0
  94. package/dist/types/document-models/workflow/v1/gen/publishing/creators.d.ts +5 -0
  95. package/dist/types/document-models/workflow/v1/gen/publishing/creators.d.ts.map +1 -0
  96. package/dist/types/document-models/workflow/v1/gen/publishing/error.d.ts +14 -0
  97. package/dist/types/document-models/workflow/v1/gen/publishing/error.d.ts.map +1 -0
  98. package/dist/types/document-models/workflow/v1/gen/publishing/operations.d.ts +12 -0
  99. package/dist/types/document-models/workflow/v1/gen/publishing/operations.d.ts.map +1 -0
  100. package/dist/types/document-models/workflow/v1/gen/reducer.d.ts.map +1 -1
  101. package/dist/types/document-models/workflow/v1/gen/runtime/actions.d.ts +6 -2
  102. package/dist/types/document-models/workflow/v1/gen/runtime/actions.d.ts.map +1 -1
  103. package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts +3 -2
  104. package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts.map +1 -1
  105. package/dist/types/document-models/workflow/v1/gen/runtime/error.d.ts +13 -1
  106. package/dist/types/document-models/workflow/v1/gen/runtime/error.d.ts.map +1 -1
  107. package/dist/types/document-models/workflow/v1/gen/runtime/operations.d.ts +2 -1
  108. package/dist/types/document-models/workflow/v1/gen/runtime/operations.d.ts.map +1 -1
  109. package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts +102 -12
  110. package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts.map +1 -1
  111. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts +21 -1
  112. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -1
  113. package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts +26 -1
  114. package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts.map +1 -1
  115. package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts +13 -1
  116. package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts.map +1 -1
  117. package/dist/types/document-models/workflow/v1/gen/utils.d.ts.map +1 -1
  118. package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts +13 -1
  119. package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts.map +1 -1
  120. package/dist/types/document-models/workflow/v1/gen/workflow/error.d.ts +13 -1
  121. package/dist/types/document-models/workflow/v1/gen/workflow/error.d.ts.map +1 -1
  122. package/dist/types/document-models/workflow/v1/module.d.ts +3 -0
  123. package/dist/types/document-models/workflow/v1/module.d.ts.map +1 -1
  124. package/dist/types/document-models/workflow/v1/src/helpers.d.ts +15 -0
  125. package/dist/types/document-models/workflow/v1/src/helpers.d.ts.map +1 -0
  126. package/dist/types/document-models/workflow/v1/src/reducers/edges.d.ts.map +1 -1
  127. package/dist/types/document-models/workflow/v1/src/reducers/publishing.d.ts +3 -0
  128. package/dist/types/document-models/workflow/v1/src/reducers/publishing.d.ts.map +1 -0
  129. package/dist/types/document-models/workflow/v1/src/reducers/runtime.d.ts.map +1 -1
  130. package/dist/types/document-models/workflow/v1/src/reducers/steps.d.ts.map +1 -1
  131. package/dist/types/document-models/workflow/v1/src/reducers/trigger.d.ts.map +1 -1
  132. package/dist/types/document-models/workflow/v1/src/reducers/variables.d.ts.map +1 -1
  133. package/dist/types/document-models/workflow/v1/src/reducers/workflow.d.ts.map +1 -1
  134. package/dist/types/document-models/workflow/v1/tests/block-validation-and-enable.test.d.ts +2 -0
  135. package/dist/types/document-models/workflow/v1/tests/block-validation-and-enable.test.d.ts.map +1 -0
  136. package/dist/types/document-models/workflow/v1/tests/config-and-variables.test.d.ts +2 -0
  137. package/dist/types/document-models/workflow/v1/tests/config-and-variables.test.d.ts.map +1 -0
  138. package/dist/types/document-models/workflow/v1/tests/draft-and-publish.test.d.ts +2 -0
  139. package/dist/types/document-models/workflow/v1/tests/draft-and-publish.test.d.ts.map +1 -0
  140. package/dist/types/document-models/workflow/v1/tests/updated-at.test.d.ts +2 -0
  141. package/dist/types/document-models/workflow/v1/tests/updated-at.test.d.ts.map +1 -0
  142. package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts.map +1 -1
  143. package/dist/types/editors/connection-editor/UsedBy.d.ts.map +1 -1
  144. package/dist/types/editors/connection-editor/connection-callbacks.d.ts.map +1 -1
  145. package/dist/types/editors/connection-editor/connection-form.d.ts +2 -1
  146. package/dist/types/editors/connection-editor/connection-form.d.ts.map +1 -1
  147. package/dist/types/editors/connection-editor/connection-usage.d.ts +3 -2
  148. package/dist/types/editors/connection-editor/connection-usage.d.ts.map +1 -1
  149. package/dist/types/editors/connection-editor/editor.d.ts.map +1 -1
  150. package/dist/types/editors/connection-editor/piece-auth.d.ts +7 -1
  151. package/dist/types/editors/connection-editor/piece-auth.d.ts.map +1 -1
  152. package/dist/types/editors/connection-editor/status.d.ts +2 -1
  153. package/dist/types/editors/connection-editor/status.d.ts.map +1 -1
  154. package/dist/types/editors/shared/controls.d.ts +17 -1
  155. package/dist/types/editors/shared/controls.d.ts.map +1 -1
  156. package/dist/types/editors/shared/editor-chrome.d.ts +2 -0
  157. package/dist/types/editors/shared/editor-chrome.d.ts.map +1 -1
  158. package/dist/types/editors/shared/icons.d.ts +2 -0
  159. package/dist/types/editors/shared/icons.d.ts.map +1 -1
  160. package/dist/types/editors/shared/undo-plan.d.ts +20 -0
  161. package/dist/types/editors/shared/undo-plan.d.ts.map +1 -0
  162. package/dist/types/editors/shared/undo-plan.test.d.ts +2 -0
  163. package/dist/types/editors/shared/undo-plan.test.d.ts.map +1 -0
  164. package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts.map +1 -1
  165. package/dist/types/editors/workflow-editor/editor.d.ts +0 -1
  166. package/dist/types/editors/workflow-editor/editor.d.ts.map +1 -1
  167. package/dist/types/editors/workflow-editor/run-kinds.d.ts +5 -0
  168. package/dist/types/editors/workflow-editor/run-kinds.d.ts.map +1 -0
  169. package/dist/types/editors/workflow-editor/runtime-api.d.ts +12 -139
  170. package/dist/types/editors/workflow-editor/runtime-api.d.ts.map +1 -1
  171. package/dist/types/editors/workflow-editor/runtime-client.d.ts +260 -0
  172. package/dist/types/editors/workflow-editor/runtime-client.d.ts.map +1 -0
  173. package/dist/types/editors/workflow-editor/runtime-client.test.d.ts +2 -0
  174. package/dist/types/editors/workflow-editor/runtime-client.test.d.ts.map +1 -0
  175. package/dist/types/editors/workflow-editor/runtime-context.d.ts +45 -0
  176. package/dist/types/editors/workflow-editor/runtime-context.d.ts.map +1 -0
  177. package/dist/types/editors/workflow-editor/runtime-persist.d.ts +23 -0
  178. package/dist/types/editors/workflow-editor/runtime-persist.d.ts.map +1 -0
  179. package/dist/types/editors/workflow-editor/runtime-persist.test.d.ts +2 -0
  180. package/dist/types/editors/workflow-editor/runtime-persist.test.d.ts.map +1 -0
  181. package/dist/types/editors/workflow-editor/runtime-queries.d.ts +128 -0
  182. package/dist/types/editors/workflow-editor/runtime-queries.d.ts.map +1 -0
  183. package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts +3 -3
  184. package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts.map +1 -1
  185. package/dist/types/editors/workflow-editor/ui/CanvasContextMenu.d.ts +4 -3
  186. package/dist/types/editors/workflow-editor/ui/CanvasContextMenu.d.ts.map +1 -1
  187. package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts +2 -3
  188. package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts.map +1 -1
  189. package/dist/types/editors/workflow-editor/ui/CreateConnectionModal.d.ts.map +1 -1
  190. package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts +6 -5
  191. package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts.map +1 -1
  192. package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts +7 -1
  193. package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -1
  194. package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts +34 -0
  195. package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts.map +1 -0
  196. package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts.map +1 -1
  197. package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts +2 -3
  198. package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -1
  199. package/dist/types/editors/workflow-editor/ui/StepTest.d.ts +11 -0
  200. package/dist/types/editors/workflow-editor/ui/StepTest.d.ts.map +1 -0
  201. package/dist/types/editors/workflow-editor/ui/VariablesEditor.d.ts +0 -1
  202. package/dist/types/editors/workflow-editor/ui/VariablesEditor.d.ts.map +1 -1
  203. package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts +1 -3
  204. package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts.map +1 -1
  205. package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts +1 -3
  206. package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts.map +1 -1
  207. package/dist/types/editors/workflow-editor/ui/add-follow-up.d.ts +31 -0
  208. package/dist/types/editors/workflow-editor/ui/add-follow-up.d.ts.map +1 -0
  209. package/dist/types/editors/workflow-editor/ui/add-follow-up.test.d.ts +2 -0
  210. package/dist/types/editors/workflow-editor/ui/add-follow-up.test.d.ts.map +1 -0
  211. package/dist/types/editors/workflow-editor/ui/ap-edge.d.ts.map +1 -1
  212. package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts +2 -1
  213. package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts.map +1 -1
  214. package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts +7 -9
  215. package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts.map +1 -1
  216. package/dist/types/editors/workflow-editor/ui/block-meta.d.ts +10 -5
  217. package/dist/types/editors/workflow-editor/ui/block-meta.d.ts.map +1 -1
  218. package/dist/types/editors/workflow-editor/ui/blocks.d.ts +43 -2
  219. package/dist/types/editors/workflow-editor/ui/blocks.d.ts.map +1 -1
  220. package/dist/types/editors/workflow-editor/ui/blocks.test.d.ts +2 -0
  221. package/dist/types/editors/workflow-editor/ui/blocks.test.d.ts.map +1 -0
  222. package/dist/types/editors/workflow-editor/ui/canvas-menu.d.ts +4 -2
  223. package/dist/types/editors/workflow-editor/ui/canvas-menu.d.ts.map +1 -1
  224. package/dist/types/editors/workflow-editor/ui/connection-create.d.ts +3 -3
  225. package/dist/types/editors/workflow-editor/ui/connection-create.d.ts.map +1 -1
  226. package/dist/types/editors/workflow-editor/ui/design-time.d.ts +92 -0
  227. package/dist/types/editors/workflow-editor/ui/design-time.d.ts.map +1 -0
  228. package/dist/types/editors/workflow-editor/ui/design-time.test.d.ts +2 -0
  229. package/dist/types/editors/workflow-editor/ui/design-time.test.d.ts.map +1 -0
  230. package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts +10 -2
  231. package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts.map +1 -1
  232. package/dist/types/editors/workflow-editor/ui/forms.d.ts +35 -6
  233. package/dist/types/editors/workflow-editor/ui/forms.d.ts.map +1 -1
  234. package/dist/types/editors/workflow-editor/ui/model.d.ts +58 -13
  235. package/dist/types/editors/workflow-editor/ui/model.d.ts.map +1 -1
  236. package/dist/types/editors/workflow-editor/ui/piece-source.d.ts +11 -6
  237. package/dist/types/editors/workflow-editor/ui/piece-source.d.ts.map +1 -1
  238. package/dist/types/editors/workflow-editor/ui/prop-controls.d.ts +5 -0
  239. package/dist/types/editors/workflow-editor/ui/prop-controls.d.ts.map +1 -1
  240. package/dist/types/editors/workflow-editor/ui/prop-controls.test.d.ts +2 -0
  241. package/dist/types/editors/workflow-editor/ui/prop-controls.test.d.ts.map +1 -0
  242. package/dist/types/editors/workflow-editor/ui/prop-defaults.d.ts +4 -0
  243. package/dist/types/editors/workflow-editor/ui/prop-defaults.d.ts.map +1 -0
  244. package/dist/types/editors/workflow-editor/ui/prop-defaults.test.d.ts +2 -0
  245. package/dist/types/editors/workflow-editor/ui/prop-defaults.test.d.ts.map +1 -0
  246. package/dist/types/editors/workflow-editor/ui/query-keys.d.ts +54 -0
  247. package/dist/types/editors/workflow-editor/ui/query-keys.d.ts.map +1 -0
  248. package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts +3 -8
  249. package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts.map +1 -1
  250. package/dist/types/editors/workflow-editor/ui/secret-ref.d.ts +18 -0
  251. package/dist/types/editors/workflow-editor/ui/secret-ref.d.ts.map +1 -0
  252. package/dist/types/editors/workflow-editor/ui/step-test.d.ts +14 -0
  253. package/dist/types/editors/workflow-editor/ui/step-test.d.ts.map +1 -0
  254. package/dist/types/editors/workflow-editor/ui/step-test.test.d.ts +2 -0
  255. package/dist/types/editors/workflow-editor/ui/step-test.test.d.ts.map +1 -0
  256. package/dist/types/editors/workflow-editor/ui/test-state.d.ts +7 -0
  257. package/dist/types/editors/workflow-editor/ui/test-state.d.ts.map +1 -0
  258. package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts +2 -1
  259. package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts.map +1 -1
  260. package/dist/types/editors/workflow-editor/ui/use-validity.d.ts +28 -0
  261. package/dist/types/editors/workflow-editor/ui/use-validity.d.ts.map +1 -0
  262. package/dist/types/editors/workflow-editor/ui/validation.d.ts +33 -1
  263. package/dist/types/editors/workflow-editor/ui/validation.d.ts.map +1 -1
  264. package/dist/types/editors/workflow-editor/ui/variable-types.d.ts +14 -0
  265. package/dist/types/editors/workflow-editor/ui/variable-types.d.ts.map +1 -0
  266. package/dist/types/editors/workflow-editor/ui/variable-types.test.d.ts +2 -0
  267. package/dist/types/editors/workflow-editor/ui/variable-types.test.d.ts.map +1 -0
  268. package/dist/types/editors/workflow-editor/ui/version-badge.d.ts +33 -0
  269. package/dist/types/editors/workflow-editor/ui/version-badge.d.ts.map +1 -0
  270. package/dist/types/editors/workflow-editor/ui/version-badge.test.d.ts +2 -0
  271. package/dist/types/editors/workflow-editor/ui/version-badge.test.d.ts.map +1 -0
  272. package/dist/types/editors/workflow-editor/use-runtime-url.d.ts +0 -1
  273. package/dist/types/editors/workflow-editor/use-runtime-url.d.ts.map +1 -1
  274. package/dist/types/editors/workflow-studio/components/RunsTable.d.ts +1 -1
  275. package/dist/types/editors/workflow-studio/components/RunsTable.d.ts.map +1 -1
  276. package/dist/types/editors/workflow-studio/components/RunsView.d.ts +4 -1
  277. package/dist/types/editors/workflow-studio/components/RunsView.d.ts.map +1 -1
  278. package/dist/types/editors/workflow-studio/components/Sidebar.d.ts.map +1 -1
  279. package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts +1 -1
  280. package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts.map +1 -1
  281. package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts +2 -1
  282. package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts.map +1 -1
  283. package/dist/types/editors/workflow-studio/components/WorkflowMenu.d.ts +13 -0
  284. package/dist/types/editors/workflow-studio/components/WorkflowMenu.d.ts.map +1 -0
  285. package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts +1 -1
  286. package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts.map +1 -1
  287. package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts +0 -1
  288. package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts.map +1 -1
  289. package/dist/types/editors/workflow-studio/components/chain.d.ts +5 -3
  290. package/dist/types/editors/workflow-studio/components/chain.d.ts.map +1 -1
  291. package/dist/types/editors/workflow-studio/components/run-format.d.ts +11 -2
  292. package/dist/types/editors/workflow-studio/components/run-format.d.ts.map +1 -1
  293. package/dist/types/editors/workflow-studio/components/step-outline.d.ts +3 -1
  294. package/dist/types/editors/workflow-studio/components/step-outline.d.ts.map +1 -1
  295. package/dist/types/editors/workflow-studio/components/ui.d.ts +2 -0
  296. package/dist/types/editors/workflow-studio/components/ui.d.ts.map +1 -1
  297. package/dist/types/editors/workflow-studio/components/useRuns.d.ts +4 -1
  298. package/dist/types/editors/workflow-studio/components/useRuns.d.ts.map +1 -1
  299. package/dist/types/editors/workflow-studio/editor.d.ts.map +1 -1
  300. package/dist/types/pieces/index.d.ts.map +1 -1
  301. package/dist/types/pieces/reactor/lib/actions/action-list-prop.test.d.ts +2 -0
  302. package/dist/types/pieces/reactor/lib/actions/action-list-prop.test.d.ts.map +1 -0
  303. package/dist/types/pieces/reactor/lib/actions/document-create.d.ts +14 -1
  304. package/dist/types/pieces/reactor/lib/actions/document-create.d.ts.map +1 -1
  305. package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts +14 -1
  306. package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts.map +1 -1
  307. package/dist/types/pieces/reactor/lib/actions/document-get.d.ts +1 -0
  308. package/dist/types/pieces/reactor/lib/actions/document-get.d.ts.map +1 -1
  309. package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts +1 -0
  310. package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts.map +1 -1
  311. package/dist/types/pieces/reactor/lib/input-props.d.ts.map +1 -1
  312. package/dist/types/pieces/reactor/lib/input-schema.d.ts +11 -2
  313. package/dist/types/pieces/reactor/lib/input-schema.d.ts.map +1 -1
  314. package/dist/types/pieces/reactor/lib/parse.d.ts +22 -4
  315. package/dist/types/pieces/reactor/lib/parse.d.ts.map +1 -1
  316. package/dist/types/pieces/reactor/lib/reactor.d.ts +15 -1
  317. package/dist/types/pieces/reactor/lib/reactor.d.ts.map +1 -1
  318. package/dist/types/scripts/ui-stack.d.ts +53 -11
  319. package/dist/types/scripts/ui-stack.d.ts.map +1 -1
  320. package/dist/types/test/ui/block-picker.spec.d.ts +2 -0
  321. package/dist/types/test/ui/block-picker.spec.d.ts.map +1 -0
  322. package/dist/types/test/ui/branch.spec.d.ts +2 -0
  323. package/dist/types/test/ui/branch.spec.d.ts.map +1 -0
  324. package/dist/types/test/ui/canvas-logos.spec.d.ts +2 -0
  325. package/dist/types/test/ui/canvas-logos.spec.d.ts.map +1 -0
  326. package/dist/types/test/ui/fixtures.d.ts +1 -0
  327. package/dist/types/test/ui/fixtures.d.ts.map +1 -1
  328. package/dist/types/test/ui/global-setup.d.ts.map +1 -1
  329. package/dist/types/test/ui/harness/prop-controls.d.ts.map +1 -1
  330. package/dist/types/test/ui/piece-version.spec.d.ts +2 -0
  331. package/dist/types/test/ui/piece-version.spec.d.ts.map +1 -0
  332. package/dist/types/test/ui/ports.spec.d.ts +2 -0
  333. package/dist/types/test/ui/ports.spec.d.ts.map +1 -0
  334. package/dist/types/test/ui/publish.spec.d.ts +2 -0
  335. package/dist/types/test/ui/publish.spec.d.ts.map +1 -0
  336. package/dist/types/test/ui/step-test.spec.d.ts +2 -0
  337. package/dist/types/test/ui/step-test.spec.d.ts.map +1 -0
  338. package/dist/types/test/ui/variables.spec.d.ts +2 -0
  339. package/dist/types/test/ui/variables.spec.d.ts.map +1 -0
  340. package/dist/types/test/ui/webhook.spec.d.ts +2 -0
  341. package/dist/types/test/ui/webhook.spec.d.ts.map +1 -0
  342. package/dist/types/test/ui/workflow-menu.spec.d.ts +2 -0
  343. package/dist/types/test/ui/workflow-menu.spec.d.ts.map +1 -0
  344. package/package.json +11 -10
  345. package/dist/browser/BlockSelector-D24DIiSX.js +0 -1388
  346. package/dist/browser/BlockSelector-D24DIiSX.js.map +0 -1
  347. package/dist/browser/connection-form-D-NETdDQ.js.map +0 -1
  348. package/dist/browser/editor-B6N0PCuZ.js.map +0 -1
  349. package/dist/browser/editor-BkdwuOC-.js.map +0 -1
  350. package/dist/browser/editor-CZ5NvCyv.js.map +0 -1
  351. package/dist/browser/module-Bkms70LV.js.map +0 -1
  352. package/dist/browser/piece-auth-Z4mZEOtL.js.map +0 -1
  353. package/dist/browser/runtime-api-DDMQc4PB.js +0 -558
  354. package/dist/browser/runtime-api-DDMQc4PB.js.map +0 -1
  355. package/dist/browser/trigger-text-CUv5Z2Uk.js +0 -551
  356. package/dist/browser/trigger-text-CUv5Z2Uk.js.map +0 -1
  357. package/dist/browser/workflow-CGtVlhr8.js.map +0 -1
  358. package/dist/node/BlockSelector-CTmmpYxu.mjs +0 -1388
  359. package/dist/node/BlockSelector-CTmmpYxu.mjs.map +0 -1
  360. package/dist/node/connection-form-C9vbfSnA.mjs.map +0 -1
  361. package/dist/node/editor-By9BHI8e.mjs.map +0 -1
  362. package/dist/node/editor-DP36YDk5.mjs.map +0 -1
  363. package/dist/node/editor-StBssjcQ.mjs.map +0 -1
  364. package/dist/node/module-DuxxhgKs.mjs.map +0 -1
  365. package/dist/node/piece-auth-Z4mZEOtL.mjs.map +0 -1
  366. package/dist/node/runtime-api-DDMQc4PB.mjs +0 -558
  367. package/dist/node/runtime-api-DDMQc4PB.mjs.map +0 -1
  368. package/dist/node/trigger-text-Bzq6VfOQ.mjs +0 -551
  369. package/dist/node/trigger-text-Bzq6VfOQ.mjs.map +0 -1
  370. package/dist/node/workflow-C-uuQPnf.mjs.map +0 -1
  371. package/dist/types/editors/workflow-editor/runtime-api.test.d.ts +0 -2
  372. package/dist/types/editors/workflow-editor/runtime-api.test.d.ts.map +0 -1
  373. package/dist/types/editors/workflow-editor/runtime-piece-source.d.ts +0 -2
  374. package/dist/types/editors/workflow-editor/runtime-piece-source.d.ts.map +0 -1
@@ -1,1388 +0,0 @@
1
- import { y as setRuntimeUrl } from "./runtime-api-DDMQc4PB.mjs";
2
- import { DEFAULT_SWITCHBOARD_URL, parseDriveUrl, subgraphUrlFromGraphqlUrl, useDefaultDrivesUrl, useSelectedDriveSafe, useSyncList } from "@powerhousedao/reactor-browser";
3
- import { Component, Fragment, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
4
- import { DOCUMENT_SCOPE_ACTION_TYPES } from "@powerhousedao/shared/document-model";
5
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
- import { createPortal } from "react-dom";
7
- new Set([...DOCUMENT_SCOPE_ACTION_TYPES].filter((type) => type !== "CREATE_DOCUMENT"));
8
- const DRIVE_COLLECTION_PREFIX = "drive.";
9
- /**
10
- * Identifies the collection a remote synchronizes. Collections are drive-level
11
- * abstractions (document-drive and reactor-drive), so a collection id is the
12
- * drive document id plus the branch it scopes to rather than an opaque string.
13
- *
14
- * The canonical string form (`drive.${branch}.${driveId}`) is produced only by
15
- * `key` and parsed only by `fromKey`; that string is the wire and storage
16
- * representation and is byte-for-byte identical to the legacy
17
- * `driveCollectionId(branch, driveId)` output, so existing `document_collections`
18
- * rows and persisted remotes remain valid without migration.
19
- */
20
- var DriveCollectionId = class DriveCollectionId {
21
- driveId;
22
- branch;
23
- constructor(driveId, branch) {
24
- this.driveId = driveId;
25
- this.branch = branch;
26
- }
27
- static forDrive(driveId, branch = "main") {
28
- return new DriveCollectionId(driveId, branch);
29
- }
30
- /**
31
- * The single deserializer for the wire/storage form. `branch` may contain
32
- * dots, while `driveId` is a dot-free document id, so the drive id is the
33
- * final dot-delimited segment.
34
- */
35
- static fromKey(key) {
36
- if (!key.startsWith(DRIVE_COLLECTION_PREFIX)) throw new Error(`Unsupported collection id: ${key}`);
37
- const rest = key.slice(6);
38
- const lastDot = rest.lastIndexOf(".");
39
- if (lastDot === -1 || lastDot === rest.length - 1) throw new Error(`Malformed drive collection id: ${key}`);
40
- return new DriveCollectionId(rest.slice(lastDot + 1), rest.slice(0, lastDot));
41
- }
42
- get key() {
43
- return `${DRIVE_COLLECTION_PREFIX}${this.branch}.${this.driveId}`;
44
- }
45
- toString() {
46
- return this.key;
47
- }
48
- equals(other) {
49
- return this.driveId === other.driveId && this.branch === other.branch;
50
- }
51
- };
52
- //#endregion
53
- //#region editors/shared/DocumentErrorBoundary.tsx
54
- /** Best-effort message for anything thrown, without stringifying an object. */
55
- function errorMessage(error) {
56
- if (error instanceof Error) return error.message;
57
- if (typeof error === "string") return error;
58
- return "Unknown error";
59
- }
60
- /** Inline "could not load" panel, also used for hook-level (non-thrown) failures. */
61
- function DocumentLoadError(props) {
62
- return /* @__PURE__ */ jsxs("div", {
63
- className: "m-3 rounded border border-solid border-wf-fail/40 bg-wf-fail/10 p-3",
64
- children: [
65
- /* @__PURE__ */ jsx("p", {
66
- className: "text-sm font-medium text-wf-fail",
67
- children: props.title ?? "This document could not be loaded"
68
- }),
69
- props.label ? /* @__PURE__ */ jsx("p", {
70
- className: "mt-0.5 text-xs text-wf-fail",
71
- children: props.label
72
- }) : null,
73
- props.documentId ? /* @__PURE__ */ jsx("p", {
74
- className: "mt-0.5 font-mono text-[11px] text-wf-fail",
75
- children: props.documentId
76
- }) : null,
77
- /* @__PURE__ */ jsx("p", {
78
- className: "mt-1 text-xs text-muted-foreground",
79
- children: errorMessage(props.error)
80
- }),
81
- /* @__PURE__ */ jsxs("div", {
82
- className: "mt-2 flex gap-2",
83
- children: [props.onRetry ? /* @__PURE__ */ jsx("button", {
84
- type: "button",
85
- className: "rounded border border-solid border-wf-fail/40 px-2 py-0.5 text-xs font-medium text-wf-fail",
86
- onClick: props.onRetry,
87
- children: "Retry"
88
- }) : null, props.onDismiss ? /* @__PURE__ */ jsx("button", {
89
- type: "button",
90
- className: "rounded border border-solid border-foreground/15 px-2 py-0.5 text-xs text-muted-foreground",
91
- onClick: props.onDismiss,
92
- children: "Dismiss"
93
- }) : null]
94
- })
95
- ]
96
- });
97
- }
98
- var DocumentErrorBoundary = class extends Component {
99
- state = {
100
- error: void 0,
101
- attempt: 0
102
- };
103
- static getDerivedStateFromError(error) {
104
- return { error };
105
- }
106
- componentDidCatch(error, info) {
107
- console.error(`Failed to render document ${this.props.documentId ?? "(unknown id)"}:`, error, info.componentStack);
108
- }
109
- retry = () => {
110
- this.setState((state) => ({
111
- error: void 0,
112
- attempt: state.attempt + 1
113
- }));
114
- };
115
- dismiss = () => {
116
- this.setState({ error: void 0 });
117
- this.props.onDismiss?.();
118
- };
119
- render() {
120
- if (this.state.error !== void 0) return /* @__PURE__ */ jsx(DocumentLoadError, {
121
- label: this.props.label,
122
- documentId: this.props.documentId,
123
- error: this.state.error,
124
- onRetry: this.retry,
125
- onDismiss: this.props.onDismiss ? this.dismiss : void 0
126
- });
127
- return /* @__PURE__ */ jsx(Fragment, { children: this.props.children }, this.state.attempt);
128
- }
129
- };
130
- //#endregion
131
- //#region editors/shared/icons.tsx
132
- const ICON_PATHS = {
133
- pencil: "M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4",
134
- trash: "M5 7h14M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3",
135
- plus: "M12 5v14M5 12h14",
136
- minus: "M5 12h14",
137
- list: "M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",
138
- play: "M7 5v14l12-7z",
139
- chevron: "M9 6l6 6-6 6",
140
- chevronDown: "M6 9l6 6 6-6",
141
- retry: "M4 12a8 8 0 1 0 2.3-5.7M4 4v4h4",
142
- back: "M15 6l-6 6 6 6",
143
- close: "M6 6l12 12M18 6L6 18",
144
- check: "M5 12l5 5 9-10",
145
- search: "M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4",
146
- braces: "M8 4c-2 0-3 1-3 3v2c0 1.5-1 3-2 3 1 0 2 1.5 2 3v2c0 2 1 3 3 3M16 4c2 0 3 1 3 3v2c0 1.5 1 3 2 3-1 0-2 1.5-2 3v2c0 2-1 3-3 3",
147
- link: "M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1",
148
- arrowRight: "M5 12h14M13 6l6 6-6 6",
149
- alert: "M12 8v5M12 16.5v.01M10.3 4l-7.6 13.2A2 2 0 0 0 4.4 20h15.2a2 2 0 0 0 1.7-2.8L13.7 4a2 2 0 0 0-3.4 0z",
150
- copy: "M9 9h10v10H9zM5 15V5h10",
151
- sliders: "M4 7h10M18 7h2M4 17h4M12 17h8M14 5v4M8 15v4",
152
- eye: "M2.5 12s3.5-6.5 9.5-6.5 9.5 6.5 9.5 6.5-3.5 6.5-9.5 6.5S2.5 12 2.5 12zM12 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",
153
- eyeOff: "M3 3l18 18M10.6 5.6A10 10 0 0 1 12 5.5c6 0 9.5 6.5 9.5 6.5a17 17 0 0 1-3 3.7M6.6 6.6C4 8.3 2.5 12 2.5 12s3.5 6.5 9.5 6.5a9.6 9.6 0 0 0 4.4-1M9.9 9.9a3 3 0 0 0 4.2 4.2",
154
- undo: "M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3",
155
- redo: "M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3",
156
- clock: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",
157
- bolt: "M13 3L5 13h6l-1 8 8-10h-6l1-8z",
158
- branch: "M6 4v10M6 14a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM18 4a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM18 10c0 4-6 3-11 6",
159
- lock: "M6 11h12v9H6zM8.5 11V8a3.5 3.5 0 0 1 7 0v3M12 15v2"
160
- };
161
- function isIconName(name) {
162
- return typeof name === "string" && name in ICON_PATHS;
163
- }
164
- function Icon(props) {
165
- return /* @__PURE__ */ jsx("svg", {
166
- "aria-hidden": true,
167
- viewBox: "0 0 24 24",
168
- fill: "none",
169
- stroke: "currentColor",
170
- strokeWidth: 1.75,
171
- strokeLinecap: "round",
172
- strokeLinejoin: "round",
173
- width: props.size,
174
- height: props.size,
175
- className: `shrink-0 ${props.size ? "" : "h-4 w-4"} ${props.className ?? ""}`,
176
- children: /* @__PURE__ */ jsx("path", { d: ICON_PATHS[props.name] })
177
- });
178
- }
179
- //#endregion
180
- //#region editors/shared/controls.tsx
181
- const FOCUS_RING = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40";
182
- const BUTTON_SIZE = {
183
- sm: "h-7 gap-1 rounded-md px-2 text-xs",
184
- md: "h-8 gap-1.5 rounded-md px-3 text-[13px]"
185
- };
186
- const BUTTON_VARIANT = {
187
- primary: "bg-primary text-primary-foreground hover:opacity-90",
188
- secondary: "border border-solid border-foreground/15 bg-card text-foreground hover:bg-accent",
189
- ghost: "text-muted-foreground hover:bg-accent hover:text-foreground",
190
- danger: "text-wf-fail hover:bg-wf-fail/10"
191
- };
192
- function Button(props) {
193
- const { variant = "secondary", size = "md", className = "", ...rest } = props;
194
- return /* @__PURE__ */ jsx("button", {
195
- type: "button",
196
- className: `inline-flex shrink-0 items-center font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 ${FOCUS_RING} ${BUTTON_SIZE[size]} ${BUTTON_VARIANT[variant]} ${className}`,
197
- ...rest
198
- });
199
- }
200
- function IconButton(props) {
201
- const { icon, label, active, className = "", ...rest } = props;
202
- return /* @__PURE__ */ jsx("button", {
203
- type: "button",
204
- title: label,
205
- "aria-label": label,
206
- className: `inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition-colors disabled:pointer-events-none disabled:opacity-50 ${FOCUS_RING} ${active ? "bg-wf-run/10 text-wf-run" : "text-muted-foreground hover:bg-accent hover:text-foreground"} ${className}`,
207
- ...rest,
208
- children: /* @__PURE__ */ jsx(Icon, {
209
- name: icon,
210
- className: "h-3.5 w-3.5"
211
- })
212
- });
213
- }
214
- const inputClass = "w-full rounded-md border border-solid border-foreground/15 bg-card px-2.5 text-[13px] text-foreground placeholder:text-muted-foreground/70 transition-colors hover:border-foreground/25 focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/25 disabled:cursor-not-allowed disabled:opacity-60";
215
- const textInputClass = `${inputClass} h-9`;
216
- const textAreaClass = `${inputClass} min-h-20 py-2 leading-relaxed`;
217
- const invalidClass = "border-wf-warn/70 hover:border-wf-warn";
218
- /** Label row above a control: name, optional marker, and a trailing action. */
219
- function FieldLabel(props) {
220
- const LabelTag = props.htmlFor ? "label" : "span";
221
- return /* @__PURE__ */ jsxs("div", {
222
- className: "mb-1.5 flex min-h-6 items-center justify-between gap-2",
223
- children: [/* @__PURE__ */ jsxs(LabelTag, {
224
- htmlFor: props.htmlFor,
225
- className: "flex min-w-0 items-baseline gap-1.5 text-[13px] font-medium text-foreground",
226
- children: [
227
- /* @__PURE__ */ jsx("span", {
228
- className: "truncate",
229
- children: props.label
230
- }),
231
- props.optional ? /* @__PURE__ */ jsx("span", {
232
- className: "shrink-0 text-xs font-normal text-muted-foreground",
233
- children: "Optional"
234
- }) : null,
235
- props.needsValue ? /* @__PURE__ */ jsx("span", {
236
- className: "shrink-0 text-xs font-normal text-wf-warn",
237
- children: "Needs a value"
238
- }) : null
239
- ]
240
- }), props.action ? /* @__PURE__ */ jsx("span", {
241
- className: "flex shrink-0 items-center gap-0.5",
242
- children: props.action
243
- }) : null]
244
- });
245
- }
246
- const LONG_HINT = 140;
247
- /** Help text under a control; long piece descriptions fold to two lines. */
248
- function Hint(props) {
249
- const [open, setOpen] = useState(false);
250
- const text = props.text;
251
- if (text !== void 0) {
252
- if (!text.trim()) return null;
253
- const long = text.length > LONG_HINT;
254
- return /* @__PURE__ */ jsxs("p", {
255
- className: "mt-1.5 text-xs leading-relaxed text-muted-foreground",
256
- children: [/* @__PURE__ */ jsx("span", {
257
- className: long && !open ? "line-clamp-2" : void 0,
258
- children: text
259
- }), long ? /* @__PURE__ */ jsx("button", {
260
- type: "button",
261
- className: "mt-0.5 block font-medium text-foreground/70 hover:text-foreground",
262
- onClick: () => setOpen((value) => !value),
263
- children: open ? "Show less" : "Show more"
264
- }) : null]
265
- });
266
- }
267
- return /* @__PURE__ */ jsx("p", {
268
- className: "mt-1.5 text-xs leading-relaxed text-muted-foreground",
269
- children: props.children
270
- });
271
- }
272
- function FieldError(props) {
273
- if (!props.children) return null;
274
- return /* @__PURE__ */ jsx("p", {
275
- className: "mt-1.5 text-xs text-wf-fail",
276
- children: props.children
277
- });
278
- }
279
- function Switch(props) {
280
- const id = useId();
281
- return /* @__PURE__ */ jsxs("div", {
282
- className: "flex items-start justify-between gap-4",
283
- children: [/* @__PURE__ */ jsxs("label", {
284
- htmlFor: id,
285
- className: "min-w-0",
286
- children: [/* @__PURE__ */ jsx("span", {
287
- className: "block text-[13px] font-medium text-foreground",
288
- children: props.label
289
- }), props.description ? /* @__PURE__ */ jsx(Hint, { text: props.description }) : null]
290
- }), /* @__PURE__ */ jsx("button", {
291
- id,
292
- type: "button",
293
- role: "switch",
294
- "aria-checked": props.checked,
295
- disabled: props.disabled,
296
- className: `relative mt-0.5 inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${FOCUS_RING} ${props.checked ? "bg-primary" : "bg-foreground/20"}`,
297
- onClick: () => props.onChange(!props.checked),
298
- children: /* @__PURE__ */ jsx("span", { className: `inline-block h-4 w-4 rounded-full bg-card shadow-sm transition-transform ${props.checked ? "translate-x-[18px]" : "translate-x-0.5"}` })
299
- })]
300
- });
301
- }
302
- function Tabs(props) {
303
- return /* @__PURE__ */ jsx("div", {
304
- role: "tablist",
305
- className: "flex gap-4",
306
- children: props.tabs.map((tab) => {
307
- const selected = tab.value === props.value;
308
- return /* @__PURE__ */ jsxs("button", {
309
- type: "button",
310
- role: "tab",
311
- "aria-selected": selected,
312
- className: `-mb-px flex items-center gap-1.5 border-b-2 border-solid pb-2 text-[13px] font-medium transition-colors ${FOCUS_RING} ${selected ? "border-foreground text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`,
313
- onClick: () => props.onChange(tab.value),
314
- children: [tab.label, tab.badge]
315
- }, tab.value);
316
- })
317
- });
318
- }
319
- /** Two or three short, mutually exclusive choices shown side by side. */
320
- function Segmented(props) {
321
- return /* @__PURE__ */ jsx("div", {
322
- role: "radiogroup",
323
- className: `flex h-9 w-full items-center gap-0.5 rounded-md bg-muted p-0.5 ${props.invalid ? "ring-1 ring-wf-warn/60" : ""}`,
324
- children: props.options.map((option) => {
325
- const selected = option.value === props.value;
326
- return /* @__PURE__ */ jsx("button", {
327
- type: "button",
328
- role: "radio",
329
- "aria-checked": selected,
330
- className: `h-8 min-w-0 flex-1 truncate rounded px-2 text-[13px] transition-colors ${FOCUS_RING} ${selected ? "bg-card font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
331
- onClick: () => props.onChange(option.value),
332
- children: option.label
333
- }, option.value);
334
- })
335
- });
336
- }
337
- const SEARCH_THRESHOLD = 7;
338
- function Select(props) {
339
- const [open, setOpen] = useState(false);
340
- const [query, setQuery] = useState("");
341
- const [active, setActive] = useState(0);
342
- const triggerRef = useRef(null);
343
- const popoverRef = useRef(null);
344
- const searchRef = useRef(null);
345
- const listId = useId();
346
- const [position, setPosition] = useState(null);
347
- const selected = props.multiple ? props.value : props.value ? [props.value] : [];
348
- const selectedSet = new Set(selected);
349
- const searchable = props.searchable || Boolean(props.onQueryChange) || props.options.length > SEARCH_THRESHOLD;
350
- const needle = query.trim().toLowerCase();
351
- const serverSide = Boolean(props.onQueryChange);
352
- const visible = useMemo(() => needle && !serverSide ? props.options.filter((option) => `${option.label} ${option.description ?? ""}`.toLowerCase().includes(needle)) : props.options, [
353
- needle,
354
- props.options,
355
- serverSide
356
- ]);
357
- const onQueryChange = props.onQueryChange;
358
- const dismiss = () => {
359
- setOpen(false);
360
- setQuery("");
361
- onQueryChange?.("");
362
- };
363
- const close = () => {
364
- dismiss();
365
- triggerRef.current?.focus();
366
- };
367
- const place = () => {
368
- const rect = triggerRef.current?.getBoundingClientRect();
369
- if (!rect) return;
370
- const below = window.innerHeight - rect.bottom - 8;
371
- const above = rect.top - 8;
372
- const flip = below < 240 && above > below;
373
- setPosition({
374
- left: rect.left,
375
- width: rect.width,
376
- top: flip ? void 0 : rect.bottom + 4,
377
- bottom: flip ? window.innerHeight - rect.top + 4 : void 0,
378
- maxHeight: Math.min(320, flip ? above : below)
379
- });
380
- };
381
- const openList = () => {
382
- const index = props.options.findIndex((option) => selectedSet.has(option.value));
383
- setActive(Math.max(0, index));
384
- setOpen(true);
385
- };
386
- useLayoutEffect(() => {
387
- if (!open) return;
388
- place();
389
- }, [open]);
390
- const placed = position !== null;
391
- useEffect(() => {
392
- if (open && placed && searchable) searchRef.current?.focus();
393
- }, [
394
- open,
395
- placed,
396
- searchable
397
- ]);
398
- useEffect(() => {
399
- if (!open) return;
400
- const onPointer = (event) => {
401
- const target = event.target;
402
- if (!popoverRef.current?.contains(target) && !triggerRef.current?.contains(target)) {
403
- setOpen(false);
404
- setQuery("");
405
- onQueryChange?.("");
406
- }
407
- };
408
- window.addEventListener("mousedown", onPointer);
409
- window.addEventListener("resize", place);
410
- window.addEventListener("scroll", place, true);
411
- return () => {
412
- window.removeEventListener("mousedown", onPointer);
413
- window.removeEventListener("resize", place);
414
- window.removeEventListener("scroll", place, true);
415
- };
416
- }, [
417
- open,
418
- searchable,
419
- onQueryChange
420
- ]);
421
- useEffect(() => {
422
- popoverRef.current?.querySelector(`[data-index="${active}"]`)?.scrollIntoView({ block: "nearest" });
423
- }, [active]);
424
- const choose = (option) => {
425
- if (option.disabled) return;
426
- if (props.multiple) {
427
- props.onChange(selectedSet.has(option.value) ? props.value.filter((value) => value !== option.value) : [...props.value, option.value]);
428
- return;
429
- }
430
- props.onChange(option.value);
431
- close();
432
- };
433
- const onListKey = (event) => {
434
- if (event.key === "ArrowDown") {
435
- event.preventDefault();
436
- setActive((index) => Math.min(visible.length - 1, index + 1));
437
- } else if (event.key === "ArrowUp") {
438
- event.preventDefault();
439
- setActive((index) => Math.max(0, index - 1));
440
- } else if (event.key === "Enter") {
441
- event.preventDefault();
442
- const option = visible[active];
443
- if (option) choose(option);
444
- } else if (event.key === "Escape") {
445
- event.preventDefault();
446
- close();
447
- } else if (event.key === "Tab") dismiss();
448
- };
449
- const labels = props.options.filter((option) => selectedSet.has(option.value)).map((option) => option.label);
450
- const unknown = selected.filter((value) => !props.options.some((option) => option.value === value));
451
- const shown = [...labels, ...unknown];
452
- const selectedIcon = props.multiple ? void 0 : props.options.find((option) => option.value === props.value)?.icon;
453
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("button", {
454
- ref: triggerRef,
455
- id: props.id,
456
- type: "button",
457
- role: "combobox",
458
- "aria-expanded": open,
459
- "aria-controls": open ? listId : void 0,
460
- "aria-activedescendant": open && visible.length > 0 ? `${listId}-${active}` : void 0,
461
- "aria-haspopup": "listbox",
462
- disabled: props.disabled,
463
- className: `${textInputClass} flex items-center gap-2 text-left ${props.invalid ? invalidClass : ""} ${open ? "border-ring ring-2 ring-ring/25" : ""}`,
464
- onClick: () => open ? close() : openList(),
465
- onKeyDown: (event) => {
466
- if (open) {
467
- onListKey(event);
468
- return;
469
- }
470
- if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
471
- event.preventDefault();
472
- openList();
473
- }
474
- },
475
- children: [
476
- selectedIcon,
477
- /* @__PURE__ */ jsx("span", {
478
- className: `min-w-0 flex-1 truncate ${shown.length ? "" : "text-muted-foreground/70"}`,
479
- children: shown.length > 0 ? shown.join(", ") : props.loading ? "Loading…" : props.placeholder ?? "Choose…"
480
- }),
481
- props.multiple && shown.length > 1 ? /* @__PURE__ */ jsx("span", {
482
- className: "shrink-0 rounded bg-muted px-1.5 text-[11px] tabular-nums text-muted-foreground",
483
- children: shown.length
484
- }) : null,
485
- /* @__PURE__ */ jsx(Icon, {
486
- name: "chevronDown",
487
- className: `h-3.5 w-3.5 text-muted-foreground transition-transform ${open ? "rotate-180" : ""}`
488
- })
489
- ]
490
- }), open && position ? createPortal(/* @__PURE__ */ jsxs("div", {
491
- ref: popoverRef,
492
- tabIndex: -1,
493
- className: "workflow-select-popover fixed flex flex-col overflow-hidden rounded-lg border border-solid border-foreground/10 bg-popover text-popover-foreground shadow-lg outline-none",
494
- style: {
495
- left: position.left,
496
- width: Math.max(position.width, 220),
497
- top: position.top,
498
- bottom: position.bottom,
499
- maxHeight: position.maxHeight
500
- },
501
- onKeyDown: onListKey,
502
- children: [
503
- searchable || props.onRefresh ? /* @__PURE__ */ jsxs("div", {
504
- className: "flex items-center gap-1 border-b border-solid border-foreground/10 px-2",
505
- children: [searchable ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
506
- name: "search",
507
- className: "h-3.5 w-3.5 text-muted-foreground"
508
- }), /* @__PURE__ */ jsx("input", {
509
- ref: searchRef,
510
- className: "h-9 min-w-0 flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground/70 focus:outline-none",
511
- placeholder: "Search",
512
- value: query,
513
- onChange: (event) => {
514
- setQuery(event.target.value);
515
- setActive(0);
516
- props.onQueryChange?.(event.target.value);
517
- }
518
- })] }) : /* @__PURE__ */ jsx("span", { className: "h-9 flex-1" }), props.onRefresh ? /* @__PURE__ */ jsx(IconButton, {
519
- icon: "retry",
520
- label: "Reload options",
521
- disabled: props.loading,
522
- onClick: props.onRefresh
523
- }) : null]
524
- }) : null,
525
- /* @__PURE__ */ jsx("div", {
526
- id: listId,
527
- role: "listbox",
528
- "aria-multiselectable": props.multiple || void 0,
529
- className: "min-h-0 flex-1 overflow-y-auto p-1",
530
- children: props.loading && props.options.length === 0 ? /* @__PURE__ */ jsx("p", {
531
- className: "px-2 py-2 text-[13px] text-muted-foreground",
532
- children: "Loading options…"
533
- }) : visible.length === 0 ? /* @__PURE__ */ jsx("p", {
534
- className: "px-2 py-2 text-[13px] text-muted-foreground",
535
- children: needle ? "Nothing matches." : props.emptyText ?? "No options."
536
- }) : visible.map((option, index) => {
537
- const isSelected = selectedSet.has(option.value);
538
- return /* @__PURE__ */ jsxs("div", {
539
- id: `${listId}-${index}`,
540
- role: "option",
541
- "aria-selected": isSelected,
542
- "aria-disabled": option.disabled || void 0,
543
- "data-index": index,
544
- className: `flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-[13px] ${index === active ? "bg-accent" : ""} ${option.disabled ? "cursor-not-allowed opacity-50" : ""}`,
545
- onMouseEnter: () => setActive(index),
546
- onMouseDown: (event) => {
547
- event.preventDefault();
548
- choose(option);
549
- },
550
- children: [
551
- props.multiple ? /* @__PURE__ */ jsx("span", {
552
- className: `flex h-4 w-4 shrink-0 items-center justify-center rounded border border-solid ${isSelected ? "border-primary bg-primary text-primary-foreground" : "border-foreground/25"}`,
553
- children: isSelected ? /* @__PURE__ */ jsx(Icon, {
554
- name: "check",
555
- className: "h-3 w-3"
556
- }) : null
557
- }) : null,
558
- option.icon,
559
- /* @__PURE__ */ jsxs("span", {
560
- className: "min-w-0 flex-1",
561
- children: [/* @__PURE__ */ jsx("span", {
562
- className: "block truncate",
563
- children: option.label
564
- }), option.description ? /* @__PURE__ */ jsx("span", {
565
- className: "block truncate text-xs text-muted-foreground",
566
- children: option.description
567
- }) : null]
568
- }),
569
- !props.multiple && isSelected ? /* @__PURE__ */ jsx(Icon, {
570
- name: "check",
571
- className: "h-3.5 w-3.5 text-foreground"
572
- }) : null
573
- ]
574
- }, option.value);
575
- })
576
- }),
577
- props.actions?.length ? /* @__PURE__ */ jsx("div", {
578
- className: "border-t border-solid border-foreground/10 p-1",
579
- children: props.actions.map((action) => /* @__PURE__ */ jsxs("button", {
580
- type: "button",
581
- className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] text-muted-foreground hover:bg-accent hover:text-foreground",
582
- onMouseDown: (event) => {
583
- event.preventDefault();
584
- dismiss();
585
- action.onSelect();
586
- },
587
- children: [action.icon ? /* @__PURE__ */ jsx(Icon, {
588
- name: action.icon,
589
- className: "h-3.5 w-3.5"
590
- }) : null, action.label]
591
- }, action.label))
592
- }) : null,
593
- !props.multiple && props.clearable && props.value ? /* @__PURE__ */ jsx("div", {
594
- className: "border-t border-solid border-foreground/10 p-1",
595
- children: /* @__PURE__ */ jsxs("button", {
596
- type: "button",
597
- className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] text-muted-foreground hover:bg-accent hover:text-foreground",
598
- onMouseDown: (event) => {
599
- event.preventDefault();
600
- props.onChange("");
601
- close();
602
- },
603
- children: [/* @__PURE__ */ jsx(Icon, {
604
- name: "close",
605
- className: "h-3.5 w-3.5"
606
- }), "Clear selection"]
607
- })
608
- }) : null
609
- ]
610
- }), document.body) : null] });
611
- }
612
- //#endregion
613
- //#region editors/workflow-editor/use-runtime-url.ts
614
- const SUBGRAPH_NAME = "workflow-runtime";
615
- function baseFromChannelUrl(channelUrl) {
616
- try {
617
- const url = new URL(channelUrl);
618
- url.search = "";
619
- url.hash = "";
620
- url.pathname = url.pathname.replace(/\/r\/?$/, "");
621
- return url.toString();
622
- } catch {
623
- return;
624
- }
625
- }
626
- function useWorkflowRuntimeUrl() {
627
- const [drive] = useSelectedDriveSafe();
628
- const remotes = useSyncList();
629
- const defaultDrivesUrl = useDefaultDrivesUrl();
630
- const driveId = drive?.header.id;
631
- return useMemo(() => {
632
- let base;
633
- if (driveId) {
634
- const channelUrl = (remotes.find((entry) => entry.meta.collectionId.equals(DriveCollectionId.forDrive(driveId)))?.channel)?.config.url;
635
- if (typeof channelUrl === "string") base = baseFromChannelUrl(channelUrl);
636
- }
637
- if (!base && defaultDrivesUrl) try {
638
- base = parseDriveUrl(defaultDrivesUrl).graphqlEndpoint.replace(/\/r$/, "");
639
- } catch {}
640
- return subgraphUrlFromGraphqlUrl(base ?? DEFAULT_SWITCHBOARD_URL, SUBGRAPH_NAME);
641
- }, [
642
- driveId,
643
- remotes,
644
- defaultDrivesUrl
645
- ]);
646
- }
647
- function useSyncWorkflowRuntimeUrl() {
648
- const url = useWorkflowRuntimeUrl();
649
- useEffect(() => {
650
- setRuntimeUrl(url);
651
- }, [url]);
652
- }
653
- //#endregion
654
- //#region editors/workflow-studio/components/run-format.ts
655
- const RUN_STATUSES = [
656
- "RUNNING",
657
- "SUCCEEDED",
658
- "FAILED"
659
- ];
660
- const TONE_TEXT = {
661
- ok: "text-wf-ok",
662
- fail: "text-wf-fail",
663
- warn: "text-wf-warn",
664
- run: "text-wf-run",
665
- idle: "text-muted-foreground"
666
- };
667
- const TONE_DOT = {
668
- ok: "bg-wf-ok",
669
- fail: "bg-wf-fail",
670
- warn: "bg-wf-warn",
671
- run: "bg-wf-run",
672
- idle: "bg-muted-foreground/40"
673
- };
674
- const TONE_BADGE = {
675
- ok: "bg-wf-ok/12 text-wf-ok",
676
- fail: "bg-wf-fail/12 text-wf-fail",
677
- warn: "bg-wf-warn/12 text-wf-warn",
678
- run: "bg-wf-run/12 text-wf-run",
679
- idle: "bg-muted text-muted-foreground"
680
- };
681
- const RUN_TONE = {
682
- SUCCEEDED: "ok",
683
- FAILED: "fail",
684
- RUNNING: "run",
685
- WAITING: "run",
686
- PENDING: "idle",
687
- PARKED: "warn",
688
- CANCELLED: "idle"
689
- };
690
- const STEP_TONE = {
691
- ...RUN_TONE,
692
- SKIPPED: "idle",
693
- REPLAYED: "run"
694
- };
695
- const WORKFLOW_TONE = {
696
- ENABLED: "ok",
697
- DRAFT: "idle",
698
- DISABLED: "warn",
699
- ARCHIVED: "idle"
700
- };
701
- function workflowHealth(status, lastRunStatus) {
702
- const state = statusLabel(status ?? "DRAFT");
703
- if (status !== "ENABLED") return {
704
- tone: "idle",
705
- label: state
706
- };
707
- if (!lastRunStatus) return {
708
- tone: "idle",
709
- label: `${state}, not run yet`
710
- };
711
- return {
712
- tone: toneOf(RUN_TONE, lastRunStatus),
713
- label: `${state}, last run ${statusLabel(lastRunStatus).toLowerCase()}`
714
- };
715
- }
716
- const CONNECTION_TONE = {
717
- OK: "ok",
718
- ERROR: "fail",
719
- REVOKED: "fail",
720
- UNCONFIGURED: "warn"
721
- };
722
- function toneOf(map, status) {
723
- return (status ? map[status] : void 0) ?? "idle";
724
- }
725
- function statusLabel(status) {
726
- return status.charAt(0) + status.slice(1).toLowerCase();
727
- }
728
- function formatDuration(startedAt, endedAt) {
729
- if (!endedAt) return "…";
730
- return formatMs(new Date(endedAt).getTime() - new Date(startedAt).getTime());
731
- }
732
- function runTimeline(run) {
733
- const start = new Date(run.startedAt).getTime();
734
- const ends = run.steps.map((step) => step.endedAt ? new Date(step.endedAt).getTime() : 0).concat(run.endedAt ? new Date(run.endedAt).getTime() : 0);
735
- const total = Math.max(...ends) - start;
736
- const spans = /* @__PURE__ */ new Map();
737
- if (total <= 0) return spans;
738
- for (const step of run.steps) {
739
- if (!step.startedAt || !step.endedAt) continue;
740
- const from = new Date(step.startedAt).getTime() - start;
741
- const ms = new Date(step.endedAt).getTime() - new Date(step.startedAt).getTime();
742
- spans.set(step.stepId, {
743
- offset: Math.min(Math.max(from / total, 0), 1),
744
- width: Math.min(Math.max(ms / total, 0), 1),
745
- ms
746
- });
747
- }
748
- return spans;
749
- }
750
- function formatMs(ms) {
751
- if (ms < 1e3) return `${ms}ms`;
752
- const tenths = Math.round(ms / 100);
753
- if (tenths < 600) return `${(tenths / 10).toFixed(1)}s`;
754
- const seconds = Math.round(ms / 1e3);
755
- return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
756
- }
757
- function durationMs(startedAt, endedAt) {
758
- if (!endedAt) return null;
759
- return new Date(endedAt).getTime() - new Date(startedAt).getTime();
760
- }
761
- function formatWhen(startedAt) {
762
- const diff = Date.now() - new Date(startedAt).getTime();
763
- if (diff < 6e4) return "just now";
764
- if (diff < 36e5) return `${Math.floor(diff / 6e4)}m ago`;
765
- if (diff < 864e5) return `${Math.floor(diff / 36e5)}h ago`;
766
- return new Date(startedAt).toLocaleDateString();
767
- }
768
- function formatAbsolute(iso) {
769
- return new Date(iso).toLocaleString();
770
- }
771
- function formatTrigger(kind) {
772
- return kind.replace(/[-_]/g, " ").toLowerCase();
773
- }
774
- function runStats(runs) {
775
- const succeeded = runs.filter((run) => run.status === "SUCCEEDED").length;
776
- const failed = runs.filter((run) => run.status === "FAILED").length;
777
- const finished = succeeded + failed;
778
- return {
779
- total: runs.length,
780
- succeeded,
781
- failed,
782
- running: runs.filter((run) => run.status === "RUNNING").length,
783
- lastRun: runs[0],
784
- successRate: finished === 0 ? null : Math.round(succeeded / finished * 100)
785
- };
786
- }
787
- //#endregion
788
- //#region editors/workflow-editor/ui/piece-source.ts
789
- function triggerStrategyRuns(strategy) {
790
- return (strategy ?? "POLLING") !== "APP_WEBHOOK";
791
- }
792
- function blockUnavailable(entry) {
793
- if (entry.unsupported) return entry.unsupported;
794
- if (entry.kind !== "trigger") return void 0;
795
- const strategy = entry.strategy ?? "POLLING";
796
- return triggerStrategyRuns(strategy) ? void 0 : `${strategy.toLowerCase()} — not supported yet`;
797
- }
798
- let source;
799
- function registerPieceSource(next) {
800
- source = next;
801
- }
802
- function getPieceSource() {
803
- return source;
804
- }
805
- //#endregion
806
- //#region editors/workflow-editor/ui/block-meta.ts
807
- const CORE_META = {
808
- "core#manual": {
809
- displayName: "Manual",
810
- subtitle: "Trigger",
811
- glyph: "▶"
812
- },
813
- "core#schedule": {
814
- displayName: "Schedule",
815
- subtitle: "Trigger",
816
- glyph: "◷"
817
- },
818
- "core#webhook": {
819
- displayName: "Webhook",
820
- subtitle: "Trigger",
821
- glyph: "⇲"
822
- },
823
- "core#branch": {
824
- displayName: "Branch",
825
- subtitle: "Core",
826
- glyph: "⑂"
827
- },
828
- "core#assert": {
829
- displayName: "Assert",
830
- subtitle: "Core",
831
- glyph: "!"
832
- }
833
- };
834
- function parsePieceBlockType(blockType) {
835
- const separator = blockType.lastIndexOf("#");
836
- if (separator <= 0) return void 0;
837
- const packageSpec = blockType.slice(0, separator);
838
- const fragment = blockType.slice(separator + 1);
839
- const isTrigger = fragment.startsWith("trigger:");
840
- const actionName = isTrigger ? fragment.slice(8) : fragment;
841
- const versionAt = packageSpec.indexOf("@", 1);
842
- const packageName = versionAt > 0 ? packageSpec.slice(0, versionAt) : packageSpec;
843
- return {
844
- packageName,
845
- pieceName: packageName.split("/").pop()?.replace(/^piece-/, "") ?? "",
846
- actionName,
847
- isTrigger
848
- };
849
- }
850
- const pieceLogos = /* @__PURE__ */ new Map();
851
- const pieceNames = /* @__PURE__ */ new Map();
852
- const listeners = /* @__PURE__ */ new Set();
853
- let logoRevision = 0;
854
- function registerPieceLogos(entries) {
855
- let changed = false;
856
- for (const entry of entries) {
857
- if (!entry.name) continue;
858
- if (entry.displayName && pieceNames.get(entry.name) !== entry.displayName) {
859
- pieceNames.set(entry.name, entry.displayName);
860
- changed = true;
861
- }
862
- if (!entry.logoUrl || pieceLogos.get(entry.name) === entry.logoUrl) continue;
863
- pieceLogos.set(entry.name, entry.logoUrl);
864
- changed = true;
865
- }
866
- if (!changed) return;
867
- logoRevision += 1;
868
- for (const listener of listeners) listener();
869
- }
870
- function pieceLogo(packageName) {
871
- return pieceLogos.get(packageName);
872
- }
873
- function pieceDisplayName(packageName) {
874
- return pieceNames.get(packageName);
875
- }
876
- const blockNames = /* @__PURE__ */ new Map();
877
- const namesRequested = /* @__PURE__ */ new Set();
878
- function nameKey(blockType) {
879
- const piece = parsePieceBlockType(blockType);
880
- if (!piece) return void 0;
881
- const fragment = piece.isTrigger ? `trigger:${piece.actionName}` : piece.actionName;
882
- return `${piece.packageName}#${fragment}`;
883
- }
884
- function registerBlockNames(entries) {
885
- let changed = false;
886
- for (const entry of entries) {
887
- const key = nameKey(entry.blockType);
888
- if (!key || !entry.displayName || blockNames.get(key) === entry.displayName) continue;
889
- blockNames.set(key, entry.displayName);
890
- changed = true;
891
- }
892
- if (!changed) return;
893
- logoRevision += 1;
894
- for (const listener of listeners) listener();
895
- }
896
- function requestBlockNames(packageName) {
897
- if (namesRequested.has(packageName)) return;
898
- const source = getPieceSource();
899
- if (!source) return;
900
- namesRequested.add(packageName);
901
- Promise.all([source.loadActions(packageName), source.loadTriggers(packageName)]).then(([actions, triggers]) => registerBlockNames([...actions, ...triggers])).catch(() => namesRequested.delete(packageName));
902
- }
903
- function subscribePieceLogos(listener) {
904
- listeners.add(listener);
905
- return () => listeners.delete(listener);
906
- }
907
- function pieceLogoRevision() {
908
- return logoRevision;
909
- }
910
- let catalogLoad;
911
- function ensurePieceLogos() {
912
- const source = getPieceSource();
913
- if (!source) return Promise.resolve();
914
- catalogLoad ??= source.loadCatalog().then((pieces) => registerPieceLogos(pieces)).catch(() => {
915
- catalogLoad = void 0;
916
- });
917
- return catalogLoad;
918
- }
919
- function blockMeta(blockType) {
920
- const core = CORE_META[blockType];
921
- if (core) return core;
922
- const piece = parsePieceBlockType(blockType);
923
- if (piece) {
924
- const pieceLabel = pieceNames.get(piece.packageName) ?? titleCase(piece.pieceName);
925
- const known = blockNames.get(nameKey(blockType) ?? "");
926
- if (!known) requestBlockNames(piece.packageName);
927
- return {
928
- displayName: known ?? titleCase(piece.actionName),
929
- subtitle: piece.isTrigger ? `${pieceLabel} · Trigger` : pieceLabel,
930
- logoUrl: pieceLogo(piece.packageName),
931
- glyph: piece.pieceName.slice(0, 1).toUpperCase() || "?"
932
- };
933
- }
934
- return {
935
- displayName: blockType,
936
- subtitle: "",
937
- glyph: "?"
938
- };
939
- }
940
- function titleCase(value) {
941
- return value.replaceAll(/[-_]/g, " ").replace(/^\w/, (char) => char.toUpperCase());
942
- }
943
- function usePieceLogos() {
944
- const revision = useSyncExternalStore(subscribePieceLogos, pieceLogoRevision, pieceLogoRevision);
945
- useEffect(() => {
946
- ensurePieceLogos();
947
- }, []);
948
- return revision;
949
- }
950
- function useBlockMeta(blockType) {
951
- usePieceLogos();
952
- return blockMeta(blockType);
953
- }
954
- //#endregion
955
- //#region editors/workflow-editor/ui/BlockSelector.tsx
956
- const ROW_LOGO = 24;
957
- const CORE_TILE = {
958
- "core#manual": {
959
- icon: "play",
960
- color: "#2563eb"
961
- },
962
- "core#schedule": {
963
- icon: "clock",
964
- color: "#7c3aed"
965
- },
966
- "core#webhook": {
967
- icon: "bolt",
968
- color: "#0891b2"
969
- },
970
- "core#branch": {
971
- icon: "branch",
972
- color: "#d97706"
973
- },
974
- "core#assert": {
975
- icon: "alert",
976
- color: "#dc2626"
977
- }
978
- };
979
- function CoreTile(props) {
980
- const tile = CORE_TILE[props.blockType];
981
- const glyph = Math.round(props.size * (props.bare ? .9 : .55));
982
- if (props.bare) return /* @__PURE__ */ jsx("span", {
983
- className: "flex shrink-0 items-center justify-center",
984
- style: {
985
- width: props.size,
986
- height: props.size,
987
- color: tile.color
988
- },
989
- children: /* @__PURE__ */ jsx(Icon, {
990
- name: tile.icon,
991
- size: glyph
992
- })
993
- });
994
- return /* @__PURE__ */ jsx("span", {
995
- className: "flex shrink-0 items-center justify-center rounded-[22%] text-white",
996
- style: {
997
- width: props.size,
998
- height: props.size,
999
- backgroundColor: tile.color
1000
- },
1001
- children: /* @__PURE__ */ jsx(Icon, {
1002
- name: tile.icon,
1003
- size: glyph
1004
- })
1005
- });
1006
- }
1007
- function BlockLogo(props) {
1008
- const meta = useBlockMeta(props.blockType);
1009
- if (props.blockType in CORE_TILE) return /* @__PURE__ */ jsx(CoreTile, {
1010
- blockType: props.blockType,
1011
- size: props.size ?? 36,
1012
- bare: props.bare
1013
- });
1014
- return /* @__PURE__ */ jsx(LogoFrame, {
1015
- src: meta.logoUrl,
1016
- alt: meta.displayName,
1017
- size: props.size ?? 36,
1018
- glyph: meta.glyph,
1019
- bare: props.bare
1020
- });
1021
- }
1022
- function GlyphBadge(props) {
1023
- return /* @__PURE__ */ jsx("div", {
1024
- className: "flex shrink-0 items-center justify-center rounded-sm border border-solid border-foreground/10 bg-muted/50 text-muted-foreground",
1025
- style: {
1026
- width: props.size,
1027
- height: props.size,
1028
- fontSize: props.size / 2
1029
- },
1030
- children: props.glyph ?? "?"
1031
- });
1032
- }
1033
- function LogoFrame(props) {
1034
- const [broken, setBroken] = useState(false);
1035
- useEffect(() => {
1036
- setBroken(false);
1037
- }, [props.src]);
1038
- if (!props.src || broken) return /* @__PURE__ */ jsx(GlyphBadge, {
1039
- glyph: props.glyph,
1040
- size: props.size
1041
- });
1042
- return /* @__PURE__ */ jsx("div", {
1043
- className: `flex shrink-0 items-center justify-center ${props.bare ? "" : "dark:rounded-[22%] dark:bg-white dark:p-[var(--logo-pad)]"}`,
1044
- style: {
1045
- width: props.size,
1046
- height: props.size,
1047
- "--logo-pad": `${Math.round(props.size * .12)}px`
1048
- },
1049
- children: /* @__PURE__ */ jsx("img", {
1050
- src: props.src,
1051
- alt: props.alt,
1052
- className: "h-full w-full object-contain drop-shadow-sm",
1053
- onError: () => setBroken(true)
1054
- })
1055
- });
1056
- }
1057
- function Row(props) {
1058
- return /* @__PURE__ */ jsxs("button", {
1059
- type: "button",
1060
- className: `flex w-full items-center gap-2 px-3 py-1.5 text-left ${props.disabled ? "cursor-not-allowed opacity-50" : "hover:bg-muted/50"}`,
1061
- disabled: props.disabled,
1062
- onClick: props.onClick,
1063
- children: [props.logo, /* @__PURE__ */ jsxs("span", {
1064
- className: "min-w-0",
1065
- children: [/* @__PURE__ */ jsx("span", {
1066
- className: "block truncate text-xs font-medium text-foreground",
1067
- children: props.label
1068
- }), /* @__PURE__ */ jsx("span", {
1069
- className: "block truncate text-[11px] text-muted-foreground/80",
1070
- children: props.description
1071
- })]
1072
- })]
1073
- });
1074
- }
1075
- function SectionLabel(props) {
1076
- return /* @__PURE__ */ jsx("div", {
1077
- className: "px-3 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/60",
1078
- children: props.children
1079
- });
1080
- }
1081
- const CATEGORY_LABELS = {
1082
- ARTIFICIAL_INTELLIGENCE: "AI",
1083
- UNIVERSAL_AI: "AI",
1084
- PRODUCTIVITY: "Productivity",
1085
- MARKETING: "Marketing",
1086
- COMMUNICATION: "Communication",
1087
- SALES_AND_CRM: "Sales & CRM",
1088
- DEVELOPER_TOOLS: "Developer tools",
1089
- CONTENT_AND_FILES: "Content & files",
1090
- BUSINESS_INTELLIGENCE: "Business intelligence",
1091
- CORE: "Utilities",
1092
- FLOW_CONTROL: "Utilities",
1093
- COMMERCE: "Commerce",
1094
- FORMS_AND_SURVEYS: "Forms & surveys",
1095
- ACCOUNTING: "Accounting",
1096
- CUSTOMER_SUPPORT: "Customer support",
1097
- PAYMENT_PROCESSING: "Payments",
1098
- HUMAN_RESOURCES: "HR"
1099
- };
1100
- const CORE_CHIP = "Core";
1101
- const POWERHOUSE_CHIP = "Powerhouse";
1102
- const AI_CHIP = "AI";
1103
- function categoryLabel(id) {
1104
- return CATEGORY_LABELS[id] ?? id.toLowerCase().replaceAll("_", " ").replace(/^\w/, (char) => char.toUpperCase());
1105
- }
1106
- function chipsOf(piece) {
1107
- return new Set(piece.categories.map(categoryLabel));
1108
- }
1109
- function orderChips(pieces) {
1110
- const counts = /* @__PURE__ */ new Map();
1111
- for (const piece of pieces) for (const chip of chipsOf(piece)) counts.set(chip, (counts.get(chip) ?? 0) + 1);
1112
- const rest = [...counts.entries()].filter(([chip]) => chip !== AI_CHIP).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([chip]) => chip);
1113
- return [
1114
- CORE_CHIP,
1115
- POWERHOUSE_CHIP,
1116
- ...counts.has(AI_CHIP) ? [AI_CHIP] : [],
1117
- ...rest
1118
- ];
1119
- }
1120
- function PieceEntries(props) {
1121
- const [entries, setEntries] = useState(null);
1122
- const [error, setError] = useState(null);
1123
- useEffect(() => {
1124
- let cancelled = false;
1125
- const pieceSource = getPieceSource();
1126
- (props.mode === "triggers" ? pieceSource?.loadTriggers(props.piece.name) : pieceSource?.loadActions(props.piece.name))?.then((result) => {
1127
- if (!cancelled) setEntries(result);
1128
- }).catch((loadError) => {
1129
- if (!cancelled) setError(loadError instanceof Error ? loadError.message : String(loadError));
1130
- });
1131
- return () => {
1132
- cancelled = true;
1133
- };
1134
- }, [props.piece.name, props.mode]);
1135
- return /* @__PURE__ */ jsxs("div", {
1136
- className: "max-h-80 overflow-y-auto py-1",
1137
- children: [/* @__PURE__ */ jsxs("button", {
1138
- type: "button",
1139
- className: "flex w-full items-center gap-1 px-3 py-1 text-[11px] text-muted-foreground/80 hover:text-muted-foreground",
1140
- onClick: props.onBack,
1141
- children: ["← ", props.piece.displayName]
1142
- }), error ? /* @__PURE__ */ jsx("div", {
1143
- className: "px-3 py-2 text-xs text-wf-fail",
1144
- children: error
1145
- }) : entries === null ? /* @__PURE__ */ jsx("div", {
1146
- className: "px-3 py-2 text-xs text-muted-foreground/80",
1147
- children: "Loading…"
1148
- }) : entries.map((entry) => {
1149
- const unavailable = blockUnavailable({
1150
- ...entry,
1151
- kind: props.mode === "triggers" ? "trigger" : "action"
1152
- });
1153
- return /* @__PURE__ */ jsx(Row, {
1154
- logo: /* @__PURE__ */ jsx(LogoFrame, {
1155
- src: props.piece.logoUrl,
1156
- alt: props.piece.displayName,
1157
- size: ROW_LOGO
1158
- }),
1159
- label: entry.displayName,
1160
- description: unavailable ?? entry.description,
1161
- disabled: unavailable !== void 0,
1162
- onClick: () => props.onPick({
1163
- label: entry.displayName,
1164
- blockType: entry.blockType,
1165
- description: entry.description,
1166
- defaultConfig: {}
1167
- })
1168
- }, entry.name);
1169
- })]
1170
- });
1171
- }
1172
- const SEARCH_MIN_CHARS = 2;
1173
- const SEARCH_DEBOUNCE_MS = 250;
1174
- const INDEXING_RETRY_MS = 2e3;
1175
- function useBlockSearch(query, enabled) {
1176
- const [state, setState] = useState({ kind: "idle" });
1177
- const [attempt, setAttempt] = useState(0);
1178
- const trimmed = query.trim();
1179
- const active = enabled && trimmed.length >= SEARCH_MIN_CHARS;
1180
- useEffect(() => {
1181
- const search = getPieceSource()?.searchBlocks;
1182
- if (!active || !search) {
1183
- setState({ kind: "idle" });
1184
- return;
1185
- }
1186
- let alive = true;
1187
- let retry;
1188
- const timer = setTimeout(() => {
1189
- setState((previous) => previous.kind === "done" ? previous : { kind: "loading" });
1190
- search(trimmed).then((result) => {
1191
- if (!alive) return;
1192
- setState({
1193
- kind: "done",
1194
- result
1195
- });
1196
- if (result.status === "indexing") retry = setTimeout(() => setAttempt((value) => value + 1), INDEXING_RETRY_MS);
1197
- }, (error) => {
1198
- if (alive) setState({
1199
- kind: "error",
1200
- message: error instanceof Error ? error.message : String(error)
1201
- });
1202
- });
1203
- }, SEARCH_DEBOUNCE_MS);
1204
- return () => {
1205
- alive = false;
1206
- clearTimeout(timer);
1207
- if (retry) clearTimeout(retry);
1208
- };
1209
- }, [
1210
- active,
1211
- trimmed,
1212
- attempt
1213
- ]);
1214
- return active ? state : { kind: "idle" };
1215
- }
1216
- function Chip(props) {
1217
- return /* @__PURE__ */ jsx("button", {
1218
- type: "button",
1219
- className: `rounded-full border px-2 py-0.5 text-[10px] font-medium ${props.active ? "border-primary bg-primary text-primary-foreground" : "border-foreground/10 text-muted-foreground hover:border-foreground/25"}`,
1220
- onClick: props.onClick,
1221
- children: props.label
1222
- });
1223
- }
1224
- function BlockSelector(props) {
1225
- const [query, setQuery] = useState("");
1226
- const [chip, setChip] = useState(null);
1227
- const [catalog, setCatalog] = useState(null);
1228
- const [piece, setPiece] = useState(null);
1229
- const containerRef = useRef(null);
1230
- useEffect(() => {
1231
- const handler = (event) => {
1232
- if (!containerRef.current?.contains(event.target)) props.onClose();
1233
- };
1234
- window.addEventListener("mousedown", handler);
1235
- return () => window.removeEventListener("mousedown", handler);
1236
- }, [props]);
1237
- const pieceSource = props.showPieces ? getPieceSource() : void 0;
1238
- useEffect(() => {
1239
- if (!pieceSource) return;
1240
- let cancelled = false;
1241
- pieceSource.loadCatalog().then((pieces) => {
1242
- if (!cancelled) setCatalog({ pieces });
1243
- }).catch((error) => {
1244
- if (!cancelled) setCatalog({
1245
- pieces: [],
1246
- error: error instanceof Error ? error.message : String(error)
1247
- });
1248
- });
1249
- return () => {
1250
- cancelled = true;
1251
- };
1252
- }, [pieceSource]);
1253
- const mode = props.pieceMode ?? "actions";
1254
- const lowered = query.toLowerCase();
1255
- const modePieces = useMemo(() => (catalog?.pieces ?? []).filter((entry) => (mode === "triggers" ? entry.triggerCount : entry.actionCount) > 0), [catalog, mode]);
1256
- const chips = useMemo(() => orderChips(modePieces), [modePieces]);
1257
- const chipsByPiece = useMemo(() => new Map(modePieces.map((entry) => [entry.name, chipsOf(entry)])), [modePieces]);
1258
- const inChip = (pieceName) => chip === null || chip === "Core" ? true : chipsByPiece.get(pieceName)?.has(chip) ?? false;
1259
- const showCatalog = pieceSource !== void 0 && !(chip === "Core" || chip === "Powerhouse");
1260
- const matching = props.presets.filter((preset) => `${preset.label} ${preset.blockType}`.toLowerCase().includes(lowered));
1261
- const corePresets = chip === null || chip === "Core" ? matching.filter((preset) => preset.group !== "powerhouse") : [];
1262
- const powerhousePresets = chip === null || chip === "Powerhouse" ? matching.filter((preset) => preset.group === "powerhouse") : [];
1263
- const filteredAttach = (props.onAttach ? props.attachSteps ?? [] : []).filter((step) => `${step.name} ${step.key} ${step.blockType}`.toLowerCase().includes(lowered));
1264
- const filteredPieces = showCatalog ? modePieces.filter((entry) => inChip(entry.name) && `${entry.displayName} ${entry.name} ${entry.description}`.toLowerCase().includes(lowered)) : [];
1265
- const search = useBlockSearch(query, showCatalog && !piece);
1266
- const presetRow = (preset) => /* @__PURE__ */ jsx(Row, {
1267
- logo: /* @__PURE__ */ jsx(BlockLogo, {
1268
- blockType: preset.blockType,
1269
- size: ROW_LOGO
1270
- }),
1271
- label: preset.label,
1272
- description: preset.description,
1273
- onClick: () => props.onPick(preset)
1274
- }, preset.blockType + preset.label);
1275
- const labelPresets = showCatalog || filteredAttach.length > 0 || corePresets.length > 0 && powerhousePresets.length > 0;
1276
- const wantedKind = mode === "triggers" ? "trigger" : "action";
1277
- const hits = search.kind === "done" ? search.result.hits.filter((hit) => hit.kind === wantedKind && inChip(hit.pieceName)) : [];
1278
- const searchActive = search.kind !== "idle";
1279
- return /* @__PURE__ */ jsxs("div", {
1280
- ref: containerRef,
1281
- className: "nodrag nopan nowheel w-80 rounded-md border border-solid border-foreground/10 bg-card shadow-lg",
1282
- onClick: (event) => event.stopPropagation(),
1283
- children: [/* @__PURE__ */ jsxs("div", {
1284
- className: "border-b border-foreground/10 p-2",
1285
- children: [/* @__PURE__ */ jsx("div", {
1286
- className: "mb-1 px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground/80",
1287
- children: props.title
1288
- }), piece ? null : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("input", {
1289
- autoFocus: true,
1290
- className: "w-full rounded border border-foreground/10 px-2 py-1 text-xs",
1291
- placeholder: pieceSource ? "Search pieces, actions, triggers…" : "Search…",
1292
- value: query,
1293
- onChange: (event) => setQuery(event.target.value)
1294
- }), pieceSource && catalog && !catalog.error ? /* @__PURE__ */ jsx("div", {
1295
- className: "mt-1.5 flex flex-wrap gap-1 px-0.5",
1296
- children: chips.map((label) => /* @__PURE__ */ jsx(Chip, {
1297
- label,
1298
- active: chip === label,
1299
- onClick: () => setChip(chip === label ? null : label)
1300
- }, label))
1301
- }) : null] })]
1302
- }), piece ? /* @__PURE__ */ jsx(PieceEntries, {
1303
- piece,
1304
- mode,
1305
- onPick: props.onPick,
1306
- onBack: () => setPiece(null)
1307
- }) : /* @__PURE__ */ jsxs("div", {
1308
- className: "max-h-80 overflow-y-auto py-1",
1309
- children: [
1310
- filteredAttach.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Attach existing step" }), filteredAttach.map((step) => /* @__PURE__ */ jsx(Row, {
1311
- logo: /* @__PURE__ */ jsx(BlockLogo, {
1312
- blockType: step.blockType,
1313
- size: ROW_LOGO
1314
- }),
1315
- label: step.name,
1316
- description: `{{steps.${step.key}}} · detached`,
1317
- onClick: () => props.onAttach?.(step.id)
1318
- }, step.id))] }) : null,
1319
- corePresets.length > 0 && labelPresets ? /* @__PURE__ */ jsx(SectionLabel, { children: "Core" }) : null,
1320
- corePresets.map(presetRow),
1321
- powerhousePresets.length > 0 && labelPresets ? /* @__PURE__ */ jsx(SectionLabel, { children: "Powerhouse" }) : null,
1322
- powerhousePresets.map(presetRow),
1323
- searchActive ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SectionLabel, { children: mode === "triggers" ? "Triggers" : "Actions & triggers" }), search.kind === "loading" ? /* @__PURE__ */ jsx("div", {
1324
- className: "px-3 py-1 text-xs text-muted-foreground/80",
1325
- children: "Searching…"
1326
- }) : search.kind === "error" ? /* @__PURE__ */ jsx("div", {
1327
- className: "px-3 py-1 text-xs text-wf-fail",
1328
- children: search.message
1329
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [hits.map((hit) => {
1330
- const unavailable = blockUnavailable(hit);
1331
- return /* @__PURE__ */ jsx(Row, {
1332
- logo: /* @__PURE__ */ jsx(LogoFrame, {
1333
- src: hit.logoUrl,
1334
- alt: hit.pieceDisplayName,
1335
- size: ROW_LOGO
1336
- }),
1337
- label: `${hit.displayName} · ${hit.pieceDisplayName}`,
1338
- description: unavailable ?? (hit.description || hit.pieceDisplayName),
1339
- disabled: unavailable !== void 0,
1340
- onClick: () => props.onPick({
1341
- label: hit.displayName,
1342
- blockType: hit.blockType,
1343
- description: hit.description,
1344
- defaultConfig: {}
1345
- })
1346
- }, hit.blockType);
1347
- }), search.result.status === "indexing" ? /* @__PURE__ */ jsx("div", {
1348
- className: "px-3 py-1 text-xs text-muted-foreground/80",
1349
- children: "Indexing the catalog… more results appear shortly."
1350
- }) : search.result.status === "error" ? /* @__PURE__ */ jsx("div", {
1351
- className: "px-3 py-1 text-xs text-wf-fail",
1352
- children: search.result.error ?? "Search failed"
1353
- }) : hits.length === 0 ? /* @__PURE__ */ jsxs("div", {
1354
- className: "px-3 py-1 text-xs text-muted-foreground/80",
1355
- children: [
1356
- "No matching ",
1357
- wantedKind,
1358
- "s"
1359
- ]
1360
- }) : null] })] }) : null,
1361
- showCatalog ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Pieces" }), catalog === null ? /* @__PURE__ */ jsx("div", {
1362
- className: "px-3 py-2 text-xs text-muted-foreground/80",
1363
- children: "Loading catalog…"
1364
- }) : catalog.error ? /* @__PURE__ */ jsx("div", {
1365
- className: "px-3 py-2 text-xs text-wf-fail",
1366
- children: catalog.error
1367
- }) : filteredPieces.map((entry) => /* @__PURE__ */ jsx(Row, {
1368
- logo: /* @__PURE__ */ jsx(LogoFrame, {
1369
- src: entry.logoUrl,
1370
- alt: entry.displayName,
1371
- size: ROW_LOGO
1372
- }),
1373
- label: entry.deprecated ? `${entry.displayName} (deprecated)` : entry.displayName,
1374
- description: entry.unsupported ?? (mode === "triggers" ? `${entry.triggerCount} trigger${entry.triggerCount === 1 ? "" : "s"} · ${entry.description}` : `${entry.actionCount} action${entry.actionCount === 1 ? "" : "s"} · ${entry.description}`),
1375
- onClick: () => setPiece(entry)
1376
- }, entry.name))] }) : null,
1377
- corePresets.length + powerhousePresets.length === 0 && filteredPieces.length === 0 && filteredAttach.length === 0 && !searchActive ? /* @__PURE__ */ jsx("div", {
1378
- className: "px-3 py-2 text-xs text-muted-foreground/80",
1379
- children: "No matches"
1380
- }) : null
1381
- ]
1382
- })]
1383
- });
1384
- }
1385
- //#endregion
1386
- export { FieldError as A, textInputClass as B, runStats as C, workflowHealth as D, toneOf as E, Select as F, errorMessage as G, isIconName as H, Switch as I, Tabs as L, Hint as M, IconButton as N, useSyncWorkflowRuntimeUrl as O, Segmented as P, invalidClass as R, formatWhen as S, statusLabel as T, DocumentErrorBoundary as U, Icon as V, DocumentLoadError as W, durationMs as _, pieceLogo as a, formatMs as b, registerPieceSource as c, RUN_TONE as d, STEP_TONE as f, WORKFLOW_TONE as g, TONE_TEXT as h, pieceDisplayName as i, FieldLabel as j, Button as k, CONNECTION_TONE as l, TONE_DOT as m, BlockSelector as n, useBlockMeta as o, TONE_BADGE as p, blockMeta as r, usePieceLogos as s, BlockLogo as t, RUN_STATUSES as u, formatAbsolute as v, runTimeline as w, formatTrigger as x, formatDuration as y, textAreaClass as z };
1387
-
1388
- //# sourceMappingURL=BlockSelector-CTmmpYxu.mjs.map