@segnavia/react 0.39.0 → 0.40.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/dist/elements.d.ts +4 -2
- package/dist/elements.js +29 -4
- package/dist/index.d.ts +2 -2
- package/dist/markdown-editor.d.ts +8 -0
- package/dist/markdown-editor.js +7 -0
- package/dist/props.d.ts +37 -1
- package/package.json +7 -2
package/dist/elements.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { BookProps, CaptionProps, CaptionsProps, CounterProps, DocumentProps, FullscreenProps, ItemSettingsProps, MuteProps, NotesProps, PageProps, PaperPickerProps, PaperProps, PlayProps, PlayerProps, RailProps, StageProps, StepProps, ThumbnailProps, TimeProps, TrackProps } from "./props.js";
|
|
1
|
+
import { BookProps, CaptionProps, CaptionsProps, CounterProps, DocumentProps, FullscreenProps, ItemSettingsProps, MarkdownEditorProps, MuteProps, NotesProps, PageProps, PaperPickerProps, PaperProps, PlayProps, PlayerProps, RailProps, StageProps, StepProps, ThumbnailProps, TimeProps, TrackProps } from "./props.js";
|
|
2
2
|
import { SegnaviaItemSettings } from "@segnavia/frame/item-settings";
|
|
3
3
|
import { SegnaviaPlayer } from "@segnavia/frame/player";
|
|
4
|
+
import { SegnaviaMarkdownEditor } from "@segnavia/frame/markdown-editor";
|
|
4
5
|
import { SegnaviaBook, SegnaviaDocument, SegnaviaPage, SegnaviaPaper, SegnaviaStage, SegnaviaThumbnail } from "@segnavia/frame";
|
|
5
6
|
import { SegnaviaCaption, SegnaviaCaptions, SegnaviaCounter, SegnaviaFullscreen, SegnaviaMute, SegnaviaNotes, SegnaviaPaperPicker, SegnaviaPlay, SegnaviaRail, SegnaviaStep, SegnaviaTime, SegnaviaTrack } from "@segnavia/frame/controls";
|
|
6
7
|
//#region src/elements.d.ts
|
|
@@ -9,7 +10,7 @@ export interface RuntimeElementDescriptor {
|
|
|
9
10
|
properties: readonly string[];
|
|
10
11
|
events: Readonly<Partial<Record<string, string>>>;
|
|
11
12
|
}
|
|
12
|
-
export interface ElementDescriptor<E extends
|
|
13
|
+
export interface ElementDescriptor<E extends object, P extends object, Tag extends `segnavia-${string}` = `segnavia-${string}`> extends RuntimeElementDescriptor {
|
|
13
14
|
tag: Tag;
|
|
14
15
|
properties: readonly Extract<keyof P, string>[];
|
|
15
16
|
events: Readonly<Partial<Record<Extract<keyof P, `on${string}`>, string>>>;
|
|
@@ -23,6 +24,7 @@ export declare const ELEMENTS: {
|
|
|
23
24
|
readonly paperPicker: ElementDescriptor<SegnaviaPaperPicker, PaperPickerProps, "segnavia-paper-picker">;
|
|
24
25
|
readonly itemSettings: ElementDescriptor<SegnaviaItemSettings, ItemSettingsProps, "segnavia-item-settings">;
|
|
25
26
|
readonly page: ElementDescriptor<SegnaviaPage, PageProps, "segnavia-page">;
|
|
27
|
+
readonly markdownEditor: ElementDescriptor<SegnaviaMarkdownEditor, MarkdownEditorProps, "segnavia-markdown-editor">;
|
|
26
28
|
readonly book: ElementDescriptor<SegnaviaBook, BookProps, "segnavia-book">;
|
|
27
29
|
readonly paper: ElementDescriptor<SegnaviaPaper, PaperProps, "segnavia-paper">;
|
|
28
30
|
readonly document: ElementDescriptor<SegnaviaDocument, DocumentProps, "segnavia-document">;
|
package/dist/elements.js
CHANGED
|
@@ -47,7 +47,8 @@ const ELEMENTS = {
|
|
|
47
47
|
"motifs",
|
|
48
48
|
"fonts",
|
|
49
49
|
"placements",
|
|
50
|
-
"designedCover"
|
|
50
|
+
"designedCover",
|
|
51
|
+
"pageWidths"
|
|
51
52
|
], { onSegnaviaThumbnailError: "segnavia-thumbnail-error" }),
|
|
52
53
|
paperPicker: element(STYLED_ELEMENTS.paperPicker, ["value", "labels"], { onChange: "change" }),
|
|
53
54
|
itemSettings: element("segnavia-item-settings", [
|
|
@@ -66,13 +67,35 @@ const ELEMENTS = {
|
|
|
66
67
|
"slots",
|
|
67
68
|
"motifs",
|
|
68
69
|
"fonts",
|
|
69
|
-
"
|
|
70
|
+
"alertLabels",
|
|
71
|
+
"placements",
|
|
72
|
+
"pageWidths"
|
|
70
73
|
], {}),
|
|
74
|
+
markdownEditor: element("segnavia-markdown-editor", [
|
|
75
|
+
"markdown",
|
|
76
|
+
"mode",
|
|
77
|
+
"title",
|
|
78
|
+
"titleSource",
|
|
79
|
+
"lockedFences",
|
|
80
|
+
"css",
|
|
81
|
+
"fonts",
|
|
82
|
+
"fontReferences",
|
|
83
|
+
"linkOrigins",
|
|
84
|
+
"alertLabels"
|
|
85
|
+
], {
|
|
86
|
+
onSegnaviaMarkdownChange: "segnavia-markdown-change",
|
|
87
|
+
onSegnaviaTitleChange: "segnavia-title-change",
|
|
88
|
+
onSegnaviaModeChange: "segnavia-mode-change",
|
|
89
|
+
onSegnaviaSave: "segnavia-save",
|
|
90
|
+
onSegnaviaEditorState: "segnavia-editor-state",
|
|
91
|
+
onSegnaviaLinkRequest: "segnavia-link-request"
|
|
92
|
+
}),
|
|
71
93
|
book: element(HEADLESS_ELEMENTS.book, [
|
|
72
94
|
"view",
|
|
73
95
|
"fonts",
|
|
74
96
|
"motifs",
|
|
75
97
|
"placements",
|
|
98
|
+
"pageWidths",
|
|
76
99
|
"dependencyOrigins"
|
|
77
100
|
], {}),
|
|
78
101
|
paper: element(HEADLESS_ELEMENTS.paper, [
|
|
@@ -84,7 +107,8 @@ const ELEMENTS = {
|
|
|
84
107
|
"slots",
|
|
85
108
|
"motifs",
|
|
86
109
|
"fonts",
|
|
87
|
-
"placements"
|
|
110
|
+
"placements",
|
|
111
|
+
"pageWidths"
|
|
88
112
|
], {}),
|
|
89
113
|
document: element(HEADLESS_ELEMENTS.document, [
|
|
90
114
|
"css",
|
|
@@ -95,7 +119,8 @@ const ELEMENTS = {
|
|
|
95
119
|
"slots",
|
|
96
120
|
"motifs",
|
|
97
121
|
"fonts",
|
|
98
|
-
"placements"
|
|
122
|
+
"placements",
|
|
123
|
+
"pageWidths"
|
|
99
124
|
], {}),
|
|
100
125
|
play: element(STYLED_ELEMENTS.play, controlProperties, {}),
|
|
101
126
|
step: element(STYLED_ELEMENTS.step, controlProperties, {}),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BookProps, CaptionProps, CaptionsProps, CounterProps, DocumentProps, FullscreenProps, ItemSettingsProps, MuteProps, NotesProps, PageProps, PaperPickerProps, PaperProps, PlayProps, PlayerProps, RailProps, StageProps, StepProps, ThumbnailProps, TimeProps, TrackProps } from "./props.js";
|
|
1
|
+
import { BookProps, CaptionProps, CaptionsProps, CounterProps, DocumentProps, FullscreenProps, ItemSettingsProps, MarkdownEditorProps, MuteProps, NotesProps, PageProps, PaperPickerProps, PaperProps, PlayProps, PlayerProps, RailProps, StageProps, StepProps, ThumbnailProps, TimeProps, TrackProps } from "./props.js";
|
|
2
2
|
import { AnyElementDescriptor, ElementFor, PropsFor } from "./elements.js";
|
|
3
3
|
import { SegnaviaIntrinsicElements } from "./jsx.js";
|
|
4
4
|
import { AuthoringController, AuthoringController as AuthoringController$1, AuthoringErrorDetail, AuthoringHandlers, AuthoringHandlers as AuthoringHandlers$1, AuthoringOptions, AuthoringOptions as AuthoringOptions$1, DirtyChangeDetail, SaveNotesInput, SavePrintMomentInput } from "@segnavia/frame/authoring";
|
|
@@ -176,4 +176,4 @@ export declare function useAuthoring(player: SegnaviaPlayer | null, handlers: Au
|
|
|
176
176
|
export declare function useDocumentAuthoring(document: SegnaviaDocument | null, handlers: DocumentAuthoringHandlers$1, options?: DocumentAuthoringOptions$1): DocumentAuthoringController$1 | null;
|
|
177
177
|
export declare function useItemSettings(element: SegnaviaItemSettings | null, handlers: ItemSettingsHandlers$1): ItemSettingsController$1 | null;
|
|
178
178
|
//#endregion
|
|
179
|
-
export type { AuthoringController, AuthoringErrorDetail, AuthoringHandlers, AuthoringOptions, BookProps, CaptionProps, CaptionsProps, CounterProps, DirtyChangeDetail, DocumentAuthoringController, DocumentAuthoringErrorDetail, DocumentAuthoringHandlers, DocumentAuthoringOptions, DocumentProps, FullscreenProps, ItemSettingsController, ItemSettingsErrorDetail, ItemSettingsHandlers, ItemSettingsLabels, ItemSettingsProps, ItemSettingsSection, ItemSettingsSectionContext, MovePageHandler, MovePageInput, MuteProps, NotesProps, PageProps, PaperPickerProps, PaperProps, PlayProps, PlayerProps, RailProps, SaveNotesInput, SavePrintMomentInput, SegnaviaIntrinsicElements, StageProps, StepProps, ThumbnailProps, TimeProps, TrackProps };
|
|
179
|
+
export type { AuthoringController, AuthoringErrorDetail, AuthoringHandlers, AuthoringOptions, BookProps, CaptionProps, CaptionsProps, CounterProps, DirtyChangeDetail, DocumentAuthoringController, DocumentAuthoringErrorDetail, DocumentAuthoringHandlers, DocumentAuthoringOptions, DocumentProps, FullscreenProps, ItemSettingsController, ItemSettingsErrorDetail, ItemSettingsHandlers, ItemSettingsLabels, ItemSettingsProps, ItemSettingsSection, ItemSettingsSectionContext, MarkdownEditorProps, MovePageHandler, MovePageInput, MuteProps, NotesProps, PageProps, PaperPickerProps, PaperProps, PlayProps, PlayerProps, RailProps, SaveNotesInput, SavePrintMomentInput, SegnaviaIntrinsicElements, StageProps, StepProps, ThumbnailProps, TimeProps, TrackProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MarkdownEditorProps } from "./props.js";
|
|
2
|
+
import "@segnavia/frame/markdown-editor";
|
|
3
|
+
//#region src/markdown-editor.d.ts
|
|
4
|
+
export declare const MarkdownEditor: import("react").ForwardRefExoticComponent<MarkdownEditorProps & {
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
} & import("react").RefAttributes<import("@segnavia/frame/markdown-editor").SegnaviaMarkdownEditor>>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export type { MarkdownEditorProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ELEMENTS } from "./elements.js";
|
|
2
|
+
import { createComponent } from "./index.js";
|
|
3
|
+
import "@segnavia/frame/markdown-editor";
|
|
4
|
+
//#region src/markdown-editor.ts
|
|
5
|
+
const MarkdownEditor = createComponent(ELEMENTS.markdownEditor);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MarkdownEditor };
|
package/dist/props.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ItemSettingsLabels, SegnaviaItemSettings } from "@segnavia/frame/item-settings";
|
|
2
2
|
import { PlayerControls, PlayerFit, SegnaviaPlayer } from "@segnavia/frame/player";
|
|
3
3
|
import { HTMLAttributes, ReactNode } from "react";
|
|
4
|
+
import { MarkdownEditorMode, MarkdownEditorStateDetail, MarkdownTitleSource, SegnaviaMarkdownEditor } from "@segnavia/frame/markdown-editor";
|
|
4
5
|
import { ControllerOptions, DeckController, FittedSize, HostTransition, PageInput, PrintInput, SegnaviaBook, SegnaviaDocument, SegnaviaPage, SegnaviaPaper, SegnaviaStage, SegnaviaThumbnail, StageReserve } from "@segnavia/frame";
|
|
5
6
|
import { PaperPickerLabelOverrides, PlayerLabels, SegnaviaCaption, SegnaviaCaptions, SegnaviaCounter, SegnaviaFullscreen, SegnaviaMute, SegnaviaNotes, SegnaviaPaperPicker, SegnaviaPlay, SegnaviaRail, SegnaviaStep, SegnaviaTime, SegnaviaTrack } from "@segnavia/frame/controls";
|
|
6
7
|
//#region src/props.d.ts
|
|
7
|
-
type ElementProps<E
|
|
8
|
+
type ElementProps<E> = Omit<HTMLAttributes<E>, 'children'> & {
|
|
8
9
|
children?: ReactNode;
|
|
9
10
|
};
|
|
10
11
|
type CustomEventProp<D = unknown> = (event: CustomEvent<D>) => void;
|
|
@@ -70,6 +71,7 @@ export interface ThumbnailProps extends ElementProps<SegnaviaThumbnail> {
|
|
|
70
71
|
fonts?: SegnaviaThumbnail['fonts'];
|
|
71
72
|
placements?: SegnaviaThumbnail['placements'];
|
|
72
73
|
designedCover?: SegnaviaThumbnail['designedCover'];
|
|
74
|
+
pageWidths?: SegnaviaThumbnail['pageWidths'];
|
|
73
75
|
onSegnaviaThumbnailError?: CustomEventProp<unknown>;
|
|
74
76
|
}
|
|
75
77
|
export type PaperPickerProps = Omit<ElementProps<SegnaviaPaperPicker>, 'onChange'> & {
|
|
@@ -94,17 +96,49 @@ export interface PageProps extends ElementProps<SegnaviaPage> {
|
|
|
94
96
|
slots?: SegnaviaPage['slots'];
|
|
95
97
|
motifs?: SegnaviaPage['motifs'];
|
|
96
98
|
fonts?: SegnaviaPage['fonts'];
|
|
99
|
+
alertLabels?: SegnaviaPage['alertLabels'];
|
|
97
100
|
placements?: SegnaviaPage['placements'];
|
|
101
|
+
pageWidths?: SegnaviaPage['pageWidths'];
|
|
98
102
|
src?: string;
|
|
99
103
|
label?: string;
|
|
100
104
|
bounded?: boolean;
|
|
101
105
|
unstyled?: boolean;
|
|
102
106
|
}
|
|
107
|
+
export interface MarkdownEditorProps extends Omit<ElementProps<HTMLElement>, 'title'> {
|
|
108
|
+
markdown?: string;
|
|
109
|
+
mode?: MarkdownEditorMode;
|
|
110
|
+
title?: string | null;
|
|
111
|
+
titleSource?: MarkdownTitleSource;
|
|
112
|
+
dir?: string;
|
|
113
|
+
lang?: string;
|
|
114
|
+
unstyled?: boolean;
|
|
115
|
+
lockedFences?: Record<string, string>;
|
|
116
|
+
css?: string;
|
|
117
|
+
fonts?: SegnaviaMarkdownEditor['fonts'];
|
|
118
|
+
fontReferences?: SegnaviaMarkdownEditor['fontReferences'];
|
|
119
|
+
linkOrigins?: SegnaviaMarkdownEditor['linkOrigins'];
|
|
120
|
+
alertLabels?: SegnaviaMarkdownEditor['alertLabels'];
|
|
121
|
+
onSegnaviaMarkdownChange?: CustomEventProp<{
|
|
122
|
+
markdown: string;
|
|
123
|
+
}>;
|
|
124
|
+
onSegnaviaTitleChange?: CustomEventProp<{
|
|
125
|
+
title: string;
|
|
126
|
+
}>;
|
|
127
|
+
onSegnaviaModeChange?: CustomEventProp<{
|
|
128
|
+
mode: MarkdownEditorMode;
|
|
129
|
+
}>;
|
|
130
|
+
onSegnaviaSave?: CustomEventProp;
|
|
131
|
+
onSegnaviaEditorState?: CustomEventProp<MarkdownEditorStateDetail>;
|
|
132
|
+
onSegnaviaLinkRequest?: CustomEventProp<{
|
|
133
|
+
href: string | null;
|
|
134
|
+
}>;
|
|
135
|
+
}
|
|
103
136
|
export interface BookProps extends ElementProps<SegnaviaBook> {
|
|
104
137
|
view?: SegnaviaBook['view'];
|
|
105
138
|
fonts?: SegnaviaBook['fonts'];
|
|
106
139
|
motifs?: SegnaviaBook['motifs'];
|
|
107
140
|
placements?: SegnaviaBook['placements'];
|
|
141
|
+
pageWidths?: SegnaviaBook['pageWidths'];
|
|
108
142
|
dependencyOrigins?: SegnaviaBook['dependencyOrigins'];
|
|
109
143
|
src?: string;
|
|
110
144
|
spread?: boolean;
|
|
@@ -121,6 +155,7 @@ export interface PaperProps extends ElementProps<SegnaviaPaper> {
|
|
|
121
155
|
motifs?: SegnaviaPaper['motifs'];
|
|
122
156
|
fonts?: SegnaviaPaper['fonts'];
|
|
123
157
|
placements?: SegnaviaPaper['placements'];
|
|
158
|
+
pageWidths?: SegnaviaPaper['pageWidths'];
|
|
124
159
|
unstyled?: boolean;
|
|
125
160
|
}
|
|
126
161
|
export interface DocumentProps extends ElementProps<SegnaviaDocument> {
|
|
@@ -133,6 +168,7 @@ export interface DocumentProps extends ElementProps<SegnaviaDocument> {
|
|
|
133
168
|
motifs?: SegnaviaDocument['motifs'];
|
|
134
169
|
fonts?: SegnaviaDocument['fonts'];
|
|
135
170
|
placements?: SegnaviaDocument['placements'];
|
|
171
|
+
pageWidths?: SegnaviaDocument['pageWidths'];
|
|
136
172
|
unstyled?: boolean;
|
|
137
173
|
}
|
|
138
174
|
export type PlayProps = ControlProps<SegnaviaPlay>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segnavia/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -23,10 +23,15 @@
|
|
|
23
23
|
"@segnavia/source": "./src/index.ts",
|
|
24
24
|
"types": "./dist/index.d.ts",
|
|
25
25
|
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./markdown-editor": {
|
|
28
|
+
"@segnavia/source": "./src/markdown-editor.ts",
|
|
29
|
+
"types": "./dist/markdown-editor.d.ts",
|
|
30
|
+
"default": "./dist/markdown-editor.js"
|
|
26
31
|
}
|
|
27
32
|
},
|
|
28
33
|
"dependencies": {
|
|
29
|
-
"@segnavia/frame": "0.
|
|
34
|
+
"@segnavia/frame": "0.40.0"
|
|
30
35
|
},
|
|
31
36
|
"peerDependencies": {
|
|
32
37
|
"react": "^18.0.0 || ^19.0.0",
|