@nice-code/action 0.3.0 → 0.3.2
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.
|
@@ -2074,7 +2074,7 @@ import { useMemo, useState as useState7 } from "react";
|
|
|
2074
2074
|
function getSizeValue(size) {
|
|
2075
2075
|
switch (size) {
|
|
2076
2076
|
case "sm" /* sm */:
|
|
2077
|
-
return 0.
|
|
2077
|
+
return 0.75;
|
|
2078
2078
|
case "md" /* md */:
|
|
2079
2079
|
return 1;
|
|
2080
2080
|
case "lg" /* lg */:
|
|
@@ -3295,8 +3295,7 @@ function Chip({
|
|
|
3295
3295
|
size = "md" /* md */,
|
|
3296
3296
|
rounded = false,
|
|
3297
3297
|
tooltip,
|
|
3298
|
-
children
|
|
3299
|
-
style
|
|
3298
|
+
children
|
|
3300
3299
|
}) {
|
|
3301
3300
|
const [anchor, setAnchor] = useState3(null);
|
|
3302
3301
|
const hasTooltip = tooltip != null;
|
|
@@ -3320,8 +3319,7 @@ function Chip({
|
|
|
3320
3319
|
borderRadius: rounded ? "0.6rem" : "3px",
|
|
3321
3320
|
flexShrink: 0,
|
|
3322
3321
|
whiteSpace: "nowrap",
|
|
3323
|
-
cursor: hasTooltip ? "default" : undefined
|
|
3324
|
-
...style
|
|
3322
|
+
cursor: hasTooltip ? "default" : undefined
|
|
3325
3323
|
},
|
|
3326
3324
|
children
|
|
3327
3325
|
}, undefined, false, undefined, this),
|
|
@@ -3336,12 +3334,7 @@ function Chip({
|
|
|
3336
3334
|
// src/devtools/browser/components/Icon.tsx
|
|
3337
3335
|
import { useState as useState4 } from "react";
|
|
3338
3336
|
import { jsxDEV as jsxDEV8, Fragment as Fragment3 } from "react/jsx-dev-runtime";
|
|
3339
|
-
var
|
|
3340
|
-
["sm" /* sm */]: 1,
|
|
3341
|
-
["md" /* md */]: 1.2,
|
|
3342
|
-
["lg" /* lg */]: 1.6
|
|
3343
|
-
};
|
|
3344
|
-
var BASE_ICON_SIDE_LENGTH_EM = 1.5;
|
|
3337
|
+
var BASE_ICON_SIDE_LENGTH_EM = 1.6;
|
|
3345
3338
|
var ICON_GAP_EM = 0.3;
|
|
3346
3339
|
function Icon({
|
|
3347
3340
|
icon: IconComponent,
|
|
@@ -3349,7 +3342,8 @@ function Icon({
|
|
|
3349
3342
|
size = "md" /* md */,
|
|
3350
3343
|
subtle = false,
|
|
3351
3344
|
tooltip,
|
|
3352
|
-
style
|
|
3345
|
+
style,
|
|
3346
|
+
noBackground = false
|
|
3353
3347
|
}) {
|
|
3354
3348
|
const [anchor, setAnchor] = useState4(null);
|
|
3355
3349
|
const hasTooltip = tooltip != null;
|
|
@@ -3371,7 +3365,7 @@ function Icon({
|
|
|
3371
3365
|
display: "flex",
|
|
3372
3366
|
alignItems: "center",
|
|
3373
3367
|
justifyContent: "center",
|
|
3374
|
-
background: "rgba(0,0,0,0.4)",
|
|
3368
|
+
background: noBackground ? "none" : "rgba(0,0,0,0.4)",
|
|
3375
3369
|
color: resolvedColor,
|
|
3376
3370
|
flexShrink: 0,
|
|
3377
3371
|
cursor: hasTooltip ? "default" : undefined,
|
|
@@ -3381,7 +3375,7 @@ function Icon({
|
|
|
3381
3375
|
style: { display: "flex", alignItems: "center", gap: `${ICON_GAP_EM}em` },
|
|
3382
3376
|
children: finalIcons.map((Comp, i) => /* @__PURE__ */ jsxDEV8(Comp, {
|
|
3383
3377
|
size: iconSideLengthEm,
|
|
3384
|
-
strokeWidth: 2.
|
|
3378
|
+
strokeWidth: 2.6
|
|
3385
3379
|
}, `${Comp.name}-${i}`, false, undefined, this))
|
|
3386
3380
|
}, undefined, false, undefined, this)
|
|
3387
3381
|
}, undefined, false, undefined, this),
|
|
@@ -4214,11 +4208,11 @@ function ActionDetailPanel({
|
|
|
4214
4208
|
import { useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2 } from "react";
|
|
4215
4209
|
|
|
4216
4210
|
// src/devtools/browser/components/action_list/ActionEntryRow.tsx
|
|
4217
|
-
import {
|
|
4211
|
+
import { CircleX as CircleX3, PackageCheck as PackageCheck2, Variable as Variable2 } from "lucide-react";
|
|
4218
4212
|
import { Fragment as Fragment8, useState as useState8 } from "react";
|
|
4219
4213
|
|
|
4220
4214
|
// src/devtools/browser/components/action_list/ActionInputAndOutputChip.tsx
|
|
4221
|
-
import {
|
|
4215
|
+
import { CircleX as CircleX2, PackageCheck, Sparkle, Variable } from "lucide-react";
|
|
4222
4216
|
|
|
4223
4217
|
// src/devtools/browser/components/action_list/IoTooltipContent.tsx
|
|
4224
4218
|
import { jsxDEV as jsxDEV17, Fragment as Fragment7 } from "react/jsx-dev-runtime";
|
|
@@ -4300,7 +4294,7 @@ var ActionInputAndOutputChip = ({
|
|
|
4300
4294
|
entry,
|
|
4301
4295
|
breakReasons,
|
|
4302
4296
|
subtle,
|
|
4303
|
-
size
|
|
4297
|
+
size = "md" /* md */
|
|
4304
4298
|
}) => {
|
|
4305
4299
|
const firstHop = entry.meta.routing[0];
|
|
4306
4300
|
const localEnvId = firstHop != null ? firstHop.runtime.envId : null;
|
|
@@ -4311,6 +4305,22 @@ var ActionInputAndOutputChip = ({
|
|
|
4311
4305
|
const isNewInput = breakReasons.includes("new_input" /* new_input */);
|
|
4312
4306
|
const isNewOutput = breakReasons.includes("new_output" /* new_output */);
|
|
4313
4307
|
const hasError = entry.error != null || entry.abortReason != null;
|
|
4308
|
+
const sizeNum = getSizeValue(size);
|
|
4309
|
+
const newIconSizeEm = `${sizeNum * 0.9}em`;
|
|
4310
|
+
const label = `${(isLocal ? localEnvId : externalLabel) ?? "unknown"}`;
|
|
4311
|
+
const newSparkleComp = /* @__PURE__ */ jsxDEV18("div", {
|
|
4312
|
+
style: {
|
|
4313
|
+
opacity: 0.9,
|
|
4314
|
+
alignSelf: "start",
|
|
4315
|
+
marginLeft: "-0.6em"
|
|
4316
|
+
},
|
|
4317
|
+
children: /* @__PURE__ */ jsxDEV18(Sparkle, {
|
|
4318
|
+
strokeWidth: "0.2em",
|
|
4319
|
+
color: "rgba(243, 250, 140, 1)",
|
|
4320
|
+
width: newIconSizeEm,
|
|
4321
|
+
height: newIconSizeEm
|
|
4322
|
+
}, undefined, false, undefined, this)
|
|
4323
|
+
}, undefined, false, undefined, this);
|
|
4314
4324
|
return /* @__PURE__ */ jsxDEV18(Chip, {
|
|
4315
4325
|
color,
|
|
4316
4326
|
size,
|
|
@@ -4319,7 +4329,8 @@ var ActionInputAndOutputChip = ({
|
|
|
4319
4329
|
style: { display: "flex", alignItems: "center", gap: "0.4em" },
|
|
4320
4330
|
children: [
|
|
4321
4331
|
/* @__PURE__ */ jsxDEV18(Icon, {
|
|
4322
|
-
|
|
4332
|
+
noBackground: true,
|
|
4333
|
+
icon: Variable,
|
|
4323
4334
|
color,
|
|
4324
4335
|
subtle: subtle || entry.input === undefined,
|
|
4325
4336
|
tooltip: {
|
|
@@ -4332,9 +4343,24 @@ var ActionInputAndOutputChip = ({
|
|
|
4332
4343
|
title: isNewInput ? "New Input" : "Input"
|
|
4333
4344
|
}
|
|
4334
4345
|
}, undefined, false, undefined, this),
|
|
4335
|
-
|
|
4346
|
+
isNewInput && newSparkleComp,
|
|
4347
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
4348
|
+
style: { opacity: 0.6 },
|
|
4349
|
+
color,
|
|
4350
|
+
children: "→"
|
|
4351
|
+
}, undefined, false, undefined, this),
|
|
4352
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
4353
|
+
style: { opacity: 0.8 },
|
|
4354
|
+
children: label
|
|
4355
|
+
}, undefined, false, undefined, this),
|
|
4356
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
4357
|
+
style: { opacity: 0.6 },
|
|
4358
|
+
color,
|
|
4359
|
+
children: "→"
|
|
4360
|
+
}, undefined, false, undefined, this),
|
|
4336
4361
|
entry.status === "success" && entry.output !== undefined && /* @__PURE__ */ jsxDEV18(Icon, {
|
|
4337
|
-
|
|
4362
|
+
noBackground: true,
|
|
4363
|
+
icon: PackageCheck,
|
|
4338
4364
|
color: !hasError ? color : "default" /* default */,
|
|
4339
4365
|
tooltip: {
|
|
4340
4366
|
content: /* @__PURE__ */ jsxDEV18(IoTooltipContent, {
|
|
@@ -4344,6 +4370,7 @@ var ActionInputAndOutputChip = ({
|
|
|
4344
4370
|
}
|
|
4345
4371
|
}, undefined, false, undefined, this),
|
|
4346
4372
|
(entry.error != null || entry.abortReason != null) && /* @__PURE__ */ jsxDEV18(Icon, {
|
|
4373
|
+
noBackground: true,
|
|
4347
4374
|
icon: CircleX2,
|
|
4348
4375
|
color: entry.status === "aborted" ? "aborted" /* aborted */ : "error" /* error */,
|
|
4349
4376
|
tooltip: {
|
|
@@ -4354,7 +4381,8 @@ var ActionInputAndOutputChip = ({
|
|
|
4354
4381
|
title: entry.status === "aborted" ? "Aborted" : "Error",
|
|
4355
4382
|
maxWidth: 340
|
|
4356
4383
|
}
|
|
4357
|
-
}, undefined, false, undefined, this)
|
|
4384
|
+
}, undefined, false, undefined, this),
|
|
4385
|
+
isNewOutput && newSparkleComp
|
|
4358
4386
|
]
|
|
4359
4387
|
}, undefined, true, undefined, this)
|
|
4360
4388
|
}, undefined, false, undefined, this);
|
|
@@ -4615,7 +4643,7 @@ function ActionEntryRow({
|
|
|
4615
4643
|
}, undefined, false, undefined, this),
|
|
4616
4644
|
child.status === "success" && child.output !== undefined && /* @__PURE__ */ jsxDEV19(Icon, {
|
|
4617
4645
|
size: "sm" /* sm */,
|
|
4618
|
-
icon:
|
|
4646
|
+
icon: PackageCheck2,
|
|
4619
4647
|
color: "io_output" /* io_output */,
|
|
4620
4648
|
subtle: true,
|
|
4621
4649
|
tooltip: {
|
|
@@ -4633,6 +4661,7 @@ function ActionEntryRow({
|
|
|
4633
4661
|
children: reason
|
|
4634
4662
|
}, reason, false, undefined, this)),
|
|
4635
4663
|
(childEntries?.length ?? 0) > 0 && (entry.error != null || entry.abortReason != null) && /* @__PURE__ */ jsxDEV19(Icon, {
|
|
4664
|
+
size: "sm" /* sm */,
|
|
4636
4665
|
icon: CircleX3,
|
|
4637
4666
|
color: entry.status === "aborted" ? "aborted" /* aborted */ : "error" /* error */,
|
|
4638
4667
|
subtle: true,
|
|
@@ -4748,41 +4777,47 @@ function ActionList({
|
|
|
4748
4777
|
return /* @__PURE__ */ jsxDEV20("div", {
|
|
4749
4778
|
ref: containerRef,
|
|
4750
4779
|
style,
|
|
4751
|
-
children:
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4780
|
+
children: [
|
|
4781
|
+
flatItems.map((item) => {
|
|
4782
|
+
const key = getFlatItemKey(item);
|
|
4783
|
+
const { group } = item;
|
|
4784
|
+
return /* @__PURE__ */ jsxDEV20("div", {
|
|
4785
|
+
style: {
|
|
4786
|
+
borderBottom: `1px solid ${DEVTOOL_LIST_GROUP_DIVIDER}`,
|
|
4787
|
+
position: "relative",
|
|
4788
|
+
overflow: "hidden"
|
|
4789
|
+
},
|
|
4790
|
+
children: [
|
|
4791
|
+
/* @__PURE__ */ jsxDEV20("div", {
|
|
4792
|
+
style: {
|
|
4793
|
+
position: "absolute",
|
|
4794
|
+
inset: 0,
|
|
4795
|
+
pointerEvents: "none",
|
|
4796
|
+
background: "linear-gradient(90deg, transparent 0%, rgba(148, 210, 255, 0.13) 50%, transparent 100%)",
|
|
4797
|
+
animation: "__nice-action-shine 0.65s ease-out forwards"
|
|
4798
|
+
}
|
|
4799
|
+
}, group.representative.cuid, false, undefined, this),
|
|
4800
|
+
/* @__PURE__ */ jsxDEV20(ActionEntryRow, {
|
|
4801
|
+
entry: group.representative,
|
|
4802
|
+
isSelected: selectedCuid === group.representative.cuid || group.rest.some((e) => e.cuid === selectedCuid),
|
|
4803
|
+
isLatest: item.groupIndex === 0,
|
|
4804
|
+
latestTime,
|
|
4805
|
+
childEntries: getGroupChildEntries(group, childEntriesMap),
|
|
4806
|
+
breakReasons: item.breakReasons,
|
|
4807
|
+
groupEntries: group.rest.length > 0 ? [group.representative, ...group.rest] : undefined,
|
|
4808
|
+
selectedGroupCuid: selectedCuid,
|
|
4809
|
+
onSelectGroupEntry: (cuid) => onSubClick(cuid, selectedCuid === cuid),
|
|
4810
|
+
onClick: () => onGroupClick(group)
|
|
4811
|
+
}, undefined, false, undefined, this)
|
|
4812
|
+
]
|
|
4813
|
+
}, key, true, undefined, this);
|
|
4814
|
+
}),
|
|
4815
|
+
/* @__PURE__ */ jsxDEV20("div", {
|
|
4816
|
+
style: { padding: "24px", textAlign: "center", color: DEVTOOL_COLOR_TEXT_MUTED },
|
|
4817
|
+
children: "Start of action history"
|
|
4818
|
+
}, undefined, false, undefined, this)
|
|
4819
|
+
]
|
|
4820
|
+
}, undefined, true, undefined, this);
|
|
4786
4821
|
}
|
|
4787
4822
|
|
|
4788
4823
|
// src/devtools/browser/components/PanelChrome.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { type ESemanticThing } from "../../core/devtools_colors";
|
|
3
3
|
import { ESize } from "../ui_util/size";
|
|
4
4
|
import { type ITooltipConfig } from "./Tooltip";
|
|
@@ -17,7 +17,6 @@ interface IChipProps {
|
|
|
17
17
|
rounded?: boolean;
|
|
18
18
|
tooltip?: ITooltipConfig;
|
|
19
19
|
children: ReactNode;
|
|
20
|
-
style?: CSSProperties;
|
|
21
20
|
}
|
|
22
|
-
export declare function Chip({ color, subtle, size, rounded, tooltip, children,
|
|
21
|
+
export declare function Chip({ color, subtle, size, rounded, tooltip, children, }: IChipProps): import("react/jsx-runtime").JSX.Element;
|
|
23
22
|
export {};
|
|
@@ -10,6 +10,7 @@ interface IIconProps {
|
|
|
10
10
|
subtle?: boolean;
|
|
11
11
|
tooltip?: ITooltipConfig;
|
|
12
12
|
style?: CSSProperties;
|
|
13
|
+
noBackground?: boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare function Icon({ icon: IconComponent, color, size, subtle, tooltip, style, }: IIconProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function Icon({ icon: IconComponent, color, size, subtle, tooltip, style, noBackground, }: IIconProps): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-code/action",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"build-types": "tsc --project tsconfig.build.json"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@nice-code/common-errors": "0.3.
|
|
48
|
-
"@nice-code/error": "0.3.
|
|
49
|
-
"@nice-code/util": "0.3.
|
|
47
|
+
"@nice-code/common-errors": "0.3.2",
|
|
48
|
+
"@nice-code/error": "0.3.2",
|
|
49
|
+
"@nice-code/util": "0.3.2",
|
|
50
50
|
"@standard-schema/spec": "^1.1.0",
|
|
51
51
|
"@tanstack/react-virtual": "^3.13.26",
|
|
52
52
|
"http-status-codes": "^2.3.0",
|