@nice-code/action 0.2.13 → 0.2.15

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/build/index.js CHANGED
@@ -311,7 +311,9 @@ class ActionPayload_Request extends ActionPayload {
311
311
  return value.waitForResultPayload();
312
312
  }
313
313
  async run(options) {
314
- this._callSite = new Error().stack;
314
+ if (this._callSite == null) {
315
+ this._callSite = new Error().stack;
316
+ }
315
317
  return this._domain.runAction(this, options);
316
318
  }
317
319
  }
@@ -13,6 +13,7 @@ function useActionMutation(action, options) {
13
13
  import {
14
14
  useQuery
15
15
  } from "@tanstack/react-query";
16
+ import { useRef } from "react";
16
17
  function actionQueryKey(action, input) {
17
18
  if (input === undefined) {
18
19
  return ["nice-action", action.domain, action.allDomains, action.id];
@@ -29,9 +30,14 @@ function useActionQuery(action, ...args) {
29
30
  [options] = args;
30
31
  }
31
32
  const { enabled, ...queryOptions } = options ?? {};
33
+ const callSiteRef = useRef(new Error().stack);
32
34
  return useQuery({
33
35
  queryKey: input != null ? actionQueryKey(action, input) : actionQueryKey(action),
34
- queryFn: () => action.request(input).runToOutput(),
36
+ queryFn: () => {
37
+ const req = action.request(input);
38
+ req._callSite = callSiteRef.current;
39
+ return req.runToOutput();
40
+ },
35
41
  enabled: hasInputSchema ? input != null && (enabled ?? true) : enabled ?? true,
36
42
  ...queryOptions
37
43
  });
@@ -7,7 +7,8 @@ export declare function DomainHierarchyTooltip({ allDomains, anchor, }: {
7
7
  allDomains: string[];
8
8
  anchor: DOMRect;
9
9
  }): import("react/jsx-runtime").JSX.Element;
10
- export declare function DomainChip({ domain, allDomains, size, }: {
10
+ export declare function DomainChip({ subtle, domain, allDomains, size, }: {
11
+ subtle?: boolean;
11
12
  domain: string;
12
13
  allDomains?: string[];
13
14
  size: "sm" | "md";
@@ -3,8 +3,6 @@ export declare function getExternalLabel(hop: IDevtoolsRouteItem): string | null
3
3
  interface IHandlerChipsProps {
4
4
  entry: IDevtoolsActionEntry;
5
5
  size: "sm" | "md";
6
- /** Show the local runtime chip even when an external chip is also present */
7
- alwaysShowLocal?: boolean;
8
6
  }
9
- export declare function HandlerChips({ entry, size, alwaysShowLocal }: IHandlerChipsProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function HandlerChips({ entry, size }: IHandlerChipsProps): import("react/jsx-runtime").JSX.Element;
10
8
  export {};
@@ -0,0 +1,6 @@
1
+ export interface IResolvedSourcePosition {
2
+ file: string;
3
+ line: number;
4
+ col: number;
5
+ }
6
+ export declare function resolveCompiledPosition(fileUrl: string, line: number, col: number): Promise<IResolvedSourcePosition | null>;
@@ -0,0 +1,4 @@
1
+ export declare const DEVTOOL_COLOR_HANDLER_LOCAL_TEXT = "#34bb89";
2
+ export declare const DEVTOOL_COLOR_HANDLER_LOCAL_BORDER = "#144427";
3
+ export declare const DEVTOOL_COLOR_HANDLER_EXTERNAL_TEXT = "#cfa12a";
4
+ export declare const DEVTOOL_COLOR_HANDLER_EXTERNAL_BORDER = "#723917";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-code/action",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -44,12 +44,13 @@
44
44
  "build-types": "tsc --project tsconfig.build.json"
45
45
  },
46
46
  "dependencies": {
47
- "@nice-code/common-errors": "0.2.13",
48
- "@nice-code/error": "0.2.13",
47
+ "@nice-code/common-errors": "0.2.15",
48
+ "@nice-code/error": "0.2.15",
49
49
  "@standard-schema/spec": "^1.1.0",
50
50
  "@tanstack/react-virtual": "^3.13.26",
51
51
  "http-status-codes": "^2.3.0",
52
52
  "nanoid": "^5.1.9",
53
+ "source-map-js": "^1.2.1",
53
54
  "std-env": "^4.1.0"
54
55
  },
55
56
  "devDependencies": {