@openpresentation/opf-editor 0.10.6 → 0.11.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 (76) hide show
  1. package/README.md +333 -8
  2. package/dist/annotations.d.ts +71 -0
  3. package/dist/annotations.js +281 -0
  4. package/dist/assets.d.ts +67 -0
  5. package/dist/assets.js +176 -0
  6. package/dist/background-options.d.ts +48 -0
  7. package/dist/background-options.js +134 -0
  8. package/dist/block-convert.d.ts +64 -0
  9. package/dist/block-convert.js +142 -0
  10. package/dist/canvas.d.ts +16 -0
  11. package/dist/canvas.js +82 -21
  12. package/dist/chart-data.d.ts +32 -0
  13. package/dist/chart-data.js +101 -0
  14. package/dist/chart-options-panel.d.ts +16 -0
  15. package/dist/chart-options-panel.js +127 -0
  16. package/dist/chart-options.d.ts +49 -0
  17. package/dist/chart-options.js +157 -0
  18. package/dist/content-actions.d.ts +91 -0
  19. package/dist/content-actions.js +207 -0
  20. package/dist/content-controls.js +326 -0
  21. package/dist/data-grid.d.ts +37 -0
  22. package/dist/data-grid.js +1035 -0
  23. package/dist/design-controls.d.ts +43 -0
  24. package/dist/design-controls.js +1077 -0
  25. package/dist/design-options.d.ts +108 -0
  26. package/dist/design-options.js +412 -0
  27. package/dist/edit-helpers.js +52 -0
  28. package/dist/export.d.ts +77 -0
  29. package/dist/export.js +216 -0
  30. package/dist/find-panel.d.ts +44 -0
  31. package/dist/find-panel.js +431 -0
  32. package/dist/find-replace.d.ts +100 -0
  33. package/dist/find-replace.js +374 -0
  34. package/dist/grid-model.d.ts +135 -0
  35. package/dist/grid-model.js +836 -0
  36. package/dist/grid-text.d.ts +33 -0
  37. package/dist/grid-text.js +251 -0
  38. package/dist/image-crop.d.ts +59 -0
  39. package/dist/image-crop.js +336 -0
  40. package/dist/image-cropper.d.ts +29 -0
  41. package/dist/image-cropper.js +519 -0
  42. package/dist/index.d.ts +11 -1
  43. package/dist/index.js +104 -171
  44. package/dist/numbering-panel.d.ts +21 -0
  45. package/dist/numbering-panel.js +200 -0
  46. package/dist/numbering.d.ts +62 -0
  47. package/dist/numbering.js +223 -0
  48. package/dist/outline-view.d.ts +17 -0
  49. package/dist/outline-view.js +278 -0
  50. package/dist/outline.d.ts +56 -0
  51. package/dist/outline.js +271 -0
  52. package/dist/persistence-ui.d.ts +24 -0
  53. package/dist/persistence-ui.js +81 -0
  54. package/dist/persistence.d.ts +105 -0
  55. package/dist/persistence.js +429 -0
  56. package/dist/review-panel.d.ts +44 -0
  57. package/dist/review-panel.js +359 -0
  58. package/dist/review.d.ts +75 -0
  59. package/dist/review.js +170 -0
  60. package/dist/slide-manager.d.ts +44 -0
  61. package/dist/slide-manager.js +695 -0
  62. package/dist/slides.d.ts +96 -0
  63. package/dist/slides.js +433 -0
  64. package/dist/switches.d.ts +26 -0
  65. package/dist/switches.js +127 -43
  66. package/dist/table-options.d.ts +80 -0
  67. package/dist/table-options.js +419 -0
  68. package/dist/table-structure.d.ts +30 -0
  69. package/dist/table-structure.js +92 -0
  70. package/dist/template-panel.d.ts +31 -0
  71. package/dist/template-panel.js +377 -0
  72. package/dist/templates.d.ts +126 -0
  73. package/dist/templates.js +331 -0
  74. package/dist/zip.d.ts +4 -0
  75. package/dist/zip.js +71 -0
  76. package/package.json +150 -10
@@ -0,0 +1,43 @@
1
+ import type { EditorSession } from "./index.js";
2
+
3
+ export type DesignControlSection = "look" | "background" | "slide-image" | "header-footer" | "brand" | "layout-options" | "info" | "selection" | "table" | "slide-content";
4
+ /** Every section, in panel order. `selection` and `table` follow the host's current selection; `slide-content` (RR-26: blocks and regions, images between content and design) follows the current slide. */
5
+ export declare const DESIGN_CONTROL_SECTIONS: readonly DesignControlSection[];
6
+
7
+ export interface DesignControlsOptions {
8
+ editor: EditorSession;
9
+ /** The slide the host is showing (default 0). Call `refresh()` when it changes. */
10
+ getSlideIndex?: () => number;
11
+ /** The host's selected OPF path, for the selection and table sections. Call `refresh()` when it changes. */
12
+ getSelectedPath?: () => string | undefined;
13
+ /** Sections to show (default: all). Mount `selection` and `table` apart from the others to put them beside the content inspector. */
14
+ sections?: readonly DesignControlSection[];
15
+ /** Initial "Applies to" choice. */
16
+ scope?: "deck" | "slide";
17
+ /** Caller-loaded catalog records by kind (layouts, font schemes, themes, ...) for options the bundled catalogs do not have. */
18
+ catalogs?: Record<string, unknown>;
19
+ catalogSources?: Record<string, unknown>;
20
+ /** Called after every committed change (never for a refused one). */
21
+ onChange?: (change: unknown) => void;
22
+ /** Called after a content conversion or replacement with the path to keep selected (the block, or the inline payload field), since the old selection path may no longer exist. */
23
+ onSelectPath?: (path: string) => void;
24
+ /** Largest image the upload controls accept, in bytes (default 2 MiB). */
25
+ maxImageBytes?: number;
26
+ /**
27
+ * For hosts that store images themselves: receives the validated bytes of an uploaded image and returns its reference (a web address or an `asset:` id
28
+ * the host added). When set, nothing is added to the document's `assets`.
29
+ */
30
+ onAddAsset?: (image: { name: string; mediaType: string; bytes: Uint8Array; size: number; alt?: string; file: unknown }) => string | { src: string } | Promise<string | { src: string }>;
31
+ /** Called with every status or error message the panel shows in its live regions. */
32
+ onStatus?: (message: string, info: { error: boolean }) => void;
33
+ }
34
+ export interface DesignControls {
35
+ element: HTMLElement;
36
+ /** Re-read the session, slide and selection. */
37
+ refresh(): void;
38
+ readonly scope: "deck" | "slide";
39
+ setScope(scope: "deck" | "slide"): void;
40
+ destroy(): void;
41
+ }
42
+ /** Mount the dimension, design-option, content-type, chart-type and table controls. Each control commits one undoable change through the session. */
43
+ export declare function createDesignControls(container: HTMLElement, options: DesignControlsOptions): DesignControls;