@powerhousedao/workflow 6.2.3-dev.90 → 6.2.3-dev.92

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.
@@ -2,10 +2,10 @@ import { h as REACTOR_CONNECTOR_ID, x as actions } from "./module-DJz6oTX0.js";
2
2
  import { t as useConnectionDocumentById } from "./connection-PaKXHYz9.js";
3
3
  import { i as connectorIdForPiece, l as planFromAuth, s as packageFromConnectorId } from "./piece-auth-63iuNFTs.js";
4
4
  import { $ as triggerFields, Q as triggerBlock, V as STEP_PRESETS, W as TRIGGER_PRESETS, X as stepBlock, Y as sameBlock, Z as stepFields, b as realRuns, f as stepOutputTreeQuery, g as blockRefKey, i as outputTreeQuery, j as CALLABLE_FLOW_TRIGGER$1, n as catalogQuery, q as isCoreBlock, u as runsQuery, y as TEST_TRIGGER_KIND } from "./runtime-queries-C5bqAgQy.js";
5
- import { y as actions$1 } from "./module-mFCt9WHJ.js";
5
+ import { _ as reducer, y as actions$1 } from "./module-mFCt9WHJ.js";
6
6
  import { t as useSelectedWorkflowDocument } from "./workflow-BFdnSGRD.js";
7
7
  import { At as Button, B as DesignTimeProvider, C as TONE_DOT, Ct as useRuntime, D as formatAbsolute, Ft as Segmented, G as useBlockResolutions, H as useBlockFormLoader, Ht as textAreaClass, It as Select, J as useDesignTime, K as useCachedBlockForm, Kt as DocumentErrorBoundary, Lt as Switch, M as formatWhen, Mt as FieldLabel, Nt as Hint, O as formatDuration, Ot as useSearchParam, Pt as IconButton, Q as useLatestRun, R as toneOf, Rt as Tabs, St as useRunsQuery, U as useBlockForms, Ut as textInputClass, V as useBlockForm, W as useBlockPorts, Wt as Icon, X as useDynamicLookup, Z as useDynamicPrefetch, _ as useBlockMeta, a as BlockResolutionsProvider, at as blockMissing, c as runsDifferentVersion, d as versionBadge, dt as storedSchema, g as stepSubtitle, gt as WorkflowRuntimeProvider, h as pieceLogo, ht as workflowReadiness, i as PickerPopover, it as useWebhookEndpoint, jt as FieldError, l as updateVersion, lt as resolverInputFor, m as pieceDisplayName, n as BlockSelector, nt as useTestStepRunner, o as VersionSummary, p as namedByCoreTab, pt as undeclaredPortIssues, q as useConnectionList, r as PICKER_SIZE, rt as useTestTrigger, s as resolutionText, st as isPropVisible, t as BlockLogo, tt as useRunById, u as useResolution, ut as settingFor, v as usePieceLogos, w as TONE_TEXT, wt as useRuntimeActions, x as RUN_TONE } from "./BlockSelector-DFzzAWXh.js";
8
- import { a as useSignInGate, f as connectionCallbacks, g as newUndoGroup, h as groupedAction, i as useReactorAccessDenial, l as reactorConnections, m as UndoRedo, n as SignInPrompt, o as missingInPublished, p as BackButton, r as usePublisher, s as runsAsText, t as ConnectionForm } from "./connection-form-B6zpGmAm.js";
8
+ import { _ as newUndoGroup, a as useSignInGate, f as connectionCallbacks, g as groupedAction, h as documentCapabilities, i as useReactorAccessDenial, l as reactorConnections, m as UndoRedo, n as SignInPrompt, o as missingInPublished, p as BackButton, r as usePublisher, s as runsAsText, t as ConnectionForm } from "./connection-form-O02M1hkC.js";
9
9
  import { A as ExpressionTargetProvider, B as documentShape, C as PropertyForm, D as ExpressionPickerButton, E as useSecretRef, F as VARIABLE_TYPES, G as usePendingEcho, H as contextMenuItems, I as VARIABLE_TYPE_LABEL, L as convertVariableValue, M as useExpressionField, N as EMPTY_SCOPE, O as ExpressionPickerPopup, P as buildExpressionScope, R as parseTypedValue, S as PiecePlaceholderContext, T as withPropDefaults, U as menuHeight, V as stateFieldsFromSdl, W as menuPosition, _ as STEP_PARAM, a as StepError, b as uniqueStepKey, d as PublishButton, f as PublishState, g as usePublish, h as StatusToggle, i as DataViewer, j as ExpressionTokenLine, k as ExpressionScopeSourceProvider, l as DraftBanner, m as ReactorDenialNote, n as describeSchedule, p as PublishedMissingNote, r as describeTrigger, s as graphLayout, t as describeCron, u as ManagedBanner, v as VARIABLES_VIEW, w as lacksDefaults, x as AvailableSoon, y as hasDraftChanges, z as valueMismatch } from "./trigger-text-BfIu-QcC.js";
10
10
  import { addDocument, dispatchActions, useDocumentModelModules, useDocumentSafe, useFileNodesInSelectedDrive, useSelectedDriveId } from "@powerhousedao/reactor-browser";
11
11
  import { generateId } from "document-model";
@@ -159,6 +159,7 @@ function toModel(state) {
159
159
  function useWorkflowModel() {
160
160
  const [document, write] = useSelectedWorkflowDocument();
161
161
  const state = document.state.global;
162
+ const caps = documentCapabilities(document.header, document.operations.document?.[0]);
162
163
  const managed = Boolean(state.managedBy);
163
164
  const dispatch = useMemo(() => managed ? (() => void 0) : write, [managed, write]);
164
165
  const latest = useRef(state);
@@ -174,7 +175,7 @@ function useWorkflowModel() {
174
175
  setStatus: (status) => dispatch(actions$1.setWorkflowStatus({ status })),
175
176
  setTrigger: (input) => {
176
177
  const id = state.trigger?.id ?? generateId();
177
- const group = newUndoGroup();
178
+ const group = newUndoGroup(caps);
178
179
  dispatch(groupedAction(actions$1.setTrigger({
179
180
  id,
180
181
  pieceName: input.pieceName,
@@ -184,7 +185,7 @@ function useWorkflowModel() {
184
185
  connectionId: input.connectionId,
185
186
  reactorConnectionId: input.reactorConnectionId,
186
187
  ...input.propertySettings ? { propertySettings: settingsInput(input.propertySettings) } : {}
187
- }), group));
188
+ }), group, caps));
188
189
  return {
189
190
  id,
190
191
  group,
@@ -200,7 +201,7 @@ function useWorkflowModel() {
200
201
  clearTrigger: () => dispatch(actions$1.clearTrigger({})),
201
202
  addStep: (input) => {
202
203
  const id = generateId();
203
- const group = newUndoGroup();
204
+ const group = newUndoGroup(caps);
204
205
  dispatch(groupedAction(actions$1.addStep({
205
206
  id,
206
207
  key: input.key,
@@ -210,7 +211,7 @@ function useWorkflowModel() {
210
211
  actionName: input.actionName,
211
212
  config: input.config,
212
213
  position: input.position
213
- }), group));
214
+ }), group, caps));
214
215
  return {
215
216
  id,
216
217
  group,
@@ -260,7 +261,7 @@ function useWorkflowModel() {
260
261
  if (!edge) return void 0;
261
262
  const stepId = generateId();
262
263
  const continuing = generateId();
263
- const group = newUndoGroup();
264
+ const group = newUndoGroup(caps);
264
265
  dispatch([
265
266
  actions$1.addStep({
266
267
  id: stepId,
@@ -285,7 +286,7 @@ function useWorkflowModel() {
285
286
  to: edge.to,
286
287
  port
287
288
  })
288
- ].map((action) => groupedAction(action, group)));
289
+ ].map((action) => groupedAction(action, group, caps)));
289
290
  return {
290
291
  id: stepId,
291
292
  group,
@@ -318,7 +319,7 @@ function useWorkflowModel() {
318
319
  },
319
320
  appendStep: (fromId, port, input) => {
320
321
  const stepId = generateId();
321
- const group = newUndoGroup();
322
+ const group = newUndoGroup(caps);
322
323
  dispatch([actions$1.addStep({
323
324
  id: stepId,
324
325
  key: input.key,
@@ -332,7 +333,7 @@ function useWorkflowModel() {
332
333
  from: fromId,
333
334
  to: stepId,
334
335
  port
335
- })].map((action) => groupedAction(action, group)));
336
+ })].map((action) => groupedAction(action, group, caps)));
336
337
  return {
337
338
  id: stepId,
338
339
  group,
@@ -361,11 +362,15 @@ function useWorkflowModel() {
361
362
  port: plan.repoint.port,
362
363
  condition: plan.repoint.edge.condition
363
364
  })] : []];
364
- dispatch(followUps.map((action) => groupedAction(action, added.group)));
365
+ dispatch(followUps.map((action) => groupedAction(action, added.group, caps)));
365
366
  };
366
367
  attempt();
367
368
  }
368
- }), [dispatch, state])
369
+ }), [
370
+ dispatch,
371
+ state,
372
+ caps
373
+ ])
369
374
  };
370
375
  }
371
376
  function findBlock(state, added) {
@@ -4642,7 +4647,9 @@ function WorkflowEditor() {
4642
4647
  leading: /* @__PURE__ */ jsx(BackButton, { documentId: workflowId }),
4643
4648
  trailing: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(LastRunFact, { workflowId }), /* @__PURE__ */ jsx(UndoRedo, {
4644
4649
  documentId: workflowId,
4645
- policy: WORKFLOW_UNDO
4650
+ reducer,
4651
+ policy: WORKFLOW_UNDO,
4652
+ readOnly: model.readOnly
4646
4653
  })] })
4647
4654
  })
4648
4655
  })
@@ -4659,4 +4666,4 @@ function Editor({ document }) {
4659
4666
  //#endregion
4660
4667
  export { Editor as default };
4661
4668
 
4662
- //# sourceMappingURL=editor-Yt-_V04R.js.map
4669
+ //# sourceMappingURL=editor-BPF_SXdt.js.map