@medienreaktor/neos-studio 2.8.1 → 2.9.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.
Files changed (2) hide show
  1. package/index.d.ts +94 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -14232,6 +14232,21 @@ interface PropertyEditorProps {
14232
14232
  nodeAddress?: NodeAddress;
14233
14233
  }
14234
14234
  type PropertyEditorComponent = React$1.ComponentType<PropertyEditorProps>;
14235
+ /** A value as its editor shows it - see PropertyEditorDefinition.formatValue. */
14236
+ interface FormattedValue {
14237
+ /** What the editor shows for the value, one line, plain text. */
14238
+ label: string;
14239
+ /** The value points at something that no longer resolves (removed node, asset). */
14240
+ missing?: boolean;
14241
+ }
14242
+ /** What formatValue gets besides the value. */
14243
+ interface ValueFormatContext {
14244
+ subject: PropertyEditorSubject;
14245
+ /** The editor's options - as the editor gets them. */
14246
+ options: Record<string, unknown>;
14247
+ /** The edited node, when there is one: lookups use its subgraph. */
14248
+ nodeAddress?: NodeAddress;
14249
+ }
14235
14250
  interface PropertyEditorDefinition {
14236
14251
  /**
14237
14252
  * The editor identifier as referenced from node type configuration, e.g.
@@ -14248,6 +14263,17 @@ interface PropertyEditorDefinition {
14248
14263
  * to false: the host renders the label above the control.
14249
14264
  */
14250
14265
  rendersOwnLabel?: boolean;
14266
+ /**
14267
+ * The value as the editor shows it, as one line of plain text - an option's
14268
+ * label instead of its key, a node's label instead of node://…, for places
14269
+ * that show a value without its editor (a list row, a summary). null when
14270
+ * there is nothing to show (no value, a false checkbox). Return the label
14271
+ * directly when no lookup is needed, a promise only for lookups; lookups go
14272
+ * through the shell's query client under the keys the editor reads with,
14273
+ * so a label and the open editor share one request. Without it, hosts show
14274
+ * the value plainly (strings, numbers, lists of them).
14275
+ */
14276
+ formatValue?: (value: unknown, context: ValueFormatContext) => FormattedValue | null | Promise<FormattedValue | null>;
14251
14277
  }
14252
14278
  /**
14253
14279
  * Composes the shared store rather than extending it: its public `get(id)`
@@ -14269,6 +14295,51 @@ declare class PropertyEditorRegistry implements ObservableStore<PropertyEditorDe
14269
14295
  /** The full definition for an editor id (component + metadata), or undefined. */
14270
14296
  getDefinition(id: string | null | undefined): PropertyEditorDefinition | undefined;
14271
14297
  }
14298
+ /** formatEditorValue's context: the options default to none. */
14299
+ type FormatEditorValueContext = Omit<ValueFormatContext, 'options'> & {
14300
+ options?: Record<string, unknown>;
14301
+ };
14302
+ /**
14303
+ * A value as the editor `editorId` shows it (see
14304
+ * PropertyEditorDefinition.formatValue), or its plain rendering for an
14305
+ * editor without a formatter. Rejects when a lookup fails; a value pointing
14306
+ * at something gone resolves with `missing`.
14307
+ */
14308
+ export declare function formatEditorValue(editorId: string | null | undefined, value: unknown, context: FormatEditorValueContext): Promise<FormattedValue | null>;
14309
+ /** One value for useFormattedValues. */
14310
+ interface FormattedValueRequest {
14311
+ editorId: string | null | undefined;
14312
+ value: unknown;
14313
+ context: FormatEditorValueContext;
14314
+ }
14315
+ interface FormattedValues {
14316
+ /**
14317
+ * Per item: its label, null for nothing to show, undefined until the
14318
+ * first one is resolved. While a changed value resolves, the item keeps
14319
+ * its last label.
14320
+ */
14321
+ labels: (FormattedValue | null | undefined)[];
14322
+ /** Some label is still being resolved. */
14323
+ pending: boolean;
14324
+ }
14325
+ /**
14326
+ * The labels of a list of values, each as its editor shows it - for list
14327
+ * rows and summaries. Items are told apart by their editor, value, options,
14328
+ * subject and node, not by object identity, so a new items array with the
14329
+ * same values neither refetches nor flickers.
14330
+ */
14331
+ export declare function useFormattedValues(items: readonly FormattedValueRequest[]): FormattedValues;
14332
+ /** The subgraph of a node address: what a batch of node lookups shares. */
14333
+ type Subgraph = Pick<NodeAddress, 'contentRepositoryId' | 'workspaceName' | 'dimensionSpacePoint'>;
14334
+ /**
14335
+ * The nodes with these aggregate ids in the subgraph of the address (any
14336
+ * node of it; its own id does not matter), null for an id that does not
14337
+ * resolve there - removed, or not readable for the account. Lookups made
14338
+ * within one tick, from anywhere, go out as one listNodes request per
14339
+ * subgraph (100 ids each), and every node is cached under the key useNode()
14340
+ * reads it with.
14341
+ */
14342
+ export declare function resolveNodes(address: Subgraph, ids: readonly string[]): Promise<Map<string, Node$1 | null>>;
14272
14343
  /**
14273
14344
  * The inspector view registry: read-only widgets that node type configuration
14274
14345
  * places between inspector properties (ui.inspector.views), registered under
@@ -14358,6 +14429,18 @@ interface LinkTypeTabProps {
14358
14429
  * incomplete - the dialog's Apply button follows.
14359
14430
  */
14360
14431
  onChange: (href: string | null) => void;
14432
+ /**
14433
+ * The editorOptions of the LinkEditor property the link is for (e.g.
14434
+ * nodeTypes, assets); empty for a rich text link.
14435
+ */
14436
+ options: Record<string, unknown>;
14437
+ /**
14438
+ * The edited node, when the link is for one of its properties: look
14439
+ * targets up in its subgraph (workspace + dimension space point). Absent
14440
+ * in the creation dialog and for rich text links - the active workspace
14441
+ * and the selected document's dimensions serve there.
14442
+ */
14443
+ nodeAddress?: NodeAddress;
14361
14444
  }
14362
14445
  interface LinkTypeDefinition {
14363
14446
  /**
@@ -14382,6 +14465,13 @@ interface LinkTypeDefinition {
14382
14465
  * registered type should set this.
14383
14466
  */
14384
14467
  isFallback?: boolean;
14468
+ /**
14469
+ * Whether the type is offered for the LinkEditor property's editorOptions
14470
+ * - false hides its tab (the asset type for `assets: false`). A stored
14471
+ * href of the type still shows in the field, and can be removed or
14472
+ * replaced. Offered always when absent.
14473
+ */
14474
+ enabled?: (options: Record<string, unknown>) => boolean;
14385
14475
  }
14386
14476
  /** Link types (tabs) in registration order, plus href → type matching. */
14387
14477
  declare class LinkEditorRegistry extends ObservableRegistry<LinkTypeDefinition> {
@@ -22431,6 +22521,9 @@ export interface NeosStudioPluginApi extends PluginComponents {
22431
22521
  useStudio: typeof useStudio;
22432
22522
  useStudioActions: typeof useStudioActions;
22433
22523
  useKeyboardShortcut: typeof useKeyboardShortcut;
22524
+ formatEditorValue: typeof formatEditorValue;
22525
+ useFormattedValues: typeof useFormattedValues;
22526
+ resolveNodes: typeof resolveNodes;
22434
22527
  toast: typeof toast;
22435
22528
  dialogs: typeof dialogs;
22436
22529
  apiFetch: typeof apiFetch;
@@ -22473,4 +22566,4 @@ declare global {
22473
22566
  * mounts and before any plugin script executes. Idempotent.
22474
22567
  */
22475
22568
  export declare function installPluginApiGlobals(): void;
22476
- export { type Account, type AccountRole, type ActionButtonConfig, type AnyExtension, type Asset, type AssetCollection, type AssetCollectionCreate, type AssetCollectionReference, type AssetCollectionUpdate, type AssetIptc, type AssetSource, type AssetTag, type AssetTagCreate, type AssetTagReference, type AssetTagUpdate, type AssetType, type AssetUpdate, type AssetUsage, type AssetUsageListing, type AssetVariantCreate, Badge, type BaseWorkspaceChange, Button, type Change, type ChangeDiff, Checkbox, Combobox, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxStatus, ComboboxTrigger, type ConflictingChange, type ContentDimension, type ContentDimensionValue, type ContentRepository, ContextMenu, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, CountBadge, type CreationDialogElementConfig, type CropRectangle, type CurrentAccount, type DataSourceData, Dialog, DialogContent, type DialogControls, DialogDescription, DialogFooter, type DialogHandle, DialogHeader, DialogTitle, type DimensionCoordinates, type DiscardingResult, type DockRegion, type Domain, type DomainCreate, type DomainUpdate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type Event$1 as Event, type EventDiff, type ExtensionConfig, Field, type HeaderActionContext, type HeaderActionDefinition, type IconProps, type IconSize, type IconVariant, type InfiniteData, Input, type InspectorGroupConfig, type InspectorTabConfig, type InspectorViewComponent, type InspectorViewConfig, type InspectorViewDefinition, type InspectorViewProps, type KeyboardShortcutDefinition, type LazyLabel, type LinkTypeDefinition, type LinkTypeTabProps, type ListingLinks, type ListingMeta, LoadingState, type MarkConfig, type ModalIcon, type NeosStudioGuestPluginApi, type Node$1 as Node, type NodeActionContext, type NodeActionDefinition, type NodeActionSurface, type NodeAddress, type NodeClassification, type NodeConfig, type NodeCopy, type NodeCreate, type NodeDecoration, type NodeDecorationContext, type NodeDecorationOverlay, type NodeDecoratorDefinition, type NodeMove, type NodePropertiesUpdate, type NodeReference, type NodeReferencesUpdate, type NodeType, type NodeTypeChange, type NodeTypeConfiguration, type NodeTypeGroup, type NodeTypeListing, type NodeTypeMap, type NodeVariantCreate, type NodeVariantListing, type PaginatedAssetListing, type PaginatedChangeListing, type PaginatedEventListing, type PaginatedNodeListing, type PaginatedUserListing, type PanelBadge, type PanelDefinition, type PanelPlacement, type PanelRect, type PasswordChange, Placeholder, Popover, PopoverContent, PopoverTrigger, type ProblemDocument, type Profile, type ProfileUpdate, type PropertyActionContext, type PropertyActionDefinition, type PropertyActionProperty, type PropertyActionRunContext, type PropertyConfig, type PropertyEditorComponent, type PropertyEditorDefinition, type PropertyEditorProps, type PropertyEditorSubject, type PropertyHint, type PropertyHintAction, type PropertyHintDefinition, type PropertyHintTone, type PropertyInspectorConfig, type PropertyScope, type PublishingResult, type QueryClient, type QueryFunctionContext, type QueryKey, type ResolvedKeyboardShortcut, type RichTextExtensionContext, type RichTextExtensionDefinition, type RichTextSurface, type RichTextToolbarItem, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, Separator, type SettingsDialogDefinition, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, type Site, type SiteCreate, type SiteCreationOptions, type SiteListing, type SiteNodeType, type SiteUpdate, Skeleton, Slider, Spinner, type StreamEvent, type StructureChange, type StudioActions, type StudioContextValue, type StudioEventHandler, type StudioEventMap, type StudioEventName, type StudioEvents, type StudioInvalidation, type StudioState, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type Task, type TaskStatus, Textarea, type TiptapBuildingBlocks, type Editor as TiptapEditor, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TranslateArgs, type UriPathSegment, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type User, type UserCreate, type UserOptions, type UserPasswordSet, type UserUpdate, type ValidatorDefinition, type ValidatorFunction, type ViewData, type Workspace, type WorkspaceClassification, type WorkspaceConflictProblem, type WorkspaceCreate, type WorkspaceDecoration, type WorkspaceDecoratorDefinition, type WorkspaceDiscard, type WorkspaceListing, type WorkspacePublish, type WorkspaceRebase, type WorkspaceRef, type WorkspaceRole, type WorkspaceRoleAssign, type WorkspaceRoleAssignment, type WorkspaceRoleAssignmentListing, type WorkspaceRoleSubject, type WorkspaceUpdate, type isRemoved, keepPreviousData, type nodeAddressFromContextPath, type nodeAddressFromKey, type nodeAddressKey, type nodeAddressOf, type nodeTypeConfiguration, type parseDimensionSpacePoint, queryClient, type sameDimensionSpacePoint, type sameNodeAddress, skipToken, studioFetch };
22569
+ export { type Account, type AccountRole, type ActionButtonConfig, type AnyExtension, type Asset, type AssetCollection, type AssetCollectionCreate, type AssetCollectionReference, type AssetCollectionUpdate, type AssetIptc, type AssetSource, type AssetTag, type AssetTagCreate, type AssetTagReference, type AssetTagUpdate, type AssetType, type AssetUpdate, type AssetUsage, type AssetUsageListing, type AssetVariantCreate, Badge, type BaseWorkspaceChange, Button, type Change, type ChangeDiff, Checkbox, Combobox, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxStatus, ComboboxTrigger, type ConflictingChange, type ContentDimension, type ContentDimensionValue, type ContentRepository, ContextMenu, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, CountBadge, type CreationDialogElementConfig, type CropRectangle, type CurrentAccount, type DataSourceData, Dialog, DialogContent, type DialogControls, DialogDescription, DialogFooter, type DialogHandle, DialogHeader, DialogTitle, type DimensionCoordinates, type DiscardingResult, type DockRegion, type Domain, type DomainCreate, type DomainUpdate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type Event$1 as Event, type EventDiff, type ExtensionConfig, Field, type FormatEditorValueContext, type FormattedValue, type FormattedValueRequest, type FormattedValues, type HeaderActionContext, type HeaderActionDefinition, type IconProps, type IconSize, type IconVariant, type InfiniteData, Input, type InspectorGroupConfig, type InspectorTabConfig, type InspectorViewComponent, type InspectorViewConfig, type InspectorViewDefinition, type InspectorViewProps, type KeyboardShortcutDefinition, type LazyLabel, type LinkTypeDefinition, type LinkTypeTabProps, type ListingLinks, type ListingMeta, LoadingState, type MarkConfig, type ModalIcon, type NeosStudioGuestPluginApi, type Node$1 as Node, type NodeActionContext, type NodeActionDefinition, type NodeActionSurface, type NodeAddress, type NodeClassification, type NodeConfig, type NodeCopy, type NodeCreate, type NodeDecoration, type NodeDecorationContext, type NodeDecorationOverlay, type NodeDecoratorDefinition, type NodeMove, type NodePropertiesUpdate, type NodeReference, type NodeReferencesUpdate, type NodeType, type NodeTypeChange, type NodeTypeConfiguration, type NodeTypeGroup, type NodeTypeListing, type NodeTypeMap, type NodeVariantCreate, type NodeVariantListing, type PaginatedAssetListing, type PaginatedChangeListing, type PaginatedEventListing, type PaginatedNodeListing, type PaginatedUserListing, type PanelBadge, type PanelDefinition, type PanelPlacement, type PanelRect, type PasswordChange, Placeholder, Popover, PopoverContent, PopoverTrigger, type ProblemDocument, type Profile, type ProfileUpdate, type PropertyActionContext, type PropertyActionDefinition, type PropertyActionProperty, type PropertyActionRunContext, type PropertyConfig, type PropertyEditorComponent, type PropertyEditorDefinition, type PropertyEditorProps, type PropertyEditorSubject, type PropertyHint, type PropertyHintAction, type PropertyHintDefinition, type PropertyHintTone, type PropertyInspectorConfig, type PropertyScope, type PublishingResult, type QueryClient, type QueryFunctionContext, type QueryKey, type ResolvedKeyboardShortcut, type RichTextExtensionContext, type RichTextExtensionDefinition, type RichTextSurface, type RichTextToolbarItem, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, Separator, type SettingsDialogDefinition, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, type Site, type SiteCreate, type SiteCreationOptions, type SiteListing, type SiteNodeType, type SiteUpdate, Skeleton, Slider, Spinner, type StreamEvent, type StructureChange, type StudioActions, type StudioContextValue, type StudioEventHandler, type StudioEventMap, type StudioEventName, type StudioEvents, type StudioInvalidation, type StudioState, type Subgraph, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type Task, type TaskStatus, Textarea, type TiptapBuildingBlocks, type Editor as TiptapEditor, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TranslateArgs, type UriPathSegment, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type User, type UserCreate, type UserOptions, type UserPasswordSet, type UserUpdate, type ValidatorDefinition, type ValidatorFunction, type ValueFormatContext, type ViewData, type Workspace, type WorkspaceClassification, type WorkspaceConflictProblem, type WorkspaceCreate, type WorkspaceDecoration, type WorkspaceDecoratorDefinition, type WorkspaceDiscard, type WorkspaceListing, type WorkspacePublish, type WorkspaceRebase, type WorkspaceRef, type WorkspaceRole, type WorkspaceRoleAssign, type WorkspaceRoleAssignment, type WorkspaceRoleAssignmentListing, type WorkspaceRoleSubject, type WorkspaceUpdate, type isRemoved, keepPreviousData, type nodeAddressFromContextPath, type nodeAddressFromKey, type nodeAddressKey, type nodeAddressOf, type nodeTypeConfiguration, type parseDimensionSpacePoint, queryClient, type sameDimensionSpacePoint, type sameNodeAddress, skipToken, studioFetch };
package/package.json CHANGED
@@ -29,5 +29,5 @@
29
29
  "@types/react": "^19.3.0",
30
30
  "@types/react-dom": "^19.3.0"
31
31
  },
32
- "version": "2.8.1"
32
+ "version": "2.9.0"
33
33
  }