@pdfme/ui 6.2.7 → 6.2.8-dev.3

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.
@@ -1,4 +1,4 @@
1
- import { Template, DesignerProps } from '@pdfme/common';
1
+ import { Template, DesignerProps, UIOptions } from '@pdfme/common';
2
2
  import { BaseUIClass } from './class.js';
3
3
  import { type DesignerSelectSchemasOptions, type DesignerSchemaSelectionTarget, type DesignerSelectedSchema, type DesignerSelection, type DesignerSelectionChangeCallback } from './designerSelection.js';
4
4
  export type DesignerUpdateTemplateOptions = {
@@ -13,7 +13,15 @@ declare class Designer extends BaseUIClass {
13
13
  private selection;
14
14
  private selectSchemasHandler;
15
15
  private updateTemplatePage?;
16
+ /**
17
+ * Template the editor loads. A new reference makes the editor discard its
18
+ * document, selection and schema ids, so it changes only when the host
19
+ * supplies a template; edits made in the editor update `this.template` only.
20
+ */
21
+ private editorTemplate;
22
+ private sidebarOpenRequest?;
16
23
  constructor(props: DesignerProps);
24
+ updateOptions(options: UIOptions): void;
17
25
  saveTemplate(): void;
18
26
  updateTemplate(template: Template, options?: DesignerUpdateTemplateOptions): void;
19
27
  onSaveTemplate(cb: (template: Template) => void): void;
@@ -10,6 +10,11 @@ type TemplateEditorProps = Omit<DesignerProps, 'domContainer'> & {
10
10
  onUpdateTemplatePageApplied?: (page: number) => void;
11
11
  onPageCursorChange: (newPageCursor: number, totalPages: number) => void;
12
12
  updateTemplatePage?: number;
13
+ /** Applied once per new reference, overriding the user's sidebar toggle. */
14
+ sidebarOpenRequest?: SidebarOpenRequest;
13
15
  };
14
- declare const TemplateEditor: ({ template, size, onSaveTemplate, onChangeTemplate, onPageCursorChange, onChangeSelection, onRegisterSchemaSelectionHandler, onUpdateTemplatePageApplied, updateTemplatePage, }: TemplateEditorProps) => React.JSX.Element;
16
+ export type SidebarOpenRequest = {
17
+ open: boolean;
18
+ };
19
+ declare const TemplateEditor: ({ template, size, onSaveTemplate, onChangeTemplate, onPageCursorChange, onChangeSelection, onRegisterSchemaSelectionHandler, onUpdateTemplatePageApplied, updateTemplatePage, sidebarOpenRequest, }: TemplateEditorProps) => React.JSX.Element;
15
20
  export default TemplateEditor;