@bpmnkit/plugins 0.0.18 → 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.
@@ -679,10 +679,25 @@ export class ConfigPanelRenderer {
679
679
  templateLabel.textContent = reg.schema.templateName;
680
680
  info.appendChild(templateLabel);
681
681
  }
682
- const nameLabel = document.createElement("div");
683
- nameLabel.className = "bpmnkit-cfg-full-name";
684
- nameLabel.textContent = this._elementName || "(unnamed)";
685
- info.appendChild(nameLabel);
682
+ const nameInput = document.createElement("input");
683
+ nameInput.type = "text";
684
+ nameInput.className = "bpmnkit-cfg-full-name";
685
+ nameInput.setAttribute("data-field-key", "name");
686
+ nameInput.value = this._elementName;
687
+ nameInput.placeholder = "(unnamed)";
688
+ nameInput.setAttribute("spellcheck", "false");
689
+ nameInput.setAttribute("autocomplete", "off");
690
+ if (this._readonly)
691
+ nameInput.readOnly = true;
692
+ nameInput.addEventListener("input", () => {
693
+ this._elementName = nameInput.value;
694
+ this._applyField("name", nameInput.value);
695
+ });
696
+ nameInput.addEventListener("keydown", (e) => {
697
+ if (e.key === "Enter" || e.key === "Escape")
698
+ nameInput.blur();
699
+ });
700
+ info.appendChild(nameInput);
686
701
  header.appendChild(info);
687
702
  // Docs link — shown when the schema provides a documentation URL
688
703
  if (reg.schema.docsUrl) {
@@ -25,6 +25,7 @@
25
25
  * @packageDocumentation
26
26
  */
27
27
  import type { CanvasPlugin } from "@bpmnkit/canvas";
28
+ import type { BpmnDefinitions } from "@bpmnkit/core";
28
29
  import { ELEMENT_TYPE_LABELS } from "@bpmnkit/editor";
29
30
  import type { ConfigPanelPlugin } from "../config-panel/index.js";
30
31
  import type { ElementTemplate } from "./template-types.js";
@@ -36,6 +37,23 @@ export interface ConfigPanelBpmnOptions {
36
37
  * Typically implemented by calling `tabsPlugin.api.openTab({ type: "feel", ... })`.
37
38
  */
38
39
  openFeelPlayground?: (expression: string) => void;
40
+ /**
41
+ * Called when a new validation DMN should be created.
42
+ * Receives the DMN XML content, a suggested file name, and the decision ID.
43
+ * Typically implemented by saving a new DMN model in the studio's model storage.
44
+ */
45
+ onCreateValidationDmn?: (dmnXml: string, fileName: string, decisionId: string) => void;
46
+ /**
47
+ * Called when the user clicks "Edit Validation DMN".
48
+ * Receives the decision ID so the host can navigate to the DMN model.
49
+ */
50
+ onEditValidationDmn?: (decisionId: string) => void;
51
+ /**
52
+ * Applies a change to the current BPMN definitions.
53
+ * Required for input validation insert/remove to work.
54
+ * Typically: `(fn) => editorRef.current?.applyChange(fn)`.
55
+ */
56
+ applyChange?: (fn: (defs: BpmnDefinitions) => BpmnDefinitions) => void;
39
57
  }
40
58
  /**
41
59
  * Creates the BPMN config panel extension plugin.