@bpmnkit/user-tasks 0.0.21 → 0.0.23

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 (2) hide show
  1. package/README.md +29 -21
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -9,31 +9,34 @@
9
9
  [![ai-assisted](https://img.shields.io/badge/AI--assisted-claude-8b5cf6?style=flat-square)](https://github.com/bpmnkit/monorepo)
10
10
  [![experimental](https://img.shields.io/badge/status-experimental-f59e0b?style=flat-square)](https://github.com/bpmnkit/monorepo)
11
11
 
12
- [Website](https://bpmnkit.com) · [Documentation](https://docs.bpmnkit.com) · [GitHub](https://github.com/bpmnkit/monorepo) · [Changelog](https://github.com/bpmnkit/monorepo/blob/main/packages/user-tasks/CHANGELOG.md)
12
+ [Website](https://bpmnkit.com) · [Documentation](https://bpmnkit.com/docs) · [GitHub](https://github.com/bpmnkit/monorepo) · [Changelog](https://github.com/bpmnkit/monorepo/blob/main/packages/user-tasks/CHANGELOG.md)
13
13
  </div>
14
14
 
15
15
  ---
16
16
 
17
17
  ## Overview
18
18
 
19
- `@bpmnkit/user-tasks` is a zero-dependency widget for rendering and interacting with Camunda 8 user tasks. Mount it into any HTML element to get a complete task UI form rendering via `@bpmnkit/plugins/form-viewer`, claim/unclaim, complete, and optional reject actions.
19
+ `@bpmnkit/user-tasks` renders a Camunda 8 user task, and the actions that go with it, into any
20
+ HTML element. Mount it and you get the task's linked Camunda Form, its metadata, and buttons for
21
+ claim, complete and — when you ask for it — reject.
20
22
 
21
- It connects to the `@bpmnkit/proxy` local server to fetch task forms and submit completions via the Camunda REST API.
23
+ It talks to a running [`@bpmnkit/proxy`](https://www.npmjs.com/package/@bpmnkit/proxy), which
24
+ holds the credentials and forwards to the Camunda REST API, so no cluster secret reaches the page.
22
25
 
23
26
  ## Features
24
27
 
25
- - **Form rendering** — loads the task's linked Camunda Form and renders it via `@bpmnkit/plugins/form-viewer`
26
- - **Claim / Unclaim** — assigns or removes the task assignee
27
- - **Complete** — submits collected form variables to the Camunda API
28
- - **Reject** — optional reject/return action with a reason prompt
29
- - **Metadata display** — assignee, due date (with overdue highlight), and priority
30
- - **Theme support** — `light`, `dark`, or `neon` via `@bpmnkit/ui` design tokens
31
- - **Zero dependencies** — no framework required; mounts into any `HTMLElement`
28
+ - **Form rendering** — loads the task's linked Camunda Form and renders it through `@bpmnkit/plugins/form-viewer`
29
+ - **Claim / unclaim** — sets or clears the task assignee
30
+ - **Complete** — submits the form's collected variables
31
+ - **Reject** — an optional return action with a reason; the button is hidden unless you pass `onReject`
32
+ - **Metadata** — assignee, priority, and a due date that highlights once it is overdue
33
+ - **Themed** — `light`, `dark`, `auto` or `neon`, drawn with the `@bpmnkit/ui` design tokens
34
+ - **No framework** — a function and an `HTMLElement`; it works inside React, Vue, Astro or a plain page
32
35
 
33
36
  ## Installation
34
37
 
35
38
  ```sh
36
- npm install @bpmnkit/user-tasks @bpmnkit/proxy
39
+ npm install @bpmnkit/user-tasks
37
40
  ```
38
41
 
39
42
  ## Quick Start
@@ -50,7 +53,7 @@ const widget = createUserTaskWidget({
50
53
  dueDate: "2025-06-01T12:00:00Z",
51
54
  priority: 50,
52
55
  },
53
- proxyUrl: "http://localhost:3033", // default
56
+ proxyUrl: "http://localhost:3033", // default
54
57
  theme: "dark",
55
58
  onComplete(variables) {
56
59
  console.log("Task completed with", variables)
@@ -66,10 +69,10 @@ const widget = createUserTaskWidget({
66
69
  },
67
70
  })
68
71
 
69
- // Later: update the displayed task
72
+ // Show a different task in the same widget — the form reloads.
70
73
  widget.setTask({ userTaskKey: "2251799813685999", name: "Approve invoice" })
71
74
 
72
- // Clean up
75
+ // Remove it from the DOM.
73
76
  widget.destroy()
74
77
  ```
75
78
 
@@ -85,17 +88,17 @@ interface UserTaskWidgetOptions {
85
88
  task: UserTask
86
89
  /** Base URL of the proxy server. Default: "http://localhost:3033" */
87
90
  proxyUrl?: string
88
- /** Active profile name for x-profile header. */
91
+ /** Active profile name, sent as the x-profile header. */
89
92
  profile?: string | null
90
- /** Visual theme. Default: "neon" */
91
- theme?: "light" | "dark" | "neon"
93
+ /** Visual theme (`Theme` from @bpmnkit/ui). Default: "neon" */
94
+ theme?: "light" | "dark" | "auto" | "neon"
92
95
  /** Called when the user completes the task. */
93
96
  onComplete(variables: Record<string, unknown>): void
94
97
  /** Called when the user claims the task. */
95
98
  onClaim(): void
96
99
  /** Called when the user unclaims the task. */
97
100
  onUnclaim(): void
98
- /** Called when the user rejects/returns the task. Optional hides the Reject button if omitted. */
101
+ /** Called when the user rejects the task. Omit to hide the Reject button. */
99
102
  onReject?(reason: string): void
100
103
  }
101
104
  ```
@@ -104,7 +107,7 @@ Returns a `UserTaskWidgetApi`:
104
107
 
105
108
  ```typescript
106
109
  interface UserTaskWidgetApi {
107
- /** Update the displayed task and reload its form. */
110
+ /** Show a different task and reload its form. */
108
111
  setTask(task: UserTask): void
109
112
  /** Remove the widget from the DOM and clean up. */
110
113
  destroy(): void
@@ -119,7 +122,7 @@ interface UserTask {
119
122
  name?: string
120
123
  assignee?: string
121
124
  candidateGroups?: string[]
122
- dueDate?: string // ISO 8601 date string
125
+ dueDate?: string // ISO 8601
123
126
  priority?: number
124
127
  processInstanceKey?: string
125
128
  processDefinitionKey?: string
@@ -139,14 +142,19 @@ interface UserTask {
139
142
  | [`@bpmnkit/engine`](https://www.npmjs.com/package/@bpmnkit/engine) | Lightweight BPMN process execution engine |
140
143
  | [`@bpmnkit/feel`](https://www.npmjs.com/package/@bpmnkit/feel) | FEEL expression language parser & evaluator |
141
144
  | [`@bpmnkit/plugins`](https://www.npmjs.com/package/@bpmnkit/plugins) | 22 composable canvas plugins |
142
- | [`@bpmnkit/operate`](https://www.npmjs.com/package/@bpmnkit/operate) | Monitoring and operations frontend for Camunda 8 |
143
145
  | [`@bpmnkit/api`](https://www.npmjs.com/package/@bpmnkit/api) | Camunda 8 REST API TypeScript client |
144
146
  | [`@bpmnkit/ascii`](https://www.npmjs.com/package/@bpmnkit/ascii) | Render BPMN diagrams as Unicode ASCII art |
147
+ | [`@bpmnkit/docspack`](https://www.npmjs.com/package/@bpmnkit/docspack) | BPMN Kit docs as an offline docspack package for AI agents |
145
148
  | [`@bpmnkit/ui`](https://www.npmjs.com/package/@bpmnkit/ui) | Shared design tokens and UI components |
146
149
  | [`@bpmnkit/profiles`](https://www.npmjs.com/package/@bpmnkit/profiles) | Shared auth, profile storage, and client factories for CLI & proxy |
150
+ | [`@bpmnkit/operate`](https://www.npmjs.com/package/@bpmnkit/operate) | Monitoring & operations frontend for Camunda clusters |
147
151
  | [`@bpmnkit/connector-gen`](https://www.npmjs.com/package/@bpmnkit/connector-gen) | Generate connector templates from OpenAPI specs |
152
+ | [`@bpmnkit/connectors`](https://www.npmjs.com/package/@bpmnkit/connectors) | Camunda 8 OOTB connector catalog and deterministic template application |
148
153
  | [`@bpmnkit/cli`](https://www.npmjs.com/package/@bpmnkit/cli) | Camunda 8 command-line interface (casen) |
149
154
  | [`@bpmnkit/proxy`](https://www.npmjs.com/package/@bpmnkit/proxy) | Local AI bridge and Camunda API proxy server |
155
+ | [`@bpmnkit/patterns`](https://www.npmjs.com/package/@bpmnkit/patterns) | Domain process patterns for BPMNKit AIKit |
156
+ | [`@bpmnkit/reebe-wasm`](https://www.npmjs.com/package/@bpmnkit/reebe-wasm) | WebAssembly BPMN engine for browser simulation |
157
+ | [`@bpmnkit/worker-client`](https://www.npmjs.com/package/@bpmnkit/worker-client) | Thin Zeebe REST client for standalone workers |
150
158
  | [`@bpmnkit/cli-sdk`](https://www.npmjs.com/package/@bpmnkit/cli-sdk) | Plugin authoring SDK for the casen CLI |
151
159
  | [`@bpmnkit/create-casen-plugin`](https://www.npmjs.com/package/@bpmnkit/create-casen-plugin) | Scaffold a new casen CLI plugin in seconds |
152
160
  | [`@bpmnkit/casen-report`](https://www.npmjs.com/package/@bpmnkit/casen-report) | HTML reports from Camunda 8 incident and SLA data |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmnkit/user-tasks",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Embeddable user task widget for Camunda 8 — form rendering, claim/complete actions, zero dependencies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,10 +18,10 @@
18
18
  "dist/**/*.d.ts"
19
19
  ],
20
20
  "dependencies": {
21
- "@bpmnkit/api": "0.0.20",
22
- "@bpmnkit/ui": "0.1.0",
23
- "@bpmnkit/plugins": "0.3.1",
24
- "@bpmnkit/core": "0.4.0"
21
+ "@bpmnkit/api": "0.0.21",
22
+ "@bpmnkit/core": "0.6.0",
23
+ "@bpmnkit/plugins": "0.3.3",
24
+ "@bpmnkit/ui": "0.2.0"
25
25
  },
26
26
  "keywords": [
27
27
  "bpmn",