@medienreaktor/neos-studio 2.6.1 → 2.8.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 +97 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -14678,6 +14678,77 @@ declare class NodeDecoratorRegistry extends ObservableRegistry<NodeDecoratorDefi
14678
14678
  */
14679
14679
  refresh(): void;
14680
14680
  }
14681
+ /**
14682
+ * The property-action registry: buttons a plugin adds under a property's field
14683
+ * in the inspector, whatever editor the property has - "Generate" a text with
14684
+ * a model, look a value up, fill it from somewhere else. The field stays
14685
+ * Studio's (or the configured editor's); the action only reads and writes its
14686
+ * value. A plugin no longer has to replace an editor to put a button under it.
14687
+ *
14688
+ * Built on the shared observable store (see lib/registry.ts), like the property
14689
+ * hints: register-replaces-by-id, a stable snapshot, refresh() for actions
14690
+ * whose `when` depends on the plugin's own data.
14691
+ */
14692
+ /** The property an action is asked about, as its node type configures it. */
14693
+ interface PropertyActionProperty {
14694
+ name: string;
14695
+ /** The property type, e.g. "string". */
14696
+ type: string;
14697
+ label: string;
14698
+ /** The editor configured for it, e.g. "Neos.Neos/Inspector/Editors/TextAreaEditor". */
14699
+ editor: string | null;
14700
+ /** ui.inspector.editorOptions - a plugin's own options can live here. */
14701
+ editorOptions: Record<string, unknown>;
14702
+ }
14703
+ /** What `when` gets to decide whether an action is offered. */
14704
+ interface PropertyActionContext {
14705
+ node: Node$1;
14706
+ property: PropertyActionProperty;
14707
+ }
14708
+ /** What `run` gets: the field's value, and the way to change it. */
14709
+ interface PropertyActionRunContext extends PropertyActionContext {
14710
+ /** The field's value now, including what was typed and not saved yet. */
14711
+ value: unknown;
14712
+ /**
14713
+ * Save a value for the property, as if the editor committed it, and show it
14714
+ * in the field - an unsaved draft there is replaced.
14715
+ */
14716
+ setValue: (value: unknown) => void;
14717
+ /** The document shown in the preview, e.g. for context about the node. */
14718
+ document: Node$1 | null;
14719
+ /** The shell's actions, as node actions get them. */
14720
+ studio: StudioActions;
14721
+ }
14722
+ /** A button under a field. Shared by property actions and hint actions. */
14723
+ interface ActionButtonConfig {
14724
+ /** The button's text, e.g. "Generate" - an ellipsis when it asks for more. */
14725
+ label: LazyLabel;
14726
+ /** A Font Awesome icon name, any syntax `ui.icon` accepts. */
14727
+ icon?: string;
14728
+ }
14729
+ interface PropertyActionDefinition extends ActionButtonConfig {
14730
+ /** Unique id. Third-party entries should namespace ('vendor.package:generate'). */
14731
+ id: string;
14732
+ /** Sort weight; lower first. Defaults to 100. */
14733
+ order?: number;
14734
+ /**
14735
+ * Whether the action is offered for this property of this node. Called
14736
+ * while the inspector renders, for every property it shows - keep it cheap
14737
+ * and synchronous. A read-only or disabled property gets no actions anyway.
14738
+ */
14739
+ when: (context: PropertyActionContext) => boolean;
14740
+ /**
14741
+ * What clicking does. A returned promise keeps the button busy until it
14742
+ * settles; a throw or a rejection ends as an error toast titled with the
14743
+ * label, as for node actions.
14744
+ */
14745
+ run: (context: PropertyActionRunContext) => void | Promise<unknown>;
14746
+ }
14747
+ declare class PropertyActionRegistry extends ObservableRegistry<PropertyActionDefinition> {
14748
+ constructor();
14749
+ /** Re-emit without a registration change: what `when` depends on changed. */
14750
+ refresh(): void;
14751
+ }
14681
14752
  /**
14682
14753
  * The property-hint registry: notes a plugin shows under a property's field in
14683
14754
  * the inspector - a finding of a content check, a reminder from an editorial
@@ -14699,6 +14770,23 @@ interface PropertyHint {
14699
14770
  message: string;
14700
14771
  /** Who says it, shown before the message when given, e.g. "Content audit". */
14701
14772
  source?: string;
14773
+ /**
14774
+ * Something to do about it, shown as a button under the message - mark a
14775
+ * finding as an exception, open the rule's explanation. Optional; a hint
14776
+ * without one only informs.
14777
+ */
14778
+ action?: PropertyHintAction;
14779
+ }
14780
+ /** The button under a hint's message. */
14781
+ interface PropertyHintAction extends ActionButtonConfig {
14782
+ /**
14783
+ * What clicking it does. A returned promise keeps the button busy until it
14784
+ * settles; a throw or a rejection ends as an error toast titled with the
14785
+ * label, as for node actions. To ask for something first, open a dialog
14786
+ * (`dialogs.open`) and return its `result`. When done, refresh the hints
14787
+ * whose data changed (`propertyHints.refresh()`).
14788
+ */
14789
+ run: () => void | Promise<unknown>;
14702
14790
  }
14703
14791
  interface PropertyHintDefinition {
14704
14792
  /** Unique id. Third-party entries should namespace ('vendor.package:findings'). */
@@ -22189,6 +22277,13 @@ export declare const nodeDecorators: NodeDecoratorRegistry;
22189
22277
  * node type configuration. See {@link PropertyHintDefinition}.
22190
22278
  */
22191
22279
  export declare const propertyHints: PropertyHintRegistry;
22280
+ /**
22281
+ * Register/unregister property actions - buttons under a property's field in
22282
+ * the inspector, whatever editor the property has: "Generate" a text, fill a
22283
+ * value from elsewhere. They read and write the field's value; the field
22284
+ * stays the configured editor. See {@link PropertyActionDefinition}.
22285
+ */
22286
+ export declare const propertyActions: PropertyActionRegistry;
22192
22287
  /**
22193
22288
  * Register/unregister node actions - commands on a node, offered in the
22194
22289
  * context menus of the document tree, the content outliner and the
@@ -22327,6 +22422,7 @@ export interface NeosStudioPluginApi extends PluginComponents {
22327
22422
  workspaceDecorators: typeof workspaceDecorators;
22328
22423
  nodeDecorators: typeof nodeDecorators;
22329
22424
  propertyHints: typeof propertyHints;
22425
+ propertyActions: typeof propertyActions;
22330
22426
  nodeActions: typeof nodeActions;
22331
22427
  headerActions: typeof headerActions;
22332
22428
  richTextExtensions: typeof richTextExtensions;
@@ -22377,4 +22473,4 @@ declare global {
22377
22473
  * mounts and before any plugin script executes. Idempotent.
22378
22474
  */
22379
22475
  export declare function installPluginApiGlobals(): void;
22380
- export { type Account, type AccountRole, 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 PropertyConfig, type PropertyEditorComponent, type PropertyEditorDefinition, type PropertyEditorProps, type PropertyEditorSubject, type PropertyHint, 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 };
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 };
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.6.1"
32
+ "version": "2.8.0"
33
33
  }