@openpresentation/opf-editor 0.12.1 → 0.15.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.
- package/README.md +122 -80
- package/dist/annotations.d.ts +16 -16
- package/dist/annotations.js +71 -79
- package/dist/assets.d.ts +7 -7
- package/dist/assets.js +16 -16
- package/dist/background-options.d.ts +12 -5
- package/dist/background-options.js +44 -19
- package/dist/block-controls.js +7 -7
- package/dist/block-convert.d.ts +7 -7
- package/dist/block-convert.js +22 -21
- package/dist/blocks.d.ts +8 -8
- package/dist/blocks.js +41 -40
- package/dist/canvas-fields.js +35 -12
- package/dist/canvas.d.ts +30 -31
- package/dist/canvas.js +64 -68
- package/dist/catalogs.d.ts +48 -0
- package/dist/catalogs.js +217 -0
- package/dist/chart-data.d.ts +10 -10
- package/dist/chart-data.js +21 -21
- package/dist/chart-options-panel.d.ts +2 -2
- package/dist/chart-options-panel.js +82 -8
- package/dist/chart-options.d.ts +35 -9
- package/dist/chart-options.js +133 -40
- package/dist/checks.js +23 -0
- package/dist/color-authoring.js +1 -1
- package/dist/content-actions.d.ts +17 -17
- package/dist/content-actions.js +74 -73
- package/dist/content-controls.js +21 -21
- package/dist/data-grid.js +7 -8
- package/dist/data.d.ts +4 -4
- package/dist/data.js +5 -5
- package/dist/dataset-refs.d.ts +2 -2
- package/dist/dataset-refs.js +5 -5
- package/dist/design-controls.d.ts +12 -5
- package/dist/design-controls.js +312 -111
- package/dist/design-options.d.ts +20 -18
- package/dist/design-options.js +91 -99
- package/dist/edit-helpers.js +8 -7
- package/dist/exact-source.js +5 -5
- package/dist/export.d.ts +7 -7
- package/dist/export.js +48 -17
- package/dist/find-panel.js +5 -5
- package/dist/find-replace.d.ts +3 -3
- package/dist/find-replace.js +23 -20
- package/dist/font-gate.js +49 -58
- package/dist/galleries.js +50 -101
- package/dist/grid-model.d.ts +25 -27
- package/dist/grid-model.js +92 -102
- package/dist/image-crop.d.ts +4 -4
- package/dist/image-crop.js +28 -29
- package/dist/image-cropper.js +3 -3
- package/dist/image-options.d.ts +45 -0
- package/dist/image-options.js +195 -0
- package/dist/index.d.ts +48 -31
- package/dist/index.js +154 -126
- package/dist/json-editor.js +2 -2
- package/dist/json-menu.js +2 -2
- package/dist/json-options.d.ts +3 -3
- package/dist/json-options.js +44 -54
- package/dist/layout-handles.js +5 -5
- package/dist/layout-placeholders.js +4 -4
- package/dist/layout.d.ts +2 -2
- package/dist/layout.js +8 -7
- package/dist/numbering-panel.js +3 -5
- package/dist/numbering.d.ts +3 -5
- package/dist/numbering.js +14 -26
- package/dist/outline-view.js +24 -24
- package/dist/outline.d.ts +12 -12
- package/dist/outline.js +52 -50
- package/dist/persistence.d.ts +1 -1
- package/dist/persistence.js +19 -18
- package/dist/presentation-ids.js +2 -2
- package/dist/react.js +3 -3
- package/dist/review-panel.d.ts +30 -13
- package/dist/review-panel.js +160 -53
- package/dist/review.d.ts +36 -43
- package/dist/review.js +92 -53
- package/dist/rich-text-input.js +4 -3
- package/dist/rich-text-toolbar.js +5 -3
- package/dist/rich-text.js +5 -2
- package/dist/schema-inspector.d.ts +2 -2
- package/dist/schema-inspector.js +16 -11
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +26 -6
- package/dist/slide-manager.d.ts +2 -2
- package/dist/slide-manager.js +19 -19
- package/dist/slides.d.ts +21 -21
- package/dist/slides.js +104 -101
- package/dist/svelte.js +2 -3
- package/dist/switches.d.ts +37 -22
- package/dist/switches.js +282 -171
- package/dist/table-options.d.ts +8 -8
- package/dist/table-options.js +28 -27
- package/dist/table-structure.d.ts +10 -10
- package/dist/table-structure.js +21 -21
- package/dist/template-panel.d.ts +3 -3
- package/dist/template-panel.js +37 -13
- package/dist/templates.d.ts +22 -11
- package/dist/templates.js +48 -55
- package/dist/transfer.d.ts +15 -4
- package/dist/transfer.js +107 -161
- package/package.json +12 -6
- package/dist/font-defaults.js +0 -25
package/dist/switches.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { ConvertOptions } from "@openpresentation/opf/convert";
|
|
2
|
+
import type { Catalog } from "@openpresentation/opf";
|
|
2
3
|
import type { EditorChange, EditorSession, JsonPatchOperation } from "./index.js";
|
|
3
4
|
|
|
5
|
+
/** Display metadata for the engine vocabularies, in the shape of `catalogDisplay` (`@openpresentation/opf/catalog`): records by id, or a list of records with `id` (`bcp47` for a language). */
|
|
6
|
+
export interface SwitchVocabularies {
|
|
7
|
+
languages?: unknown;
|
|
8
|
+
chartTypes?: unknown;
|
|
9
|
+
socialPlatforms?: unknown;
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
/** The schema's DimensionPreset values: the values of the slide-sizes switch. */
|
|
5
|
-
export declare const SLIDE_SIZE_PRESETS: readonly ["16:9", "4:3", "16:10", "letter", "a4", "widescreen", "standard"];
|
|
13
|
+
export declare const SLIDE_SIZE_PRESETS: readonly ["16:9", "4:3", "16:10", "1:1", "4:5", "9:16", "letter", "a4", "widescreen", "standard"];
|
|
6
14
|
export type SlideSizePreset = (typeof SLIDE_SIZE_PRESETS)[number];
|
|
7
15
|
|
|
8
16
|
/** Every switchable dimension: the 14 pptx.gallery dimensions, then `slide-sizes` and `purposes`. */
|
|
@@ -29,16 +37,19 @@ export type SwitchDimension = (typeof SWITCH_DIMENSIONS)[number];
|
|
|
29
37
|
export interface DimensionSwitchOptions {
|
|
30
38
|
/** Required for layouts and charts; for design dimensions it scopes the switch to one slide (default: the deck). */
|
|
31
39
|
slideIndex?: number;
|
|
32
|
-
/** blocks: the complete block (`slides.0.blocks.1`) or one-payload slide/region to replace. charts: the block holding the chart (default: the slide's first chart). */
|
|
40
|
+
/** blocks: the complete block (`slides.0.blocks.1`) or one-payload slide/region to replace. charts: the block holding the chart (default: the slide's first chart). image-treatments: the image block. */
|
|
33
41
|
path?: string | string[];
|
|
34
|
-
/** A gallery item's catalog record,
|
|
42
|
+
/** A gallery item's catalog record, embedded in the same transaction (under the group of `recordSource`, else `custom`) when it is not embedded yet. */
|
|
35
43
|
record?: Record<string, unknown> & { id: string };
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
/** The catalog source of `record` (for example "https://www.pptx.gallery"). */
|
|
45
|
+
recordSource?: string;
|
|
46
|
+
/** Host catalogs (`Catalog[]`): references resolve in the document, then in these. */
|
|
47
|
+
catalogs?: readonly Catalog[];
|
|
48
|
+
/** Display metadata for languages, chart types and social platforms (labels in pickers). */
|
|
49
|
+
vocabularies?: SwitchVocabularies;
|
|
50
|
+
/** themes: the theme's own color scheme, font scheme and background (and, for the deck, dimensions) apply: overrides of those at the switched scope are removed; on a slide whose deck sets one, the theme's value is written on the slide (default true). */
|
|
40
51
|
bundle?: boolean;
|
|
41
|
-
/** Deck-scope design switches
|
|
52
|
+
/** Deck-scope design switches: remove slide-level values that would hide the switch. */
|
|
42
53
|
clearSlideOverrides?: boolean;
|
|
43
54
|
/** socials: which document field holds the handle (default "speaker") and, for an array, which entry (default 0). */
|
|
44
55
|
owner?: "speaker" | "organization";
|
|
@@ -55,18 +66,17 @@ export interface DimensionSwitchOptions {
|
|
|
55
66
|
|
|
56
67
|
export type DimensionSwitchValue =
|
|
57
68
|
| null /* backgrounds: remove it */
|
|
58
|
-
| string /* slide-sizes: a SlideSizePreset. purposes: a catalog
|
|
59
|
-
| string[] /* audiences: catalog
|
|
69
|
+
| string /* slide-sizes: a SlideSizePreset. purposes: a catalog reference or free-form goal text. languages: a BCP-47 tag. Catalog dimensions: a reference, `id` or `name:id`. */
|
|
70
|
+
| string[] /* audiences: catalog references */
|
|
60
71
|
| { platform: string; handle: string }
|
|
61
72
|
| { header?: unknown; footer?: unknown }
|
|
62
|
-
|
|
|
63
|
-
| Record<string, unknown>;
|
|
73
|
+
| Record<string, unknown> /* image-treatments: fit, focus, aspectRatio, shape, cornerRadius, border, opacity, recolor, overlay, placement (null removes) */;
|
|
64
74
|
|
|
65
75
|
export interface PreparedDimensionSwitch {
|
|
66
76
|
dimension: SwitchDimension;
|
|
67
77
|
scope: "deck" | "slide" | "block";
|
|
68
78
|
slideIndex?: number;
|
|
69
|
-
|
|
79
|
+
presentation: unknown;
|
|
70
80
|
patches: JsonPatchOperation[];
|
|
71
81
|
changed: boolean;
|
|
72
82
|
/** Slides whose own design hides a deck-level switch. */
|
|
@@ -75,8 +85,8 @@ export interface PreparedDimensionSwitch {
|
|
|
75
85
|
loss?: string[];
|
|
76
86
|
}
|
|
77
87
|
|
|
78
|
-
export interface DimensionSwitchChange extends Omit<EditorChange, "
|
|
79
|
-
|
|
88
|
+
export interface DimensionSwitchChange extends Omit<EditorChange, "presentation" | "patches"> {
|
|
89
|
+
presentation: unknown;
|
|
80
90
|
patches: JsonPatchOperation[];
|
|
81
91
|
dimension: SwitchDimension;
|
|
82
92
|
scope: "deck" | "slide" | "block";
|
|
@@ -87,23 +97,28 @@ export interface DimensionSwitchChange extends Omit<EditorChange, "document" | "
|
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
/** Compute and validate the patch for one dimension without changing any session. */
|
|
90
|
-
export declare function prepareDimensionSwitch(
|
|
100
|
+
export declare function prepareDimensionSwitch(presentation: unknown, dimension: SwitchDimension, value: DimensionSwitchValue, options?: DimensionSwitchOptions): PreparedDimensionSwitch;
|
|
91
101
|
/** Apply one dimension switch to a session as a single undoable transaction. */
|
|
92
102
|
export declare function switchDimension(editor: EditorSession, dimension: SwitchDimension, value: DimensionSwitchValue, options?: DimensionSwitchOptions): DimensionSwitchChange;
|
|
93
103
|
|
|
94
104
|
export interface SwitchOption {
|
|
105
|
+
/** The value to switch to: for a catalog dimension the reference, `id` or `name:id`. */
|
|
95
106
|
id: string;
|
|
96
107
|
label: string;
|
|
97
108
|
record?: Record<string, unknown>;
|
|
109
|
+
reference?: string;
|
|
110
|
+
group?: string;
|
|
111
|
+
source?: string;
|
|
112
|
+
origin?: "document" | "host";
|
|
98
113
|
}
|
|
99
114
|
export interface CompatibleChartType extends SwitchOption {
|
|
100
115
|
/** True for the chart's present type, which is always listed. */
|
|
101
116
|
current: boolean;
|
|
102
117
|
}
|
|
103
|
-
/** Values a picker can offer
|
|
104
|
-
export declare function listSwitchOptions(
|
|
105
|
-
/** Chart types the chart's inline data can use as it is (data-shape compatibility
|
|
106
|
-
export declare function compatibleChartTypes(
|
|
107
|
-
/** The value a dimension currently has: `{ value, scope }`, with the
|
|
108
|
-
export declare function currentSwitchValue(
|
|
118
|
+
/** Values a picker can offer: a catalog dimension lists core's `catalogRecords` (embedded records, then `catalogs`); `charts` and `socials` list core's vocabularies, `languages` core's `LANGUAGES` tags; `blocks` lists the content kinds and `slide-sizes` the presets. `purposes` lists the catalogs; any other goal text is also a valid switch value. */
|
|
119
|
+
export declare function listSwitchOptions(presentation: unknown, dimension: SwitchDimension, options?: Pick<DimensionSwitchOptions, "catalogs" | "vocabularies">): SwitchOption[];
|
|
120
|
+
/** Chart types the chart's inline data can use as it is (data-shape compatibility from `vocabularies.chartTypes`, not an engine-support claim). `path` or `slideIndex` picks the chart. */
|
|
121
|
+
export declare function compatibleChartTypes(presentation: unknown, options?: Pick<DimensionSwitchOptions, "slideIndex" | "path" | "catalogs" | "vocabularies">): CompatibleChartType[];
|
|
122
|
+
/** The value a dimension currently has: `{ value, scope }`, with the reference (`id` or `name:id`) for catalog dimensions. `slide-sizes` reads the deck's design.dimensions, else its theme's (a preset string, or the object for a custom size); `purposes` reads the goal text or Purpose id. */
|
|
123
|
+
export declare function currentSwitchValue(presentation: unknown, dimension: SwitchDimension, options?: Pick<DimensionSwitchOptions, "slideIndex" | "path" | "owner" | "index" | "catalogs">): { value: unknown; scope: "deck" | "slide" | "block" };
|
|
109
124
|
export { blockConversionTargets } from "./block-convert.js";
|