@particle-academy/fancy-flow 0.33.0 → 0.33.1

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.
package/dist/index.cjs CHANGED
@@ -12757,9 +12757,11 @@ function ConfigFieldRenderer({
12757
12757
  field,
12758
12758
  value,
12759
12759
  onChange,
12760
+ id: id2,
12760
12761
  renderCredentialField,
12761
12762
  renderDocumentField
12762
12763
  }) {
12764
+ const handle = { id: id2, "data-ff-field": field.key };
12763
12765
  switch (field.type) {
12764
12766
  case "text": {
12765
12767
  if (field.choices?.length) {
@@ -12768,6 +12770,7 @@ function ConfigFieldRenderer({
12768
12770
  return /* @__PURE__ */ jsxRuntime.jsx(
12769
12771
  "input",
12770
12772
  {
12773
+ ...handle,
12771
12774
  className: "ff-panel__input",
12772
12775
  type: "text",
12773
12776
  value: value ?? "",
@@ -12780,6 +12783,7 @@ function ConfigFieldRenderer({
12780
12783
  return /* @__PURE__ */ jsxRuntime.jsx(
12781
12784
  "textarea",
12782
12785
  {
12786
+ ...handle,
12783
12787
  className: "ff-panel__input ff-panel__input--textarea",
12784
12788
  rows: field.rows ?? 4,
12785
12789
  value: value ?? "",
@@ -12791,6 +12795,7 @@ function ConfigFieldRenderer({
12791
12795
  return /* @__PURE__ */ jsxRuntime.jsx(
12792
12796
  "input",
12793
12797
  {
12798
+ ...handle,
12794
12799
  className: "ff-panel__input",
12795
12800
  type: "number",
12796
12801
  value: value ?? "",
@@ -12805,6 +12810,7 @@ function ConfigFieldRenderer({
12805
12810
  /* @__PURE__ */ jsxRuntime.jsx(
12806
12811
  "input",
12807
12812
  {
12813
+ ...handle,
12808
12814
  type: "checkbox",
12809
12815
  checked: !!value,
12810
12816
  onChange: (e) => onChange(e.target.checked)
@@ -12816,6 +12822,7 @@ function ConfigFieldRenderer({
12816
12822
  return /* @__PURE__ */ jsxRuntime.jsxs(
12817
12823
  "select",
12818
12824
  {
12825
+ ...handle,
12819
12826
  className: "ff-panel__input",
12820
12827
  value: value ?? "",
12821
12828
  onChange: (e) => onChange(e.target.value),
@@ -12831,6 +12838,7 @@ function ConfigFieldRenderer({
12831
12838
  return /* @__PURE__ */ jsxRuntime.jsx(
12832
12839
  "textarea",
12833
12840
  {
12841
+ ...handle,
12834
12842
  className: "ff-panel__input ff-panel__input--expression",
12835
12843
  rows: 2,
12836
12844
  value: value ?? "",
@@ -13131,6 +13139,8 @@ function NodeConfigPanel({
13131
13139
  className,
13132
13140
  style: style2
13133
13141
  }) {
13142
+ const uid = ReactExports.useId();
13143
+ const fieldId = (key) => `${uid}-${key}`;
13134
13144
  if (!node) {
13135
13145
  return /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: ["ff-panel", "ff-panel--empty", className ?? ""].filter(Boolean).join(" "), style: style2, children: [
13136
13146
  header,
@@ -13180,10 +13190,12 @@ function NodeConfigPanel({
13180
13190
  ] }),
13181
13191
  kind.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ff-panel__kind-desc", children: kind.description }),
13182
13192
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ff-panel__field", children: [
13183
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "ff-panel__label", children: "Label" }),
13193
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "ff-panel__label", htmlFor: fieldId("label"), children: "Label" }),
13184
13194
  /* @__PURE__ */ jsxRuntime.jsx(
13185
13195
  "input",
13186
13196
  {
13197
+ id: fieldId("label"),
13198
+ "data-ff-field": "label",
13187
13199
  className: "ff-panel__input",
13188
13200
  value: node.data.label ?? "",
13189
13201
  onChange: (e) => setLabel(e.target.value),
@@ -13192,10 +13204,12 @@ function NodeConfigPanel({
13192
13204
  )
13193
13205
  ] }),
13194
13206
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ff-panel__field", children: [
13195
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "ff-panel__label", children: "Description" }),
13207
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "ff-panel__label", htmlFor: fieldId("description"), children: "Description" }),
13196
13208
  /* @__PURE__ */ jsxRuntime.jsx(
13197
13209
  "textarea",
13198
13210
  {
13211
+ id: fieldId("description"),
13212
+ "data-ff-field": "description",
13199
13213
  className: "ff-panel__input ff-panel__input--textarea",
13200
13214
  rows: 2,
13201
13215
  value: node.data.description ?? "",
@@ -13210,7 +13224,7 @@ function NodeConfigPanel({
13210
13224
  }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13211
13225
  (kind.configSchema ?? []).length > 0 && /* @__PURE__ */ jsxRuntime.jsx("hr", { className: "ff-panel__divider" }),
13212
13226
  (kind.configSchema ?? []).map((field) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ff-panel__field", children: [
13213
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "ff-panel__label", children: [
13227
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "ff-panel__label", htmlFor: fieldId(field.key), children: [
13214
13228
  field.label,
13215
13229
  field.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-panel__required", "aria-hidden": true, children: " *" })
13216
13230
  ] }),
@@ -13218,6 +13232,7 @@ function NodeConfigPanel({
13218
13232
  /* @__PURE__ */ jsxRuntime.jsx(
13219
13233
  ConfigFieldRenderer,
13220
13234
  {
13235
+ id: fieldId(field.key),
13221
13236
  field,
13222
13237
  value: config[field.key],
13223
13238
  onChange: (v2) => setConfigValue(field.key, v2),