@kentico/xperience-admin-base 26.6.0 → 27.0.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/entry.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  /// <reference types="react" />
2
2
 
3
+ import { DefineIconParameters } from 'froala-editor';
3
4
  import { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';
5
+ import { MutableRefObject } from 'react';
4
6
  import { default as React_2 } from 'react';
5
7
  import { RefObject } from 'react';
8
+ import { RegisterCommandParameters } from 'froala-editor';
6
9
 
7
10
  /**
8
11
  * Represents basic set of additional action properties.
@@ -12,6 +15,16 @@ declare interface AdditionalActionProps {
12
15
  readonly componentName: string;
13
16
  }
14
17
 
18
+ /**
19
+ * Represents RTE dropdown option component for inserting assets.
20
+ */
21
+ export declare const AssetPanelRichTextEditorNestedComponent: React_2.ForwardRefExoticComponent<RichTextEditorNestedComponentProps & React_2.RefAttributes<RichTextEditorNestedComponentRef>>;
22
+
23
+ export declare const AssetRichTextEditorPlugin: ({ inputRef, froalaEditorConfigurator, froalaEditorRef }: AssetRichTextEditorPluginProps) => JSX.Element;
24
+
25
+ export declare interface AssetRichTextEditorPluginProps extends RichTextEditorPluginProps {
26
+ }
27
+
15
28
  declare interface BaseButtonProps extends UITestProps {
16
29
  readonly renderComponent: (props: InjectedProps) => React.ReactNode;
17
30
  readonly size?: ButtonSize;
@@ -27,7 +40,7 @@ declare interface BaseButtonProps extends UITestProps {
27
40
  readonly disabled?: boolean;
28
41
  readonly borderless?: boolean;
29
42
  readonly tabIndex?: number;
30
- readonly dragHandleProps?: DraggableProvidedDragHandleProps;
43
+ readonly dragHandleProps?: DraggableProvidedDragHandleProps | null;
31
44
  readonly className?: string;
32
45
  }
33
46
 
@@ -155,10 +168,14 @@ export declare interface FormComponentProps extends FieldInfo {
155
168
  * Dangerously sets explanation as inner HTML.
156
169
  */
157
170
  readonly explanationTextAsHtml?: boolean;
158
- /**
159
- * Indicates whether value change events should be debounced when form component has dependencies.
160
- */
161
- readonly debounceValueChange?: boolean;
171
+ }
172
+
173
+ /** Configurator enables custom Froala Typescript plugins to use global Froala configuration methods, which would be unavailable due to different module context. */
174
+ declare interface FroalaEditorConfigurator {
175
+ readonly defineIcon: (iconName: string, parameters: Partial<DefineIconParameters>) => void;
176
+ readonly registerCommand: (buttonName: string, parameters: Partial<RegisterCommandParameters>) => void;
177
+ readonly disableButton: (buttonName: string, buttonTitle?: string) => void;
178
+ readonly enableButton: (buttonName: string, buttonTitle?: string) => void;
162
179
  }
163
180
 
164
181
  declare type HTMLButtonProps = Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title' | 'onClick'>;
@@ -469,6 +486,7 @@ declare const Icons = {
469
486
  'xp-monitor-smartphone' : monitorSmartphone,
470
487
  'xp-monitor' : monitor,
471
488
  'xp-mug' : mug,
489
+ 'xp-multi-channel' : multiChannel,
472
490
  'xp-newspaper' : newspaper,
473
491
  'xp-note' : note,
474
492
  'xp-notebook' : notebook,
@@ -600,6 +618,28 @@ declare interface InjectedProps {
600
618
  readonly children: React.ReactNode;
601
619
  }
602
620
 
621
+ /**
622
+ * Describes options and configuration of a link plugin added to Rich text editor.
623
+ */
624
+ export declare interface LinkRichTextEditorPluginOptions extends RichTextEditorPluginOptionsBase {
625
+ /**
626
+ * Dropdown options for a dropdown used in the plugin.
627
+ */
628
+ readonly dropdownOptions: RichTextEditorDropdownOption[];
629
+ }
630
+
631
+ /**
632
+ * LinkRichTextEditorPlugin properties.
633
+ */
634
+ export declare interface LinkRichTextEditorPluginProps extends RichTextEditorPluginProps {
635
+ }
636
+
637
+ export declare enum LinkType {
638
+ Asset = "asset",
639
+ External = "external",
640
+ WebPage = "webpage"
641
+ }
642
+
603
643
  declare interface NotificationMessage {
604
644
  readonly id?: string | number;
605
645
  readonly message: string;
@@ -617,7 +657,106 @@ declare enum NotificationMessageType {
617
657
  /**
618
658
  * Untyped alias for value used on change.
619
659
  */
620
- declare type OnChangeValueType = any;
660
+ declare type OnChangeValueType = Object | null;
661
+
662
+ /**
663
+ * Describes single dropdown option configuration.
664
+ */
665
+ export declare interface RichTextEditorDropdownOption {
666
+ /**
667
+ * Option to be contained in dropdown.
668
+ */
669
+ readonly linkOption: string;
670
+ /**
671
+ * Corresponding component of an option.
672
+ */
673
+ readonly componentName?: string;
674
+ }
675
+
676
+ export declare const RichTextEditorNestedComponentLoader: {
677
+ ({ onLoad, ...props }: RichTextEditorNestedComponentLoaderProps): JSX.Element;
678
+ displayName: string;
679
+ };
680
+
681
+ export declare interface RichTextEditorNestedComponentLoaderProps extends RichTextEditorNestedComponentProps {
682
+ /** Function called after load of the plugin. */
683
+ readonly onLoad: (inputRef: RichTextEditorNestedComponentRef) => void;
684
+ }
685
+
686
+ export declare interface RichTextEditorNestedComponentProps {
687
+ readonly componentName: string;
688
+ /** Reference to RichTextEditor providing higher-scope functions (i.e. inserting link/image or executing a command). */
689
+ readonly inputRef?: RefObject<RichTextEditorRef>;
690
+ /** General low-level reference to Froala editor. */
691
+ readonly froalaEditorRef?: MutableRefObject<any>;
692
+ /** Configurator is used to access Froala configuration methods usually available in global JS scope and unavailable for a plugin in different JS module. */
693
+ readonly froalaEditorConfigurator: FroalaEditorConfigurator;
694
+ }
695
+
696
+ /**
697
+ * Ref to provide rich text editor's nested component methods.
698
+ */
699
+ export declare interface RichTextEditorNestedComponentRef {
700
+ /**
701
+ * Runs rich text editor nested component.
702
+ */
703
+ readonly execute: () => void;
704
+ }
705
+
706
+ /**
707
+ * Describes options and configuration of a custom plugin added to Rich text editor.
708
+ */
709
+ declare interface RichTextEditorPluginOptionsBase {
710
+
711
+ }
712
+
713
+ declare interface RichTextEditorPluginProps {
714
+ readonly componentName: string;
715
+ /** Reference to RichTextEditor providing higher-scope functions (i.e. inserting link/image or executing a command). */
716
+ readonly inputRef?: RefObject<RichTextEditorRef>;
717
+ /** General low-level reference to Froala editor. */
718
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
719
+ readonly froalaEditorRef?: MutableRefObject<any>;
720
+ /** Configurator is used to access Froala configuration methods usually available in global JS scope and unavailable for a plugin in different JS module. */
721
+ readonly froalaEditorConfigurator: FroalaEditorConfigurator;
722
+ /** Options and configuration of RTE plugins. */
723
+ readonly pluginOptions?: RichTextEditorPluginOptionsBase;
724
+ }
725
+
726
+ /**
727
+ * Ref to provide rich text editor's methods.
728
+ */
729
+ declare interface RichTextEditorRef {
730
+ /**
731
+ * Insert image into the text on current caret position (required).
732
+ */
733
+ readonly insertImage: (imageUrl: string, imageAttributes: { [key: string]: string }) => void;
734
+ /**
735
+ * Replace image with a different one.
736
+ */
737
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
738
+ readonly replaceImage: (imageUrl: string, imageAttributes: { [key: string]: string }, imageToReplace: any) => void;
739
+ /**
740
+ * Insert link into the text on current caret position (required).
741
+ */
742
+ readonly insertLink: (linkUrl: string, linkTitle: string, linkAttributes?: { [key: string]: string }) => void;
743
+ /**
744
+ * Executes registered command by its name.
745
+ */
746
+ readonly executeCommand: (commandName: string) => void;
747
+ /**
748
+ * Insert html content into the text on current caret position (required).
749
+ */
750
+ readonly insertHtml?: (htmlContent: string) => void;
751
+ /**
752
+ * Ensure onChange event.
753
+ */
754
+ readonly ensureChange?: () => void;
755
+ /**
756
+ * Indicates if the rich text editor is disabled.
757
+ */
758
+ readonly isDisabled?: () => boolean
759
+ }
621
760
 
622
761
  export declare const RoutingContentPlaceholder: ({ children }: RoutingContentPlaceholderProps) => JSX.Element;
623
762