@parhelia/alpaca 0.4.12884 → 0.4.12903

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.
@@ -43,8 +43,12 @@ async function getCheckboxCommand(components, editContext, fieldName, label) {
43
43
  const items = await editContext.itemsRepository.getItems(datasourceItems);
44
44
  if (!items.length)
45
45
  return null;
46
- const someLinked = items.some((item) => item.fields.find((field) => field.name === fieldName)?.rawValue === "1");
47
- const allLinked = items.every((item) => item.fields.find((field) => field.name === fieldName)?.rawValue === "1");
46
+ // W12 phase 3 (fecanon lane): a routed read carries the canonical "true" (payload
47
+ // `canonical: true`), an old-route read the checkbox's "1"; both mean checked. The save below
48
+ // keeps posting the store's own "1"/"" unmarked, which both backends still accept.
49
+ const isChecked = (raw) => raw === "1" || (raw ?? "").toLowerCase() === "true";
50
+ const someLinked = items.some((item) => isChecked(item.fields.find((field) => field.name === fieldName)?.rawValue));
51
+ const allLinked = items.every((item) => isChecked(item.fields.find((field) => field.name === fieldName)?.rawValue));
48
52
  return {
49
53
  id: fieldName,
50
54
  icon: allLinked ? (_jsx(Check, { strokeWidth: 1, size: defaultIconSize })) : someLinked ? (_jsx(StopCircle, { strokeWidth: 1, size: defaultIconSize })) : (_jsx(Square, { strokeWidth: 1, size: defaultIconSize })),
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EAKpB,MAAM,gBAAgB,CAAC;AA4ExB,eAAO,MAAM,2BAA2B,mBAAmB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,yBAAyB,CAAC;AAkCtE;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,mBAAmB,uBAoBxE;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,mBAAmB,uBA6BjE;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,mBAAmB,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EAGpB,MAAM,gBAAgB,CAAC;AAuBxB,eAAO,MAAM,2BAA2B,mBAAmB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,yBAAyB,CAAC;AAkCtE;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,mBAAmB,uBAoBxE;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,mBAAmB,uBAqBjE;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,mBAAmB,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -1,53 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { lazy, Suspense } from "react";
3
- import { Activity, PanelsTopLeft, Waypoints } from "lucide-react";
4
- import { GraphQLIcon, JsonIcon, } from "@parhelia/core";
5
- import { Layout } from "./Layout";
3
+ import { Activity, Waypoints } from "lucide-react";
6
4
  import { alpacaComponentCommandProvider } from "./componentCommands";
7
5
  import { TracingTitlebar } from "./tracing/components/TracingTitlebar";
8
6
  import { TraceSourcesSidebar } from "./tracing/components/TraceSourcesSidebar";
9
- const GraphQL = lazy(() => import("./GraphQL").then((module) => ({ default: module.GraphQL })));
10
- function LazyGraphQLPanel() {
11
- return (_jsx(Suspense, { fallback: _jsx("div", { className: "p-4 text-sm text-muted-foreground", children: "Loading GraphQL editor..." }), children: _jsx(GraphQL, {}) }));
12
- }
13
7
  const TracingWorkspaceComponent = lazy(() => import("./tracing/components/TracingWorkspace").then((module) => ({
14
8
  default: module.TracingWorkspace,
15
9
  })));
16
10
  function LazyTracingWorkspace() {
17
11
  return (_jsx(Suspense, { fallback: _jsx("div", { className: "p-4 text-sm text-muted-foreground", children: "Loading tracing\u2026" }), children: _jsx(TracingWorkspaceComponent, {}) }));
18
12
  }
19
- const layoutDebugSidebar = {
20
- id: "layout",
21
- title: "Layout",
22
- icon: _jsx(PanelsTopLeft, { strokeWidth: 1 }),
23
- position: "left",
24
- sortOrder: 100,
25
- panels: [
26
- {
27
- name: "layout",
28
- icon: _jsx(JsonIcon, {}),
29
- title: "Layout",
30
- content: _jsx(Layout, {}),
31
- initialSize: 100,
32
- },
33
- ],
34
- };
35
- const graphqlSidebar = {
36
- id: "graphql",
37
- title: "GraphQL",
38
- icon: _jsx(GraphQLIcon, {}),
39
- position: "left",
40
- sortOrder: 101,
41
- panels: [
42
- {
43
- name: "graphql",
44
- icon: _jsx(GraphQLIcon, {}),
45
- title: "GraphQL",
46
- content: _jsx(LazyGraphQLPanel, {}),
47
- initialSize: 100,
48
- },
49
- ],
50
- };
51
13
  export const ALPACA_TRACING_WORKSPACE_ID = "alpaca-tracing";
52
14
  export const ALPACA_TRACE_SOURCES_SIDEBAR_ID = "alpaca-trace-sources";
53
15
  const traceSourcesSidebar = {
@@ -102,16 +64,11 @@ export function configureAlpacaTracing(configuration) {
102
64
  }
103
65
  export function configureAlpaca(configuration) {
104
66
  const sidebars = (configuration.editor?.sidebars || []).filter((s) => s.id !== "debug");
105
- const hasLayoutDebugSidebar = sidebars.some((s) => s.id === layoutDebugSidebar.id);
106
- const hasGraphqlSidebar = sidebars.some((s) => s.id === graphqlSidebar.id);
107
- const nextSidebars = [...sidebars];
108
- if (!hasLayoutDebugSidebar)
109
- nextSidebars.push(layoutDebugSidebar);
110
- if (!hasGraphqlSidebar)
111
- nextSidebars.push(graphqlSidebar);
67
+ // cf-panels (DevOps 8651 / 8652): the Layout and GraphQL panels are the core editor's now, driven by the page's store's
68
+ // capabilities on every host.
112
69
  configuration.editor = {
113
70
  ...configuration.editor,
114
- sidebars: nextSidebars,
71
+ sidebars,
115
72
  };
116
73
  const componentCommandProviders = configuration.componentCommands?.providers ?? [];
117
74
  if (!componentCommandProviders.includes(alpacaComponentCommandProvider)) {
@@ -1 +1 @@
1
- {"version":3,"file":"TracingTitlebar.d.ts","sourceRoot":"","sources":["../../../src/tracing/components/TracingTitlebar.tsx"],"names":[],"mappings":"AAwBA,wBAAgB,eAAe,uCA2M9B;AAwED,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,QAAQ,EACR,KAAe,EACf,MAAM,GACP,EAAE;IACD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BAYA;AAED,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,OAAO,EACP,WAAW,EACX,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BAgBA"}
1
+ {"version":3,"file":"TracingTitlebar.d.ts","sourceRoot":"","sources":["../../../src/tracing/components/TracingTitlebar.tsx"],"names":[],"mappings":"AAwBA,wBAAgB,eAAe,uCAmN9B;AAwED,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,QAAQ,EACR,KAAe,EACf,MAAM,GACP,EAAE;IACD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BAYA;AAED,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,OAAO,EACP,WAAW,EACX,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BAgBA"}
@@ -18,23 +18,29 @@ export function TracingTitlebar() {
18
18
  const countdown = recording?.autoOffAtUtc ? formatCountdown((Date.parse(recording.autoOffAtUtc) - now) / 1000) : "recording";
19
19
  if (!editContext?.workspace || editContext.isMobile)
20
20
  return null;
21
+ // Until the instance's status arrives the view knows neither its state nor its process generation, which every
22
+ // mutation must echo: the indicators read "loading…" and their menus stay closed instead of offering "off" actions
23
+ // that the instance would refuse as coming from a stale view.
24
+ const loading = !status;
21
25
  const attachment = status?.browserAttachment;
22
26
  const attached = !!attachment?.sessionId && !attachment.stale;
23
27
  const source = selectedSource(state);
24
28
  const canPersist = !!status?.storageAvailable && !!source && source.kind !== "global" && (source.kind !== "capture" || (!!source.finalized && !status.storageOutdated));
25
29
  const confirm = editContext.confirm;
26
- return (_jsxs("div", { className: "flex w-full min-w-0 items-center justify-between gap-3 overflow-hidden pr-2 pl-2", "data-testid": "alpaca-tracing-titlebar", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 overflow-hidden", children: [remote ? _jsxs("span", { className: "text-xs text-neutral-grey-50", children: ["Remote: ", state.selectedInstance, " (no cookie recording)"] }) : _jsx(_Fragment, { children: _jsx(Menu, { testId: "alpaca-tracing-browser-menu", trigger: _jsx(Indicator, { icon: _jsx(User, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: attached, label: "This browser", value: attached
27
- ? `recording to “${attachment?.name ?? "session"}”`
28
- : attachment?.stale
29
- ? "stale attachment"
30
- : "not recording" }), children: attached ? (_jsxs(_Fragment, { children: [_jsx(MenuItem, { onClick: () => void traceActions.detach(), testId: "alpaca-tracing-detach", children: "Detach (stop recording, keep the session)" }), _jsx(MenuItem, { destructive: true, onClick: () => confirm({
30
+ return (_jsxs("div", { className: "flex w-full min-w-0 items-center justify-between gap-3 overflow-hidden pr-2 pl-2", "data-testid": "alpaca-tracing-titlebar", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 overflow-hidden", children: [remote ? _jsxs("span", { className: "text-xs text-neutral-grey-50", children: ["Remote: ", state.selectedInstance, " (no cookie recording)"] }) : _jsx(_Fragment, { children: _jsx(Menu, { testId: "alpaca-tracing-browser-menu", trigger: _jsx(Indicator, { icon: _jsx(User, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: attached, label: "This browser", value: loading
31
+ ? "loading…"
32
+ : attached
33
+ ? `recording to “${attachment?.name ?? "session"}”`
34
+ : attachment?.stale
35
+ ? "stale attachment"
36
+ : "not recording", disabled: loading }), children: attached ? (_jsxs(_Fragment, { children: [_jsx(MenuItem, { onClick: () => void traceActions.detach(), testId: "alpaca-tracing-detach", children: "Detach (stop recording, keep the session)" }), _jsx(MenuItem, { destructive: true, onClick: () => confirm({
31
37
  header: "Detach and delete session",
32
38
  message: `Delete the session “${attachment?.name ?? ""}” and everything it recorded on this instance?`,
33
39
  acceptLabel: "Delete",
34
40
  accept: () => {
35
41
  void traceActions.deleteSession(attachment.sessionId, false);
36
42
  },
37
- }), testId: "alpaca-tracing-detach-delete", children: "Detach and delete session\u2026" })] })) : (_jsxs(MenuItem, { onClick: () => void traceActions.recordMySession(), testId: "alpaca-tracing-record-my-session", children: ["Record my session", _jsx("span", { className: "block text-2xs text-neutral-grey-50", children: "Traces every request this browser makes to this instance." })] })) }) }), _jsx(Menu, { testId: "alpaca-tracing-global-menu", trigger: _jsx(Indicator, { icon: _jsx(Globe, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: !!status?.globalEnabled, onTone: "warning", label: "Global", value: status?.globalEnabled ? countdown : "off" }), children: status?.globalEnabled ? (_jsxs(_Fragment, { children: [support.keep === "capture" ? _jsxs(_Fragment, { children: [_jsx(MenuItem, { onClick: () => void traceActions.stopGlobal(), testId: "alpaca-tracing-stop-global", children: "Stop and keep capture" }), _jsx(MenuItem, { destructive: true, onClick: () => confirm({ header: "Discard recording", message: "Discard this instance's active recording and its evidence?", acceptLabel: "Discard", accept: () => { void traceActions.disableGlobal(); } }), children: "Discard\u2026" })] }) : _jsx(MenuItem, { onClick: () => confirm({ header: "Stop recording", message: "Stop this instance's recording? The recorded stories are discarded. Keeping stopped recordings is not available on this instance.", acceptLabel: "Stop", accept: () => { void traceActions.disableGlobal(); } }), testId: "alpaca-tracing-stop-global", children: "Stop recording\u2026" }), support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.setAutoOff(minutes), children: ["Stop in ", minutes, " min"] }, minutes))] })) : (_jsxs(_Fragment, { children: [support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.enableGlobal(minutes), children: ["Record everything for ", minutes, " min\u2026"] }, minutes)), (!remote || !support.autoOff) && _jsx(MenuItem, { onClick: () => void traceActions.enableGlobal(null), children: "Record everything until stopped\u2026" })] })) }), status && _jsx(InstanceLine, { status: status })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(SimpleIconButton, { icon: _jsx(Crosshair, { className: "h-5 w-5", strokeWidth: 1 }), label: state.follow ? "Stop following the newest story" : "Follow the newest story", size: "large", selected: state.follow, onClick: () => traceActions.setFollow(!state.follow), "data-testid": "alpaca-tracing-follow" }), _jsx(SimpleIconButton, { icon: _jsx(Save, { className: "h-5 w-5", strokeWidth: 1 }), label: !status?.storageAvailable
43
+ }), testId: "alpaca-tracing-detach-delete", children: "Detach and delete session\u2026" })] })) : (_jsxs(MenuItem, { onClick: () => void traceActions.recordMySession(), testId: "alpaca-tracing-record-my-session", children: ["Record my session", _jsx("span", { className: "block text-2xs text-neutral-grey-50", children: "Traces every request this browser makes to this instance." })] })) }) }), _jsx(Menu, { testId: "alpaca-tracing-global-menu", trigger: _jsx(Indicator, { icon: _jsx(Globe, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: !!status?.globalEnabled, onTone: "warning", label: "Global", value: loading ? "loading…" : status.globalEnabled ? countdown : "off", disabled: loading }), children: status?.globalEnabled ? (_jsxs(_Fragment, { children: [support.keep === "capture" ? _jsxs(_Fragment, { children: [_jsx(MenuItem, { onClick: () => void traceActions.stopGlobal(), testId: "alpaca-tracing-stop-global", children: "Stop and keep capture" }), _jsx(MenuItem, { destructive: true, onClick: () => confirm({ header: "Discard recording", message: "Discard this instance's active recording and its evidence?", acceptLabel: "Discard", accept: () => { void traceActions.disableGlobal(); } }), children: "Discard\u2026" })] }) : _jsx(MenuItem, { onClick: () => confirm({ header: "Stop recording", message: "Stop this instance's recording? The recorded stories are discarded. Keeping stopped recordings is not available on this instance.", acceptLabel: "Stop", accept: () => { void traceActions.disableGlobal(); } }), testId: "alpaca-tracing-stop-global", children: "Stop recording\u2026" }), support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.setAutoOff(minutes), children: ["Stop in ", minutes, " min"] }, minutes))] })) : (_jsxs(_Fragment, { children: [support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.enableGlobal(minutes), children: ["Record everything for ", minutes, " min\u2026"] }, minutes)), (!remote || !support.autoOff) && _jsx(MenuItem, { onClick: () => void traceActions.enableGlobal(null), children: "Record everything until stopped\u2026" })] })) }), status && _jsx(InstanceLine, { status: status })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(SimpleIconButton, { icon: _jsx(Crosshair, { className: "h-5 w-5", strokeWidth: 1 }), label: state.follow ? "Stop following the newest story" : "Follow the newest story", size: "large", selected: state.follow, onClick: () => traceActions.setFollow(!state.follow), "data-testid": "alpaca-tracing-follow" }), _jsx(SimpleIconButton, { icon: _jsx(Save, { className: "h-5 w-5", strokeWidth: 1 }), label: !status?.storageAvailable
38
44
  ? "Trace storage is not installed on this instance"
39
45
  : source?.kind === "global" && !support.persistGlobal ? "Persisting the global recording is not available on this instance"
40
46
  : source?.kind === "capture" && status.storageOutdated ? "Update Alpaca.Tracing.Storage to persist captures"
@@ -87,7 +93,7 @@ function InstanceLine({ status }) {
87
93
  }
88
94
  // Used as a Radix PopoverTrigger child (asChild): it must forward the ref and spread the trigger props.
89
95
  const Indicator = forwardRef(function Indicator({ icon, on, onTone = "success", label, value, className, ...props }, ref) {
90
- return (_jsxs("button", { ref: ref, type: "button", title: `${label}: ${value}`, ...props, className: cls("flex h-8 min-w-0 shrink items-center gap-1.5 rounded border border-border-default bg-background px-2 text-xs whitespace-nowrap text-neutral-grey-100 hover:bg-neutral-grey-5", className), children: [_jsx("span", { className: cls("inline-block h-2 w-2 rounded-full", on ? (onTone === "warning" ? "animate-pulse bg-feedback-red" : "animate-pulse bg-feedback-green") : "bg-neutral-grey-15") }), icon, _jsxs("span", { className: "shrink-0 text-neutral-grey-50", children: [label, ":"] }), _jsx("span", { className: "min-w-0 max-w-[220px] truncate", children: value }), _jsx(ChevronDown, { className: "h-3 w-3 text-neutral-grey-50", strokeWidth: 1.5 })] }));
96
+ return (_jsxs("button", { ref: ref, type: "button", title: `${label}: ${value}`, ...props, className: cls("flex h-8 min-w-0 shrink items-center gap-1.5 rounded border border-border-default bg-background px-2 text-xs whitespace-nowrap text-neutral-grey-100 hover:bg-neutral-grey-5 disabled:cursor-wait disabled:opacity-60 disabled:hover:bg-background", className), children: [_jsx("span", { className: cls("inline-block h-2 w-2 rounded-full", on ? (onTone === "warning" ? "animate-pulse bg-feedback-red" : "animate-pulse bg-feedback-green") : "bg-neutral-grey-15") }), icon, _jsxs("span", { className: "shrink-0 text-neutral-grey-50", children: [label, ":"] }), _jsx("span", { className: "min-w-0 max-w-[220px] truncate", children: value }), _jsx(ChevronDown, { className: "h-3 w-3 text-neutral-grey-50", strokeWidth: 1.5 })] }));
91
97
  });
92
98
  export function Menu({ trigger, children, align = "start", testId, }) {
93
99
  const [open, setOpen] = useState(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parhelia/alpaca",
3
- "version": "0.4.12884",
3
+ "version": "0.4.12903",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -42,12 +42,8 @@
42
42
  "typescript": "npm:@typescript/typescript6@6.0.2"
43
43
  },
44
44
  "dependencies": {
45
- "@graphiql/plugin-explorer": "^5.1.5",
46
- "@graphiql/react": "^0.39.0",
47
45
  "@parhelia/core": "*",
48
46
  "@uiw/react-textarea-code-editor": "^3.1.1",
49
- "graphiql": "^5.4.0",
50
- "graphql": "^17.0.2",
51
47
  "lucide-react": "^1.38.0",
52
48
  "postcss": "^8.5.26",
53
49
  "react": "19.2.8",