@octaviaflow/core 3.1.0-beta.107 → 3.1.0-beta.108

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.js CHANGED
@@ -2420,14 +2420,32 @@ import { useBreadcrumbItem, useBreadcrumbs } from "react-aria";
2420
2420
  import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2421
2421
  function BreadcrumbItem({ item, isCurrent }) {
2422
2422
  const ref = useRef3(null);
2423
+ const interactive = !isCurrent && (!!item.href || !!item.onClick);
2423
2424
  const { itemProps } = useBreadcrumbItem(
2424
- { children: item.label, isCurrent, elementType: item.href ? "a" : "span" },
2425
+ {
2426
+ children: item.label,
2427
+ isCurrent,
2428
+ elementType: item.href ? "a" : item.onClick && !isCurrent ? "button" : "span"
2429
+ },
2425
2430
  ref
2426
2431
  );
2427
2432
  const content = /* @__PURE__ */ jsxs8(Fragment5, { children: [
2428
2433
  item.icon && /* @__PURE__ */ jsx8("span", { className: "ods-breadcrumb__icon", children: item.icon }),
2429
2434
  /* @__PURE__ */ jsx8("span", { children: item.label })
2430
2435
  ] });
2436
+ if (item.onClick && !item.href && interactive) {
2437
+ return /* @__PURE__ */ jsx8(
2438
+ "button",
2439
+ {
2440
+ ...itemProps,
2441
+ ref,
2442
+ type: "button",
2443
+ onClick: item.onClick,
2444
+ className: cn("ods-breadcrumb__link", "ods-breadcrumb__link--button"),
2445
+ children: content
2446
+ }
2447
+ );
2448
+ }
2431
2449
  if (item.href && !isCurrent) {
2432
2450
  return /* @__PURE__ */ jsx8(
2433
2451
  "a",
@@ -34428,6 +34446,7 @@ import {
34428
34446
  useRef as useRef50,
34429
34447
  useState as useState71
34430
34448
  } from "react";
34449
+ import { AddIcon as AddIcon6, CloseIcon as CloseIcon20 } from "@octaviaflow/icons";
34431
34450
 
34432
34451
  // src/components/ExpressionField/parseExpression.ts
34433
34452
  var CALL_NAME_SOURCE = "(?:[A-Z_][A-Z0-9_]*|user\\.[A-Za-z_][A-Za-z0-9_]*)";
@@ -35081,27 +35100,17 @@ function CallEditor({
35081
35100
  "aria-label": `Edit ${crumbs[0]?.label ?? "function"}`,
35082
35101
  children: [
35083
35102
  /* @__PURE__ */ jsxs141("div", { className: "ods-expression-field__editor-head", children: [
35084
- /* @__PURE__ */ jsx147("nav", { className: "ods-expression-field__editor-crumbs", "aria-label": "Nested functions", children: crumbs.map((crumb, i) => /* @__PURE__ */ jsxs141("span", { children: [
35085
- i > 0 && /* @__PURE__ */ jsx147("span", { "aria-hidden": "true", children: " \u203A " }),
35086
- /* @__PURE__ */ jsx147(
35087
- "button",
35088
- {
35089
- type: "button",
35090
- disabled: i === crumbs.length - 1,
35091
- onClick: () => setPath(crumb.path),
35092
- children: crumb.label
35093
- }
35094
- )
35095
- ] }, crumb.path.join(".") || "root")) }),
35096
35103
  /* @__PURE__ */ jsx147(
35097
- "button",
35104
+ Breadcrumb,
35098
35105
  {
35099
- type: "button",
35100
- className: "ods-expression-field__editor-link",
35101
- onClick: () => setRawMode((r) => !r),
35102
- children: rawMode ? "Back to fields" : "Edit as text"
35106
+ className: "ods-expression-field__editor-crumbs",
35107
+ items: crumbs.map((crumb) => ({
35108
+ label: crumb.label,
35109
+ onClick: () => setPath(crumb.path)
35110
+ }))
35103
35111
  }
35104
- )
35112
+ ),
35113
+ /* @__PURE__ */ jsx147(Button, { variant: "ghost", size: "sm", onClick: () => setRawMode((r) => !r), children: rawMode ? "Back to fields" : "Edit as text" })
35105
35114
  ] }),
35106
35115
  rawMode ? /* @__PURE__ */ jsx147(
35107
35116
  "textarea",
@@ -35121,16 +35130,16 @@ function CallEditor({
35121
35130
  // eslint-disable-next-line react/no-array-index-key
35122
35131
  /* @__PURE__ */ jsxs141("div", { className: "ods-expression-field__editor-row", children: [
35123
35132
  /* @__PURE__ */ jsxs141("span", { className: "ods-expression-field__editor-row-head", children: [
35124
- /* @__PURE__ */ jsx147("span", { id: `arg-${index}-label`, children: rowLabel }),
35133
+ /* @__PURE__ */ jsx147("span", { className: "ods-expression-field__editor-row-name", id: `arg-${index}-label`, children: rowLabel }),
35125
35134
  /* @__PURE__ */ jsx147(
35126
- "button",
35135
+ Button,
35127
35136
  {
35128
- type: "button",
35129
- className: "ods-expression-field__editor-remove",
35137
+ variant: "icon",
35138
+ size: "sm",
35130
35139
  "aria-label": `Remove ${rowLabel}`,
35131
35140
  title: "Remove this argument",
35132
35141
  onClick: () => removeArg(index),
35133
- children: "\u2715"
35142
+ children: /* @__PURE__ */ jsx147(CloseIcon20, { size: "sm" })
35134
35143
  }
35135
35144
  )
35136
35145
  ] }),
@@ -35145,8 +35154,17 @@ function CallEditor({
35145
35154
  children: [
35146
35155
  /* @__PURE__ */ jsx147("code", { children: argSummary(arg, nameOf) }),
35147
35156
  /* @__PURE__ */ jsxs141("span", { children: [
35148
- /* @__PURE__ */ jsx147("button", { type: "button", onClick: () => setPath([...path, index]), children: "Open" }),
35149
- /* @__PURE__ */ jsx147("button", { type: "button", onClick: () => setArg(index, ""), "aria-label": `Clear ${rowLabel}`, children: "Clear" })
35157
+ /* @__PURE__ */ jsx147(Button, { variant: "secondary", size: "sm", onClick: () => setPath([...path, index]), children: "Open" }),
35158
+ /* @__PURE__ */ jsx147(
35159
+ Button,
35160
+ {
35161
+ variant: "ghost",
35162
+ size: "sm",
35163
+ "aria-label": `Clear ${rowLabel}`,
35164
+ onClick: () => setArg(index, ""),
35165
+ children: "Clear"
35166
+ }
35167
+ )
35150
35168
  ] })
35151
35169
  ]
35152
35170
  }
@@ -35171,7 +35189,16 @@ function CallEditor({
35171
35189
  children: labelFor(arg.startsWith("ods://") ? `{{${arg}}}` : arg)
35172
35190
  }
35173
35191
  ),
35174
- /* @__PURE__ */ jsx147("button", { type: "button", onClick: () => setArg(index, ""), "aria-label": `Clear ${rowLabel}`, children: "Clear" })
35192
+ /* @__PURE__ */ jsx147(
35193
+ Button,
35194
+ {
35195
+ variant: "ghost",
35196
+ size: "sm",
35197
+ "aria-label": `Clear ${rowLabel}`,
35198
+ onClick: () => setArg(index, ""),
35199
+ children: "Clear"
35200
+ }
35201
+ )
35175
35202
  ]
35176
35203
  }
35177
35204
  )
@@ -35193,31 +35220,25 @@ function CallEditor({
35193
35220
  );
35194
35221
  }),
35195
35222
  /* @__PURE__ */ jsx147(
35196
- "button",
35223
+ Button,
35197
35224
  {
35198
- type: "button",
35199
- className: "ods-expression-field__editor-add",
35225
+ variant: "ghost",
35226
+ size: "sm",
35227
+ fullWidth: true,
35228
+ leftIcon: /* @__PURE__ */ jsx147(AddIcon6, { size: "sm" }),
35200
35229
  onClick: () => setDraft((d) => {
35201
35230
  const at = callAt(d, path);
35202
35231
  if (!at) return d;
35203
35232
  const next = [...at.args, '""'];
35204
35233
  return path.length === 0 ? formatCall(at.name, next) : replaceArgument(d, path, `${at.name}(${next.join(", ")})`);
35205
35234
  }),
35206
- children: "+ Add argument"
35235
+ children: "Add argument"
35207
35236
  }
35208
35237
  )
35209
35238
  ] }),
35210
35239
  /* @__PURE__ */ jsxs141("div", { className: "ods-expression-field__editor-foot", children: [
35211
- /* @__PURE__ */ jsx147("button", { type: "button", onClick: onCancel, children: "Cancel" }),
35212
- /* @__PURE__ */ jsx147(
35213
- "button",
35214
- {
35215
- type: "button",
35216
- className: "ods-expression-field__editor-primary",
35217
- onClick: () => onApply(draft),
35218
- children: "Apply"
35219
- }
35220
- )
35240
+ /* @__PURE__ */ jsx147(Button, { variant: "secondary", size: "sm", onClick: onCancel, children: "Cancel" }),
35241
+ /* @__PURE__ */ jsx147(Button, { variant: "primary", size: "sm", onClick: () => onApply(draft), children: "Apply" })
35221
35242
  ] })
35222
35243
  ]
35223
35244
  }
@@ -39613,7 +39634,7 @@ function draftFromChannel(channel, fallbackType = "slack") {
39613
39634
  }
39614
39635
 
39615
39636
  // src/notifications/components/NotificationChannelForm/NotificationChannelForm.tsx
39616
- import { AddIcon as AddIcon6, CheckmarkFilledIcon as CheckmarkFilledIcon3, LaunchIcon as LaunchIcon2 } from "@octaviaflow/icons";
39637
+ import { AddIcon as AddIcon7, CheckmarkFilledIcon as CheckmarkFilledIcon3, LaunchIcon as LaunchIcon2 } from "@octaviaflow/icons";
39617
39638
  import { useId as useId68, useState as useState83 } from "react";
39618
39639
  import { jsx as jsx164, jsxs as jsxs156 } from "react/jsx-runtime";
39619
39640
  var DEFAULT_TYPES = [
@@ -39779,7 +39800,7 @@ function NotificationChannelForm({
39779
39800
  {
39780
39801
  size,
39781
39802
  variant: "ghost",
39782
- leftIcon: /* @__PURE__ */ jsx164(AddIcon6, { size: "sm", "aria-hidden": "true" }),
39803
+ leftIcon: /* @__PURE__ */ jsx164(AddIcon7, { size: "sm", "aria-hidden": "true" }),
39783
39804
  onClick: () => onConnectNew(value.type),
39784
39805
  className: "ods-notif-channel-form__connect",
39785
39806
  children: "Connect new"
@@ -40069,7 +40090,7 @@ function NotificationChannelDialog({
40069
40090
  NotificationChannelDialog.displayName = "NotificationChannelDialog";
40070
40091
 
40071
40092
  // src/notifications/components/NotificationChannelList/NotificationChannelList.tsx
40072
- import { AddIcon as AddIcon7, ConnectIcon } from "@octaviaflow/icons";
40093
+ import { AddIcon as AddIcon8, ConnectIcon } from "@octaviaflow/icons";
40073
40094
  import { jsx as jsx166, jsxs as jsxs158 } from "react/jsx-runtime";
40074
40095
  function NotificationChannelList({
40075
40096
  channels,
@@ -40098,7 +40119,7 @@ function NotificationChannelList({
40098
40119
  {
40099
40120
  size: "sm",
40100
40121
  variant: "secondary",
40101
- leftIcon: /* @__PURE__ */ jsx166(AddIcon7, { size: "sm", "aria-hidden": "true" }),
40122
+ leftIcon: /* @__PURE__ */ jsx166(AddIcon8, { size: "sm", "aria-hidden": "true" }),
40102
40123
  onClick: onAdd,
40103
40124
  children: "Add channel"
40104
40125
  }
@@ -40114,7 +40135,7 @@ function NotificationChannelList({
40114
40135
  Button,
40115
40136
  {
40116
40137
  variant: "primary",
40117
- leftIcon: /* @__PURE__ */ jsx166(AddIcon7, { size: "sm", "aria-hidden": "true" }),
40138
+ leftIcon: /* @__PURE__ */ jsx166(AddIcon8, { size: "sm", "aria-hidden": "true" }),
40118
40139
  onClick: onAdd,
40119
40140
  children: "Add channel"
40120
40141
  }
@@ -40138,7 +40159,7 @@ function NotificationChannelList({
40138
40159
  channel.id
40139
40160
  )),
40140
40161
  canAdd && /* @__PURE__ */ jsxs158("button", { type: "button", className: "ods-notif-channels__add", onClick: onAdd, children: [
40141
- /* @__PURE__ */ jsx166("span", { className: "ods-notif-channels__add-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx166(AddIcon7, { size: "sm" }) }),
40162
+ /* @__PURE__ */ jsx166("span", { className: "ods-notif-channels__add-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx166(AddIcon8, { size: "sm" }) }),
40142
40163
  "Add channel"
40143
40164
  ] })
40144
40165
  ] })
@@ -40420,7 +40441,7 @@ function NotificationPreferenceMatrix({
40420
40441
  NotificationPreferenceMatrix.displayName = "NotificationPreferenceMatrix";
40421
40442
 
40422
40443
  // src/notifications/components/NotificationRuleEditor/NotificationRuleEditor.tsx
40423
- import { AddIcon as AddIcon8, RuleIcon } from "@octaviaflow/icons";
40444
+ import { AddIcon as AddIcon9, RuleIcon } from "@octaviaflow/icons";
40424
40445
  import { useId as useId70, useMemo as useMemo45 } from "react";
40425
40446
  import { Fragment as Fragment68, jsx as jsx168, jsxs as jsxs160 } from "react/jsx-runtime";
40426
40447
  var COOLDOWN_OPTIONS = [
@@ -40571,7 +40592,7 @@ function NotificationRuleEditor({
40571
40592
  {
40572
40593
  size: "sm",
40573
40594
  variant: "ghost",
40574
- leftIcon: /* @__PURE__ */ jsx168(AddIcon8, { size: "sm", "aria-hidden": "true" }),
40595
+ leftIcon: /* @__PURE__ */ jsx168(AddIcon9, { size: "sm", "aria-hidden": "true" }),
40575
40596
  onClick: onAddChannel,
40576
40597
  children: "Add channel"
40577
40598
  }
@@ -40765,7 +40786,7 @@ function NotificationRuleEditor({
40765
40786
  NotificationRuleEditor.displayName = "NotificationRuleEditor";
40766
40787
 
40767
40788
  // src/notifications/components/NotificationRuleList/NotificationRuleList.tsx
40768
- import { AddIcon as AddIcon9, CopyIcon as CopyIcon6, EditIcon as EditIcon2, RuleIcon as RuleIcon2, TrashCanIcon as TrashCanIcon4 } from "@octaviaflow/icons";
40789
+ import { AddIcon as AddIcon10, CopyIcon as CopyIcon6, EditIcon as EditIcon2, RuleIcon as RuleIcon2, TrashCanIcon as TrashCanIcon4 } from "@octaviaflow/icons";
40769
40790
  import { Fragment as Fragment69, jsx as jsx169, jsxs as jsxs161 } from "react/jsx-runtime";
40770
40791
  function NotificationRuleList({
40771
40792
  rules,
@@ -40795,7 +40816,7 @@ function NotificationRuleList({
40795
40816
  {
40796
40817
  size: "sm",
40797
40818
  variant: "secondary",
40798
- leftIcon: /* @__PURE__ */ jsx169(AddIcon9, { size: "sm", "aria-hidden": "true" }),
40819
+ leftIcon: /* @__PURE__ */ jsx169(AddIcon10, { size: "sm", "aria-hidden": "true" }),
40799
40820
  onClick: onCreate,
40800
40821
  children: "New rule"
40801
40822
  }
@@ -40812,7 +40833,7 @@ function NotificationRuleList({
40812
40833
  Button,
40813
40834
  {
40814
40835
  variant: "primary",
40815
- leftIcon: /* @__PURE__ */ jsx169(AddIcon9, { size: "sm", "aria-hidden": "true" }),
40836
+ leftIcon: /* @__PURE__ */ jsx169(AddIcon10, { size: "sm", "aria-hidden": "true" }),
40816
40837
  onClick: onCreate,
40817
40838
  children: "New rule"
40818
40839
  }