@nice2dev/ui-presentations 1.4.32 → 1.4.34

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/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @nice2dev/ui-presentations — Changelog
2
2
 
3
+ ## 1.4.34
4
+
5
+ ### Patch Changes
6
+
7
+ - c6b30fe: Presentations, recipes and map routes (round 44, 1.4.34).
8
+
9
+ - **NicePresentationEditor / NicePresentationPlayer**:
10
+ - PowerPoint files: Open… in the editor's toolbar (`allowOpen`, default true) and the player's new
11
+ `file` prop read a `.pptx` in the browser — no dependency: the ZIP is unpacked with
12
+ `DecompressionStream('deflate-raw')`, the slides read with `DOMParser`. Text boxes (size, bold,
13
+ colour, alignment, font), shapes with their fill, pictures, backgrounds (colour, gradient,
14
+ picture) and speaker notes come across; new exports `importPptx`, `readPresentationFile`;
15
+ - Add slide, Insert (each element with its icon) and Export are buttons with a list; undo / redo
16
+ are icons (they were ↩ ↪ glyphs);
17
+ - the property panel: a text's font, bold, colour and alignment; the slide background as a colour,
18
+ a gradient (visual editor) or a picture; the slide's transition — effect, duration, direction.
19
+ - **NiceRecipeEditor**: tabs (Basics, Ingredients, Steps, Photos, Nutrition, Preview); the language it
20
+ is written in (new `NiceRecipe.language`, default: the provider's); a step's action
21
+ (`NiceRecipeStep.action`, `NICE_RECIPE_STEP_ACTIONS`) with its kitchen icon; the Preview is the
22
+ recipe built into a view (new `recipeToView`, `onViewChange`) drawn by NiceViewRenderer — whose
23
+ default registry has a `recipe` control.
24
+ - **NiceMap**: `routes` (lines through points — colour, width, dashed), `routeStops` with
25
+ `routeProvider` (default: straight lines; new `osrmRouteProvider()` follows the roads,
26
+ `straightRouteProvider`) — the found route is drawn, its length and time shown, a map without
27
+ center / zoom fits it; `onRouteChange`. The zoom buttons are icons with names (they were + and −).
28
+ - **NiceIcon**: `fallback` — a built-in icon for a name neither the resolver nor the built-ins know.
29
+ - Translations for the new texts in all dictionaries.
30
+
31
+ ## 1.4.33
32
+
33
+ No changes in this release.
34
+
3
35
  ## 1.4.32
4
36
 
5
37
  No changes in this release.
@@ -18,6 +18,8 @@ export interface NicePresentationEditorProps {
18
18
  showToolbar?: boolean;
19
19
  showThumbnails?: boolean;
20
20
  showPropertyPanel?: boolean;
21
+ /** 1.4.34: Open… in the toolbar reads a PowerPoint `.pptx` or an `.ndp` file (default true). */
22
+ allowOpen?: boolean;
21
23
  className?: string;
22
24
  style?: React.CSSProperties;
23
25
  /** Optional "?" guided tour. Off by default; `true` uses the built-in tour. */
@@ -1,8 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { NicePresentationDocument } from '../types/presentationTypes';
3
3
  export interface NicePresentationPlayerProps {
4
- /** The presentation document to play */
5
- document: NicePresentationDocument;
4
+ /** The presentation document to play (or give `file`). */
5
+ document?: NicePresentationDocument;
6
+ /** 1.4.34: a PowerPoint `.pptx` (or `.ndp`) file to play — read in the browser. */
7
+ file?: Blob | ArrayBuffer;
6
8
  /** Which slide to start from (0-based) */
7
9
  startSlide?: number;
8
10
  /** Called when the user exits (Escape key) */
@@ -25,4 +27,5 @@ export interface NicePresentationPlayerProps {
25
27
  autoFullscreen?: boolean;
26
28
  className?: string;
27
29
  }
30
+ /** Plays `document` — or the presentation in `file` (a PowerPoint .pptx or an .ndp). */
28
31
  export declare const NicePresentationPlayer: React.FC<NicePresentationPlayerProps>;
@@ -9,6 +9,8 @@ export interface PresentationToolbarProps {
9
9
  canRedo?: boolean;
10
10
  onPresent?: () => void;
11
11
  onExport?: (format: 'html' | 'ndp') => void;
12
+ /** 1.4.34: a `.pptx` / `.ndp` file the user picked (Open…). Without it there is no Open. */
13
+ onOpenFile?: (file: File) => void;
12
14
  className?: string;
13
15
  }
14
16
  export declare const PresentationToolbar: React.FC<PresentationToolbarProps>;
@@ -0,0 +1,11 @@
1
+ import { NicePresentationDocument } from '../types/presentationTypes';
2
+ /** The slides of a PowerPoint file as a presentation document. */
3
+ export declare function importPptx(data: ArrayBuffer | Blob, options?: {
4
+ title?: string;
5
+ fallbackTitle?: string;
6
+ }): Promise<NicePresentationDocument>;
7
+ /**
8
+ * A presentation from a file the user picked: a PowerPoint `.pptx`, or this library's own `.ndp`
9
+ * (JSON) document.
10
+ */
11
+ export declare function readPresentationFile(file: Blob): Promise<NicePresentationDocument>;