@pipelex/mthds-ui 0.42.0 → 0.43.0

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.
@@ -3,7 +3,7 @@ import React__default from 'react';
3
3
  import { d as GraphSpec, e as GraphNodeData, f as GraphEdge, g as GraphNode, h as GraphConfig, i as GraphDirection, F as FoldMode, G as GraphThemeMode, T as ToolbarPosition, j as GraphStyleId, a as GraphTheme, k as PipeStatus, l as GraphSpecNodeIoItem, m as ValidationState, V as ValidationIssue, L as LabelDescriptor, n as PipeControllerType, o as FoldToggleOptions, N as NodeValidationSummary, p as PipeCardPayload, C as ConceptInfo, q as GraphSpecNode } from '../../types-DLAnYNoi.js';
4
4
  export { r as PipeOperatorType } from '../../types-DLAnYNoi.js';
5
5
  import { PipeIOContracts, OutputForm, InputForm, SaveFiles } from '@pipelex/mthds-form';
6
- import { ResolveUrl, ResolveShareUrl, DownloadDisplay } from '@pipelex/mthds-form/react';
6
+ import { ResolveUrl, ResolveRendition, ResolveShareUrl, DownloadDisplay } from '@pipelex/mthds-form/react';
7
7
  import { Edge, Node, ReactFlowInstance } from '@xyflow/react';
8
8
  import 'mthds/errors';
9
9
 
@@ -247,6 +247,20 @@ interface GraphViewerProps {
247
247
  * durable, so supply one if your storage has an authenticated read path.
248
248
  */
249
249
  resolveUrl?: ResolveUrl;
250
+ /**
251
+ * Answers a smaller copy of a picture, so the result panel's gallery tiles
252
+ * and table thumbnails stop loading whole files.
253
+ *
254
+ * Called with the picture's own `url` member, as `resolveUrl` is, and the
255
+ * width the kernel asks for; answer the URL of a copy at least that wide, or
256
+ * `undefined` to have the whole picture drawn. Only those small pictures use
257
+ * it: the viewer a picture opens, "Open the original", the copy control and
258
+ * every download keep the whole picture. It goes on the panel's provider
259
+ * beside `resolveUrl`, which replaces an outer provider rather than merging
260
+ * with it, so a `resolveRendition` set around the graph does not reach the
261
+ * panel.
262
+ */
263
+ resolveRendition?: ResolveRendition;
250
264
  /**
251
265
  * Mints a URL that works OUTSIDE this page, for the copy control.
252
266
  *
@@ -464,7 +478,10 @@ declare function PipeCardBase({ data, children }: PipeCardBaseProps): react_jsx_
464
478
  * It does not resolve `pipelex-storage://` URIs itself. A host that can passes
465
479
  * `resolveUrl`, which is installed as the kernel's `ResultEnvProvider` so the
466
480
  * kernel's own file arms paint the file; without one, the panel paints whatever
467
- * `public_url` the payload carries.
481
+ * `public_url` the payload carries. A host that keeps smaller copies of its
482
+ * pictures passes `resolveRendition` on the same provider, and a gallery's
483
+ * tiles and a table cell's thumbnails are drawn from those copies while every
484
+ * other use of a picture keeps the whole one.
468
485
  *
469
486
  * ## Saving
470
487
  *
@@ -526,6 +543,14 @@ interface StuffResultPanelProps extends StuffResultRendererOptions {
526
543
  * problem rather than an expiry. A resolver is what makes a result durable.
527
544
  */
528
545
  resolveUrl?: ResolveUrl;
546
+ /**
547
+ * Answers a smaller copy of a picture, at the width the kernel asks for, so a
548
+ * gallery's tiles and a table cell's thumbnails stop loading the whole file.
549
+ * The viewer a picture opens, "Open the original", the copy control and every
550
+ * download keep the whole picture, and a copy that fails to load gives way to
551
+ * it. Unset, or for a picture it does not answer, the whole picture is drawn.
552
+ */
553
+ resolveRendition?: ResolveRendition;
529
554
  /**
530
555
  * Mints a URL that works OUTSIDE this page — what the copy control hands over.
531
556
  * A display URL may sit behind the host's session; a shared one carries its
@@ -543,7 +568,7 @@ interface StuffResultPanelProps extends StuffResultRendererOptions {
543
568
  */
544
569
  downloads?: DownloadDisplay;
545
570
  }
546
- declare function StuffResultPanel({ pipeIoContracts, outputForm, inputForm, stuff, producerPipeRef, consumer, resolveUrl, resolveShareUrl, saveFiles, downloads, }: StuffResultPanelProps): react_jsx_runtime.JSX.Element | null;
571
+ declare function StuffResultPanel({ pipeIoContracts, outputForm, inputForm, stuff, producerPipeRef, consumer, resolveUrl, resolveRendition, resolveShareUrl, saveFiles, downloads, }: StuffResultPanelProps): react_jsx_runtime.JSX.Element | null;
547
572
 
548
573
  interface DetailPanelProps {
549
574
  isOpen: boolean;
@@ -114,6 +114,7 @@ function StuffResultPanel({
114
114
  producerPipeRef,
115
115
  consumer,
116
116
  resolveUrl,
117
+ resolveRendition,
117
118
  resolveShareUrl,
118
119
  saveFiles,
119
120
  downloads
@@ -127,10 +128,11 @@ function StuffResultPanel({
127
128
  );
128
129
  if (field) {
129
130
  const panel = /* @__PURE__ */ jsx(StuffViewer, { field, value: stuff.data, name: stuff.name });
130
- return resolveUrl || resolveShareUrl || saveFiles || downloads ? /* @__PURE__ */ jsx(
131
+ return resolveUrl || resolveRendition || resolveShareUrl || saveFiles || downloads ? /* @__PURE__ */ jsx(
131
132
  ResultEnvProvider,
132
133
  {
133
134
  resolveUrl,
135
+ resolveRendition,
134
136
  resolveShareUrl,
135
137
  saveFiles,
136
138
  downloads,
@@ -3229,6 +3231,7 @@ function StuffNodeDetail({
3229
3231
  artifacts,
3230
3232
  theme,
3231
3233
  resolveUrl,
3234
+ resolveRendition,
3232
3235
  resolveShareUrl,
3233
3236
  saveFiles,
3234
3237
  downloads
@@ -3239,9 +3242,9 @@ function StuffNodeDetail({
3239
3242
  const descriptors = resultDescriptors(artifacts);
3240
3243
  const renderData = descriptors ? () => /* @__PURE__ */ jsx30(
3241
3244
  StuffResultPanel,
3242
- __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, descriptors), {
3245
+ __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, descriptors), {
3243
3246
  stuff: stuffData
3244
- }), conceptInfo ? { concept: conceptInfo } : {}), producerPipeRef ? { producerPipeRef } : {}), consumer ? { consumer } : {}), resolveUrl ? { resolveUrl } : {}), resolveShareUrl ? { resolveShareUrl } : {}), saveFiles ? { saveFiles } : {}), downloads ? { downloads } : {}), {
3247
+ }), conceptInfo ? { concept: conceptInfo } : {}), producerPipeRef ? { producerPipeRef } : {}), consumer ? { consumer } : {}), resolveUrl ? { resolveUrl } : {}), resolveRendition ? { resolveRendition } : {}), resolveShareUrl ? { resolveShareUrl } : {}), saveFiles ? { saveFiles } : {}), downloads ? { downloads } : {}), {
3245
3248
  theme
3246
3249
  })
3247
3250
  ) : void 0;
@@ -3386,6 +3389,7 @@ function GraphViewerCanvas(props) {
3386
3389
  onPaneClick,
3387
3390
  renderDetailExtra,
3388
3391
  resolveUrl,
3392
+ resolveRendition,
3389
3393
  resolveShareUrl,
3390
3394
  saveFiles,
3391
3395
  downloads,
@@ -4196,6 +4200,7 @@ function GraphViewerCanvas(props) {
4196
4200
  theme: resolvedTheme,
4197
4201
  artifacts: graph,
4198
4202
  resolveUrl,
4203
+ resolveRendition,
4199
4204
  resolveShareUrl,
4200
4205
  saveFiles,
4201
4206
  downloads