@pixerate/editor-react 0.207.0 → 0.209.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.
@@ -0,0 +1,36 @@
1
+ import { type FocusEvent, type KeyboardEvent } from "react";
2
+ import { type LinkFocusModel, type LinkFocusOptions, type LinkFocusState } from "@pixerate/editor/tools";
3
+ export interface UseLinkFocusOptions extends Partial<LinkFocusOptions> {
4
+ /** Use an existing model instead of creating one from `marks` and `links`. */
5
+ model?: LinkFocusModel;
6
+ }
7
+ /** Handlers for one mark's element: hover and keyboard focus put its key in focus. */
8
+ export interface LinkFocusMarkProps {
9
+ onPointerEnter: () => void;
10
+ onFocus: () => void;
11
+ "data-link-focus": string;
12
+ }
13
+ /** Handlers for the picture's container: arrow keys, Home, End, Escape, and clearing on leave. */
14
+ export interface LinkFocusRootProps {
15
+ onKeyDown: (event: KeyboardEvent) => void;
16
+ onPointerLeave: () => void;
17
+ onBlur: (event: FocusEvent) => void;
18
+ }
19
+ export interface UseLinkFocusResult {
20
+ model: LinkFocusModel;
21
+ state: LinkFocusState;
22
+ /** Spread on a mark's element (the key it focuses: an item or a tag). */
23
+ markProps(key: string): LinkFocusMarkProps;
24
+ /** Spread on the picture's container. */
25
+ rootProps: LinkFocusRootProps;
26
+ /** Opacity for the mark at `index`: 1 when lit, the model's `dim` otherwise. */
27
+ opacity(index: number): number;
28
+ /** The focused key and its links, for a live region. */
29
+ description: string;
30
+ }
31
+ /**
32
+ * Focus across linked marks (#812): creates (or adopts) a `createLinkFocus` model and re-renders on
33
+ * its changes. Hovering or focusing a mark lights it and everything linked to it; arrow keys walk
34
+ * the keys, Escape clears, and leaving the picture (pointer or focus) clears too.
35
+ */
36
+ export declare function useLinkFocus(options: UseLinkFocusOptions): UseLinkFocusResult;
@@ -0,0 +1,36 @@
1
+ import { type FocusEvent, type KeyboardEvent } from "react";
2
+ import { type LinkFocusModel, type LinkFocusOptions, type LinkFocusState } from "@pixerate/editor/tools";
3
+ export interface UseLinkFocusOptions extends Partial<LinkFocusOptions> {
4
+ /** Use an existing model instead of creating one from `marks` and `links`. */
5
+ model?: LinkFocusModel;
6
+ }
7
+ /** Handlers for one mark's element: hover and keyboard focus put its key in focus. */
8
+ export interface LinkFocusMarkProps {
9
+ onPointerEnter: () => void;
10
+ onFocus: () => void;
11
+ "data-link-focus": string;
12
+ }
13
+ /** Handlers for the picture's container: arrow keys, Home, End, Escape, and clearing on leave. */
14
+ export interface LinkFocusRootProps {
15
+ onKeyDown: (event: KeyboardEvent) => void;
16
+ onPointerLeave: () => void;
17
+ onBlur: (event: FocusEvent) => void;
18
+ }
19
+ export interface UseLinkFocusResult {
20
+ model: LinkFocusModel;
21
+ state: LinkFocusState;
22
+ /** Spread on a mark's element (the key it focuses: an item or a tag). */
23
+ markProps(key: string): LinkFocusMarkProps;
24
+ /** Spread on the picture's container. */
25
+ rootProps: LinkFocusRootProps;
26
+ /** Opacity for the mark at `index`: 1 when lit, the model's `dim` otherwise. */
27
+ opacity(index: number): number;
28
+ /** The focused key and its links, for a live region. */
29
+ description: string;
30
+ }
31
+ /**
32
+ * Focus across linked marks (#812): creates (or adopts) a `createLinkFocus` model and re-renders on
33
+ * its changes. Hovering or focusing a mark lights it and everything linked to it; arrow keys walk
34
+ * the keys, Escape clears, and leaving the picture (pointer or focus) clears too.
35
+ */
36
+ export declare function useLinkFocus(options: UseLinkFocusOptions): UseLinkFocusResult;
@@ -10,6 +10,8 @@ export interface LayersPanelProps {
10
10
  psdFileName?: string;
11
11
  /** Show the active layer's effects section (default true). */
12
12
  effects?: boolean;
13
+ /** Show the active smart object's contents and smart filters section (default true). */
14
+ smartObjects?: boolean;
13
15
  className?: string;
14
16
  }
15
17
  /**
@@ -18,6 +20,9 @@ export interface LayersPanelProps {
18
20
  * as the selection, Alt-click to show it alone in grey, Alt+Shift-click as a red overlay; Ctrl/⌘-click a layer thumbnail to select its pixels), drag to reorder or drop
19
21
  * into a group, opacity / fill / blend / clipping for the active layer, and the layer menu
20
22
  * (right-click a row, or the ⋯ button), an fx badge on rows with effects (click to switch them
21
- * on or off) and the active layer's effects. Every action is one undo step on the controller.
23
+ * on or off) and the active layer's effects. Smart objects show a badge on their thumbnail
24
+ * (double-click it to edit the contents), their smart filters under the row (each with its eye)
25
+ * and the smart object section; while contents are open a bar says so, with Save and Discard.
26
+ * Every action is one undo step on the controller.
22
27
  */
23
28
  export declare const LayersPanel: React.FC<LayersPanelProps>;
@@ -10,6 +10,8 @@ export interface LayersPanelProps {
10
10
  psdFileName?: string;
11
11
  /** Show the active layer's effects section (default true). */
12
12
  effects?: boolean;
13
+ /** Show the active smart object's contents and smart filters section (default true). */
14
+ smartObjects?: boolean;
13
15
  className?: string;
14
16
  }
15
17
  /**
@@ -18,6 +20,9 @@ export interface LayersPanelProps {
18
20
  * as the selection, Alt-click to show it alone in grey, Alt+Shift-click as a red overlay; Ctrl/⌘-click a layer thumbnail to select its pixels), drag to reorder or drop
19
21
  * into a group, opacity / fill / blend / clipping for the active layer, and the layer menu
20
22
  * (right-click a row, or the ⋯ button), an fx badge on rows with effects (click to switch them
21
- * on or off) and the active layer's effects. Every action is one undo step on the controller.
23
+ * on or off) and the active layer's effects. Smart objects show a badge on their thumbnail
24
+ * (double-click it to edit the contents), their smart filters under the row (each with its eye)
25
+ * and the smart object section; while contents are open a bar says so, with Save and Discard.
26
+ * Every action is one undo step on the controller.
22
27
  */
23
28
  export declare const LayersPanel: React.FC<LayersPanelProps>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { ImageEditorController } from '@pixerate/editor/image-editor';
3
+ export interface SmartObjectPanelProps {
4
+ controller: ImageEditorController;
5
+ /** The smart object to show (default: the active layer). */
6
+ layerId?: string | null;
7
+ className?: string;
8
+ }
9
+ /**
10
+ * A smart object's contents and smart filters: Edit Contents, Replace Contents…, Export Contents,
11
+ * New Smart Object via Copy and Rasterize; the smart filter stack (add Develop or Blur, the
12
+ * stack's switch, each filter's eye, order, remove and, when expanded, blend mode, opacity and
13
+ * settings); and the filter mask (add, enable, link, paint it, remove). Every change is one undo
14
+ * step (a slider drag is one step too).
15
+ */
16
+ export declare const SmartObjectPanel: React.FC<SmartObjectPanelProps>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { ImageEditorController } from '@pixerate/editor/image-editor';
3
+ export interface SmartObjectPanelProps {
4
+ controller: ImageEditorController;
5
+ /** The smart object to show (default: the active layer). */
6
+ layerId?: string | null;
7
+ className?: string;
8
+ }
9
+ /**
10
+ * A smart object's contents and smart filters: Edit Contents, Replace Contents…, Export Contents,
11
+ * New Smart Object via Copy and Rasterize; the smart filter stack (add Develop or Blur, the
12
+ * stack's switch, each filter's eye, order, remove and, when expanded, blend mode, opacity and
13
+ * settings); and the filter mask (add, enable, link, paint it, remove). Every change is one undo
14
+ * step (a slider drag is one step too).
15
+ */
16
+ export declare const SmartObjectPanel: React.FC<SmartObjectPanelProps>;