@pixerate/editor 0.220.0 → 0.221.1

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 (29) hide show
  1. package/dist/image-editor/controller.d.cts +27 -4
  2. package/dist/image-editor/controller.d.ts +27 -4
  3. package/dist/image-editor/index.cjs +2276 -1864
  4. package/dist/image-editor/index.js +1240 -828
  5. package/dist/image-editor/layers/serialize.d.cts +2 -0
  6. package/dist/image-editor/layers/serialize.d.ts +2 -0
  7. package/dist/image-editor/selection/index.d.cts +1 -0
  8. package/dist/image-editor/selection/index.d.ts +1 -0
  9. package/dist/image-editor/selection/inspect.d.cts +1 -1
  10. package/dist/image-editor/selection/inspect.d.ts +1 -1
  11. package/dist/image-editor/selection/recipe.d.cts +89 -0
  12. package/dist/image-editor/selection/recipe.d.ts +89 -0
  13. package/dist/image-editor/types.d.cts +9 -0
  14. package/dist/image-editor/types.d.ts +9 -0
  15. package/package.json +1 -1
  16. package/skills/README.md +40 -9
  17. package/skills/WORKFLOW_TEMPLATE.md +50 -0
  18. package/skills/pixerate-image-editor/SKILL.md +14 -11
  19. package/skills/pixerate-image-editor/references/painting.md +17 -1
  20. package/skills/pixerate-image-selection-masking/SKILL.md +3 -3
  21. package/skills/pixerate-image-selection-masking/evals/local-adjustment.json +22 -0
  22. package/skills/pixerate-image-selection-masking/evals/mask-out-background.json +24 -0
  23. package/skills/pixerate-image-selection-masking/evals/select-one-of-two.json +22 -0
  24. package/skills/pixerate-spreadsheet/SKILL.md +7 -0
  25. package/skills/pixerate-spreadsheet-clean-import/SKILL.md +154 -0
  26. package/skills/pixerate-spreadsheet-clean-import/evals/clean-in-place.json +43 -0
  27. package/skills/pixerate-spreadsheet-clean-import/evals/dedupe-keep-latest.json +25 -0
  28. package/skills/pixerate-spreadsheet-clean-import/evals/fix-types-only.json +24 -0
  29. package/skills/pixerate-video-editor/SKILL.md +8 -0
@@ -1,5 +1,6 @@
1
1
  import { AdjustmentKind, AdjustmentLayer, AdjustmentParamsMap, Annotation, CreateAnnotationPayload, AspectRatio, CropBox, DepthMaskOptions, ExportOptions, ImageAdjustments, ImageDimensions, ImageEditorFit, ImageEditorOptions, ImageEditorState, ImageEditorTool, ImageTransform, ImagePoint, SerializedImageEditorState, DocumentOpener } from './types.cjs';
2
2
  import { type InspectMaskEdgeOptions, type MaskEdgeReport } from './selection/inspect.cjs';
3
+ import { type SelectionRecipeStep } from './selection/recipe.cjs';
3
4
  import { type CompareSelectionsOptions, type SelectionDiff } from './selection/diff.cjs';
4
5
  import { type SelectionUncertainty, type SelectionUncertaintyOptions } from './selection/uncertainty.cjs';
5
6
  import { type PathToSelectionOptions, type SelectionToPathOptions } from './selection/path.cjs';
@@ -745,10 +746,6 @@ export declare function migrateToLayeredState(data: Partial<SerializedImageEdito
745
746
  }, size: ImageDimensions): SerializedLayeredImageEditorState;
746
747
  export declare const DEFAULT_TRANSFORM: ImageTransform;
747
748
  export declare const DEFAULT_DEPTH_MASK: DepthMaskOptions;
748
- /**
749
- * ImageEditorController manages the complete lifecycle, canvas rendering pipeline,
750
- * tool interaction states, undo/redo history, serialization, and image export.
751
- */
752
749
  export declare class ImageEditorController {
753
750
  private state;
754
751
  private renderer;
@@ -1802,6 +1799,32 @@ export declare class ImageEditorController {
1802
1799
  * Returns false when nothing changed.
1803
1800
  */
1804
1801
  setSelection(mask: SelectionMask | null, mode?: SelectionMode): boolean;
1802
+ /** The recipe step of the selection command now running, taken by `setSelection`. */
1803
+ private pendingStep;
1804
+ /** Runs a selection command whose change `step` describes, so the selection's recipe records it. */
1805
+ private withRecipeStep;
1806
+ /** The selection's recipe as agents and panels read it (empty and not live when frozen or empty). */
1807
+ getSelectionRecipe(): {
1808
+ live: boolean;
1809
+ steps: Array<{
1810
+ index: number;
1811
+ } & SelectionRecipeStep>;
1812
+ };
1813
+ private requireRecipe;
1814
+ /**
1815
+ * Replaces the selection's recipe with `steps` (checked first) and the selection with what they
1816
+ * make, from nothing. One undo step; nothing changes on an error. Returns the recipe.
1817
+ */
1818
+ setSelectionRecipe(steps: readonly unknown[]): Promise<ReturnType<ImageEditorController['getSelectionRecipe']>>;
1819
+ /** Changes step `index` of the selection's recipe (fields given replace its own; `op` replaces it whole) and replays. One undo step. */
1820
+ editSelectionStep(index: number, changes: Record<string, unknown>): Promise<ReturnType<ImageEditorController['getSelectionRecipe']>>;
1821
+ /** Inserts a step at `index` (0..length; length appends) and replays. One undo step. */
1822
+ insertSelectionStep(index: number, step: unknown): Promise<ReturnType<ImageEditorController['getSelectionRecipe']>>;
1823
+ /** Removes step `index` and replays (the last step cannot go: deselect instead). One undo step. */
1824
+ removeSelectionStep(index: number): Promise<ReturnType<ImageEditorController['getSelectionRecipe']>>;
1825
+ /** Drops the selection's recipe, keeping the selection as it is (a plain bitmap). One undo step. */
1826
+ freezeSelection(): boolean;
1827
+ private recipeIndex;
1805
1828
  /**
1806
1829
  * Shows `mask` in place of the selection while a gesture runs (Quick Selection as the brush
1807
1830
  * moves; `null` shows nothing selected), or with `undefined` stops. View state only: no undo
@@ -1,5 +1,6 @@
1
1
  import { AdjustmentKind, AdjustmentLayer, AdjustmentParamsMap, Annotation, CreateAnnotationPayload, AspectRatio, CropBox, DepthMaskOptions, ExportOptions, ImageAdjustments, ImageDimensions, ImageEditorFit, ImageEditorOptions, ImageEditorState, ImageEditorTool, ImageTransform, ImagePoint, SerializedImageEditorState, DocumentOpener } from './types.js';
2
2
  import { type InspectMaskEdgeOptions, type MaskEdgeReport } from './selection/inspect.js';
3
+ import { type SelectionRecipeStep } from './selection/recipe.js';
3
4
  import { type CompareSelectionsOptions, type SelectionDiff } from './selection/diff.js';
4
5
  import { type SelectionUncertainty, type SelectionUncertaintyOptions } from './selection/uncertainty.js';
5
6
  import { type PathToSelectionOptions, type SelectionToPathOptions } from './selection/path.js';
@@ -745,10 +746,6 @@ export declare function migrateToLayeredState(data: Partial<SerializedImageEdito
745
746
  }, size: ImageDimensions): SerializedLayeredImageEditorState;
746
747
  export declare const DEFAULT_TRANSFORM: ImageTransform;
747
748
  export declare const DEFAULT_DEPTH_MASK: DepthMaskOptions;
748
- /**
749
- * ImageEditorController manages the complete lifecycle, canvas rendering pipeline,
750
- * tool interaction states, undo/redo history, serialization, and image export.
751
- */
752
749
  export declare class ImageEditorController {
753
750
  private state;
754
751
  private renderer;
@@ -1802,6 +1799,32 @@ export declare class ImageEditorController {
1802
1799
  * Returns false when nothing changed.
1803
1800
  */
1804
1801
  setSelection(mask: SelectionMask | null, mode?: SelectionMode): boolean;
1802
+ /** The recipe step of the selection command now running, taken by `setSelection`. */
1803
+ private pendingStep;
1804
+ /** Runs a selection command whose change `step` describes, so the selection's recipe records it. */
1805
+ private withRecipeStep;
1806
+ /** The selection's recipe as agents and panels read it (empty and not live when frozen or empty). */
1807
+ getSelectionRecipe(): {
1808
+ live: boolean;
1809
+ steps: Array<{
1810
+ index: number;
1811
+ } & SelectionRecipeStep>;
1812
+ };
1813
+ private requireRecipe;
1814
+ /**
1815
+ * Replaces the selection's recipe with `steps` (checked first) and the selection with what they
1816
+ * make, from nothing. One undo step; nothing changes on an error. Returns the recipe.
1817
+ */
1818
+ setSelectionRecipe(steps: readonly unknown[]): Promise<ReturnType<ImageEditorController['getSelectionRecipe']>>;
1819
+ /** Changes step `index` of the selection's recipe (fields given replace its own; `op` replaces it whole) and replays. One undo step. */
1820
+ editSelectionStep(index: number, changes: Record<string, unknown>): Promise<ReturnType<ImageEditorController['getSelectionRecipe']>>;
1821
+ /** Inserts a step at `index` (0..length; length appends) and replays. One undo step. */
1822
+ insertSelectionStep(index: number, step: unknown): Promise<ReturnType<ImageEditorController['getSelectionRecipe']>>;
1823
+ /** Removes step `index` and replays (the last step cannot go: deselect instead). One undo step. */
1824
+ removeSelectionStep(index: number): Promise<ReturnType<ImageEditorController['getSelectionRecipe']>>;
1825
+ /** Drops the selection's recipe, keeping the selection as it is (a plain bitmap). One undo step. */
1826
+ freezeSelection(): boolean;
1827
+ private recipeIndex;
1805
1828
  /**
1806
1829
  * Shows `mask` in place of the selection while a gesture runs (Quick Selection as the brush
1807
1830
  * moves; `null` shows nothing selected), or with `undefined` stops. View state only: no undo