@acorex/platform 21.0.0-next.64 → 21.0.0-next.67

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 (50) hide show
  1. package/fesm2022/acorex-platform-common.mjs +94 -18
  2. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  3. package/fesm2022/acorex-platform-core.mjs +42 -1
  4. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-layout-builder.mjs +29 -7
  6. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-layout-components.mjs +282 -108
  8. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-layout-designer.mjs +1 -1
  10. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-layout-entity-attachments-page.component-BaTS183I.mjs +383 -0
  12. package/fesm2022/acorex-platform-layout-entity-attachments-page.component-BaTS183I.mjs.map +1 -0
  13. package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs → acorex-platform-layout-entity-file-list-popup.component-_yrP5SQe.mjs} +15 -18
  14. package/fesm2022/acorex-platform-layout-entity-file-list-popup.component-_yrP5SQe.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-layout-entity.mjs +3339 -301
  16. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-views.mjs +0 -1
  18. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-widget-core.mjs +1377 -4
  20. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-layout-widgets.mjs +8938 -11693
  22. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  23. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs → acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs} +3 -3
  24. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs.map} +1 -1
  25. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs → acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs} +3 -3
  26. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs.map → acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs → acorex-platform-themes-default-entity-master-single-view.component-Br9p5aXT.mjs} +4 -4
  28. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-Br9p5aXT.mjs.map} +1 -1
  29. package/fesm2022/acorex-platform-themes-default.mjs +685 -287
  30. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  31. package/fesm2022/{acorex-platform-themes-shared-settings.provider-BgXYCFia.mjs → acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs} +29 -2
  32. package/fesm2022/acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-themes-shared.mjs +94 -24
  34. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  35. package/fesm2022/acorex-platform-workflow.mjs +176 -26
  36. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  37. package/package.json +1 -1
  38. package/types/acorex-platform-common.d.ts +74 -10
  39. package/types/acorex-platform-core.d.ts +63 -2
  40. package/types/acorex-platform-layout-builder.d.ts +7 -1
  41. package/types/acorex-platform-layout-components.d.ts +162 -36
  42. package/types/acorex-platform-layout-entity.d.ts +704 -14
  43. package/types/acorex-platform-layout-views.d.ts +28 -0
  44. package/types/acorex-platform-layout-widget-core.d.ts +156 -3
  45. package/types/acorex-platform-layout-widgets.d.ts +29 -393
  46. package/types/acorex-platform-themes-default.d.ts +137 -30
  47. package/types/acorex-platform-themes-shared.d.ts +23 -1
  48. package/types/acorex-platform-workflow.d.ts +91 -4
  49. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs.map +0 -1
  50. package/fesm2022/acorex-platform-themes-shared-settings.provider-BgXYCFia.mjs.map +0 -1
@@ -1303,6 +1303,80 @@ function isWorkflowContinuationSuppressed(userInput) {
1303
1303
  }
1304
1304
  //#endregion
1305
1305
 
1306
+ //#region ---- Inline frontend classification ----
1307
+ /**
1308
+ * Frontend step executed inline (dialog/popup), not suspended on the task board.
1309
+ * Derived from execution mode and task-board activity types — no per-activity hardcoding.
1310
+ */
1311
+ function axpIsWorkflowInlineFrontendTask(task) {
1312
+ if (!task) {
1313
+ return false;
1314
+ }
1315
+ if (axpIsWorkflowTaskBoardActivityType(task.activityType)) {
1316
+ return false;
1317
+ }
1318
+ return task.executionMode === 'frontend' || task.executionMode === 'both';
1319
+ }
1320
+ /** @deprecated Use {@link axpIsWorkflowInlineFrontendTask}. */
1321
+ function axpIsWorkflowInteractiveFrontendTask(task) {
1322
+ return axpIsWorkflowInlineFrontendTask(task);
1323
+ }
1324
+ //#endregion
1325
+ //#region ---- Continuation metadata on tasks ----
1326
+ /** Resolved before-interactive behavior from task metadata (set by engine from activity definition). */
1327
+ function axpResolveWorkflowContinuationBeforeInteractive(task) {
1328
+ return task?.continuation?.beforeInteractive ?? 'default';
1329
+ }
1330
+ /**
1331
+ * Whether to skip the pre-interactive "continue?" prompt based on activity metadata.
1332
+ * Assignee-specific rules are applied in workflow-management (needs session).
1333
+ */
1334
+ function axpShouldSkipBeforeInteractiveFromMetadata(behavior, completedWasHumanTask) {
1335
+ return behavior === 'skip-when-chained-from-human-task' && completedWasHumanTask;
1336
+ }
1337
+ /**
1338
+ * Whether to show a "continue?" prompt before running inline frontend activities.
1339
+ * Skips when the user already resumed a task-board step (primary action / resume).
1340
+ */
1341
+ function axpShouldOfferBeforeInteractiveFlow(context) {
1342
+ return !context.completedActivityId;
1343
+ }
1344
+ //#endregion
1345
+ //#region ---- Step advancement gate ----
1346
+ /** Resume outcomes that do not advance the workflow graph (draft save, cancel, loop back). */
1347
+ const NON_ADVANCING_RESUME_OUTCOMES = new Set(['saved', 'cancelled', 'cancel', 'save', 'draft']);
1348
+ /**
1349
+ * Whether the workflow advanced enough to consider a continuation prompt.
1350
+ * Includes pending interactive steps when inbox bookmarks are already consumed.
1351
+ */
1352
+ function axpShouldOfferWorkflowContinuationAfterStep(context, activeBookmarkActivityIds) {
1353
+ const outcome = context.resumeOutcome?.trim().toLowerCase();
1354
+ if (outcome && NON_ADVANCING_RESUME_OUTCOMES.has(outcome)) {
1355
+ return false;
1356
+ }
1357
+ const pendingActivityId = context.pendingNextTask?.activityId;
1358
+ const completedActivityId = context.completedActivityId;
1359
+ if (pendingActivityId && completedActivityId && pendingActivityId === completedActivityId) {
1360
+ return false;
1361
+ }
1362
+ if (activeBookmarkActivityIds.length === 0) {
1363
+ const pending = context.pendingNextTask;
1364
+ if (completedActivityId && pending && pending.activityId !== completedActivityId) {
1365
+ if (axpIsWorkflowInlineFrontendTask(pending) ||
1366
+ axpIsWorkflowTaskBoardActivityType(pending.activityType)) {
1367
+ return true;
1368
+ }
1369
+ }
1370
+ return false;
1371
+ }
1372
+ /** No continuation on bare workflow start (bookmarks exist before any step completes). */
1373
+ if (!completedActivityId) {
1374
+ return false;
1375
+ }
1376
+ return activeBookmarkActivityIds.some((id) => id !== completedActivityId);
1377
+ }
1378
+ //#endregion
1379
+
1306
1380
  //#endregion
1307
1381
  /**
1308
1382
  * Workflow Manager - Facade for workflow lifecycle orchestration.
@@ -1412,9 +1486,22 @@ class AXPWorkflowManager {
1412
1486
  const nextInteractive = (completeResponse.nextTask.executionMode === 'frontend' || completeResponse.nextTask.executionMode === 'both') &&
1413
1487
  !axpIsWorkflowTaskBoardActivityType(completeResponse.nextTask.activityType);
1414
1488
  if (!nextInteractive) {
1489
+ const humanTaskNext = completeResponse.nextTask;
1490
+ let boundaryContinuationOffer;
1491
+ if (humanTaskNext &&
1492
+ axpIsWorkflowTaskBoardActivityType(humanTaskNext.activityType)) {
1493
+ boundaryContinuationOffer =
1494
+ (await this.continuationHook?.offerAfterWorkflowStep?.({
1495
+ instanceId,
1496
+ completedActivityId: currentTask.activityId,
1497
+ resumeOutcome: execResult.outcome,
1498
+ pendingNextTask: humanTaskNext,
1499
+ })) ?? 'not-offered';
1500
+ }
1415
1501
  return {
1416
- nextTask: completeResponse.nextTask,
1502
+ nextTask: humanTaskNext,
1417
1503
  state: currentState,
1504
+ boundaryContinuationOffer,
1418
1505
  };
1419
1506
  }
1420
1507
  // Continue with next interactive frontend task
@@ -1437,6 +1524,69 @@ class AXPWorkflowManager {
1437
1524
  state: currentState,
1438
1525
  };
1439
1526
  }
1527
+ /**
1528
+ * Runs inline interactive activities when allowed, with an optional pre-flow continuation prompt.
1529
+ */
1530
+ async runInteractiveFlowWithContinuation(instanceId, pendingTask, state, continuationContext, suppressContinuation, activityOutputs) {
1531
+ let continuationOffer = 'not-offered';
1532
+ if (!suppressContinuation &&
1533
+ axpShouldOfferBeforeInteractiveFlow(continuationContext) &&
1534
+ axpIsWorkflowInlineFrontendTask(pendingTask) &&
1535
+ this.continuationHook?.offerBeforeInteractiveFlow) {
1536
+ continuationOffer =
1537
+ (await this.continuationHook.offerBeforeInteractiveFlow({
1538
+ ...continuationContext,
1539
+ instanceId,
1540
+ pendingNextTask: pendingTask,
1541
+ })) ?? 'not-offered';
1542
+ if (continuationOffer === 'declined') {
1543
+ await this.revertResumeAfterDeclinedInteractiveContinuation(instanceId, continuationContext, pendingTask);
1544
+ const revertedState = this.stateCache.get(instanceId) ?? state;
1545
+ return { nextTask: null, state: revertedState, continuationOffer };
1546
+ }
1547
+ }
1548
+ const interactiveResult = await this.executeInteractiveFlow(instanceId, pendingTask, state, activityOutputs);
1549
+ const boundaryOffer = interactiveResult.boundaryContinuationOffer;
1550
+ if (boundaryOffer && boundaryOffer !== 'not-offered') {
1551
+ continuationOffer = boundaryOffer;
1552
+ }
1553
+ return { ...interactiveResult, continuationOffer };
1554
+ }
1555
+ async invokeWorkflowContinuationAfterStep(context, priorOffer, suppressContinuation = false) {
1556
+ if (suppressContinuation || priorOffer === 'declined') {
1557
+ return;
1558
+ }
1559
+ if (priorOffer && priorOffer !== 'not-offered') {
1560
+ return;
1561
+ }
1562
+ await this.continuationHook?.offerAfterWorkflowStep?.(context);
1563
+ }
1564
+ /**
1565
+ * Restores the suspended task-board step when the user declines a pre-interactive continuation prompt.
1566
+ */
1567
+ async revertResumeAfterDeclinedInteractiveContinuation(instanceId, context, abortedTask) {
1568
+ const suspendedStepId = context.completedActivityId;
1569
+ if (!suspendedStepId) {
1570
+ return;
1571
+ }
1572
+ const revert = this.workflowEngine.revertResumeAfterDeclinedInteractiveContinuation?.bind(this.workflowEngine);
1573
+ if (!revert) {
1574
+ return;
1575
+ }
1576
+ const result = await revert({
1577
+ instanceId,
1578
+ suspendedStepId,
1579
+ abortedStepId: abortedTask.activityId,
1580
+ bookmarkId: context.completedBookmarkId,
1581
+ });
1582
+ if (result.success && result.state) {
1583
+ let normalizedState = { ...result.state };
1584
+ if (normalizedState.lastUpdated && !(normalizedState.lastUpdated instanceof Date)) {
1585
+ normalizedState.lastUpdated = new Date(normalizedState.lastUpdated);
1586
+ }
1587
+ this.stateCache.set(instanceId, normalizedState);
1588
+ }
1589
+ }
1440
1590
  /**
1441
1591
  * Start a new workflow instance.
1442
1592
  *
@@ -1479,31 +1629,23 @@ class AXPWorkflowManager {
1479
1629
  if (pendingTask &&
1480
1630
  (pendingTask.executionMode === 'frontend' || pendingTask.executionMode === 'both') &&
1481
1631
  !axpIsWorkflowTaskBoardActivityType(pendingTask.activityType)) {
1482
- const interactiveResult = await this.executeInteractiveFlow(response.instanceId, pendingTask, startNormalizedState, response.activityOutputs || response.state.activityOutputs);
1632
+ const interactiveResult = await this.runInteractiveFlowWithContinuation(response.instanceId, pendingTask, startNormalizedState, { instanceId: response.instanceId, pendingNextTask: pendingTask }, isWorkflowContinuationSuppressed(input), (response.activityOutputs ?? response.state.activityOutputs));
1483
1633
  finalNextTask = interactiveResult.nextTask;
1484
1634
  startNormalizedState = interactiveResult.state;
1485
- if (interactiveResult.output !== undefined) {
1635
+ if (interactiveResult.output != null) {
1486
1636
  finalOutput = interactiveResult.output;
1487
1637
  }
1488
- // Update cache with final state
1489
1638
  this.stateCache.set(response.instanceId, startNormalizedState);
1490
1639
  }
1491
1640
  // If backend returned null or non-executable task, return it as-is
1492
1641
  // Backend already decided workflow status (suspended, completed, etc.)
1493
- const startResult = {
1642
+ return {
1494
1643
  success: true,
1495
1644
  instanceId: response.instanceId,
1496
1645
  state: startNormalizedState,
1497
1646
  nextTask: finalNextTask,
1498
1647
  output: finalOutput,
1499
1648
  };
1500
- if (!isWorkflowContinuationSuppressed(input)) {
1501
- await this.continuationHook?.offerAfterWorkflowStep?.({
1502
- instanceId: response.instanceId,
1503
- pendingNextTask: finalNextTask,
1504
- });
1505
- }
1506
- return startResult;
1507
1649
  }
1508
1650
  catch (error) {
1509
1651
  console.error('[AXPWorkflowManager] ❌ Error starting workflow:', error);
@@ -1552,16 +1694,26 @@ class AXPWorkflowManager {
1552
1694
  let finalNextTask = response.nextTask || null;
1553
1695
  let finalOutput = response.output;
1554
1696
  const nextTask = response.nextTask;
1697
+ let resumeContinuationOffer;
1555
1698
  if (nextTask &&
1556
1699
  (nextTask.executionMode === 'frontend' || nextTask.executionMode === 'both') &&
1557
1700
  !axpIsWorkflowTaskBoardActivityType(nextTask.activityType)) {
1558
- const interactiveResult = await this.executeInteractiveFlow(instanceId, nextTask, normalizedState, normalizedState?.activityOutputs);
1701
+ const completedBookmarkId = typeof userInput === 'object' && userInput != null && 'bookmarkId' in userInput
1702
+ ? String(userInput.bookmarkId ?? '')
1703
+ : undefined;
1704
+ const interactiveResult = await this.runInteractiveFlowWithContinuation(instanceId, nextTask, normalizedState, {
1705
+ instanceId,
1706
+ completedActivityId: stepId,
1707
+ completedBookmarkId: completedBookmarkId || undefined,
1708
+ resumeOutcome: outcome,
1709
+ pendingNextTask: nextTask,
1710
+ }, isWorkflowContinuationSuppressed(userInput), normalizedState?.activityOutputs);
1559
1711
  finalNextTask = interactiveResult.nextTask;
1560
1712
  normalizedState = interactiveResult.state;
1561
- if (interactiveResult.output !== undefined) {
1713
+ resumeContinuationOffer = interactiveResult.continuationOffer;
1714
+ if (interactiveResult.output != null) {
1562
1715
  finalOutput = interactiveResult.output;
1563
1716
  }
1564
- // Update cache with final state
1565
1717
  this.stateCache.set(instanceId, normalizedState);
1566
1718
  }
1567
1719
  // If backend returned null or non-executable task, return it as-is
@@ -1573,18 +1725,16 @@ class AXPWorkflowManager {
1573
1725
  nextTask: finalNextTask,
1574
1726
  output: finalOutput,
1575
1727
  };
1576
- const completedBookmarkId = typeof userInput === 'object' && userInput != null && 'bookmarkId' in userInput
1728
+ const completedBookmarkIdForContinuation = typeof userInput === 'object' && userInput != null && 'bookmarkId' in userInput
1577
1729
  ? String(userInput.bookmarkId ?? '')
1578
1730
  : undefined;
1579
- if (!isWorkflowContinuationSuppressed(userInput)) {
1580
- await this.continuationHook?.offerAfterWorkflowStep?.({
1581
- instanceId,
1582
- completedActivityId: stepId,
1583
- completedBookmarkId: completedBookmarkId || undefined,
1584
- resumeOutcome: outcome,
1585
- pendingNextTask: finalNextTask,
1586
- });
1587
- }
1731
+ await this.invokeWorkflowContinuationAfterStep({
1732
+ instanceId,
1733
+ completedActivityId: stepId,
1734
+ completedBookmarkId: completedBookmarkIdForContinuation || undefined,
1735
+ resumeOutcome: outcome,
1736
+ pendingNextTask: finalNextTask,
1737
+ }, resumeContinuationOffer, isWorkflowContinuationSuppressed(userInput));
1588
1738
  return resumeResult;
1589
1739
  }
1590
1740
  catch (error) {
@@ -2671,5 +2821,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
2671
2821
  * Generated bundle index. Do not edit.
2672
2822
  */
2673
2823
 
2674
- export { AXPActivityDefinitionService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionService, AXPWorkflowEngineError, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowLocalEngine, AXPWorkflowManager, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_CATEGORY_PROVIDER, AXP_WORKFLOW_CONTINUATION_HOOK, AXP_WORKFLOW_ENGINE, AXP_WORKFLOW_ERROR_CODES, AXP_WORKFLOW_PROVIDER, AXP_WORKFLOW_SUPPRESS_CONTINUATION_INPUT_KEY, AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES, ActivityExecutor, WorkflowExpressionScopeService, axpIsWorkflowTaskBoardActivityType, createWorkFlowEvent, getWorkflowEngineErrorCode, getWorkflowEngineErrorInfo, isWorkflowContinuationSuppressed, ofType };
2824
+ export { AXPActivityDefinitionService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionService, AXPWorkflowEngineError, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowLocalEngine, AXPWorkflowManager, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_CATEGORY_PROVIDER, AXP_WORKFLOW_CONTINUATION_HOOK, AXP_WORKFLOW_ENGINE, AXP_WORKFLOW_ERROR_CODES, AXP_WORKFLOW_PROVIDER, AXP_WORKFLOW_SUPPRESS_CONTINUATION_INPUT_KEY, AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES, ActivityExecutor, WorkflowExpressionScopeService, axpIsWorkflowInlineFrontendTask, axpIsWorkflowInteractiveFrontendTask, axpIsWorkflowTaskBoardActivityType, axpResolveWorkflowContinuationBeforeInteractive, axpShouldOfferBeforeInteractiveFlow, axpShouldOfferWorkflowContinuationAfterStep, axpShouldSkipBeforeInteractiveFromMetadata, createWorkFlowEvent, getWorkflowEngineErrorCode, getWorkflowEngineErrorInfo, isWorkflowContinuationSuppressed, ofType };
2675
2825
  //# sourceMappingURL=acorex-platform-workflow.mjs.map