@flanksource/clicky-ui 0.3.76 → 0.3.78

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.
Files changed (155) hide show
  1. package/NOTICE.md +16 -0
  2. package/dist/data/ai/SpecRuntimeEditor/SandboxSection.cjs +7 -3
  3. package/dist/data/ai/SpecRuntimeEditor/SandboxSection.cjs.map +1 -1
  4. package/dist/data/ai/SpecRuntimeEditor/SandboxSection.d.ts.map +1 -1
  5. package/dist/data/ai/SpecRuntimeEditor/SandboxSection.js +7 -3
  6. package/dist/data/ai/SpecRuntimeEditor/SandboxSection.js.map +1 -1
  7. package/dist/data/ai/SpecRuntimeEditor.sandbox-model.cjs +3 -2
  8. package/dist/data/ai/SpecRuntimeEditor.sandbox-model.cjs.map +1 -1
  9. package/dist/data/ai/SpecRuntimeEditor.sandbox-model.d.ts +1 -1
  10. package/dist/data/ai/SpecRuntimeEditor.sandbox-model.d.ts.map +1 -1
  11. package/dist/data/ai/SpecRuntimeEditor.sandbox-model.js +3 -2
  12. package/dist/data/ai/SpecRuntimeEditor.sandbox-model.js.map +1 -1
  13. package/dist/data/ai/sandbox-kind-meta.cjs +8 -0
  14. package/dist/data/ai/sandbox-kind-meta.cjs.map +1 -1
  15. package/dist/data/ai/sandbox-kind-meta.d.ts.map +1 -1
  16. package/dist/data/ai/sandbox-kind-meta.js +8 -0
  17. package/dist/data/ai/sandbox-kind-meta.js.map +1 -1
  18. package/dist/data/version-info.cjs +3 -3
  19. package/dist/data/version-info.js +3 -3
  20. package/dist/data.cjs +32 -0
  21. package/dist/data.js +17 -1
  22. package/dist/icons/components/UiGlobeShare.cjs +33 -0
  23. package/dist/icons/components/UiGlobeShare.cjs.map +1 -0
  24. package/dist/icons/components/UiGlobeShare.d.ts +9 -0
  25. package/dist/icons/components/UiGlobeShare.d.ts.map +1 -0
  26. package/dist/icons/components/UiGlobeShare.js +31 -0
  27. package/dist/icons/components/UiGlobeShare.js.map +1 -0
  28. package/dist/icons/components/UiKubernetesLink.cjs +38 -0
  29. package/dist/icons/components/UiKubernetesLink.cjs.map +1 -0
  30. package/dist/icons/components/UiKubernetesLink.d.ts +9 -0
  31. package/dist/icons/components/UiKubernetesLink.d.ts.map +1 -0
  32. package/dist/icons/components/UiKubernetesLink.js +36 -0
  33. package/dist/icons/components/UiKubernetesLink.js.map +1 -0
  34. package/dist/icons/components/UiLogoAws.cjs +29 -0
  35. package/dist/icons/components/UiLogoAws.cjs.map +1 -0
  36. package/dist/icons/components/UiLogoAws.d.ts +9 -0
  37. package/dist/icons/components/UiLogoAws.d.ts.map +1 -0
  38. package/dist/icons/components/UiLogoAws.js +27 -0
  39. package/dist/icons/components/UiLogoAws.js.map +1 -0
  40. package/dist/icons/components/UiLogoAzure.cjs +29 -0
  41. package/dist/icons/components/UiLogoAzure.cjs.map +1 -0
  42. package/dist/icons/components/UiLogoAzure.d.ts +9 -0
  43. package/dist/icons/components/UiLogoAzure.d.ts.map +1 -0
  44. package/dist/icons/components/UiLogoAzure.js +27 -0
  45. package/dist/icons/components/UiLogoAzure.js.map +1 -0
  46. package/dist/icons/components/UiLogoAzureDevops.cjs +29 -0
  47. package/dist/icons/components/UiLogoAzureDevops.cjs.map +1 -0
  48. package/dist/icons/components/UiLogoAzureDevops.d.ts +9 -0
  49. package/dist/icons/components/UiLogoAzureDevops.d.ts.map +1 -0
  50. package/dist/icons/components/UiLogoAzureDevops.js +27 -0
  51. package/dist/icons/components/UiLogoAzureDevops.js.map +1 -0
  52. package/dist/icons/components/UiLogoGit.cjs +29 -0
  53. package/dist/icons/components/UiLogoGit.cjs.map +1 -0
  54. package/dist/icons/components/UiLogoGit.d.ts +9 -0
  55. package/dist/icons/components/UiLogoGit.d.ts.map +1 -0
  56. package/dist/icons/components/UiLogoGit.js +27 -0
  57. package/dist/icons/components/UiLogoGit.js.map +1 -0
  58. package/dist/icons/components/UiLogoGithub.cjs +29 -0
  59. package/dist/icons/components/UiLogoGithub.cjs.map +1 -0
  60. package/dist/icons/components/UiLogoGithub.d.ts +9 -0
  61. package/dist/icons/components/UiLogoGithub.d.ts.map +1 -0
  62. package/dist/icons/components/UiLogoGithub.js +27 -0
  63. package/dist/icons/components/UiLogoGithub.js.map +1 -0
  64. package/dist/icons/components/UiLogoJava.cjs +29 -0
  65. package/dist/icons/components/UiLogoJava.cjs.map +1 -0
  66. package/dist/icons/components/UiLogoJava.d.ts +9 -0
  67. package/dist/icons/components/UiLogoJava.d.ts.map +1 -0
  68. package/dist/icons/components/UiLogoJava.js +27 -0
  69. package/dist/icons/components/UiLogoJava.js.map +1 -0
  70. package/dist/icons/components/UiLogoKubernetes.cjs +29 -0
  71. package/dist/icons/components/UiLogoKubernetes.cjs.map +1 -0
  72. package/dist/icons/components/UiLogoKubernetes.d.ts +9 -0
  73. package/dist/icons/components/UiLogoKubernetes.d.ts.map +1 -0
  74. package/dist/icons/components/UiLogoKubernetes.js +27 -0
  75. package/dist/icons/components/UiLogoKubernetes.js.map +1 -0
  76. package/dist/icons/components/UiLogoMssql.cjs +29 -0
  77. package/dist/icons/components/UiLogoMssql.cjs.map +1 -0
  78. package/dist/icons/components/UiLogoMssql.d.ts +9 -0
  79. package/dist/icons/components/UiLogoMssql.d.ts.map +1 -0
  80. package/dist/icons/components/UiLogoMssql.js +27 -0
  81. package/dist/icons/components/UiLogoMssql.js.map +1 -0
  82. package/dist/icons/components/UiLogoOpenjdk.cjs +29 -0
  83. package/dist/icons/components/UiLogoOpenjdk.cjs.map +1 -0
  84. package/dist/icons/components/UiLogoOpenjdk.d.ts +9 -0
  85. package/dist/icons/components/UiLogoOpenjdk.d.ts.map +1 -0
  86. package/dist/icons/components/UiLogoOpenjdk.js +27 -0
  87. package/dist/icons/components/UiLogoOpenjdk.js.map +1 -0
  88. package/dist/icons/components/UiLogoOpensearch.cjs +29 -0
  89. package/dist/icons/components/UiLogoOpensearch.cjs.map +1 -0
  90. package/dist/icons/components/UiLogoOpensearch.d.ts +9 -0
  91. package/dist/icons/components/UiLogoOpensearch.d.ts.map +1 -0
  92. package/dist/icons/components/UiLogoOpensearch.js +27 -0
  93. package/dist/icons/components/UiLogoOpensearch.js.map +1 -0
  94. package/dist/icons/components/UiLogoOpentelemetry.cjs +29 -0
  95. package/dist/icons/components/UiLogoOpentelemetry.cjs.map +1 -0
  96. package/dist/icons/components/UiLogoOpentelemetry.d.ts +9 -0
  97. package/dist/icons/components/UiLogoOpentelemetry.d.ts.map +1 -0
  98. package/dist/icons/components/UiLogoOpentelemetry.js +27 -0
  99. package/dist/icons/components/UiLogoOpentelemetry.js.map +1 -0
  100. package/dist/icons/components/UiLogoPostgres.cjs +29 -0
  101. package/dist/icons/components/UiLogoPostgres.cjs.map +1 -0
  102. package/dist/icons/components/UiLogoPostgres.d.ts +9 -0
  103. package/dist/icons/components/UiLogoPostgres.d.ts.map +1 -0
  104. package/dist/icons/components/UiLogoPostgres.js +27 -0
  105. package/dist/icons/components/UiLogoPostgres.js.map +1 -0
  106. package/dist/icons/components/UiLogoSqlite.cjs +29 -0
  107. package/dist/icons/components/UiLogoSqlite.cjs.map +1 -0
  108. package/dist/icons/components/UiLogoSqlite.d.ts +9 -0
  109. package/dist/icons/components/UiLogoSqlite.d.ts.map +1 -0
  110. package/dist/icons/components/UiLogoSqlite.js +27 -0
  111. package/dist/icons/components/UiLogoSqlite.js.map +1 -0
  112. package/dist/icons/components/UiWebLink.cjs +40 -0
  113. package/dist/icons/components/UiWebLink.cjs.map +1 -0
  114. package/dist/icons/components/UiWebLink.d.ts +9 -0
  115. package/dist/icons/components/UiWebLink.d.ts.map +1 -0
  116. package/dist/icons/components/UiWebLink.js +38 -0
  117. package/dist/icons/components/UiWebLink.js.map +1 -0
  118. package/dist/icons/index.d.ts +16 -0
  119. package/dist/icons/index.d.ts.map +1 -1
  120. package/dist/icons/registry.cjs +32 -0
  121. package/dist/icons/registry.cjs.map +1 -1
  122. package/dist/icons/registry.d.ts.map +1 -1
  123. package/dist/icons/registry.js +32 -0
  124. package/dist/icons/registry.js.map +1 -1
  125. package/dist/icons.cjs +32 -0
  126. package/dist/icons.js +17 -1
  127. package/dist/index.cjs +32 -0
  128. package/dist/index.js +17 -1
  129. package/dist/profiles/editor/profileEditor.cjs +21 -2
  130. package/dist/profiles/editor/profileEditor.cjs.map +1 -1
  131. package/dist/profiles/editor/profileEditor.d.ts +5 -1
  132. package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
  133. package/dist/profiles/editor/profileEditor.js +21 -2
  134. package/dist/profiles/editor/profileEditor.js.map +1 -1
  135. package/dist/profiles/editor/profileSaveAsDialog.cjs +85 -0
  136. package/dist/profiles/editor/profileSaveAsDialog.cjs.map +1 -0
  137. package/dist/profiles/editor/profileSaveAsDialog.d.ts +17 -0
  138. package/dist/profiles/editor/profileSaveAsDialog.d.ts.map +1 -0
  139. package/dist/profiles/editor/profileSaveAsDialog.js +85 -0
  140. package/dist/profiles/editor/profileSaveAsDialog.js.map +1 -0
  141. package/dist/profiles/processor/processorPipeline.cjs +16 -2
  142. package/dist/profiles/processor/processorPipeline.cjs.map +1 -1
  143. package/dist/profiles/processor/processorPipeline.d.ts.map +1 -1
  144. package/dist/profiles/processor/processorPipeline.js +16 -2
  145. package/dist/profiles/processor/processorPipeline.js.map +1 -1
  146. package/dist/rpc/SessionHeader.cjs +117 -111
  147. package/dist/rpc/SessionHeader.cjs.map +1 -1
  148. package/dist/rpc/SessionHeader.d.ts +3 -1
  149. package/dist/rpc/SessionHeader.d.ts.map +1 -1
  150. package/dist/rpc/SessionHeader.js +117 -111
  151. package/dist/rpc/SessionHeader.js.map +1 -1
  152. package/dist/runtime/barrels.json +8941 -8877
  153. package/dist/runtime/importmap.json +2146 -2129
  154. package/dist/styles.css +1 -1
  155. package/package.json +1 -1
@@ -7,6 +7,7 @@ import { UiTable } from "../../icons/components/UiTable.js";
7
7
  import { cloneProfileDraft, mergeSampledProfileColumns, profileColumnResetState, profileEditorSectionStatus, profileEditorSections, profileGeneralOptionKeys, profileSampleSignature, profileUpdateConflictTarget, resetProfileColumns, validateProfileEditorDraft } from "./profileEditorModel.js";
8
8
  import { ProfileEditorPreview } from "./profileEditorPreview.js";
9
9
  import { ProfileEditorRail } from "./profileEditorRail.js";
10
+ import { ProfileSaveAsDialog } from "./profileSaveAsDialog.js";
10
11
  import { ProfileGeneralSection, ProfileSchemaSection, ProfileSourceSection } from "./profileEditorSections.js";
11
12
  import { ProfileFieldSidebarList } from "../fields/profileFieldList.js";
12
13
  import { ProfileFieldEditorForm, profileFieldEditorEmptyMessage } from "../fields/profileFieldEditor.js";
@@ -32,7 +33,7 @@ var ProfileEditorRaw = lazy(() => import("./profileEditorRaw.js").then((module)
32
33
  * across visits. Collection fields stay in the rail while the selected item is
33
34
  * edited in the center, keeping names and icons visible throughout the edit.
34
35
  */
35
- function ProfileEditor({ client, action, surfaceKey, initialValue, onClose, onSuccess }) {
36
+ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue, onClose, onSuccess }) {
36
37
  const lookupFetcher = useOperationLookupFetcher(client);
37
38
  const initialDraft = useMemo(() => cloneProfileDraft(initialValue), [initialValue]);
38
39
  const initialSerialized = useMemo(() => JSON.stringify(initialDraft), [initialDraft]);
@@ -50,6 +51,7 @@ function ProfileEditor({ client, action, surfaceKey, initialValue, onClose, onSu
50
51
  const [saving, setSaving] = useState(false);
51
52
  const [error, setError] = useState("");
52
53
  const [replaceTarget, setReplaceTarget] = useState("");
54
+ const [savingAs, setSavingAs] = useState(false);
53
55
  const [confirmDiscard, setConfirmDiscard] = useState(false);
54
56
  const [confirmResetColumns, setConfirmResetColumns] = useState(false);
55
57
  const dirty = JSON.stringify(draft) !== initialSerialized;
@@ -57,6 +59,7 @@ function ProfileEditor({ client, action, surfaceKey, initialValue, onClose, onSu
57
59
  const traces = draft.render === "traces";
58
60
  const obsolete = traces ? obsoleteSpanColumns(draft.columns ?? [], discovered) : [];
59
61
  const validationError = validateProfileEditorDraft(draft) ?? (obsolete.length ? `Columns require normalized sources: ${obsolete.join(", ")}. Reset to default or remove them.` : null);
62
+ const saveBlocked = saving || Boolean(validationError) || section === "raw" && !rawValid;
60
63
  const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;
61
64
  const resetState = traces ? {
62
65
  visible: true,
@@ -426,10 +429,19 @@ function ProfileEditor({ client, action, surfaceKey, initialValue, onClose, onSu
426
429
  onClick: leave,
427
430
  children: "Discard"
428
431
  }),
432
+ createAction ? /* @__PURE__ */ jsx(Button, {
433
+ type: "button",
434
+ size: "sm",
435
+ variant: "outline",
436
+ disabled: saveBlocked,
437
+ title: validationError ?? void 0,
438
+ onClick: () => setSavingAs(true),
439
+ children: "Save as new…"
440
+ }) : null,
429
441
  /* @__PURE__ */ jsx(Button, {
430
442
  type: "button",
431
443
  size: "sm",
432
- disabled: saving || Boolean(validationError) || section === "raw" && !rawValid,
444
+ disabled: saveBlocked,
433
445
  title: validationError ?? void 0,
434
446
  onClick: () => void save(),
435
447
  children: saving ? "Saving…" : "Save profile"
@@ -498,6 +510,13 @@ function ProfileEditor({ client, action, surfaceKey, initialValue, onClose, onSu
498
510
  ]
499
511
  })
500
512
  }) : null,
513
+ savingAs && createAction ? /* @__PURE__ */ jsx(ProfileSaveAsDialog, {
514
+ client,
515
+ action: createAction,
516
+ draft,
517
+ onCancel: () => setSavingAs(false),
518
+ onSaved: onSuccess
519
+ }) : null,
501
520
  replaceTarget ? /* @__PURE__ */ jsx(Modal, {
502
521
  open: true,
503
522
  onClose: () => setReplaceTarget(""),
@@ -1 +1 @@
1
- {"version":3,"file":"profileEditor.js","names":["_Fragment"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { UiListTree, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileSourceSection,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport type {\n ProfileColumn,\n ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport type {\n ProcessorPreset,\n ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns, obsoleteSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const obsolete = traces ? obsoleteSpanColumns(draft.columns ?? [], discovered) : [];\n const validationError = validateProfileEditorDraft(draft) ?? (obsolete.length ? `Columns require normalized sources: ${obsolete.join(\", \")}. Reset to default or remove them.` : null);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const processorPresets = useMemo(() => {\n const processorSchema = profileSchema().properties?.processors;\n return (\n (processorSchema?.[\"x-clicky-presets\"] as\n | Record<string, ProcessorPreset>\n | undefined) ?? {}\n );\n }, []);\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n setMappingRows(mappingInputRows);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:async () => {\n const response = await fetch(profileApiPath(\"profile/sample\"), {method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({profile:sampleRequestProfile(initialDraft),params:{},previewProcessors:true})});\n if (!response.ok) throw new Error(await response.text());\n return await response.json() as Omit<ProfileSample,\"sourceDraft\">;\n },\n });\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileSourceSection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n presets={processorPresets}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes = useMemo<WorkspacePaneSpec[]>(() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n presets={processorPresets}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeight: 120,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleRows.length\n ? `${sampleRows.length} sampled rows · updates as you edit`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={draft.render === \"traces\" ? mappingRows : sampleRows}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n />\n ),\n });\n }\n return result;\n }, [\n activeParameter,\n activeProcessor,\n draft,\n fields,\n resetState,\n sampleRows,\n mappingRows,\n sampleStale,\n section,\n sectionContent,\n processorPresets,\n processors,\n setProcessors,\n traces,\n acceptNormalized,\n ]);\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"truncate text-sm text-destructive\">{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={\n saving ||\n Boolean(validationError) ||\n (section === \"raw\" && !rawValid)\n }\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n return profileEditorSections.find((entry) => entry.id === section)!.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgEA,IAAM,mBAAmB,WACvB,OAAO,wBAAqB,CAAC,MAAM,YAAY,EAC7C,SAAS,OAAO,iBAClB,EAAE,CACJ;;;;;;;;;;AAWA,SAAgB,cAAc,EAC5B,QACA,QACA,YACA,cACA,SACA,aAQC;CACD,MAAM,gBAAgB,0BAA0B,MAAM;CACtD,MAAM,eAAe,cACb,kBAAkB,YAAY,GACpC,CAAC,YAAY,CACf;CACA,MAAM,oBAAoB,cAClB,KAAK,UAAU,YAAY,GACjC,CAAC,YAAY,CACf;CACA,MAAM,CAAC,OAAO,YAAY,SAA6B,YAAY;CACnE,MAAM,CAAC,SAAS,cAAc,SAA+B,aAAa,WAAW,WAAW,UAAU,SAAS;CACnH,MAAM,CAAC,YAAY,iBAAiB,SAClC,aAAa,WAAW,WAAW,mBAAmB,IAAI,aAAa,WAAW,CAAC,CACrF;CACA,MAAM,CAAC,gBAAgB,qBAAqB,SAA0B,CAAC,CAAC;CACxE,MAAM,CAAC,YAAY,iBAAiB,SAAoC,CAAC,CAAC;CAC1E,MAAM,CAAC,aAAa,kBAAkB,SAAoC,CAAC,CAAC;CAC5E,MAAM,CAAC,aAAa,kBAAkB,SACpC,aAAa,UAAU,EAAE,EAAE,QAAQ,EACrC;CACA,MAAM,CAAC,iBAAiB,sBAAsB,SAAS,CAAC;CACxD,MAAM,CAAC,iBAAiB,sBAAsB,SAAS,CAAC;CACxD,MAAM,CAAC,qBAAqB,0BAA0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,QAAD;MACE,MAAK;MACL,SAAQ;MACR,UAAU,WAAW;MACrB,SAAS;MAER,UAAA,SAAS,qBAAqB;KACzB,CAAA,CACL;;IAGP,UAAA,qBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MAClC,OAAO;MAAgB;MAC/B,OAAO,oBAAoB,IAAI,KAAK;MAAI;MAAM;MAC9C,SAAS,kCAAkC,GAAG,eAAe,OAAO;MAAiC;KAIrG;;GACE,CAAA,IACL;GAEH,gBACC,oBAAC,OAAD;IACE,MAAA;IACA,eAAe,iBAAiB,EAAE;IAClC,OAAO,WAAW,cAAc;IAChC,MAAK;IACL,QACE,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,oBAAC,QAAD;MACE,MAAK;MACL,SAAQ;MACR,eAAe,iBAAiB,EAAE;MACnC,UAAA;KAEO,CAAA,GACR,oBAAC,QAAD;MACE,MAAK;MACL,SAAQ;MACR,UAAU;MACV,eAAe;OACb,iBAAiB,EAAE;OACnB,KAAU,IAAI;MAChB;MACD,UAAA;KAEO,CAAA,CACL;;IAGP,UAAA,qBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MAC1B;MAAc;KAG9B;;GACE,CAAA,IACL;EAC8B;;AAExC;AAEA,SAAS,aAAa,SAAuC;CAC3D,OAAO,sBAAsB,MAAM,UAAU,MAAM,OAAO,OAAO,CAAC,CAAE;AACtE"}
1
+ {"version":3,"file":"profileEditor.js","names":["_Fragment"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { UiListTree, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileSourceSection,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport type {\n ProfileColumn,\n ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport type {\n ProcessorPreset,\n ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns, obsoleteSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const obsolete = traces ? obsoleteSpanColumns(draft.columns ?? [], discovered) : [];\n const validationError = validateProfileEditorDraft(draft) ?? (obsolete.length ? `Columns require normalized sources: ${obsolete.join(\", \")}. Reset to default or remove them.` : null);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const processorPresets = useMemo(() => {\n const processorSchema = profileSchema().properties?.processors;\n return (\n (processorSchema?.[\"x-clicky-presets\"] as\n | Record<string, ProcessorPreset>\n | undefined) ?? {}\n );\n }, []);\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n setMappingRows(mappingInputRows);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:async () => {\n const response = await fetch(profileApiPath(\"profile/sample\"), {method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({profile:sampleRequestProfile(initialDraft),params:{},previewProcessors:true})});\n if (!response.ok) throw new Error(await response.text());\n return await response.json() as Omit<ProfileSample,\"sourceDraft\">;\n },\n });\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileSourceSection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n presets={processorPresets}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes = useMemo<WorkspacePaneSpec[]>(() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n presets={processorPresets}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeight: 120,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleRows.length\n ? `${sampleRows.length} sampled rows · updates as you edit`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={draft.render === \"traces\" ? mappingRows : sampleRows}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n />\n ),\n });\n }\n return result;\n }, [\n activeParameter,\n activeProcessor,\n draft,\n fields,\n resetState,\n sampleRows,\n mappingRows,\n sampleStale,\n section,\n sectionContent,\n processorPresets,\n processors,\n setProcessors,\n traces,\n acceptNormalized,\n ]);\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"truncate text-sm text-destructive\">{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={onSuccess}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n return profileEditorSections.find((entry) => entry.id === section)!.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,IAAM,mBAAmB,WACvB,OAAO,wBAAqB,CAAC,MAAM,YAAY,EAC7C,SAAS,OAAO,iBAClB,EAAE,CACJ;;;;;;;;;;AAWA,SAAgB,cAAc,EAC5B,QACA,QACA,cACA,YACA,cACA,SACA,aAYC;CACD,MAAM,gBAAgB,0BAA0B,MAAM;CACtD,MAAM,eAAe,cACb,kBAAkB,YAAY,GACpC,CAAC,YAAY,CACf;CACA,MAAM,oBAAoB,cAClB,KAAK,UAAU,YAAY,GACjC,CAAC,YAAY,CACf;CACA,MAAM,CAAC,OAAO,YAAY,SAA6B,YAAY;CACnE,MAAM,CAAC,SAAS,cAAc,SAA+B,aAAa,WAAW,WAAW,UAAU,SAAS;CACnH,MAAM,CAAC,YAAY,iBAAiB,SAClC,aAAa,WAAW,WAAW,mBAAmB,IAAI,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,oBAAC,QAAD;MACE,MAAK;MACL,SAAQ;MACR,UAAU;MACV,eAAe;OACb,iBAAiB,EAAE;OACnB,KAAU,IAAI;MAChB;MACD,UAAA;KAEO,CAAA,CACL;;IAGP,UAAA,qBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MAC1B;MAAc;KAG9B;;GACE,CAAA,IACL;EAC8B;;AAExC;AAEA,SAAS,aAAa,SAAuC;CAC3D,OAAO,sBAAsB,MAAM,UAAU,MAAM,OAAO,OAAO,CAAC,CAAE;AACtE"}
@@ -0,0 +1,85 @@
1
+ const require_button = require("../../components/button.cjs");
2
+ const require_InputField = require("../../components/InputField.cjs");
3
+ const require_Modal = require("../../overlay/Modal.cjs");
4
+ let react = require("react");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ // src/profiles/editor/profileSaveAsDialog.tsx
7
+ /**
8
+ * Saves the editor's draft as a new profile through the profiles collection's
9
+ * create operation, leaving the profile being edited as it was. The server
10
+ * refuses a name already in use, and the refusal stays in the dialog so the
11
+ * user can pick another.
12
+ */
13
+ function ProfileSaveAsDialog({ client, action, draft, onCancel, onSaved }) {
14
+ const [name, setName] = (0, react.useState)(`${draft.profile ?? "profile"}-copy`);
15
+ const [saving, setSaving] = (0, react.useState)(false);
16
+ const [error, setError] = (0, react.useState)("");
17
+ const trimmed = name.trim();
18
+ const save = async () => {
19
+ if (!client.submitForm) {
20
+ setError("Profile creation is unavailable");
21
+ return;
22
+ }
23
+ setSaving(true);
24
+ setError("");
25
+ try {
26
+ const response = await client.submitForm(action.path, action.method, {
27
+ ...draft,
28
+ profile: trimmed
29
+ });
30
+ if (!response.success) throw new Error(response.error || response.message || "Profile creation failed");
31
+ await onSaved(trimmed);
32
+ } catch (saveError) {
33
+ setError(saveError instanceof Error ? saveError.message : "Profile creation failed");
34
+ } finally {
35
+ setSaving(false);
36
+ }
37
+ };
38
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Modal.Modal, {
39
+ open: true,
40
+ onClose: onCancel,
41
+ title: "Save as a new profile",
42
+ size: "sm",
43
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
44
+ className: "flex w-full justify-end gap-2",
45
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_button.Button, {
46
+ type: "button",
47
+ variant: "ghost",
48
+ onClick: onCancel,
49
+ children: "Cancel"
50
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_button.Button, {
51
+ type: "button",
52
+ disabled: saving || !trimmed,
53
+ onClick: () => void save(),
54
+ children: saving ? "Saving…" : "Save as new profile"
55
+ })]
56
+ }),
57
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
58
+ className: "space-y-3",
59
+ children: [
60
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
61
+ className: "text-sm text-muted-foreground",
62
+ children: [
63
+ "Your changes are saved under the new name. ",
64
+ draft.profile ?? "This profile",
65
+ " stays as it was."
66
+ ]
67
+ }),
68
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_InputField.InputField, {
69
+ "aria-label": "New profile name",
70
+ value: name,
71
+ onChange: setName,
72
+ autoFocus: true
73
+ }),
74
+ error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
75
+ role: "alert",
76
+ className: "text-sm text-destructive",
77
+ children: error
78
+ }) : null
79
+ ]
80
+ })
81
+ });
82
+ }
83
+ exports.ProfileSaveAsDialog = ProfileSaveAsDialog;
84
+
85
+ //# sourceMappingURL=profileSaveAsDialog.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profileSaveAsDialog.cjs","names":["useState","Modal","Button","InputField"],"sources":["../../../src/profiles/editor/profileSaveAsDialog.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { InputField } from \"../../components/InputField\";\nimport { Modal } from \"../../overlay/Modal\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\n\n/**\n * Saves the editor's draft as a new profile through the profiles collection's\n * create operation, leaving the profile being edited as it was. The server\n * refuses a name already in use, and the refusal stays in the dialog so the\n * user can pick another.\n */\nexport function ProfileSaveAsDialog({\n client,\n action,\n draft,\n onCancel,\n onSaved,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n draft: ProfileWizardDraft;\n onCancel: () => void;\n onSaved: (name: string) => void | Promise<void>;\n}) {\n const [name, setName] = useState(`${draft.profile ?? \"profile\"}-copy`);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const trimmed = name.trim();\n\n const save = async () => {\n if (!client.submitForm) {\n setError(\"Profile creation is unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const response = await client.submitForm(action.path, action.method, { ...draft, profile: trimmed });\n if (!response.success) throw new Error(response.error || response.message || \"Profile creation failed\");\n await onSaved(trimmed);\n } catch (saveError) {\n setError(saveError instanceof Error ? saveError.message : \"Profile creation failed\");\n } finally {\n setSaving(false);\n }\n };\n\n return (\n <Modal\n open\n onClose={onCancel}\n title=\"Save as a new profile\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button type=\"button\" variant=\"ghost\" onClick={onCancel}>\n Cancel\n </Button>\n <Button type=\"button\" disabled={saving || !trimmed} onClick={() => void save()}>\n {saving ? \"Saving…\" : \"Save as new profile\"}\n </Button>\n </div>\n }\n >\n <div className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n Your changes are saved under the new name. {draft.profile ?? \"This profile\"} stays as it was.\n </p>\n <InputField aria-label=\"New profile name\" value={name} onChange={setName} autoFocus />\n {error ? (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error}\n </p>\n ) : null}\n </div>\n </Modal>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,oBAAoB,EAClC,QACA,QACA,OACA,UACA,WAOC;CACD,M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AAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MACC,MAAM,WAAW;MAAe;KAC3E;;IACH,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;KAAY,cAAW;KAAmB,OAAO;KAAM,UAAU;KAAS,WAAA;IAAW,CAAA;IACpF,QACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,MAAK;KAAQ,WAAU;KACvB,UAAA;IACA,CAAA,IACD;GACD;;CACA,CAAA;AAEX"}
@@ -0,0 +1,17 @@
1
+ import { ResolvedOperation } from '../../rpc/types.js';
2
+ import { OperationsApiClient } from '../../rpc/useOperations.js';
3
+ import { ProfileWizardDraft } from '../wizard/profileWizardModel.js';
4
+ /**
5
+ * Saves the editor's draft as a new profile through the profiles collection's
6
+ * create operation, leaving the profile being edited as it was. The server
7
+ * refuses a name already in use, and the refusal stays in the dialog so the
8
+ * user can pick another.
9
+ */
10
+ export declare function ProfileSaveAsDialog({ client, action, draft, onCancel, onSaved, }: {
11
+ client: OperationsApiClient;
12
+ action: ResolvedOperation;
13
+ draft: ProfileWizardDraft;
14
+ onCancel: () => void;
15
+ onSaved: (name: string) => void | Promise<void>;
16
+ }): import("react").JSX.Element;
17
+ //# sourceMappingURL=profileSaveAsDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profileSaveAsDialog.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileSaveAsDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,OAAO,GACR,EAAE;IACD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD,+BAsDA"}
@@ -0,0 +1,85 @@
1
+ import { Button } from "../../components/button.js";
2
+ import { InputField } from "../../components/InputField.js";
3
+ import { Modal } from "../../overlay/Modal.js";
4
+ import { useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ // src/profiles/editor/profileSaveAsDialog.tsx
7
+ /**
8
+ * Saves the editor's draft as a new profile through the profiles collection's
9
+ * create operation, leaving the profile being edited as it was. The server
10
+ * refuses a name already in use, and the refusal stays in the dialog so the
11
+ * user can pick another.
12
+ */
13
+ function ProfileSaveAsDialog({ client, action, draft, onCancel, onSaved }) {
14
+ const [name, setName] = useState(`${draft.profile ?? "profile"}-copy`);
15
+ const [saving, setSaving] = useState(false);
16
+ const [error, setError] = useState("");
17
+ const trimmed = name.trim();
18
+ const save = async () => {
19
+ if (!client.submitForm) {
20
+ setError("Profile creation is unavailable");
21
+ return;
22
+ }
23
+ setSaving(true);
24
+ setError("");
25
+ try {
26
+ const response = await client.submitForm(action.path, action.method, {
27
+ ...draft,
28
+ profile: trimmed
29
+ });
30
+ if (!response.success) throw new Error(response.error || response.message || "Profile creation failed");
31
+ await onSaved(trimmed);
32
+ } catch (saveError) {
33
+ setError(saveError instanceof Error ? saveError.message : "Profile creation failed");
34
+ } finally {
35
+ setSaving(false);
36
+ }
37
+ };
38
+ return /* @__PURE__ */ jsx(Modal, {
39
+ open: true,
40
+ onClose: onCancel,
41
+ title: "Save as a new profile",
42
+ size: "sm",
43
+ footer: /* @__PURE__ */ jsxs("div", {
44
+ className: "flex w-full justify-end gap-2",
45
+ children: [/* @__PURE__ */ jsx(Button, {
46
+ type: "button",
47
+ variant: "ghost",
48
+ onClick: onCancel,
49
+ children: "Cancel"
50
+ }), /* @__PURE__ */ jsx(Button, {
51
+ type: "button",
52
+ disabled: saving || !trimmed,
53
+ onClick: () => void save(),
54
+ children: saving ? "Saving…" : "Save as new profile"
55
+ })]
56
+ }),
57
+ children: /* @__PURE__ */ jsxs("div", {
58
+ className: "space-y-3",
59
+ children: [
60
+ /* @__PURE__ */ jsxs("p", {
61
+ className: "text-sm text-muted-foreground",
62
+ children: [
63
+ "Your changes are saved under the new name. ",
64
+ draft.profile ?? "This profile",
65
+ " stays as it was."
66
+ ]
67
+ }),
68
+ /* @__PURE__ */ jsx(InputField, {
69
+ "aria-label": "New profile name",
70
+ value: name,
71
+ onChange: setName,
72
+ autoFocus: true
73
+ }),
74
+ error ? /* @__PURE__ */ jsx("p", {
75
+ role: "alert",
76
+ className: "text-sm text-destructive",
77
+ children: error
78
+ }) : null
79
+ ]
80
+ })
81
+ });
82
+ }
83
+ export { ProfileSaveAsDialog };
84
+
85
+ //# sourceMappingURL=profileSaveAsDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profileSaveAsDialog.js","names":[],"sources":["../../../src/profiles/editor/profileSaveAsDialog.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { InputField } from \"../../components/InputField\";\nimport { Modal } from \"../../overlay/Modal\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\n\n/**\n * Saves the editor's draft as a new profile through the profiles collection's\n * create operation, leaving the profile being edited as it was. The server\n * refuses a name already in use, and the refusal stays in the dialog so the\n * user can pick another.\n */\nexport function ProfileSaveAsDialog({\n client,\n action,\n draft,\n onCancel,\n onSaved,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n draft: ProfileWizardDraft;\n onCancel: () => void;\n onSaved: (name: string) => void | Promise<void>;\n}) {\n const [name, setName] = useState(`${draft.profile ?? \"profile\"}-copy`);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const trimmed = name.trim();\n\n const save = async () => {\n if (!client.submitForm) {\n setError(\"Profile creation is unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const response = await client.submitForm(action.path, action.method, { ...draft, profile: trimmed });\n if (!response.success) throw new Error(response.error || response.message || \"Profile creation failed\");\n await onSaved(trimmed);\n } catch (saveError) {\n setError(saveError instanceof Error ? saveError.message : \"Profile creation failed\");\n } finally {\n setSaving(false);\n }\n };\n\n return (\n <Modal\n open\n onClose={onCancel}\n title=\"Save as a new profile\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button type=\"button\" variant=\"ghost\" onClick={onCancel}>\n Cancel\n </Button>\n <Button type=\"button\" disabled={saving || !trimmed} onClick={() => void save()}>\n {saving ? \"Saving…\" : \"Save as new profile\"}\n </Button>\n </div>\n }\n >\n <div className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n Your changes are saved under the new name. {draft.profile ?? \"This profile\"} stays as it was.\n </p>\n <InputField aria-label=\"New profile name\" value={name} onChange={setName} autoFocus />\n {error ? (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error}\n </p>\n ) : null}\n </div>\n </Modal>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,oBAAoB,EAClC,QACA,QACA,OACA,UACA,WAOC;CACD,MAAM,CAAC,MAAM,WAAW,SAAS,GAAG,MAAM,WAAW,UAAU,MAAM;CACrE,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CACrC,MAAM,UAAU,KAAK,KAAK;CAE1B,MAAM,OAAO,YAAY;EACvB,IAAI,CAAC,OAAO,YAAY;GACtB,SAAS,iCAAiC;GAC1C;EACF;EACA,UAAU,IAAI;EACd,SAAS,EAAE;EACX,IAAI;GACF,MAAM,WAAW,MAAM,OAAO,WAAW,OAAO,MAAM,OAAO,QAAQ;IAAE,GAAG;IAAO,SAAS;GAAQ,CAAC;GACnG,IAAI,CAAC,SAAS,SAAS,MAAM,IAAI,MAAM,SAAS,SAAS,SAAS,WAAW,yBAAyB;GACtG,MAAM,QAAQ,OAAO;EACvB,SAAS,WAAW;GAClB,SAAS,qBAAqB,QAAQ,UAAU,UAAU,yBAAyB;EACrF,UAAU;GACR,UAAU,KAAK;EACjB;CACF;CAEA,OACE,oBAAC,OAAD;EACE,MAAA;EACA,SAAS;EACT,OAAM;EACN,MAAK;EACL,QACE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,QAAD;IAAQ,MAAK;IAAS,SAAQ;IAAQ,SAAS;IAAU,UAAA;GAEjD,CAAA,GACR,oBAAC,QAAD;IAAQ,MAAK;IAAS,UAAU,UAAU,CAAC;IAAS,eAAe,KAAK,KAAK;IAC1E,UAAA,SAAS,YAAY;GAChB,CAAA,CACL;;EAGP,UAAA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,qBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MACC,MAAM,WAAW;MAAe;KAC3E;;IACH,oBAAC,YAAD;KAAY,cAAW;KAAmB,OAAO;KAAM,UAAU;KAAS,WAAA;IAAW,CAAA;IACpF,QACC,oBAAC,KAAD;KAAG,MAAK;KAAQ,WAAU;KACvB,UAAA;IACA,CAAA,IACD;GACD;;CACA,CAAA;AAEX"}
@@ -155,9 +155,23 @@ function ProcessorPipeline({ steps, presets, onChange, profile, previewer = requ
155
155
  }),
156
156
  onPreview: () => void runPreview(),
157
157
  onChange: (next) => update(selected, next)
158
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
158
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
159
159
  className: "text-xs text-muted-foreground",
160
- children: "Add a processor to configure and preview it."
160
+ children: [
161
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DropdownMenu.DropdownMenu, {
162
+ trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
163
+ type: "button",
164
+ className: "font-medium text-primary underline-offset-2 hover:underline",
165
+ children: "Add a processor"
166
+ }),
167
+ className: "inline-flex align-baseline",
168
+ menuClassName: "min-w-64",
169
+ menuLabel: "Add processor",
170
+ items: addItems
171
+ }),
172
+ " ",
173
+ "to configure and preview it."
174
+ ]
161
175
  })
162
176
  }) : null]
163
177
  }), showEditor && preview ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_processorPreviewTable.ProcessorPreviewTable, {
@@ -1 +1 @@
1
- {"version":3,"file":"processorPipeline.cjs","names":["previewProfileProcessors","useState","processorPreviewParams","processorPreviewParamDefaults","pagingBlock","effectiveType","PROCESSOR_CONFIG_KEYS","cn","Icon","UiFunnelData","Badge","reorder","DropdownMenu","UiAdd","ProcessorPipelineEditor","missingProcessorPreviewParams","ProcessorPreviewTable","validateProcessor","processorStageRows","UiWarningTriangle","UiArrowUp","UiArrowDown","UiTrash"],"sources":["../../../src/profiles/processor/processorPipeline.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Badge } from \"../../data/Badge\";\nimport { Icon } from \"../../data/Icon\";\nimport { DropdownMenu } from \"../../overlay/DropdownMenu\";\nimport {\n UiAdd,\n UiArrowDown,\n UiArrowUp,\n UiFunnelData,\n UiTrash,\n UiWarningTriangle,\n} from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport {\n effectiveType,\n PROCESSOR_CONFIG_KEYS,\n pagingBlock,\n reorder,\n validateProcessor,\n type ProcessorPreset,\n type ProcessorSpec,\n} from \"./processorConfig\";\nimport { ProcessorPipelineEditor } from \"./processorPipelineEditor\";\nimport {\n previewProfileProcessors,\n processorStageRows,\n type ProcessorPreview,\n type ProcessorSampleResult,\n} from \"./processorPreview\";\nimport { ProcessorPreviewTable } from \"./processorPreviewTable\";\nimport {\n missingProcessorPreviewParams,\n processorPreviewParamDefaults,\n processorPreviewParams,\n} from \"./processorSampleParams\";\n\nexport type ProcessorPreviewer = (\n profile: unknown,\n params?: Record<string, unknown>,\n) => Promise<ProcessorSampleResult>;\n\nexport function ProcessorPipeline({\n steps,\n presets,\n onChange,\n profile,\n previewer = previewProfileProcessors,\n selectedIndex,\n onSelectedIndexChange,\n showSteps = true,\n showEditor = true,\n tree = false,\n}: {\n steps: ProcessorSpec[];\n presets: Record<string, ProcessorPreset>;\n onChange: (next: ProcessorSpec[]) => void;\n profile: unknown;\n previewer?: ProcessorPreviewer;\n selectedIndex?: number;\n onSelectedIndexChange?: (index: number) => void;\n showSteps?: boolean;\n showEditor?: boolean;\n tree?: boolean;\n}) {\n const [innerSelected, setInnerSelected] = useState(0);\n const requestedSelected = selectedIndex ?? innerSelected;\n const selected =\n steps.length === 0\n ? 0\n : Math.max(0, Math.min(requestedSelected, steps.length - 1));\n const [preview, setPreview] = useState<ProcessorPreview>();\n const [previewing, setPreviewing] = useState(false);\n const [previewError, setPreviewError] = useState(\"\");\n const params = processorPreviewParams(profile);\n const paramsSignature = JSON.stringify(params);\n const [sampleParams, setSampleParams] = useState<Record<string, unknown>>(\n () => processorPreviewParamDefaults(params),\n );\n const signature = JSON.stringify({ profile, steps });\n const step = steps[selected];\n const blocks = steps\n .map((entry) =>\n pagingBlock(\n effectiveType(entry, entry.use ? presets[entry.use] : undefined),\n ),\n )\n .filter((block): block is NonNullable<typeof block> => Boolean(block));\n const addItems = [\n ...Object.entries(presets)\n .sort(([, left], [, right]) =>\n (left.title ?? \"\").localeCompare(right.title ?? \"\"),\n )\n .map(([name, preset]) => ({\n label: preset.title ?? name,\n group: \"Library presets\",\n ...(preset.description ? { title: preset.description } : {}),\n onSelect: () => {\n onChange([...steps, { use: name }]);\n select(steps.length);\n },\n })),\n ...Object.keys(PROCESSOR_CONFIG_KEYS)\n .sort()\n .map((type) => ({\n label: type,\n group: \"Processor types\",\n onSelect: () => {\n onChange([...steps, { type }]);\n select(steps.length);\n },\n })),\n ];\n\n function select(index: number) {\n if (selectedIndex === undefined) setInnerSelected(index);\n onSelectedIndexChange?.(index);\n }\n\n useEffect(() => {\n setPreview(undefined);\n setPreviewError(\"\");\n }, [signature]);\n\n useEffect(() => {\n setSampleParams(processorPreviewParamDefaults(params));\n }, [paramsSignature]);\n\n const update = (index: number, next: ProcessorSpec) =>\n onChange(\n steps.map((entry, position) => (position === index ? next : entry)),\n );\n\n const runPreview = async () => {\n setPreviewing(true);\n setPreviewError(\"\");\n try {\n const result = await previewer(\n withCurrentProcessors(profile, steps),\n sampleParams,\n );\n if (!result.processorPreview) {\n throw new Error(\n \"Processor preview response did not include processorPreview\",\n );\n }\n setPreview(result.processorPreview);\n } catch (error) {\n setPreview(undefined);\n setPreviewError(\n error instanceof Error ? error.message : \"Processor preview failed\",\n );\n } finally {\n setPreviewing(false);\n }\n };\n\n return (\n <div className=\"space-y-3\">\n <div\n className={cn(\n \"grid gap-3\",\n showSteps && showEditor\n ? \"lg:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)]\"\n : \"grid-cols-1\",\n )}\n >\n {showSteps ? (\n <section className=\"space-y-1\">\n <div className=\"flex items-center gap-1.5 pb-1 text-[11px] text-muted-foreground\">\n <Icon icon={UiFunnelData} className=\"text-[13px]\" />\n Runs in order after aliases, filters and columns\n {preview ? (\n <Badge tone=\"neutral\" variant=\"soft\" size=\"md\">\n {preview.input.length} rows in\n </Badge>\n ) : null}\n </div>\n\n {steps.length === 0 ? (\n <p\n data-profile-tree-item={tree ? \"\" : undefined}\n className={cn(\n \"text-xs text-muted-foreground\",\n tree\n ? \"relative rounded-md px-2 py-2\"\n : \"rounded border border-dashed border-border px-2 py-3 text-center\",\n )}\n >\n No post-query steps.\n </p>\n ) : null}\n\n {steps.map((entry, index) => (\n <StepCard\n key={index}\n step={entry}\n preset={entry.use ? presets[entry.use] : undefined}\n preview={preview?.stages[index]}\n selected={index === selected}\n first={index === 0}\n last={index === steps.length - 1}\n tree={tree}\n onSelect={() => select(index)}\n onMove={(direction) => {\n onChange(reorder(steps, index, index + direction));\n select(index + direction);\n }}\n onRemove={() => {\n onChange(steps.filter((_, position) => position !== index));\n select(Math.max(0, Math.min(index, steps.length - 2)));\n }}\n />\n ))}\n\n <div\n data-profile-tree-item={tree ? \"\" : undefined}\n className={tree ? \"relative\" : undefined}\n >\n <DropdownMenu\n label=\"Add processor\"\n icon={UiAdd}\n variant={tree ? \"ghost\" : \"outline\"}\n size=\"sm\"\n className=\"w-full [&>button]:w-full [&>button]:justify-start\"\n menuClassName=\"min-w-64\"\n menuLabel=\"Add processor\"\n items={addItems}\n />\n </div>\n\n {blocks.length > 0 ? <PagingNotice blocks={blocks} /> : null}\n </section>\n ) : null}\n\n {showEditor ? (\n <section className=\"rounded-lg border border-border p-3\">\n {step ? (\n <ProcessorPipelineEditor\n step={step}\n preset={step.use ? presets[step.use] : undefined}\n profile={withCurrentProcessors(profile, steps)}\n previewing={previewing}\n previewError={previewError}\n params={params}\n paramValues={sampleParams}\n missingParams={missingProcessorPreviewParams(\n params,\n sampleParams,\n )}\n onParamChange={(name, value) =>\n setSampleParams((current) => {\n const next = { ...current };\n if (value === undefined) delete next[name];\n else next[name] = value;\n return next;\n })\n }\n onPreview={() => void runPreview()}\n onChange={(next) => update(selected, next)}\n />\n ) : (\n <p className=\"text-xs text-muted-foreground\">\n Add a processor to configure and preview it.\n </p>\n )}\n </section>\n ) : null}\n </div>\n\n {showEditor && preview ? (\n <ProcessorPreviewTable preview={preview} selected={selected} />\n ) : null}\n </div>\n );\n}\n\nfunction StepCard({\n step,\n preset,\n preview,\n selected,\n first,\n last,\n tree,\n onSelect,\n onMove,\n onRemove,\n}: {\n step: ProcessorSpec;\n preset: ProcessorPreset | undefined;\n preview: ProcessorPreview[\"stages\"][number] | undefined;\n selected: boolean;\n first: boolean;\n last: boolean;\n tree: boolean;\n onSelect: () => void;\n onMove: (direction: number) => void;\n onRemove: () => void;\n}) {\n const type = effectiveType(step, preset);\n const issues = validateProcessor(step, preset);\n const errors = issues.filter((issue) => issue.severity === \"error\").length;\n const warnings = issues.length - errors;\n const block = pagingBlock(type);\n const title = preset?.title ?? step.use ?? type ?? \"unconfigured\";\n\n return (\n <div\n data-profile-tree-item={tree ? \"\" : undefined}\n className={cn(\n \"relative flex items-center gap-2 px-2 py-2\",\n tree ? \"rounded-md\" : \"rounded-lg border\",\n selected\n ? tree\n ? \"bg-primary/[0.08]\"\n : \"border-primary/50 bg-primary/[0.05] ring-1 ring-primary/20\"\n : tree\n ? \"hover:bg-muted/50\"\n : \"border-border hover:bg-muted/50\",\n )}\n >\n <Icon\n icon={UiFunnelData}\n className=\"shrink-0 text-[14px] text-muted-foreground\"\n />\n <button\n type=\"button\"\n aria-label={`Edit ${title}`}\n onClick={onSelect}\n className=\"min-w-0 flex-1 text-left\"\n >\n <div className=\"flex flex-wrap items-center gap-1.5\">\n <span className=\"truncate text-sm font-medium\">{title}</span>\n {block ? (\n <span title={block.reason}>\n <Badge\n tone={block.kind === \"inherent\" ? \"warning\" : \"neutral\"}\n variant=\"soft\"\n size=\"md\"\n clickToCopy={false}\n >\n {block.kind === \"inherent\" ? \"needs all rows\" : \"could page\"}\n </Badge>\n </span>\n ) : null}\n {preview ? (\n <Badge tone=\"success\" variant=\"soft\" size=\"md\" clickToCopy={false}>\n {processorStageRows(preview)}\n </Badge>\n ) : null}\n {errors > 0 ? (\n <Badge\n tone=\"danger\"\n variant=\"soft\"\n size=\"md\"\n icon={UiWarningTriangle}\n clickToCopy={false}\n >\n {errors}\n </Badge>\n ) : null}\n {warnings > 0 ? (\n <Badge tone=\"warning\" variant=\"soft\" size=\"md\" clickToCopy={false}>\n {warnings}\n </Badge>\n ) : null}\n </div>\n <p className=\"truncate font-mono text-[11px] text-muted-foreground\">\n {type || \"no type\"}\n </p>\n </button>\n <div className=\"flex shrink-0 flex-col\">\n <button\n type=\"button\"\n aria-label={`Move ${title} up`}\n disabled={first}\n onClick={() => onMove(-1)}\n className=\"rounded px-1 text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30\"\n >\n <Icon icon={UiArrowUp} className=\"text-[11px]\" />\n </button>\n <button\n type=\"button\"\n aria-label={`Move ${title} down`}\n disabled={last}\n onClick={() => onMove(1)}\n className=\"rounded px-1 text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30\"\n >\n <Icon icon={UiArrowDown} className=\"text-[11px]\" />\n </button>\n </div>\n <button\n type=\"button\"\n aria-label={`Remove ${title}`}\n onClick={onRemove}\n className=\"shrink-0 rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive\"\n >\n <Icon icon={UiTrash} className=\"text-[13px]\" />\n </button>\n </div>\n );\n}\n\nfunction PagingNotice({\n blocks,\n}: {\n blocks: { kind: \"inherent\" | \"gap\"; reason: string }[];\n}) {\n return (\n <div className=\"mt-2 space-y-1 rounded border border-amber-500/40 bg-amber-500/[0.06] p-2\">\n <div className=\"flex items-center gap-1.5 text-[11px] font-medium\">\n <Icon\n icon={UiWarningTriangle}\n className=\"text-[12px] text-amber-600 [[data-theme=dark]_&]:text-amber-400\"\n />\n This profile can no longer be paged\n </div>\n <p className=\"text-[11px] text-muted-foreground\">\n These steps cannot run page by page, so every page is cut from a full\n run of the query.\n {blocks.every((block) => block.kind === \"gap\")\n ? \" None needs the whole result; the per-page interface is unimplemented.\"\n : \"\"}\n </p>\n </div>\n );\n}\n\nfunction withCurrentProcessors(\n profile: unknown,\n processors: ProcessorSpec[],\n): unknown {\n if (!profile || typeof profile !== \"object\" || Array.isArray(profile))\n return profile;\n return { ...profile, processors };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,SAAgB,kBAAkB,EAChC,OACA,SACA,UACA,SACA,YAAYA,yBAAAA,0BACZ,eACA,uBACA,YAAY,MACZ,aAAa,MACb,OAAO,SAYN;CACD,MAAM,CAAC,eAAe,qBAAA,GAAoBC,MAAAA,SAAAA,CAAS,CAAC;CACpD,MAAM,oBAAoB,iBAAiB;CAC3C,MAAM,WACJ,MAAM,WAAW,IACb,IACA,KAAK,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ACH;EACA,CAAA,CAAA;;AAET;AAEA,SAAS,sBACP,SACA,YACS;CACT,IAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAClE,OAAO;CACT,OAAO;EAAE,GAAG;EAAS;CAAW;AAClC"}
1
+ {"version":3,"file":"processorPipeline.cjs","names":["previewProfileProcessors","useState","processorPreviewParams","processorPreviewParamDefaults","pagingBlock","effectiveType","PROCESSOR_CONFIG_KEYS","cn","Icon","UiFunnelData","Badge","reorder","DropdownMenu","UiAdd","ProcessorPipelineEditor","missingProcessorPreviewParams","ProcessorPreviewTable","validateProcessor","processorStageRows","UiWarningTriangle","UiArrowUp","UiArrowDown","UiTrash"],"sources":["../../../src/profiles/processor/processorPipeline.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Badge } from \"../../data/Badge\";\nimport { Icon } from \"../../data/Icon\";\nimport { DropdownMenu } from \"../../overlay/DropdownMenu\";\nimport {\n UiAdd,\n UiArrowDown,\n UiArrowUp,\n UiFunnelData,\n UiTrash,\n UiWarningTriangle,\n} from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport {\n effectiveType,\n PROCESSOR_CONFIG_KEYS,\n pagingBlock,\n reorder,\n validateProcessor,\n type ProcessorPreset,\n type ProcessorSpec,\n} from \"./processorConfig\";\nimport { ProcessorPipelineEditor } from \"./processorPipelineEditor\";\nimport {\n previewProfileProcessors,\n processorStageRows,\n type ProcessorPreview,\n type ProcessorSampleResult,\n} from \"./processorPreview\";\nimport { ProcessorPreviewTable } from \"./processorPreviewTable\";\nimport {\n missingProcessorPreviewParams,\n processorPreviewParamDefaults,\n processorPreviewParams,\n} from \"./processorSampleParams\";\n\nexport type ProcessorPreviewer = (\n profile: unknown,\n params?: Record<string, unknown>,\n) => Promise<ProcessorSampleResult>;\n\nexport function ProcessorPipeline({\n steps,\n presets,\n onChange,\n profile,\n previewer = previewProfileProcessors,\n selectedIndex,\n onSelectedIndexChange,\n showSteps = true,\n showEditor = true,\n tree = false,\n}: {\n steps: ProcessorSpec[];\n presets: Record<string, ProcessorPreset>;\n onChange: (next: ProcessorSpec[]) => void;\n profile: unknown;\n previewer?: ProcessorPreviewer;\n selectedIndex?: number;\n onSelectedIndexChange?: (index: number) => void;\n showSteps?: boolean;\n showEditor?: boolean;\n tree?: boolean;\n}) {\n const [innerSelected, setInnerSelected] = useState(0);\n const requestedSelected = selectedIndex ?? innerSelected;\n const selected =\n steps.length === 0\n ? 0\n : Math.max(0, Math.min(requestedSelected, steps.length - 1));\n const [preview, setPreview] = useState<ProcessorPreview>();\n const [previewing, setPreviewing] = useState(false);\n const [previewError, setPreviewError] = useState(\"\");\n const params = processorPreviewParams(profile);\n const paramsSignature = JSON.stringify(params);\n const [sampleParams, setSampleParams] = useState<Record<string, unknown>>(\n () => processorPreviewParamDefaults(params),\n );\n const signature = JSON.stringify({ profile, steps });\n const step = steps[selected];\n const blocks = steps\n .map((entry) =>\n pagingBlock(\n effectiveType(entry, entry.use ? presets[entry.use] : undefined),\n ),\n )\n .filter((block): block is NonNullable<typeof block> => Boolean(block));\n const addItems = [\n ...Object.entries(presets)\n .sort(([, left], [, right]) =>\n (left.title ?? \"\").localeCompare(right.title ?? \"\"),\n )\n .map(([name, preset]) => ({\n label: preset.title ?? name,\n group: \"Library presets\",\n ...(preset.description ? { title: preset.description } : {}),\n onSelect: () => {\n onChange([...steps, { use: name }]);\n select(steps.length);\n },\n })),\n ...Object.keys(PROCESSOR_CONFIG_KEYS)\n .sort()\n .map((type) => ({\n label: type,\n group: \"Processor types\",\n onSelect: () => {\n onChange([...steps, { type }]);\n select(steps.length);\n },\n })),\n ];\n\n function select(index: number) {\n if (selectedIndex === undefined) setInnerSelected(index);\n onSelectedIndexChange?.(index);\n }\n\n useEffect(() => {\n setPreview(undefined);\n setPreviewError(\"\");\n }, [signature]);\n\n useEffect(() => {\n setSampleParams(processorPreviewParamDefaults(params));\n }, [paramsSignature]);\n\n const update = (index: number, next: ProcessorSpec) =>\n onChange(\n steps.map((entry, position) => (position === index ? next : entry)),\n );\n\n const runPreview = async () => {\n setPreviewing(true);\n setPreviewError(\"\");\n try {\n const result = await previewer(\n withCurrentProcessors(profile, steps),\n sampleParams,\n );\n if (!result.processorPreview) {\n throw new Error(\n \"Processor preview response did not include processorPreview\",\n );\n }\n setPreview(result.processorPreview);\n } catch (error) {\n setPreview(undefined);\n setPreviewError(\n error instanceof Error ? error.message : \"Processor preview failed\",\n );\n } finally {\n setPreviewing(false);\n }\n };\n\n return (\n <div className=\"space-y-3\">\n <div\n className={cn(\n \"grid gap-3\",\n showSteps && showEditor\n ? \"lg:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)]\"\n : \"grid-cols-1\",\n )}\n >\n {showSteps ? (\n <section className=\"space-y-1\">\n <div className=\"flex items-center gap-1.5 pb-1 text-[11px] text-muted-foreground\">\n <Icon icon={UiFunnelData} className=\"text-[13px]\" />\n Runs in order after aliases, filters and columns\n {preview ? (\n <Badge tone=\"neutral\" variant=\"soft\" size=\"md\">\n {preview.input.length} rows in\n </Badge>\n ) : null}\n </div>\n\n {steps.length === 0 ? (\n <p\n data-profile-tree-item={tree ? \"\" : undefined}\n className={cn(\n \"text-xs text-muted-foreground\",\n tree\n ? \"relative rounded-md px-2 py-2\"\n : \"rounded border border-dashed border-border px-2 py-3 text-center\",\n )}\n >\n No post-query steps.\n </p>\n ) : null}\n\n {steps.map((entry, index) => (\n <StepCard\n key={index}\n step={entry}\n preset={entry.use ? presets[entry.use] : undefined}\n preview={preview?.stages[index]}\n selected={index === selected}\n first={index === 0}\n last={index === steps.length - 1}\n tree={tree}\n onSelect={() => select(index)}\n onMove={(direction) => {\n onChange(reorder(steps, index, index + direction));\n select(index + direction);\n }}\n onRemove={() => {\n onChange(steps.filter((_, position) => position !== index));\n select(Math.max(0, Math.min(index, steps.length - 2)));\n }}\n />\n ))}\n\n <div\n data-profile-tree-item={tree ? \"\" : undefined}\n className={tree ? \"relative\" : undefined}\n >\n <DropdownMenu\n label=\"Add processor\"\n icon={UiAdd}\n variant={tree ? \"ghost\" : \"outline\"}\n size=\"sm\"\n className=\"w-full [&>button]:w-full [&>button]:justify-start\"\n menuClassName=\"min-w-64\"\n menuLabel=\"Add processor\"\n items={addItems}\n />\n </div>\n\n {blocks.length > 0 ? <PagingNotice blocks={blocks} /> : null}\n </section>\n ) : null}\n\n {showEditor ? (\n <section className=\"rounded-lg border border-border p-3\">\n {step ? (\n <ProcessorPipelineEditor\n step={step}\n preset={step.use ? presets[step.use] : undefined}\n profile={withCurrentProcessors(profile, steps)}\n previewing={previewing}\n previewError={previewError}\n params={params}\n paramValues={sampleParams}\n missingParams={missingProcessorPreviewParams(\n params,\n sampleParams,\n )}\n onParamChange={(name, value) =>\n setSampleParams((current) => {\n const next = { ...current };\n if (value === undefined) delete next[name];\n else next[name] = value;\n return next;\n })\n }\n onPreview={() => void runPreview()}\n onChange={(next) => update(selected, next)}\n />\n ) : (\n <p className=\"text-xs text-muted-foreground\">\n <DropdownMenu\n trigger={\n <button\n type=\"button\"\n className=\"font-medium text-primary underline-offset-2 hover:underline\"\n >\n Add a processor\n </button>\n }\n className=\"inline-flex align-baseline\"\n menuClassName=\"min-w-64\"\n menuLabel=\"Add processor\"\n items={addItems}\n />{\" \"}\n to configure and preview it.\n </p>\n )}\n </section>\n ) : null}\n </div>\n\n {showEditor && preview ? (\n <ProcessorPreviewTable preview={preview} selected={selected} />\n ) : null}\n </div>\n );\n}\n\nfunction StepCard({\n step,\n preset,\n preview,\n selected,\n first,\n last,\n tree,\n onSelect,\n onMove,\n onRemove,\n}: {\n step: ProcessorSpec;\n preset: ProcessorPreset | undefined;\n preview: ProcessorPreview[\"stages\"][number] | undefined;\n selected: boolean;\n first: boolean;\n last: boolean;\n tree: boolean;\n onSelect: () => void;\n onMove: (direction: number) => void;\n onRemove: () => void;\n}) {\n const type = effectiveType(step, preset);\n const issues = validateProcessor(step, preset);\n const errors = issues.filter((issue) => issue.severity === \"error\").length;\n const warnings = issues.length - errors;\n const block = pagingBlock(type);\n const title = preset?.title ?? step.use ?? type ?? \"unconfigured\";\n\n return (\n <div\n data-profile-tree-item={tree ? \"\" : undefined}\n className={cn(\n \"relative flex items-center gap-2 px-2 py-2\",\n tree ? \"rounded-md\" : \"rounded-lg border\",\n selected\n ? tree\n ? \"bg-primary/[0.08]\"\n : \"border-primary/50 bg-primary/[0.05] ring-1 ring-primary/20\"\n : tree\n ? \"hover:bg-muted/50\"\n : \"border-border hover:bg-muted/50\",\n )}\n >\n <Icon\n icon={UiFunnelData}\n className=\"shrink-0 text-[14px] text-muted-foreground\"\n />\n <button\n type=\"button\"\n aria-label={`Edit ${title}`}\n onClick={onSelect}\n className=\"min-w-0 flex-1 text-left\"\n >\n <div className=\"flex flex-wrap items-center gap-1.5\">\n <span className=\"truncate text-sm font-medium\">{title}</span>\n {block ? (\n <span title={block.reason}>\n <Badge\n tone={block.kind === \"inherent\" ? \"warning\" : \"neutral\"}\n variant=\"soft\"\n size=\"md\"\n clickToCopy={false}\n >\n {block.kind === \"inherent\" ? \"needs all rows\" : \"could page\"}\n </Badge>\n </span>\n ) : null}\n {preview ? (\n <Badge tone=\"success\" variant=\"soft\" size=\"md\" clickToCopy={false}>\n {processorStageRows(preview)}\n </Badge>\n ) : null}\n {errors > 0 ? (\n <Badge\n tone=\"danger\"\n variant=\"soft\"\n size=\"md\"\n icon={UiWarningTriangle}\n clickToCopy={false}\n >\n {errors}\n </Badge>\n ) : null}\n {warnings > 0 ? (\n <Badge tone=\"warning\" variant=\"soft\" size=\"md\" clickToCopy={false}>\n {warnings}\n </Badge>\n ) : null}\n </div>\n <p className=\"truncate font-mono text-[11px] text-muted-foreground\">\n {type || \"no type\"}\n </p>\n </button>\n <div className=\"flex shrink-0 flex-col\">\n <button\n type=\"button\"\n aria-label={`Move ${title} up`}\n disabled={first}\n onClick={() => onMove(-1)}\n className=\"rounded px-1 text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30\"\n >\n <Icon icon={UiArrowUp} className=\"text-[11px]\" />\n </button>\n <button\n type=\"button\"\n aria-label={`Move ${title} down`}\n disabled={last}\n onClick={() => onMove(1)}\n className=\"rounded px-1 text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30\"\n >\n <Icon icon={UiArrowDown} className=\"text-[11px]\" />\n </button>\n </div>\n <button\n type=\"button\"\n aria-label={`Remove ${title}`}\n onClick={onRemove}\n className=\"shrink-0 rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive\"\n >\n <Icon icon={UiTrash} className=\"text-[13px]\" />\n </button>\n </div>\n );\n}\n\nfunction PagingNotice({\n blocks,\n}: {\n blocks: { kind: \"inherent\" | \"gap\"; reason: string }[];\n}) {\n return (\n <div className=\"mt-2 space-y-1 rounded border border-amber-500/40 bg-amber-500/[0.06] p-2\">\n <div className=\"flex items-center gap-1.5 text-[11px] font-medium\">\n <Icon\n icon={UiWarningTriangle}\n className=\"text-[12px] text-amber-600 [[data-theme=dark]_&]:text-amber-400\"\n />\n This profile can no longer be paged\n </div>\n <p className=\"text-[11px] text-muted-foreground\">\n These steps cannot run page by page, so every page is cut from a full\n run of the query.\n {blocks.every((block) => block.kind === \"gap\")\n ? \" None needs the whole result; the per-page interface is unimplemented.\"\n : \"\"}\n </p>\n </div>\n );\n}\n\nfunction withCurrentProcessors(\n profile: unknown,\n processors: ProcessorSpec[],\n): unknown {\n if (!profile || typeof profile !== \"object\" || Array.isArray(profile))\n return profile;\n return { ...profile, processors };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,SAAgB,kBAAkB,EAChC,OACA,SACA,UACA,SACA,YAAYA,yBAAAA,0BACZ,eACA,uBACA,YAAY,MACZ,aAAa,MACb,OAAO,SAYN;CACD,MAAM,CAAC,eAAe,qBAAA,GAAoBC,MAAAA,SAAAA,CAAS,CAAC;CACpD,MAAM,oBAAoB,iBAAiB;CAC3C,MAAM,WACJ,MAAM,WAAW,IACb,IACA,KAAK,IAAI,GAAG,KAAK,IAAI,mBAAm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WAAU;GACX,CAAA,GAAC,qCAEC;EACL,CAAA,GAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;GAAG,WAAU;GAAb,UAAA,CAAiD,2FAG9C,OAAO,OAAO,UAAU,MAAM,SAAS,KAAK,IACzC,2EACA,EACH;EACA,CAAA,CAAA;;AAET;AAEA,SAAS,sBACP,SACA,YACS;CACT,IAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAClE,OAAO;CACT,OAAO;EAAE,GAAG;EAAS;CAAW;AAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"processorPipeline.d.ts","sourceRoot":"","sources":["../../../src/profiles/processor/processorPipeline.tsx"],"names":[],"mappings":"AAaA,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAQ5B,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAoC,EACpC,aAAa,EACb,qBAAqB,EACrB,SAAgB,EAChB,UAAiB,EACjB,IAAY,GACb,EAAE;IACD,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,+BAmNA"}
1
+ {"version":3,"file":"processorPipeline.d.ts","sourceRoot":"","sources":["../../../src/profiles/processor/processorPipeline.tsx"],"names":[],"mappings":"AAaA,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAQ5B,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAoC,EACpC,aAAa,EACb,qBAAqB,EACrB,SAAgB,EAChB,UAAiB,EACjB,IAAY,GACb,EAAE;IACD,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,+BAiOA"}