@octaviaflow/core 3.0.18-beta.25 → 3.0.18-beta.27

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/workflow.js CHANGED
@@ -619,26 +619,25 @@ function ConfigPanel({
619
619
 
620
620
  // src/workflow/components/FxPanel/FxPanel.tsx
621
621
  import {
622
- useEffect as useEffect3,
623
622
  useMemo as useMemo2,
624
623
  useRef as useRef4,
625
624
  useState as useState4
626
625
  } from "react";
627
626
  import {
628
- CheckmarkIcon,
629
627
  ChevronDownIcon,
630
628
  ChevronRightIcon,
631
629
  CloseIcon,
632
630
  CollapseAllIcon,
633
- CopyIcon,
634
631
  DraggableIcon,
635
632
  ExpandAllIcon,
636
- SearchIcon
633
+ FunctionMathIcon,
634
+ SearchIcon,
635
+ ValueVariableIcon
637
636
  } from "@octaviaflow/icons";
638
637
  import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
639
- var KIND_GLYPH = {
640
- function: "\u0192",
641
- variable: "\u2B21"
638
+ var KIND_ICON = {
639
+ function: FunctionMathIcon,
640
+ variable: ValueVariableIcon
642
641
  };
643
642
  function countLeaves(items) {
644
643
  let n = 0;
@@ -747,15 +746,7 @@ function FxPanel({
747
746
  });
748
747
  };
749
748
  const [draggingId, setDraggingId] = useState4(null);
750
- const [copiedId, setCopiedId] = useState4(null);
751
749
  const [focusedId, setFocusedId] = useState4(null);
752
- const copyTimer = useRef4(null);
753
- useEffect3(
754
- () => () => {
755
- if (copyTimer.current) clearTimeout(copyTimer.current);
756
- },
757
- []
758
- );
759
750
  const hits = useMemo2(() => {
760
751
  if (!query) return null;
761
752
  const all = [];
@@ -780,13 +771,6 @@ function FxPanel({
780
771
  e.dataTransfer.effectAllowed = "copy";
781
772
  }
782
773
  };
783
- const handleCopy = (item) => {
784
- if (!item.insertValue || typeof navigator === "undefined") return;
785
- void navigator.clipboard?.writeText(item.insertValue);
786
- setCopiedId(item.id);
787
- if (copyTimer.current) clearTimeout(copyTimer.current);
788
- copyTimer.current = setTimeout(() => setCopiedId(null), 1400);
789
- };
790
774
  const listRef = useRef4(null);
791
775
  const focusRow = (id) => {
792
776
  setFocusedId(id);
@@ -898,27 +882,13 @@ function FxPanel({
898
882
  ),
899
883
  children: item.valueType
900
884
  }
901
- ),
902
- item.preview !== void 0 && /* @__PURE__ */ jsx2("span", { className: "ods-flow-fx-panel__preview", title: item.preview, children: item.preview })
885
+ )
903
886
  ] }),
904
887
  (item.description || crumb) && /* @__PURE__ */ jsxs2("span", { className: "ods-flow-fx-panel__row-sub", children: [
905
888
  crumb && /* @__PURE__ */ jsx2("span", { className: "ods-flow-fx-panel__crumb", children: crumb }),
906
889
  item.description
907
890
  ] })
908
- ] }),
909
- item.insertValue && /* @__PURE__ */ jsx2(
910
- "button",
911
- {
912
- type: "button",
913
- className: "ods-flow-fx-panel__copy",
914
- "aria-label": `Copy ${item.label}`,
915
- onClick: (e) => {
916
- e.stopPropagation();
917
- handleCopy(item);
918
- },
919
- children: copiedId === item.id ? /* @__PURE__ */ jsx2(CheckmarkIcon, { size: "sm" }) : /* @__PURE__ */ jsx2(CopyIcon, { size: "sm" })
920
- }
921
- )
891
+ ] })
922
892
  ]
923
893
  },
924
894
  item.id
@@ -988,6 +958,7 @@ function FxPanel({
988
958
  !query && visibleCategories.map((cat) => {
989
959
  const isOpen = openCategoryId === cat.id;
990
960
  const kind = cat.kind ?? "function";
961
+ const KindIcon = KIND_ICON[kind];
991
962
  const branchIds = /* @__PURE__ */ new Set();
992
963
  collectBranchIds(cat.items, branchIds);
993
964
  const hasTree = branchIds.size > 0;
@@ -1030,11 +1001,10 @@ function FxPanel({
1030
1001
  ),
1031
1002
  children: [
1032
1003
  /* @__PURE__ */ jsx2(
1033
- "span",
1004
+ KindIcon,
1034
1005
  {
1035
- className: "ods-flow-fx-panel__badge-glyph",
1036
- "aria-hidden": "true",
1037
- children: KIND_GLYPH[kind]
1006
+ size: "sm",
1007
+ className: "ods-flow-fx-panel__badge-icon"
1038
1008
  }
1039
1009
  ),
1040
1010
  cat.label
@@ -1076,12 +1046,12 @@ function FxPanel({
1076
1046
  );
1077
1047
  }
1078
1048
 
1079
- // src/workflow/components/FxPanel/FxToggleButton.tsx
1080
- import { FunctionIcon } from "@octaviaflow/icons";
1049
+ // src/workflow/components/FxPanel/DataRefButton.tsx
1050
+ import { DataReferenceIcon } from "@octaviaflow/icons";
1081
1051
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1082
- function FxToggleButton({
1052
+ function DataRefButton({
1083
1053
  active = false,
1084
- label = "FX",
1054
+ label = "Data ref",
1085
1055
  className,
1086
1056
  type = "button",
1087
1057
  ...rest
@@ -1092,16 +1062,22 @@ function FxToggleButton({
1092
1062
  ...rest,
1093
1063
  type,
1094
1064
  className: cn(
1095
- "ods-flow-fx-toggle",
1096
- active && "ods-flow-fx-toggle--active",
1097
- label == null && "ods-flow-fx-toggle--icon-only",
1065
+ "ods-flow-dataref-button",
1066
+ active && "ods-flow-dataref-button--active",
1067
+ label == null && "ods-flow-dataref-button--icon-only",
1098
1068
  className
1099
1069
  ),
1100
1070
  "aria-pressed": active,
1101
- title: active ? "Hide FX / IO" : "Show FX / IO",
1071
+ title: active ? "Hide data references" : "Show data references",
1102
1072
  children: [
1103
- /* @__PURE__ */ jsx3(FunctionIcon, { size: "sm", className: "ods-flow-fx-toggle__icon" }),
1104
- label != null && /* @__PURE__ */ jsx3("span", { className: "ods-flow-fx-toggle__label", children: label })
1073
+ /* @__PURE__ */ jsx3(
1074
+ DataReferenceIcon,
1075
+ {
1076
+ size: "sm",
1077
+ className: "ods-flow-dataref-button__icon"
1078
+ }
1079
+ ),
1080
+ label != null && /* @__PURE__ */ jsx3("span", { className: "ods-flow-dataref-button__label", children: label })
1105
1081
  ]
1106
1082
  }
1107
1083
  );
@@ -1283,13 +1259,13 @@ export {
1283
1259
  DEFAULT_NODE_HEIGHT,
1284
1260
  DEFAULT_NODE_KINDS,
1285
1261
  DEFAULT_NODE_WIDTH,
1262
+ DataRefButton,
1286
1263
  ErrorNode,
1287
1264
  FlowCanvas,
1288
1265
  FlowEdge,
1289
1266
  FlowNode,
1290
1267
  ForEachNode,
1291
1268
  FxPanel,
1292
- FxToggleButton,
1293
1269
  GroupNode,
1294
1270
  Handle,
1295
1271
  HttpRequestNode,