@octaviaflow/core 3.0.18-beta.24 → 3.0.18-beta.26

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.
@@ -16,8 +16,6 @@ export interface FxPanelItem {
16
16
  description?: string;
17
17
  /** Data type — renders a colour-coded badge. Source-Data fields only. */
18
18
  valueType?: FxValueType;
19
- /** Sample value preview, shown dimmed at the end of the row. */
20
- preview?: string;
21
19
  /**
22
20
  * Nested children. When present the item renders as an expandable
23
21
  * branch — this is what powers the n-th-level Source-Data tree.
@@ -1 +1 @@
1
- {"version":3,"file":"FxPanel.d.ts","sourceRoot":"","sources":["../../../../src/workflow/components/FxPanel/FxPanel.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAEd,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAcf,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAEjD,wEAAwE;AACxE,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,CAAC;AAEV,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACr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EACV,KAAiB,EACjB,IAKC,EACD,MAAM,EAAE,gBAAgB,EACxB,aAAkB,EAClB,cAAc,EACd,gBAAgB,EAAE,kBAAkB,EACpC,uBAAuB,EACvB,wBAAwB,EACxB,OAAO,EACP,eAAe,EACf,YAAY,EACZ,KAAW,EACX,UAAyB,EACzB,iBAA2D,EAC3D,SAAS,EACT,KAAK,GACN,EAAE,YAAY,2CAodd"}
1
+ {"version":3,"file":"FxPanel.d.ts","sourceRoot":"","sources":["../../../../src/workflow/components/FxPanel/FxPanel.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAEd,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAYf,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAEjD,wEAAwE;AACxE,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,CAAC;AAEV,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,oEAAoE;IACpE,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,UAAU,EAAE,eAAe,EAAE,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,YAAY,EACZ,KAAW,EACX,UAAyB,EACzB,iBAA2D,EAC3D,SAAS,EACT,KAAK,GACN,EAAE,YAAY,2CA8ad"}
package/dist/workflow.cjs CHANGED
@@ -3694,15 +3694,7 @@ function FxPanel({
3694
3694
  });
3695
3695
  };
3696
3696
  const [draggingId, setDraggingId] = (0, import_react16.useState)(null);
3697
- const [copiedId, setCopiedId] = (0, import_react16.useState)(null);
3698
3697
  const [focusedId, setFocusedId] = (0, import_react16.useState)(null);
3699
- const copyTimer = (0, import_react16.useRef)(null);
3700
- (0, import_react16.useEffect)(
3701
- () => () => {
3702
- if (copyTimer.current) clearTimeout(copyTimer.current);
3703
- },
3704
- []
3705
- );
3706
3698
  const hits = (0, import_react16.useMemo)(() => {
3707
3699
  if (!query) return null;
3708
3700
  const all = [];
@@ -3727,13 +3719,6 @@ function FxPanel({
3727
3719
  e.dataTransfer.effectAllowed = "copy";
3728
3720
  }
3729
3721
  };
3730
- const handleCopy = (item) => {
3731
- if (!item.insertValue || typeof navigator === "undefined") return;
3732
- void navigator.clipboard?.writeText(item.insertValue);
3733
- setCopiedId(item.id);
3734
- if (copyTimer.current) clearTimeout(copyTimer.current);
3735
- copyTimer.current = setTimeout(() => setCopiedId(null), 1400);
3736
- };
3737
3722
  const listRef = (0, import_react16.useRef)(null);
3738
3723
  const focusRow = (id) => {
3739
3724
  setFocusedId(id);
@@ -3741,7 +3726,7 @@ function FxPanel({
3741
3726
  listRef.current?.querySelector(`[data-fx-row="${CSS.escape(id)}"]`)?.focus();
3742
3727
  });
3743
3728
  };
3744
- const onRowKeyDown = (e, rows, row) => {
3729
+ const onRowKeyDown = (e, rows, row, category) => {
3745
3730
  const idx = rows.findIndex((r) => r.item.id === row.item.id);
3746
3731
  if (idx < 0) return;
3747
3732
  switch (e.key) {
@@ -3786,16 +3771,22 @@ function FxPanel({
3786
3771
  case " ":
3787
3772
  e.preventDefault();
3788
3773
  if (row.hasChildren) toggleItem(row.item.id);
3789
- else {
3790
- const cat = visibleCategories.find((c) => c.id === openCategoryId);
3791
- if (cat) onItemSelect?.(row.item, cat);
3792
- }
3774
+ else onItemSelect?.(row.item, category);
3793
3775
  break;
3794
3776
  default:
3795
3777
  break;
3796
3778
  }
3797
3779
  };
3798
- const renderRow = (row, category, rows, opts = {}) => {
3780
+ const searchRows = (0, import_react16.useMemo)(
3781
+ () => hits ? hits.map(({ hit }) => ({
3782
+ item: hit.item,
3783
+ depth: 0,
3784
+ hasChildren: false,
3785
+ expanded: false
3786
+ })) : [],
3787
+ [hits]
3788
+ );
3789
+ const renderRow = (row, category, rows, crumb) => {
3799
3790
  const { item, depth, hasChildren, expanded } = row;
3800
3791
  const mono = category.kind === "function";
3801
3792
  const draggable = !!item.insertValue;
@@ -3818,7 +3809,7 @@ function FxPanel({
3818
3809
  onDragStart: draggable ? handleDragStart(item, category) : void 0,
3819
3810
  onDragEnd: () => setDraggingId(null),
3820
3811
  onFocus: () => setFocusedId(item.id),
3821
- onKeyDown: opts.searching ? void 0 : (e) => onRowKeyDown(e, rows, row),
3812
+ onKeyDown: (e) => onRowKeyDown(e, rows, row, category),
3822
3813
  onClick: () => {
3823
3814
  if (hasChildren) toggleItem(item.id);
3824
3815
  else onItemSelect?.(item, category);
@@ -3839,27 +3830,13 @@ function FxPanel({
3839
3830
  ),
3840
3831
  children: item.valueType
3841
3832
  }
3842
- ),
3843
- item.preview !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ods-flow-fx-panel__preview", title: item.preview, children: item.preview })
3833
+ )
3844
3834
  ] }),
3845
- (item.description || opts.crumb) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "ods-flow-fx-panel__row-sub", children: [
3846
- opts.crumb && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ods-flow-fx-panel__crumb", children: opts.crumb }),
3835
+ (item.description || crumb) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "ods-flow-fx-panel__row-sub", children: [
3836
+ crumb && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ods-flow-fx-panel__crumb", children: crumb }),
3847
3837
  item.description
3848
3838
  ] })
3849
- ] }),
3850
- item.insertValue && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3851
- "button",
3852
- {
3853
- type: "button",
3854
- className: "ods-flow-fx-panel__copy",
3855
- "aria-label": `Copy ${item.label}`,
3856
- onClick: (e) => {
3857
- e.stopPropagation();
3858
- handleCopy(item);
3859
- },
3860
- children: copiedId === item.id ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons2.CheckmarkIcon, { size: "sm" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons2.CopyIcon, { size: "sm" })
3861
- }
3862
- )
3839
+ ] })
3863
3840
  ]
3864
3841
  },
3865
3842
  item.id
@@ -3918,19 +3895,11 @@ function FxPanel({
3918
3895
  hits.length === 1 ? "match" : "matches"
3919
3896
  ] }),
3920
3897
  hits.map(
3921
- ({ category, hit }) => renderRow(
3922
- { item: hit.item, depth: 0, hasChildren: false, expanded: false },
3898
+ ({ category, hit }, i) => renderRow(
3899
+ searchRows[i],
3923
3900
  category,
3924
- hits.map((h) => ({
3925
- item: h.hit.item,
3926
- depth: 0,
3927
- hasChildren: false,
3928
- expanded: false
3929
- })),
3930
- {
3931
- searching: true,
3932
- crumb: hit.ancestors.length ? hit.ancestors.join(" / ") : category.label
3933
- }
3901
+ searchRows,
3902
+ hit.ancestors.length ? hit.ancestors.join(" / ") : category.label
3934
3903
  )
3935
3904
  )
3936
3905
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "ods-flow-fx-panel__empty", children: emptyLabel })),