uhuu-components 0.3.5 → 0.3.7
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/index.d.ts +40 -2
- package/package.json +1 -1
- package/uhuu-components.es.js +3323 -3256
- package/uhuu-components.es.js.map +1 -1
- package/uhuu-components.umd.cjs +20 -20
- package/uhuu-components.umd.cjs.map +1 -1
package/index.d.ts
CHANGED
|
@@ -208,6 +208,12 @@ export interface ImageBlockProps {
|
|
|
208
208
|
overlaySvg?: string;
|
|
209
209
|
overlayClassName?: string;
|
|
210
210
|
options?: unknown[];
|
|
211
|
+
/**
|
|
212
|
+
* Extra props (className, handlers, data attributes) merged into the click target that `dialog`
|
|
213
|
+
* binds. Applied in `auto` mode, where ImageBlock renders that element itself. In `bleed` and
|
|
214
|
+
* `spread` modes the image is positioned on the page and its element is the library's: there
|
|
215
|
+
* `dialogProps` is not applied; style the block through `className` / `imageClassName`.
|
|
216
|
+
*/
|
|
211
217
|
dialogProps?: Record<string, unknown>;
|
|
212
218
|
placeholder?: ReactNode;
|
|
213
219
|
children?: ReactNode;
|
|
@@ -553,8 +559,32 @@ export type PrintConfigMap = Record<string, PrintConfig>;
|
|
|
553
559
|
*/
|
|
554
560
|
export type PageEditorDefaultZoomMode = "manual" | "fit-width" | "fit-height" | "fit-page";
|
|
555
561
|
|
|
562
|
+
/**
|
|
563
|
+
* `templateConfig.pageManagement`: which page-management controls the editor shell offers. Like a
|
|
564
|
+
* map API's UI options, `locked` turns every control off at once and each control key overrides it
|
|
565
|
+
* either way: `{ locked: true }` for a print product whose pages the template computes,
|
|
566
|
+
* `{ locked: true, rename: true }` to allow renaming only, `{ add: false }` to hide adding alone.
|
|
567
|
+
* When add, remove, reorder and duplicate are all off, the template owns the page list and a saved
|
|
568
|
+
* page order is ignored (page-option settings saved on a page are kept). Default: every control on.
|
|
569
|
+
*/
|
|
570
|
+
export interface PageManagementOptions {
|
|
571
|
+
/** Master switch: every control below off unless it is set to `true`. */
|
|
572
|
+
locked?: boolean;
|
|
573
|
+
/** Add pages or groups: toolbar Add, the page menu's Add page, the add dialog. */
|
|
574
|
+
add?: boolean;
|
|
575
|
+
/** Delete a page or group: page menu, reorder dialog. */
|
|
576
|
+
remove?: boolean;
|
|
577
|
+
/** Reorder: toolbar Reorder dialog, the page menu's Move up / Move down. */
|
|
578
|
+
reorder?: boolean;
|
|
579
|
+
/** Duplicate a page or group: page menu. */
|
|
580
|
+
duplicate?: boolean;
|
|
581
|
+
/** Rename a page or group: page menu. */
|
|
582
|
+
rename?: boolean;
|
|
583
|
+
}
|
|
584
|
+
|
|
556
585
|
export interface PageEditorProps {
|
|
557
|
-
|
|
586
|
+
/** Pages, groups and initial items; `pageManagement` sets the page-management controls. */
|
|
587
|
+
templateConfig: Record<string, unknown> & { pageManagement?: PageManagementOptions };
|
|
558
588
|
payload?: Record<string, unknown>;
|
|
559
589
|
onPayloadChange?: (nextPayload: Record<string, unknown>) => void;
|
|
560
590
|
pageFormat?: {
|
|
@@ -789,6 +819,14 @@ export type HtmlFlowItem = {
|
|
|
789
819
|
breakBefore: boolean;
|
|
790
820
|
};
|
|
791
821
|
|
|
822
|
+
/** A block from `Static.markdownToFlowItems`: the block's own markdown, rendered by the template. */
|
|
823
|
+
export type MarkdownFlowItem = {
|
|
824
|
+
id: string;
|
|
825
|
+
type: 'heading' | 'paragraph' | 'list' | 'table' | 'code' | 'quote' | 'rule' | 'image';
|
|
826
|
+
markdown: string;
|
|
827
|
+
breakBefore: boolean;
|
|
828
|
+
};
|
|
829
|
+
|
|
792
830
|
export interface StaticFlowDocumentProps {
|
|
793
831
|
html: string;
|
|
794
832
|
header?: ReactNode;
|
|
@@ -891,7 +929,7 @@ export const Static: {
|
|
|
891
929
|
markdownToFlowItems: (
|
|
892
930
|
markdown?: string,
|
|
893
931
|
options?: Record<string, unknown>
|
|
894
|
-
) =>
|
|
932
|
+
) => MarkdownFlowItem[];
|
|
895
933
|
htmlToFlowItems: (
|
|
896
934
|
html?: string,
|
|
897
935
|
options?: Record<string, unknown>
|
package/package.json
CHANGED