@frontify/guideline-blocks-settings 0.29.17 → 0.30.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/components/Attachments/AttachmentItem.es.js +73 -79
  3. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
  4. package/dist/components/Attachments/Attachments.es.js +103 -96
  5. package/dist/components/Attachments/Attachments.es.js.map +1 -1
  6. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +21 -0
  7. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +1 -0
  8. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +47 -43
  9. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
  10. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +123 -0
  11. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -0
  12. package/dist/components/BlockItemWrapper/Toolbar/ToolbarAttachments.es.js +27 -0
  13. package/dist/components/BlockItemWrapper/Toolbar/ToolbarAttachments.es.js.map +1 -0
  14. package/dist/components/BlockItemWrapper/Toolbar/ToolbarAttachmentsTrigger.es.js +12 -0
  15. package/dist/components/BlockItemWrapper/Toolbar/ToolbarAttachmentsTrigger.es.js.map +1 -0
  16. package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js +6 -0
  17. package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js.map +1 -0
  18. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +26 -0
  19. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -0
  20. package/dist/hooks/useAttachments.es.js +43 -20
  21. package/dist/hooks/useAttachments.es.js.map +1 -1
  22. package/dist/index.cjs.js +3 -3
  23. package/dist/index.cjs.js.map +1 -1
  24. package/dist/index.d.ts +84 -15
  25. package/dist/index.es.js +103 -100
  26. package/dist/index.umd.js +3 -3
  27. package/dist/index.umd.js.map +1 -1
  28. package/dist/styles.css +1 -1
  29. package/package.json +1 -1
  30. package/src/components/Attachments/AttachmentItem.tsx +2 -13
  31. package/src/components/Attachments/Attachments.tsx +30 -15
  32. package/src/components/Attachments/AttachmentsButtonTrigger.tsx +22 -0
  33. package/src/components/Attachments/types.ts +10 -2
  34. package/src/components/BlockItemWrapper/BlockItemWrapper.tsx +23 -20
  35. package/src/components/BlockItemWrapper/Toolbar/Toolbar.spec.tsx +127 -0
  36. package/src/components/BlockItemWrapper/Toolbar/Toolbar.tsx +133 -0
  37. package/src/components/BlockItemWrapper/Toolbar/ToolbarAttachments.tsx +29 -0
  38. package/src/components/BlockItemWrapper/Toolbar/ToolbarAttachmentsTrigger.tsx +14 -0
  39. package/src/components/BlockItemWrapper/Toolbar/ToolbarSegment.tsx +9 -0
  40. package/src/components/BlockItemWrapper/Toolbar/helpers.ts +33 -0
  41. package/src/components/BlockItemWrapper/Toolbar/index.ts +4 -0
  42. package/src/components/BlockItemWrapper/Toolbar/types.ts +38 -0
  43. package/src/components/BlockItemWrapper/types.ts +11 -34
  44. package/src/hooks/{useAttachments.spec.ts → useAttachments.spec.tsx} +55 -4
  45. package/src/hooks/useAttachments.tsx +95 -0
  46. package/dist/components/BlockItemWrapper/Toolbar.es.js +0 -117
  47. package/dist/components/BlockItemWrapper/Toolbar.es.js.map +0 -1
  48. package/src/components/BlockItemWrapper/Toolbar.tsx +0 -133
  49. package/src/hooks/useAttachments.ts +0 -46
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ import type { AppBridgeTheme } from '@frontify/app-bridge';
6
6
  import { Asset } from '@frontify/app-bridge';
7
7
  import type { AssetInputBlock as AssetInputBlock_2 } from '@frontify/sidebar-settings';
8
8
  import type { BaseBlock as BaseBlock_2 } from '@frontify/sidebar-settings';
9
+ import { BlockContext } from '@frontify/app-bridge';
10
+ import { BlockState } from '@frontify/app-bridge';
9
11
  import type { Bundle as Bundle_2 } from '@frontify/sidebar-settings';
10
12
  import { ButtonSize } from '@frontify/fondue';
11
13
  import { CheckboxState } from '@frontify/fondue';
@@ -41,7 +43,7 @@ import { PluginComposer } from '@frontify/fondue';
41
43
  import { PluginProps } from '@frontify/fondue';
42
44
  import { RangeBeforeOptions } from '@udecode/plate';
43
45
  import { ReactElement } from 'react';
44
- import type { ReactNode } from 'react';
46
+ import { ReactNode } from 'react';
45
47
  import type { SectionHeadingBlock as SectionHeadingBlock_2 } from '@frontify/sidebar-settings';
46
48
  import type { SegmentedControlsBlock as SegmentedControlsBlock_2 } from '@frontify/sidebar-settings';
47
49
  import { SensorDescriptor } from '@dnd-kit/core';
@@ -50,6 +52,7 @@ import type { SettingBlock as SettingBlock_2 } from '@frontify/sidebar-settings'
50
52
  import type { SimpleSettingBlock as SimpleSettingBlock_2 } from '@frontify/sidebar-settings';
51
53
  import type { SwitchBlock as SwitchBlock_2 } from '@frontify/sidebar-settings';
52
54
  import type { TemplateInputBlock as TemplateInputBlock_2 } from '@frontify/sidebar-settings';
55
+ import { TemplateLegacy } from '@frontify/app-bridge';
53
56
  import type { TextareaBlock as TextareaBlock_2 } from '@frontify/sidebar-settings';
54
57
  import { TextStyleRenderElementProps } from '@frontify/fondue';
55
58
  import { TLinkElement } from '@udecode/plate';
@@ -75,7 +78,7 @@ export declare type AttachmentItemProps = SortableAttachmentItemProps & {
75
78
  isOverlay?: boolean;
76
79
  };
77
80
 
78
- export declare const Attachments: ({ items, onDelete, onReplaceWithBrowse, onReplaceWithUpload, onBrowse, onUpload, onSorted, appBridge, }: AttachmentsProps) => JSX_2.Element | null;
81
+ export declare const Attachments: ({ items, onDelete, onReplaceWithBrowse, onReplaceWithUpload, onBrowse, onUpload, onSorted, appBridge, triggerComponent: TriggerComponent, isOpen, onOpenChange, }: AttachmentsProps) => JSX_2.Element | null;
79
82
 
80
83
  export declare type AttachmentsProps = {
81
84
  items?: Asset[];
@@ -86,6 +89,24 @@ export declare type AttachmentsProps = {
86
89
  onUpload: (uploadedAttachments: Asset[]) => Promise<void>;
87
90
  onBrowse: (browserAttachments: Asset[]) => void;
88
91
  onSorted: (sortedAttachments: Asset[]) => void;
92
+ triggerComponent?: (props: AttachmentsTriggerProps) => JSX.Element;
93
+ } & ({
94
+ isOpen?: never;
95
+ onOpenChange?: never;
96
+ } | {
97
+ isOpen: boolean;
98
+ onOpenChange: (isOpen: boolean) => void;
99
+ });
100
+
101
+ export declare const AttachmentsProvider: ({ appBridge, children, assetId, }: {
102
+ appBridge: AppBridgeBlock;
103
+ children: ReactNode;
104
+ assetId: string;
105
+ }) => JSX_2.Element;
106
+
107
+ export declare type AttachmentsTriggerProps = {
108
+ children: ReactNode;
109
+ isFlyoutOpen: boolean;
89
110
  };
90
111
 
91
112
  /**
@@ -168,7 +189,7 @@ export declare type BlockInjectButtonProps = {
168
189
  verticalLayout?: boolean;
169
190
  };
170
191
 
171
- export declare const BlockItemWrapper: ({ children, toolbarFlyoutItems, toolbarItems, shouldHideWrapper, shouldHideComponent, isDragging, shouldFillContainer, outlineOffset, shouldBeShown, }: BlockItemWrapperProps) => ReactElement;
192
+ export declare const BlockItemWrapper: ({ children, toolbarFlyoutItems, toolbarItems, shouldHideWrapper, shouldHideComponent, isDragging, shouldFillContainer, outlineOffset, shouldBeShown, showAttachments, }: BlockItemWrapperProps) => ReactElement;
172
193
 
173
194
  export declare type BlockItemWrapperProps = {
174
195
  children: ReactNode;
@@ -180,6 +201,12 @@ export declare type BlockItemWrapperProps = {
180
201
  shouldFillContainer?: boolean;
181
202
  outlineOffset?: number;
182
203
  shouldBeShown?: boolean;
204
+ /**
205
+ * When set to true the BlockItemWrapper must be a child of a {@link AttachmentsProvider} component,
206
+ * or the block must be wrapped with a {@link withAttachmentsProvider} HOC.
207
+ * @default false
208
+ */
209
+ showAttachments?: boolean;
183
210
  };
184
211
 
185
212
  export declare type BlockProps = {
@@ -404,7 +431,7 @@ export declare type DynamicSupportedBlock = DynamicSupportedBlock_2<AppBridgeBlo
404
431
 
405
432
  export declare const ELEMENT_BUTTON = "button";
406
433
 
407
- export declare type FlyoutToolbarItem = {
434
+ declare type FlyoutToolbarItem = {
408
435
  title: string;
409
436
  onClick: () => void;
410
437
  icon: JSX.Element;
@@ -839,6 +866,7 @@ export declare type SortableAttachmentItemProps = {
839
866
  isLoading?: boolean;
840
867
  onReplaceWithBrowse: () => void;
841
868
  onReplaceWithUpload: (uploadedAsset: Asset) => void;
869
+ onDownload?: () => Promise<void>;
842
870
  };
843
871
 
844
872
  export declare const submitFloatingButton: <V extends Value>(editor: PlateEditor<V>) => true | undefined;
@@ -907,16 +935,7 @@ export declare const toHex8String: (color: Color) => string;
907
935
  */
908
936
  export declare const toHexString: (color: Color) => string;
909
937
 
910
- export declare type ToolbarItem = DraghandleToolbarItem | ButtonToolbarItem;
911
-
912
- export declare type ToolbarProps = {
913
- items: ToolbarItem[];
914
- flyoutItems: FlyoutToolbarItem[][];
915
- isFlyoutOpen: boolean;
916
- setIsFlyoutOpen: (isOpen: boolean) => void;
917
- isDragging?: boolean;
918
- isFlyoutDisabled?: boolean;
919
- };
938
+ declare type ToolbarItem = DraghandleToolbarItem | ButtonToolbarItem;
920
939
 
921
940
  /**
922
941
  * Maps color object of rgba values to rgba string.
@@ -988,17 +1007,67 @@ export declare type UpsertButtonOptions<V extends Value = Value> = CreateButtonN
988
1007
  export declare const upsertButtonText: <V extends Value>(editor: PlateEditor<V>, { text }: UpsertButtonOptions<V>) => void;
989
1008
 
990
1009
  export declare const useAttachments: (appBridge: AppBridgeBlock, assetId: string) => {
991
- onAddAttachments: (newAssets: Asset[]) => Promise<void>;
1010
+ onAttachmentsAdd: (newAssets: Asset[]) => Promise<void>;
992
1011
  onAttachmentDelete: (assetToDelete: Asset) => Promise<void>;
993
1012
  onAttachmentReplace: (attachmentToReplace: Asset, newAsset: Asset) => Promise<void>;
994
1013
  onAttachmentsSorted: (assets: Asset[]) => Promise<void>;
995
1014
  attachments: Asset[];
1015
+ appBridge: AppBridgeBlock<BlockState, BlockContext, {
1016
+ assetsChosen: {
1017
+ assets: Asset[];
1018
+ };
1019
+ templateChosen: {
1020
+ template: TemplateLegacy;
1021
+ };
1022
+ "State.settings": [Record<string, unknown>, Record<string, unknown>];
1023
+ "State.assets": [Record<string, unknown>, Record<string, unknown>];
1024
+ "State.templates": [Record<string, unknown>, Record<string, unknown>];
1025
+ "State.*": [BlockState, BlockState];
1026
+ "Context.portalId": [number, number];
1027
+ "Context.blockId": [number, number];
1028
+ "Context.sectionId"?: [number | undefined, number | undefined] | undefined;
1029
+ "Context.*": [BlockContext, BlockContext];
1030
+ }>;
1031
+ };
1032
+
1033
+ export declare const useAttachmentsContext: () => {
1034
+ onAttachmentsAdd: (newAssets: Asset[]) => Promise<void>;
1035
+ onAttachmentDelete: (assetToDelete: Asset) => Promise<void>;
1036
+ onAttachmentReplace: (attachmentToReplace: Asset, newAsset: Asset) => Promise<void>;
1037
+ onAttachmentsSorted: (assets: Asset[]) => Promise<void>;
1038
+ attachments: Asset[];
1039
+ appBridge: AppBridgeBlock<BlockState, BlockContext, {
1040
+ assetsChosen: {
1041
+ assets: Asset[];
1042
+ };
1043
+ templateChosen: {
1044
+ template: TemplateLegacy;
1045
+ };
1046
+ "State.settings": [Record<string, unknown>, Record<string, unknown>];
1047
+ "State.assets": [Record<string, unknown>, Record<string, unknown>];
1048
+ "State.templates": [Record<string, unknown>, Record<string, unknown>];
1049
+ "State.*": [BlockState, BlockState];
1050
+ "Context.portalId": [number, number];
1051
+ "Context.blockId": [number, number];
1052
+ "Context.sectionId"?: [number | undefined, number | undefined] | undefined;
1053
+ "Context.*": [BlockContext, BlockContext];
1054
+ }>;
996
1055
  };
997
1056
 
998
1057
  export declare const useDndSensors: (columnGap?: number, rowGap?: number) => SensorDescriptor<SensorOptions>[];
999
1058
 
1000
1059
  export declare type ValueOrPromisedValue<T> = ValueOrPromisedValue_2<AppBridgeBlock, T>;
1001
1060
 
1061
+ /**
1062
+ * Block-level HOC for cases when there is only one attachment asset field related to the block.
1063
+ * Recommended for most cases.
1064
+ * If finer control is required over attachments, use {@link AttachmentsProvider} component.
1065
+ */
1066
+ export declare const withAttachmentsProvider: <T extends BlockProps>(Component: (props: T) => ReactNode, assetId: string) => {
1067
+ (props: T): JSX_2.Element;
1068
+ displayName: string;
1069
+ };
1070
+
1002
1071
  /**
1003
1072
  * Insert space after a url to wrap a button.
1004
1073
  * Lookup from the block start to the cursor to check if there is an url.
package/dist/index.es.js CHANGED
@@ -3,12 +3,12 @@ export * from "@frontify/sidebar-settings";
3
3
  import { BlockInjectButton as g } from "./components/BlockInjectButton/BlockInjectButton.es.js";
4
4
  import { BlockItemWrapper as l } from "./components/BlockItemWrapper/BlockItemWrapper.es.js";
5
5
  import { DEFAULT_DRAGGING_TOOLTIP as u, DEFAULT_DRAG_TOOLTIP as f } from "./components/BlockItemWrapper/constants.es.js";
6
- import { Attachments as s } from "./components/Attachments/Attachments.es.js";
6
+ import { Attachments as d } from "./components/Attachments/Attachments.es.js";
7
7
  import { DownloadButton as P } from "./components/DownloadButton/DownloadButton.es.js";
8
- import { RichTextEditor as c } from "./components/RichTextEditor/RichTextEditor.es.js";
9
- import { LinkPlugin as T, createLinkPlugin as E } from "./components/RichTextEditor/plugins/LinkPlugin/index.es.js";
10
- import { BUTTON_PLUGIN as L, ButtonPlugin as R, ELEMENT_BUTTON as h, createButtonPlugin as A } from "./components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js";
11
- import { withButton as C } from "./components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js";
8
+ import { RichTextEditor as B } from "./components/RichTextEditor/RichTextEditor.es.js";
9
+ import { LinkPlugin as T, createLinkPlugin as h } from "./components/RichTextEditor/plugins/LinkPlugin/index.es.js";
10
+ import { BUTTON_PLUGIN as k, ButtonPlugin as A, ELEMENT_BUTTON as L, createButtonPlugin as R } from "./components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js";
11
+ import { withButton as I } from "./components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js";
12
12
  import { insertButton as F } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js";
13
13
  import { submitFloatingButton as b } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js";
14
14
  import { unwrapButton as D } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js";
@@ -23,16 +23,16 @@ import { triggerFloatingButtonInsert as Y } from "./components/RichTextEditor/pl
23
23
  import { BlockButtonStyles as $ } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js";
24
24
  import { Custom1Plugin as rt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js";
25
25
  import { Custom2Plugin as ot } from "./components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js";
26
- import { Custom3Plugin as pt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js";
27
- import { Heading1Plugin as at } from "./components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js";
26
+ import { Custom3Plugin as it } from "./components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js";
27
+ import { Heading1Plugin as pt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js";
28
28
  import { Heading2Plugin as mt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js";
29
29
  import { Heading3Plugin as xt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js";
30
30
  import { Heading4Plugin as ft } from "./components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js";
31
- import { ImageCaptionPlugin as st } from "./components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js";
31
+ import { ImageCaptionPlugin as dt } from "./components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js";
32
32
  import { ImageTitlePlugin as Pt } from "./components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js";
33
- import { PARAGRAPH_CLASSES as ct, ParagraphMarkupElement as yt, ParagraphMarkupElementNode as Tt, ParagraphPlugin as Et, createParagraphPlugin as kt } from "./components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js";
34
- import { QuoteMarkupElementNode as Rt, QuotePlugin as ht, createQuotePlugin as At } from "./components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js";
35
- import { AllTextStylePlugins as Ct, AllTextStyles as Mt, TextStylePluginsWithoutImage as Ft, TextStylesWithoutImage as Ut } from "./components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js";
33
+ import { PARAGRAPH_CLASSES as Bt, ParagraphMarkupElement as yt, ParagraphMarkupElementNode as Tt, ParagraphPlugin as ht, createParagraphPlugin as Et } from "./components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js";
34
+ import { QuoteMarkupElementNode as At, QuotePlugin as Lt, createQuotePlugin as Rt } from "./components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js";
35
+ import { AllTextStylePlugins as It, AllTextStyles as Mt, TextStylePluginsWithoutImage as Ft, TextStylesWithoutImage as Ut } from "./components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js";
36
36
  import { BlockStyles as Gt, TextStyles as Dt } from "./components/RichTextEditor/plugins/styles.es.js";
37
37
  import { getDefaultPluginsWithLinkChooser as Nt } from "./components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js";
38
38
  import { THEME_PREFIX as _t } from "./components/RichTextEditor/constants.es.js";
@@ -43,141 +43,142 @@ import { relativeUrlRegex as Kt } from "./components/Link/utils/relativeUrlRegex
43
43
  import { isValidUrl as Zt, isValidUrlOrEmpty as $t } from "./components/Link/utils/url.es.js";
44
44
  import { convertToRteValue as rr } from "./helpers/convertToRichTextValue.es.js";
45
45
  import { customCoordinatesGetterFactory as or } from "./helpers/customCoordinatesGetterFactory.es.js";
46
- import { hasRichTextValue as pr } from "./helpers/hasRichTextValue.es.js";
47
- import { isDownloadable as ar } from "./helpers/isDownloadable.es.js";
46
+ import { hasRichTextValue as ir } from "./helpers/hasRichTextValue.es.js";
47
+ import { isDownloadable as pr } from "./helpers/isDownloadable.es.js";
48
48
  import { mapAppBridgeColorPaletteToFonduePalette as mr, mapAppBridgeColorPalettesToFonduePalettes as lr } from "./helpers/mapColorPalettes.es.js";
49
49
  import { addHttps as ur } from "./helpers/addHttps.es.js";
50
- import { useAttachments as dr } from "./hooks/useAttachments.es.js";
51
- import { useDndSensors as Sr } from "./hooks/useDndSensors.es.js";
52
- import { getBackgroundSettings as Br } from "./settings/background.es.js";
53
- import { getBorderSettings as yr } from "./settings/border.es.js";
54
- import { getBorderRadiusSettings as Er, getBorderRadiusSlider as kr } from "./settings/borderRadius.es.js";
55
- import { getExtendedBorderRadiusSettings as Rr } from "./settings/borderRadiusExtended.es.js";
56
- import { getGutterSettings as Ar } from "./settings/gutter.es.js";
57
- import { getMarginSettings as Cr, getMarginSlider as Mr } from "./settings/margin.es.js";
58
- import { getMarginExtendedSettings as Ur } from "./settings/marginExtended.es.js";
59
- import { getPaddingSettings as Gr, getPaddingSlider as Dr } from "./settings/padding.es.js";
60
- import { getPaddingExtendedSettings as Nr } from "./settings/paddingExtended.es.js";
61
- import { BorderStyle as _r, GutterSpacing as wr, Margin as vr, Padding as Vr, Radius as Wr, Security as jr, borderStyleMap as Qr, gutterSpacingStyleMap as Xr, marginStyleMap as qr, paddingStyleMap as zr, radiusStyleMap as Jr } from "./settings/types.es.js";
62
- import { getSecurityDownloadableSetting as Yr, getSecurityGlobalControlId as Zr } from "./settings/securityDownloadable.es.js";
63
- import { getSecurityGlobalControlSetting as te } from "./settings/securityGlobalControl.es.js";
64
- import { isDark as ee } from "./utilities/color/isDark.es.js";
65
- import { toHex8String as ne } from "./utilities/color/toHex8String.es.js";
66
- import { toHexString as ie } from "./utilities/color/toHexString.es.js";
67
- import { toRgbaString as ge } from "./utilities/color/toRgbaString.es.js";
68
- import { setAlpha as le } from "./utilities/color/setAlpha.es.js";
69
- import { toColorObject as ue } from "./utilities/color/toColorObject.es.js";
70
- import { getReadableColor as de } from "./utilities/color/getReadableColor.es.js";
71
- import { toShortRgba as Se } from "./utilities/color/toShortRgba.es.js";
72
- import { moveItemInArray as Be } from "./utilities/moveItemInArray.es.js";
73
- import { getBackgroundColorStyles as ye } from "./utilities/react/getBackgroundColorStyles.es.js";
74
- import { getBorderStyles as Ee } from "./utilities/react/getBorderStyles.es.js";
75
- import { getRadiusStyles as Le } from "./utilities/react/getRadiusStyles.es.js";
76
- import { joinClassNames as he } from "./utilities/react/joinClassNames.es.js";
50
+ import { AttachmentsProvider as sr, useAttachments as dr, useAttachmentsContext as Sr, withAttachmentsProvider as Pr } from "./hooks/useAttachments.es.js";
51
+ import { useDndSensors as Br } from "./hooks/useDndSensors.es.js";
52
+ import { getBackgroundSettings as Tr } from "./settings/background.es.js";
53
+ import { getBorderSettings as Er } from "./settings/border.es.js";
54
+ import { getBorderRadiusSettings as Ar, getBorderRadiusSlider as Lr } from "./settings/borderRadius.es.js";
55
+ import { getExtendedBorderRadiusSettings as Cr } from "./settings/borderRadiusExtended.es.js";
56
+ import { getGutterSettings as Mr } from "./settings/gutter.es.js";
57
+ import { getMarginSettings as Ur, getMarginSlider as br } from "./settings/margin.es.js";
58
+ import { getMarginExtendedSettings as Dr } from "./settings/marginExtended.es.js";
59
+ import { getPaddingSettings as Nr, getPaddingSlider as Or } from "./settings/padding.es.js";
60
+ import { getPaddingExtendedSettings as wr } from "./settings/paddingExtended.es.js";
61
+ import { BorderStyle as Vr, GutterSpacing as Wr, Margin as jr, Padding as Qr, Radius as Xr, Security as qr, borderStyleMap as zr, gutterSpacingStyleMap as Jr, marginStyleMap as Kr, paddingStyleMap as Yr, radiusStyleMap as Zr } from "./settings/types.es.js";
62
+ import { getSecurityDownloadableSetting as te, getSecurityGlobalControlId as re } from "./settings/securityDownloadable.es.js";
63
+ import { getSecurityGlobalControlSetting as oe } from "./settings/securityGlobalControl.es.js";
64
+ import { isDark as ie } from "./utilities/color/isDark.es.js";
65
+ import { toHex8String as pe } from "./utilities/color/toHex8String.es.js";
66
+ import { toHexString as me } from "./utilities/color/toHexString.es.js";
67
+ import { toRgbaString as xe } from "./utilities/color/toRgbaString.es.js";
68
+ import { setAlpha as fe } from "./utilities/color/setAlpha.es.js";
69
+ import { toColorObject as de } from "./utilities/color/toColorObject.es.js";
70
+ import { getReadableColor as Pe } from "./utilities/color/getReadableColor.es.js";
71
+ import { toShortRgba as Be } from "./utilities/color/toShortRgba.es.js";
72
+ import { moveItemInArray as Te } from "./utilities/moveItemInArray.es.js";
73
+ import { getBackgroundColorStyles as Ee } from "./utilities/react/getBackgroundColorStyles.es.js";
74
+ import { getBorderStyles as Ae } from "./utilities/react/getBorderStyles.es.js";
75
+ import { getRadiusStyles as Re } from "./utilities/react/getRadiusStyles.es.js";
76
+ import { joinClassNames as Ie } from "./utilities/react/joinClassNames.es.js";
77
77
  var r = /* @__PURE__ */ ((t) => (t.Main = "main", t.Basics = "basics", t.Layout = "layout", t.Style = "style", t.Security = "security", t.Targets = "targets", t))(r || {});
78
78
  const o = (t) => t, n = (t) => t;
79
79
  export {
80
- Ct as AllTextStylePlugins,
80
+ It as AllTextStylePlugins,
81
81
  Mt as AllTextStyles,
82
- s as Attachments,
83
- L as BUTTON_PLUGIN,
82
+ d as Attachments,
83
+ sr as AttachmentsProvider,
84
+ k as BUTTON_PLUGIN,
84
85
  $ as BlockButtonStyles,
85
86
  g as BlockInjectButton,
86
87
  l as BlockItemWrapper,
87
88
  Gt as BlockStyles,
88
- _r as BorderStyle,
89
- R as ButtonPlugin,
89
+ Vr as BorderStyle,
90
+ A as ButtonPlugin,
90
91
  rt as Custom1Plugin,
91
92
  ot as Custom2Plugin,
92
- pt as Custom3Plugin,
93
+ it as Custom3Plugin,
93
94
  u as DEFAULT_DRAGGING_TOOLTIP,
94
95
  f as DEFAULT_DRAG_TOOLTIP,
95
96
  P as DownloadButton,
96
- h as ELEMENT_BUTTON,
97
- wr as GutterSpacing,
98
- at as Heading1Plugin,
97
+ L as ELEMENT_BUTTON,
98
+ Wr as GutterSpacing,
99
+ pt as Heading1Plugin,
99
100
  mt as Heading2Plugin,
100
101
  xt as Heading3Plugin,
101
102
  ft as Heading4Plugin,
102
- st as ImageCaptionPlugin,
103
+ dt as ImageCaptionPlugin,
103
104
  Pt as ImageTitlePlugin,
104
105
  Wt as LinkInput,
105
106
  T as LinkPlugin,
106
107
  vt as LinkSelector,
107
- vr as Margin,
108
- ct as PARAGRAPH_CLASSES,
109
- Vr as Padding,
108
+ jr as Margin,
109
+ Bt as PARAGRAPH_CLASSES,
110
+ Qr as Padding,
110
111
  yt as ParagraphMarkupElement,
111
112
  Tt as ParagraphMarkupElementNode,
112
- Et as ParagraphPlugin,
113
- Rt as QuoteMarkupElementNode,
114
- ht as QuotePlugin,
115
- Wr as Radius,
116
- c as RichTextEditor,
113
+ ht as ParagraphPlugin,
114
+ At as QuoteMarkupElementNode,
115
+ Lt as QuotePlugin,
116
+ Xr as Radius,
117
+ B as RichTextEditor,
117
118
  r as Sections,
118
- jr as Security,
119
+ qr as Security,
119
120
  _t as THEME_PREFIX,
120
121
  Ft as TextStylePluginsWithoutImage,
121
122
  Dt as TextStyles,
122
123
  Ut as TextStylesWithoutImage,
123
124
  ur as addHttps,
124
- Qr as borderStyleMap,
125
+ zr as borderStyleMap,
125
126
  rr as convertToRteValue,
126
127
  Q as createButtonNode,
127
- A as createButtonPlugin,
128
- E as createLinkPlugin,
129
- kt as createParagraphPlugin,
130
- At as createQuotePlugin,
128
+ R as createButtonPlugin,
129
+ h as createLinkPlugin,
130
+ Et as createParagraphPlugin,
131
+ Rt as createQuotePlugin,
131
132
  or as customCoordinatesGetterFactory,
132
133
  o as defineBlock,
133
134
  n as defineSettings,
134
- ye as getBackgroundColorStyles,
135
- Br as getBackgroundSettings,
136
- Er as getBorderRadiusSettings,
137
- kr as getBorderRadiusSlider,
138
- yr as getBorderSettings,
139
- Ee as getBorderStyles,
135
+ Ee as getBackgroundColorStyles,
136
+ Tr as getBackgroundSettings,
137
+ Ar as getBorderRadiusSettings,
138
+ Lr as getBorderRadiusSlider,
139
+ Er as getBorderSettings,
140
+ Ae as getBorderStyles,
140
141
  Nt as getDefaultPluginsWithLinkChooser,
141
- Rr as getExtendedBorderRadiusSettings,
142
- Ar as getGutterSettings,
142
+ Cr as getExtendedBorderRadiusSettings,
143
+ Mr as getGutterSettings,
143
144
  Qt as getLegacyUrl,
144
145
  Xt as getLinkFromEditor,
145
- Ur as getMarginExtendedSettings,
146
- Cr as getMarginSettings,
147
- Mr as getMarginSlider,
148
- Nr as getPaddingExtendedSettings,
149
- Gr as getPaddingSettings,
150
- Dr as getPaddingSlider,
151
- Le as getRadiusStyles,
152
- de as getReadableColor,
153
- Yr as getSecurityDownloadableSetting,
154
- Zr as getSecurityGlobalControlId,
155
- te as getSecurityGlobalControlSetting,
146
+ Dr as getMarginExtendedSettings,
147
+ Ur as getMarginSettings,
148
+ br as getMarginSlider,
149
+ wr as getPaddingExtendedSettings,
150
+ Nr as getPaddingSettings,
151
+ Or as getPaddingSlider,
152
+ Re as getRadiusStyles,
153
+ Pe as getReadableColor,
154
+ te as getSecurityDownloadableSetting,
155
+ re as getSecurityGlobalControlId,
156
+ oe as getSecurityGlobalControlSetting,
156
157
  qt as getUrl,
157
158
  W as getUrlFromEditor,
158
159
  zt as getUrlFromLinkOrLegacyLink,
159
- Xr as gutterSpacingStyleMap,
160
- pr as hasRichTextValue,
160
+ Jr as gutterSpacingStyleMap,
161
+ ir as hasRichTextValue,
161
162
  F as insertButton,
162
- ee as isDark,
163
- ar as isDownloadable,
163
+ ie as isDark,
164
+ pr as isDownloadable,
164
165
  Zt as isValidUrl,
165
166
  $t as isValidUrlOrEmpty,
166
- he as joinClassNames,
167
+ Ie as joinClassNames,
167
168
  mr as mapAppBridgeColorPaletteToFonduePalette,
168
169
  lr as mapAppBridgeColorPalettesToFonduePalettes,
169
- qr as marginStyleMap,
170
- Be as moveItemInArray,
171
- zr as paddingStyleMap,
172
- Jr as radiusStyleMap,
170
+ Kr as marginStyleMap,
171
+ Te as moveItemInArray,
172
+ Yr as paddingStyleMap,
173
+ Zr as radiusStyleMap,
173
174
  Kt as relativeUrlRegex,
174
- le as setAlpha,
175
+ fe as setAlpha,
175
176
  b as submitFloatingButton,
176
- ue as toColorObject,
177
- ne as toHex8String,
178
- ie as toHexString,
179
- ge as toRgbaString,
180
- Se as toShortRgba,
177
+ de as toColorObject,
178
+ pe as toHex8String,
179
+ me as toHexString,
180
+ xe as toRgbaString,
181
+ Be as toShortRgba,
181
182
  q as triggerFloatingButton,
182
183
  J as triggerFloatingButtonEdit,
183
184
  Y as triggerFloatingButtonInsert,
@@ -185,8 +186,10 @@ export {
185
186
  N as upsertButton,
186
187
  _ as upsertButtonText,
187
188
  dr as useAttachments,
188
- Sr as useDndSensors,
189
- C as withButton,
189
+ Sr as useAttachmentsContext,
190
+ Br as useDndSensors,
191
+ Pr as withAttachmentsProvider,
192
+ I as withButton,
190
193
  v as wrapButton
191
194
  };
192
195
  //# sourceMappingURL=index.es.js.map