@magicpages/kalotyp-ui 0.1.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 (110) hide show
  1. package/dist/canvas/position-handles.d.ts +18 -0
  2. package/dist/canvas/position-handles.d.ts.map +1 -0
  3. package/dist/canvas/preview-canvas.d.ts +21 -0
  4. package/dist/canvas/preview-canvas.d.ts.map +1 -0
  5. package/dist/canvas/render-image.d.ts +4 -0
  6. package/dist/canvas/render-image.d.ts.map +1 -0
  7. package/dist/canvas/render-overlay.d.ts +4 -0
  8. package/dist/canvas/render-overlay.d.ts.map +1 -0
  9. package/dist/canvas/stage-gestures.d.ts +12 -0
  10. package/dist/canvas/stage-gestures.d.ts.map +1 -0
  11. package/dist/cheatsheet/modal.d.ts +10 -0
  12. package/dist/cheatsheet/modal.d.ts.map +1 -0
  13. package/dist/dom/build-preset-row.d.ts +10 -0
  14. package/dist/dom/build-preset-row.d.ts.map +1 -0
  15. package/dist/dom/build-shell-dom.d.ts +39 -0
  16. package/dist/dom/build-shell-dom.d.ts.map +1 -0
  17. package/dist/dom/build-stage.d.ts +19 -0
  18. package/dist/dom/build-stage.d.ts.map +1 -0
  19. package/dist/dom/build-util-nav.d.ts +18 -0
  20. package/dist/dom/build-util-nav.d.ts.map +1 -0
  21. package/dist/dom/focus-trap.d.ts +21 -0
  22. package/dist/dom/focus-trap.d.ts.map +1 -0
  23. package/dist/dom/nested-modal.d.ts +25 -0
  24. package/dist/dom/nested-modal.d.ts.map +1 -0
  25. package/dist/icons.d.ts +13 -0
  26. package/dist/icons.d.ts.map +1 -0
  27. package/dist/index.d.ts +61 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +5198 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/keyboard-shortcuts.d.ts +15 -0
  32. package/dist/keyboard-shortcuts.d.ts.map +1 -0
  33. package/dist/output/popover.d.ts +21 -0
  34. package/dist/output/popover.d.ts.map +1 -0
  35. package/dist/plugins/annotate/coord-inputs.d.ts +72 -0
  36. package/dist/plugins/annotate/coord-inputs.d.ts.map +1 -0
  37. package/dist/plugins/annotate/mount.d.ts +40 -0
  38. package/dist/plugins/annotate/mount.d.ts.map +1 -0
  39. package/dist/plugins/annotate/panel.d.ts +43 -0
  40. package/dist/plugins/annotate/panel.d.ts.map +1 -0
  41. package/dist/plugins/annotate/plugin.d.ts +20 -0
  42. package/dist/plugins/annotate/plugin.d.ts.map +1 -0
  43. package/dist/plugins/annotate/pointer-drag.d.ts +41 -0
  44. package/dist/plugins/annotate/pointer-drag.d.ts.map +1 -0
  45. package/dist/plugins/annotate/render.d.ts +46 -0
  46. package/dist/plugins/annotate/render.d.ts.map +1 -0
  47. package/dist/plugins/annotate/selection.d.ts +43 -0
  48. package/dist/plugins/annotate/selection.d.ts.map +1 -0
  49. package/dist/plugins/annotate/stage.d.ts +29 -0
  50. package/dist/plugins/annotate/stage.d.ts.map +1 -0
  51. package/dist/plugins/annotate/text-editor.d.ts +34 -0
  52. package/dist/plugins/annotate/text-editor.d.ts.map +1 -0
  53. package/dist/plugins/annotate/tools.d.ts +46 -0
  54. package/dist/plugins/annotate/tools.d.ts.map +1 -0
  55. package/dist/plugins/crop/interaction.d.ts +17 -0
  56. package/dist/plugins/crop/interaction.d.ts.map +1 -0
  57. package/dist/plugins/crop/mount.d.ts +19 -0
  58. package/dist/plugins/crop/mount.d.ts.map +1 -0
  59. package/dist/plugins/crop/plugin.d.ts +11 -0
  60. package/dist/plugins/crop/plugin.d.ts.map +1 -0
  61. package/dist/plugins/filter/mount.d.ts +16 -0
  62. package/dist/plugins/filter/mount.d.ts.map +1 -0
  63. package/dist/plugins/filter/plugin.d.ts +10 -0
  64. package/dist/plugins/filter/plugin.d.ts.map +1 -0
  65. package/dist/plugins/filter/thumbnails.d.ts +32 -0
  66. package/dist/plugins/filter/thumbnails.d.ts.map +1 -0
  67. package/dist/plugins/finetune/mount.d.ts +16 -0
  68. package/dist/plugins/finetune/mount.d.ts.map +1 -0
  69. package/dist/plugins/finetune/plugin.d.ts +6 -0
  70. package/dist/plugins/finetune/plugin.d.ts.map +1 -0
  71. package/dist/plugins/finetune/preview.d.ts +16 -0
  72. package/dist/plugins/finetune/preview.d.ts.map +1 -0
  73. package/dist/plugins/flip/mount.d.ts +14 -0
  74. package/dist/plugins/flip/mount.d.ts.map +1 -0
  75. package/dist/plugins/flip/plugin.d.ts +6 -0
  76. package/dist/plugins/flip/plugin.d.ts.map +1 -0
  77. package/dist/plugins/frame/mount.d.ts +33 -0
  78. package/dist/plugins/frame/mount.d.ts.map +1 -0
  79. package/dist/plugins/frame/plugin.d.ts +15 -0
  80. package/dist/plugins/frame/plugin.d.ts.map +1 -0
  81. package/dist/plugins/redact/coord-inputs.d.ts +18 -0
  82. package/dist/plugins/redact/coord-inputs.d.ts.map +1 -0
  83. package/dist/plugins/redact/mount.d.ts +26 -0
  84. package/dist/plugins/redact/mount.d.ts.map +1 -0
  85. package/dist/plugins/redact/panel.d.ts +34 -0
  86. package/dist/plugins/redact/panel.d.ts.map +1 -0
  87. package/dist/plugins/redact/plugin.d.ts +14 -0
  88. package/dist/plugins/redact/plugin.d.ts.map +1 -0
  89. package/dist/plugins/redact/render.d.ts +57 -0
  90. package/dist/plugins/redact/render.d.ts.map +1 -0
  91. package/dist/plugins/redact/selection.d.ts +30 -0
  92. package/dist/plugins/redact/selection.d.ts.map +1 -0
  93. package/dist/plugins/redact/stage.d.ts +19 -0
  94. package/dist/plugins/redact/stage.d.ts.map +1 -0
  95. package/dist/plugins/resize/mount.d.ts +21 -0
  96. package/dist/plugins/resize/mount.d.ts.map +1 -0
  97. package/dist/plugins/resize/plugin.d.ts +6 -0
  98. package/dist/plugins/resize/plugin.d.ts.map +1 -0
  99. package/dist/plugins/rotate/mount.d.ts +16 -0
  100. package/dist/plugins/rotate/mount.d.ts.map +1 -0
  101. package/dist/plugins/rotate/plugin.d.ts +6 -0
  102. package/dist/plugins/rotate/plugin.d.ts.map +1 -0
  103. package/dist/preferences/modal.d.ts +24 -0
  104. package/dist/preferences/modal.d.ts.map +1 -0
  105. package/dist/preferences/storage.d.ts +77 -0
  106. package/dist/preferences/storage.d.ts.map +1 -0
  107. package/dist/shell.d.ts +27 -0
  108. package/dist/shell.d.ts.map +1 -0
  109. package/dist/styles.css +1 -0
  110. package/package.json +58 -0
@@ -0,0 +1,32 @@
1
+ import { type FilterPreset } from '@magicpages/kalotyp-core';
2
+ /**
3
+ * Filter-strip thumbnails. Uses the same `applyFinetuneToImageData` as bake+preview, so
4
+ * the thumbnail honestly previews the saved result (modulo source→thumbnail resampling).
5
+ */
6
+ export declare const THUMBNAIL_MAX_WIDTH = 80;
7
+ export declare const THUMBNAIL_MAX_HEIGHT = 60;
8
+ export interface ThumbnailDims {
9
+ readonly width: number;
10
+ readonly height: number;
11
+ }
12
+ /** Largest aspect-preserving fit inside the THUMBNAIL_MAX_* box. */
13
+ export declare function computeThumbnailDims(source: {
14
+ width: number;
15
+ height: number;
16
+ }): ThumbnailDims;
17
+ export interface ThumbnailCache {
18
+ get(preset: FilterPreset): HTMLCanvasElement;
19
+ dispose(): void;
20
+ }
21
+ export interface BuildThumbnailCacheOptions {
22
+ readonly source: CanvasImageSource & {
23
+ readonly width?: number;
24
+ readonly height?: number;
25
+ };
26
+ readonly dims: ThumbnailDims;
27
+ readonly dpr: number;
28
+ readonly presets?: readonly FilterPreset[];
29
+ }
30
+ /** Lazy-rendered preset cache. Baseline ImageData is captured once so per-preset cost is math + putImageData. */
31
+ export declare function buildThumbnailCache(options: BuildThumbnailCacheOptions): ThumbnailCache;
32
+ //# sourceMappingURL=thumbnails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thumbnails.d.ts","sourceRoot":"","sources":["../../../src/plugins/filter/thumbnails.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAU7F;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,iBAAiB,CAAC;IAC7C,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3F,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAC5C;AAED,iHAAiH;AACjH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,cAAc,CA2DvF"}
@@ -0,0 +1,16 @@
1
+ import { type FinetuneState, type SourceImage, type Store, type ViewportController } from '@magicpages/kalotyp-core';
2
+ export interface MountFinetuneOptions {
3
+ readonly stageHost: HTMLElement;
4
+ readonly utilHost: HTMLElement;
5
+ readonly source: SourceImage;
6
+ readonly store: Store<FinetuneState>;
7
+ /** Editor-level zoom + pan controller. Optional in jsdom tests. */
8
+ readonly viewport?: ViewportController;
9
+ /** Fires on slider `change` / number `change` / reset (one undo entry per drag, not per `input`). */
10
+ readonly onCommit?: () => void;
11
+ }
12
+ export interface MountFinetuneHandle {
13
+ destroy(): void;
14
+ }
15
+ export declare function mountFinetuneUtility(options: MountFinetuneOptions): MountFinetuneHandle;
16
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/plugins/finetune/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAIlC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACrC,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IACvC,qGAAqG;IACrG,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CA4GvF"}
@@ -0,0 +1,6 @@
1
+ import { type FinetuneState, type UtilityPlugin } from '@magicpages/kalotyp-core';
2
+ export interface FinetunePluginOptions {
3
+ readonly panelHost: HTMLElement;
4
+ }
5
+ export declare function createFinetunePlugin(options: FinetunePluginOptions): UtilityPlugin<FinetuneState>;
6
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/finetune/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CACjC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,aAAa,CAAC,aAAa,CAAC,CAiBjG"}
@@ -0,0 +1,16 @@
1
+ import { type FinetuneState } from '@magicpages/kalotyp-core';
2
+ /**
3
+ * Finetune preview pipeline. Operates on display-res pixels (a 4000×3000 photo letterboxed to
4
+ * ~720×480 at DPR 2 is ~1.4 MP — the six-adjust composed pass measures ~5 ms there).
5
+ */
6
+ export interface FinetunePreviewPipeline {
7
+ paint(state: FinetuneState): void;
8
+ rebuild(width: number, height: number): void;
9
+ dispose(): void;
10
+ }
11
+ export interface BuildPreviewPipelineOptions {
12
+ readonly canvas: HTMLCanvasElement;
13
+ readonly sourceBitmap: CanvasImageSource;
14
+ }
15
+ export declare function buildFinetunePreviewPipeline(options: BuildPreviewPipelineOptions): FinetunePreviewPipeline;
16
+ //# sourceMappingURL=preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/plugins/finetune/preview.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAClC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,OAAO,IAAI,IAAI,CAAC;CACjB;AAWD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;CAC1C;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,2BAA2B,GACnC,uBAAuB,CAgEzB"}
@@ -0,0 +1,14 @@
1
+ import { type FlipState, type SourceImage, type Store, type ViewportController } from '@magicpages/kalotyp-core';
2
+ export interface MountFlipOptions {
3
+ readonly stageHost: HTMLElement;
4
+ readonly utilHost: HTMLElement;
5
+ readonly source: SourceImage;
6
+ readonly store: Store<FlipState>;
7
+ readonly viewport?: ViewportController;
8
+ readonly onCommit?: () => void;
9
+ }
10
+ export interface MountFlipHandle {
11
+ destroy(): void;
12
+ }
13
+ export declare function mountFlipUtility(options: MountFlipOptions): MountFlipHandle;
14
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/plugins/flip/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,kBAAkB,EAExB,MAAM,0BAA0B,CAAC;AAQlC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAuF3E"}
@@ -0,0 +1,6 @@
1
+ import { type FlipState, type UtilityPlugin } from '@magicpages/kalotyp-core';
2
+ export interface FlipPluginOptions {
3
+ readonly panelHost: HTMLElement;
4
+ }
5
+ export declare function createFlipPlugin(options: FlipPluginOptions): UtilityPlugin<FlipState>;
6
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/flip/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CACjC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa,CAAC,SAAS,CAAC,CAiBrF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Mount the frame plugin: a preset thumbnail strip (six entries
3
+ * matching Ghost's `frameOptions` order) plus a colour picker for the
4
+ * presets that accept colour customisation. The stage shows the
5
+ * upstream-baked source with the active frame composited on top.
6
+ *
7
+ * frame is the chain's tail link, so the live preview
8
+ * is conceptually "what the user gets on Save." We render the source
9
+ * + frame composite into a single preview canvas; clicking a
10
+ * thumbnail updates the store, the preview re-renders, and the
11
+ * editor's history captures the commit.
12
+ */
13
+ import { type FramePresetId, type FrameState, type SourceImage, type Store, type ViewportController } from '@magicpages/kalotyp-core';
14
+ export interface MountFrameOptions {
15
+ readonly stageHost: HTMLElement;
16
+ readonly utilHost: HTMLElement;
17
+ readonly source: SourceImage;
18
+ readonly store: Store<FrameState>;
19
+ readonly viewport?: ViewportController | undefined;
20
+ /**
21
+ * Optional locale callbacks Ghost passes via `frameOptions[i][1]`.
22
+ * The factory wires this from the Ghost adapter; the playground
23
+ * passes nothing and the strip falls back to the preset's default
24
+ * label.
25
+ */
26
+ readonly labels?: Partial<Record<FramePresetId, string>> | undefined;
27
+ readonly onCommit?: (() => void) | undefined;
28
+ }
29
+ export interface MountFrameHandle {
30
+ destroy(): void;
31
+ }
32
+ export declare function mountFrameUtility(options: MountFrameOptions): MountFrameHandle;
33
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/plugins/frame/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,KAAK,EAEV,KAAK,kBAAkB,EAMxB,MAAM,0BAA0B,CAAC;AAIlC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CAC9C;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAoK9E"}
@@ -0,0 +1,15 @@
1
+ import { type FramePresetId, type FrameState, type UtilityPlugin } from '@magicpages/kalotyp-core';
2
+ export interface FramePluginOptions {
3
+ /** Where the plugin's panel UI mounts. */
4
+ readonly panelHost: HTMLElement;
5
+ /**
6
+ * Optional locale labels for the six presets. The Ghost adapter
7
+ * passes Ghost's resolved `frameOptions[i][1](locale)` strings here
8
+ * so the strip uses the user's localised labels; the playground
9
+ * passes nothing and the strip falls back to the defaults from the
10
+ * core preset list.
11
+ */
12
+ readonly labels?: Partial<Record<FramePresetId, string>> | undefined;
13
+ }
14
+ export declare function createFramePlugin(options: FramePluginOptions): UtilityPlugin<FrameState>;
15
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/frame/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;CACtE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,CAkBxF"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Per-region coordinate-input row for the redact plugin's keyboard
3
+ * placement path. Same shape as the annotate
4
+ * plugin's coord-inputs.ts but with one shape kind (rect) and four
5
+ * fields (Left, Top, Width, Height).
6
+ */
7
+ import type { RedactRegion } from '@magicpages/kalotyp-core';
8
+ export interface RedactCoordInputsOptions {
9
+ onRegionChanged(region: RedactRegion): void;
10
+ }
11
+ export interface RedactCoordInputsHandle {
12
+ readonly container: HTMLDivElement;
13
+ /** Show inputs for the given region, or hide when null. */
14
+ updateForRegion(region: RedactRegion | null): void;
15
+ destroy(): void;
16
+ }
17
+ export declare function buildRedactCoordInputs(options: RedactCoordInputsOptions): RedactCoordInputsHandle;
18
+ //# sourceMappingURL=coord-inputs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coord-inputs.d.ts","sourceRoot":"","sources":["../../../src/plugins/redact/coord-inputs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,2DAA2D;IAC3D,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;IACnD,OAAO,IAAI,IAAI,CAAC;CACjB;AAeD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,uBAAuB,CAqGjG"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Mount the redact plugin's stage UI and wire up:
3
+ * - the layered canvases (image / regions / live);
4
+ * - the bottom panel (mode toolbar, colour picker, insert/delete);
5
+ * - pointer drag-to-define for new regions;
6
+ * - the selection layer (corner handles + per-handle resize);
7
+ * - the per-region coordinate inputs (Phase 6.4 keyboard a11y);
8
+ * - keyboard shortcuts (Delete/Backspace removes selection; Esc
9
+ * deselects; arrow keys nudge the selected region);
10
+ * - revalidation against upstream-bounds changes.
11
+ */
12
+ import { type RedactState, type SourceImage, type Store, type ViewportController } from '@magicpages/kalotyp-core';
13
+ export interface MountRedactOptions {
14
+ readonly stageHost: HTMLElement;
15
+ readonly utilHost: HTMLElement;
16
+ readonly source: SourceImage;
17
+ readonly store: Store<RedactState>;
18
+ readonly viewport?: ViewportController;
19
+ readonly onCommit?: () => void;
20
+ readonly onAnnounce?: (message: string) => void;
21
+ }
22
+ export interface MountRedactHandle {
23
+ destroy(): void;
24
+ }
25
+ export declare function mountRedactUtility(options: MountRedactOptions): MountRedactHandle;
26
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/plugins/redact/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,KAAK,EAEV,KAAK,kBAAkB,EAgBxB,MAAM,0BAA0B,CAAC;AAUlC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,iBAAiB,CA+XjF"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Build the redact panel: mode toggle, optional colour picker, the
3
+ * per-selection coordinate inputs row, and Insert/Delete actions.
4
+ *
5
+ * Same panel-rhythm conventions as the annotate plugin (Phase 6.3) —
6
+ * a toolbar of mode buttons, then a style row with colour + Insert +
7
+ * Delete, then a slot for the coordinate inputs row mounted by the
8
+ * mount layer.
9
+ */
10
+ import type { RedactMode } from '@magicpages/kalotyp-core';
11
+ export interface RedactPanelOptions {
12
+ readonly initialMode: RedactMode;
13
+ readonly initialColor: string;
14
+ readonly canDelete: boolean;
15
+ /** Where the per-selection coordinate-input row mounts. */
16
+ readonly coordInputs: HTMLElement;
17
+ onSelectMode(mode: RedactMode): void;
18
+ onColorChange(color: string): void;
19
+ onDeleteSelected(): void;
20
+ onInsertAtCenter(): void;
21
+ }
22
+ export interface RedactPanel {
23
+ readonly container: HTMLDivElement;
24
+ readonly modeButtons: ReadonlyMap<RedactMode, HTMLButtonElement>;
25
+ readonly colorInput: HTMLInputElement;
26
+ readonly hexInput: HTMLInputElement;
27
+ readonly insertButton: HTMLButtonElement;
28
+ readonly deleteButton: HTMLButtonElement;
29
+ setActiveMode(mode: RedactMode): void;
30
+ setColor(color: string): void;
31
+ setCanDelete(canDelete: boolean): void;
32
+ }
33
+ export declare function buildRedactPanel(options: RedactPanelOptions): RedactPanel;
34
+ //# sourceMappingURL=panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../src/plugins/redact/panel.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACrC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,gBAAgB,IAAI,IAAI,CAAC;IACzB,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IACjE,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAQD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,CAgJzE"}
@@ -0,0 +1,14 @@
1
+ import { type RedactState, type UtilityPlugin } from '@magicpages/kalotyp-core';
2
+ export interface RedactPluginOptions {
3
+ /** Where the plugin's panel UI mounts. */
4
+ readonly panelHost: HTMLElement;
5
+ }
6
+ /**
7
+ * Build the redact `UtilityPlugin` instance for one editor session.
8
+ * redact is the chain link between annotate and resize;
9
+ * `bake` is called by the chain runner with the post-annotate
10
+ * composite as input and returns a fresh `SourceImage` with each
11
+ * region redacted.
12
+ */
13
+ export declare function createRedactPlugin(options: RedactPluginOptions): UtilityPlugin<RedactState>;
14
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/redact/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,aAAa,CAAC,WAAW,CAAC,CAmB3F"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Render helpers for the redact plugin's three canvas layers. The
3
+ * approach mirrors the annotate plugin's stacked layers exactly:
4
+ *
5
+ * - `paintRedactImageLayer` draws the upstream-baked source onto the
6
+ * bottom canvas. Called once on mount and on stage resize.
7
+ * - `paintRedactRegionsLayer` draws every committed region's preview
8
+ * representation on top of the image. Pixelate/blur are baked
9
+ * into the layer here so the live stage matches the export. Solid
10
+ * regions are simple coloured rectangles.
11
+ * - `paintRedactLiveLayer` draws the in-progress region (during a
12
+ * drag) in display space — a dashed marquee with the current mode
13
+ * rendered as a translucent fill so the user gets a feel for what
14
+ * they'll get on commit.
15
+ *
16
+ * The regions layer reuses the core `paintRegion` so the visible
17
+ * preview is byte-equal to the bake output (per region). The image
18
+ * argument is only needed for pixelate/blur — solid doesn't read it.
19
+ */
20
+ import { type RedactRegion, type SourceImage, type Viewport } from '@magicpages/kalotyp-core';
21
+ export declare function paintRedactImageLayer(canvas: HTMLCanvasElement, source: SourceImage, stageWidth: number, stageHeight: number, viewport: Viewport): void;
22
+ /**
23
+ * Paint every region onto the regions canvas. Pixelate and blur read
24
+ * from the supplied image-source bitmap (drawn at viewport scale) so
25
+ * the preview is the same composition the bake produces. We draw the
26
+ * image into an off-screen canvas at the viewport scale, then ask
27
+ * the core `paintRegion` to redact each region's pixels in turn.
28
+ *
29
+ * The trade-off here: regions drawn during the live preview composite
30
+ * onto the image at *display* pixels (not source pixels), so the
31
+ * pixelate grid size in the preview differs slightly from the export.
32
+ * The bake re-runs at source resolution; the user sees the right
33
+ * thing on the way out.
34
+ */
35
+ export declare function paintRedactRegionsLayer(canvas: HTMLCanvasElement, source: SourceImage, regions: ReadonlyArray<RedactRegion>, selectedId: string | null, stageWidth: number, stageHeight: number, viewport: Viewport): void;
36
+ /**
37
+ * Draw a marquee for the in-progress drag. We don't bake pixelate /
38
+ * blur here — pixelate at the live drag's pixel grid is jittery and
39
+ * doesn't help the user understand the result. Instead we paint a
40
+ * translucent fill in the mode's signature colour:
41
+ *
42
+ * - `solid` → user-chosen colour at 70% alpha
43
+ * - `pixelate` → neutral grey at 60% alpha + a "pixelate" texture
44
+ * (a small grid of squares) so the user knows what they're getting
45
+ * - `blur` → low-alpha blue-grey, signalling "softening" without
46
+ * actually blurring (we'd have to repeatedly re-read the canvas;
47
+ * the export bake handles the real blur).
48
+ */
49
+ export declare function paintRedactLiveLayer(canvas: HTMLCanvasElement, marquee: {
50
+ x: number;
51
+ y: number;
52
+ width: number;
53
+ height: number;
54
+ mode: RedactRegion['mode'];
55
+ color: string;
56
+ } | null, stageWidth: number, stageHeight: number, viewport: Viewport): void;
57
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/plugins/redact/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEd,MAAM,0BAA0B,CAAC;AA0BlC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GACjB,IAAI,CAYN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GACjB,IAAI,CAmEN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE;IACP,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,EACR,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GACjB,IAAI,CA2BN"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Selection rendering and per-handle resize gesture for redaction
3
+ * regions. The annotate plugin's `selection.ts` does the same job for
4
+ * shapes; the redact version is simpler because there's only one
5
+ * shape kind (rectangle), so we can wire the corner/edge handles
6
+ * directly to a rect-resize without a per-kind dispatch.
7
+ */
8
+ import { type RedactRegion, type RedactState, type Store, type Viewport } from '@magicpages/kalotyp-core';
9
+ export interface RedactSelectionLayerOptions {
10
+ readonly host: HTMLDivElement;
11
+ readonly store: Store<RedactState>;
12
+ /** Project a raw client-space pointer to image-space pixels. */
13
+ toImageSpace(point: {
14
+ clientX: number;
15
+ clientY: number;
16
+ }): {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ /** Read the current viewport at gesture start. */
21
+ getViewport(): Viewport;
22
+ /** Emit a history-commit at gesture end. */
23
+ commit(): void;
24
+ }
25
+ export interface RedactSelectionLayer {
26
+ update(region: RedactRegion | null, viewport: Viewport): void;
27
+ destroy(): void;
28
+ }
29
+ export declare function buildRedactSelectionLayer(options: RedactSelectionLayerOptions): RedactSelectionLayer;
30
+ //# sourceMappingURL=selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../src/plugins/redact/selection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,KAAK,KAAK,EACV,KAAK,QAAQ,EAId,MAAM,0BAA0B,CAAC;AAIlC,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACnC,gEAAgE;IAChE,YAAY,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpF,kDAAkD;IAClD,WAAW,IAAI,QAAQ,CAAC;IACxB,4CAA4C;IAC5C,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC9D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,2BAA2B,GACnC,oBAAoB,CA6GtB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Build the layered DOM for the redact plugin's stage. Same structural
3
+ * shape as the annotate plugin (image canvas, regions canvas, live
4
+ * canvas, hit-area, handles layer) — redact reuses the same selection
5
+ * + drag-to-define interaction model with one shape kind, so keeping
6
+ * the DOM rhythm aligned across plugins is the cleanest choice.
7
+ *
8
+ * No text overlay: redactions don't carry typed content.
9
+ */
10
+ export interface RedactStageElements {
11
+ readonly container: HTMLDivElement;
12
+ readonly imageCanvas: HTMLCanvasElement;
13
+ readonly regionsCanvas: HTMLCanvasElement;
14
+ readonly liveCanvas: HTMLCanvasElement;
15
+ readonly hitArea: HTMLDivElement;
16
+ readonly handlesLayer: HTMLDivElement;
17
+ }
18
+ export declare function buildRedactStage(): RedactStageElements;
19
+ //# sourceMappingURL=stage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/plugins/redact/stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC;CACvC;AAED,wBAAgB,gBAAgB,IAAI,mBAAmB,CAgCtD"}
@@ -0,0 +1,21 @@
1
+ import { type ResizeState, type SourceImage, type Store, type ViewportController } from '@magicpages/kalotyp-core';
2
+ export interface MountResizeOptions {
3
+ readonly stageHost: HTMLElement;
4
+ readonly utilHost: HTMLElement;
5
+ readonly source: SourceImage;
6
+ readonly store: Store<ResizeState>;
7
+ /** Editor-level zoom + pan controller. Optional in jsdom tests. */
8
+ readonly viewport?: ViewportController;
9
+ /**
10
+ * Called after each width/height/percent/lock change so the editor
11
+ * can capture an undo snapshot. Inputs already commit on
12
+ * `change` (blur/Enter), not `input`, so a single typed value is one
13
+ * undo step.
14
+ */
15
+ readonly onCommit?: () => void;
16
+ }
17
+ export interface MountResizeHandle {
18
+ destroy(): void;
19
+ }
20
+ export declare function mountResizeUtility(options: MountResizeOptions): MountResizeHandle;
21
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/plugins/resize/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,kBAAkB,EAMxB,MAAM,0BAA0B,CAAC;AAQlC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACnC,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,iBAAiB,CAyFjF"}
@@ -0,0 +1,6 @@
1
+ import { type ResizeState, type UtilityPlugin } from '@magicpages/kalotyp-core';
2
+ export interface ResizePluginOptions {
3
+ readonly panelHost: HTMLElement;
4
+ }
5
+ export declare function createResizePlugin(options: ResizePluginOptions): UtilityPlugin<ResizeState>;
6
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/resize/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CACjC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,aAAa,CAAC,WAAW,CAAC,CAiB3F"}
@@ -0,0 +1,16 @@
1
+ import { type RotateState, type SourceImage, type Store, type ViewportController } from '@magicpages/kalotyp-core';
2
+ export interface MountRotateOptions {
3
+ readonly stageHost: HTMLElement;
4
+ readonly utilHost: HTMLElement;
5
+ readonly source: SourceImage;
6
+ readonly store: Store<RotateState>;
7
+ /** Editor-level zoom + pan controller. Optional in jsdom tests. */
8
+ readonly viewport?: ViewportController;
9
+ /** Fires on quarter-turn / slider `change` / number `change` / reset — one undo per drag, not per tick. */
10
+ readonly onCommit?: () => void;
11
+ }
12
+ export interface MountRotateHandle {
13
+ destroy(): void;
14
+ }
15
+ export declare function mountRotateUtility(options: MountRotateOptions): MountRotateHandle;
16
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/plugins/rotate/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,kBAAkB,EAOxB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACnC,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IACvC,2GAA2G;IAC3G,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,IAAI,IAAI,CAAC;CACjB;AAOD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,iBAAiB,CA6IjF"}
@@ -0,0 +1,6 @@
1
+ import { type RotateState, type UtilityPlugin } from '@magicpages/kalotyp-core';
2
+ export interface RotatePluginOptions {
3
+ readonly panelHost: HTMLElement;
4
+ }
5
+ export declare function createRotatePlugin(options: RotatePluginOptions): UtilityPlugin<RotateState>;
6
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/rotate/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CACjC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,aAAa,CAAC,WAAW,CAAC,CAiB3F"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Preferences modal. Lets the user adjust persisted defaults across
3
+ * editor sessions: output format/quality, plus per-utility "remember
4
+ * what I picked last time" toggles.
5
+ *
6
+ * Lifecycle: the caller supplies the current preferences and an
7
+ * `onChange` handler that fires on every internal interaction. The
8
+ * caller is responsible for persisting via `savePreferences` —
9
+ * keeping this modal storage-free means it can be tested without
10
+ * a `localStorage` shim and lets the editor coordinate batched
11
+ * writes with its own debounce.
12
+ */
13
+ import { type KalotypPreferences } from './storage.js';
14
+ export interface OpenPreferencesModalOptions {
15
+ readonly host: HTMLElement;
16
+ readonly initial: KalotypPreferences;
17
+ onChange(next: KalotypPreferences): void;
18
+ onClose(): void;
19
+ }
20
+ export interface PreferencesModalHandle {
21
+ close(): void;
22
+ }
23
+ export declare function openPreferencesModal(options: OpenPreferencesModalOptions): PreferencesModalHandle;
24
+ //# sourceMappingURL=modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/preferences/modal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE5E,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,IAAI,IAAI,CAAC;CACf;AAeD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,sBAAsB,CAqIjG"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Per-site preferences for the editor. Persisted to `localStorage`
3
+ * (browser-origin-scoped automatically); the `siteScope` derived from
4
+ * the Ghost-passed `src` URL further namespaces same-origin-multi-site
5
+ * installs by Ghost-content-root.
6
+ *
7
+ * What's persisted:
8
+ * - Output format and quality (always, no opt-out — saving the
9
+ * user's preferred output format is universally useful).
10
+ * - Annotation default style (colour + stroke width) — opt-in via
11
+ * `rememberAnnotationStyle`.
12
+ * - Last-used filter preset id — opt-in via `rememberFilter`.
13
+ * - Last-used frame preset id and colour — opt-in via
14
+ * `rememberFrame`.
15
+ *
16
+ * What's *not* persisted:
17
+ * - The current edit (transient session state — undo/redo handles
18
+ * in-session reverts).
19
+ * - The image source (Ghost passes a fresh `src` each open).
20
+ * - Anything that could leak identity across sessions (no telemetry,
21
+ * no usage counts).
22
+ *
23
+ * The total payload sits well under 1 KB; quota is not a concern, and
24
+ * even repeated writes-on-commit don't approach `localStorage`'s 5–10 MB
25
+ * per-origin budget.
26
+ */
27
+ import type { OutputMimeChoice } from '@magicpages/kalotyp-core';
28
+ export interface KalotypPreferences {
29
+ readonly outputMimeChoice: OutputMimeChoice;
30
+ readonly outputQuality: number;
31
+ /**
32
+ * Whether to strip EXIF / GPS / camera metadata on save. Stored
33
+ * alongside the output format so the user's privacy choice
34
+ * survives across sessions like the format and quality do.
35
+ */
36
+ readonly outputStripMetadata: boolean;
37
+ readonly rememberAnnotationStyle: boolean;
38
+ readonly rememberFilter: boolean;
39
+ readonly rememberFrame: boolean;
40
+ readonly lastAnnotationColor: string;
41
+ readonly lastAnnotationStrokeWidth: number;
42
+ readonly lastFilterPresetId: string | null;
43
+ readonly lastFramePresetId: string | null;
44
+ readonly lastFrameColor: string;
45
+ }
46
+ export declare const DEFAULT_PREFERENCES: KalotypPreferences;
47
+ /**
48
+ * Derive a stable per-site scope identifier from the `src` option
49
+ * Ghost passes. Used as the suffix on the `localStorage` key so two
50
+ * Ghost installs on the same origin (rare but possible, e.g. a host
51
+ * serving `/site-a/` and `/site-b/` Ghost instances) get separate
52
+ * preferences.
53
+ *
54
+ * Strategy:
55
+ * - URL `src`: use `origin + the leading path up to (and excluding)
56
+ * `/content/`. Ghost serves images at `<origin>/content/images/...`,
57
+ * so the prefix uniquely identifies a Ghost root.
58
+ * - Blob/File `src` (test environments, future direct-feed
59
+ * scenarios): fall back to `window.location.origin`.
60
+ * - Anything else falls to `'default'` so the read still succeeds.
61
+ */
62
+ export declare function getSiteScope(srcOption: unknown): string;
63
+ /**
64
+ * Load preferences for `siteScope`. Missing keys fill from defaults
65
+ * (sparse merge) so a partial historical payload doesn't break the
66
+ * editor. Any read error (no storage, quota, parse failure) returns
67
+ * the defaults — preferences are best-effort.
68
+ */
69
+ export declare function loadPreferences(siteScope: string): KalotypPreferences;
70
+ /**
71
+ * Save preferences for `siteScope`. Writes are best-effort: quota
72
+ * errors and missing storage are swallowed so a failed save never
73
+ * crashes the editor. Validation happens here too — any non-finite
74
+ * or out-of-range value is replaced with the default before write.
75
+ */
76
+ export declare function savePreferences(siteScope: string, prefs: KalotypPreferences): void;
77
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/preferences/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAYjC,CAAC;AAUF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAgBvD;AAMD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAUrE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAQlF"}