@frontify/guideline-blocks-settings 0.32.2 → 0.33.1
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/CHANGELOG.md +114 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +23 -27
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +10 -14
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +50 -12
- package/dist/index.es.js +205 -195
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -2
- package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +37 -38
- package/src/components/BlockItemWrapper/BlockItemWrapper.tsx +0 -4
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.tsx +2 -1
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/index.ts +1 -0
- package/src/components/BlockItemWrapper/Toolbar/Toolbar.spec.tsx +165 -30
- package/src/components/BlockItemWrapper/Toolbar/Toolbar.tsx +14 -9
- package/src/components/BlockItemWrapper/Toolbar/context/index.ts +4 -0
- package/src/components/BlockItemWrapper/Toolbar/hooks/index.ts +3 -0
- package/src/components/BlockItemWrapper/Toolbar/index.ts +2 -0
- package/src/components/BlockItemWrapper/Toolbar/types.ts +8 -9
- package/src/components/BlockItemWrapper/types.ts +1 -2
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { Color as Color_2 } from '@frontify/sidebar-settings';
|
|
|
16
16
|
import type { ColorInputBlock as ColorInputBlock_2 } from '@frontify/sidebar-settings';
|
|
17
17
|
import { ColorPalette } from '@frontify/app-bridge';
|
|
18
18
|
import { CSSProperties } from 'react';
|
|
19
|
+
import { Dispatch } from 'react';
|
|
19
20
|
import type { Document as Document_2 } from '@frontify/app-bridge';
|
|
20
21
|
import type { DocumentPage } from '@frontify/app-bridge';
|
|
21
22
|
import type { DocumentSection } from '@frontify/app-bridge';
|
|
@@ -51,6 +52,7 @@ import type { SectionHeadingBlock as SectionHeadingBlock_2 } from '@frontify/sid
|
|
|
51
52
|
import type { SegmentedControlsBlock as SegmentedControlsBlock_2 } from '@frontify/sidebar-settings';
|
|
52
53
|
import { SensorDescriptor } from '@dnd-kit/core';
|
|
53
54
|
import { SensorOptions } from '@dnd-kit/core';
|
|
55
|
+
import { SetStateAction } from 'react';
|
|
54
56
|
import type { SettingBlock as SettingBlock_2 } from '@frontify/sidebar-settings';
|
|
55
57
|
import type { SimpleSettingBlock as SimpleSettingBlock_2 } from '@frontify/sidebar-settings';
|
|
56
58
|
import type { SwitchBlock as SwitchBlock_2 } from '@frontify/sidebar-settings';
|
|
@@ -185,14 +187,13 @@ export declare type BlockInjectButtonProps = {
|
|
|
185
187
|
verticalLayout?: boolean;
|
|
186
188
|
};
|
|
187
189
|
|
|
188
|
-
export declare const BlockItemWrapper: ({ children,
|
|
190
|
+
export declare const BlockItemWrapper: ({ children, toolbarItems, shouldHideWrapper, shouldHideComponent, isDragging, shouldFillContainer, outlineOffset, shouldBeShown, showAttachments, }: BlockItemWrapperProps) => ReactElement;
|
|
189
191
|
|
|
190
192
|
export declare type BlockItemWrapperProps = {
|
|
191
193
|
children: ReactNode;
|
|
192
194
|
shouldHideWrapper?: boolean;
|
|
193
195
|
shouldHideComponent?: boolean;
|
|
194
196
|
toolbarItems: (ToolbarItem | undefined)[];
|
|
195
|
-
toolbarFlyoutItems: FlyoutToolbarItem[][];
|
|
196
197
|
isDragging?: boolean;
|
|
197
198
|
shouldFillContainer?: boolean;
|
|
198
199
|
outlineOffset?: number;
|
|
@@ -340,7 +341,9 @@ export declare type ButtonPluginProps = Omit<PluginProps, 'styles'> & {
|
|
|
340
341
|
appBridge: AppBridgeBlock;
|
|
341
342
|
};
|
|
342
343
|
|
|
343
|
-
export declare type ButtonToolbarItem =
|
|
344
|
+
export declare type ButtonToolbarItem = {
|
|
345
|
+
type: 'button';
|
|
346
|
+
} & ToolbarButtonProps;
|
|
344
347
|
|
|
345
348
|
export declare type ChecklistBlock = ChecklistBlock_2<AppBridgeBlock>;
|
|
346
349
|
|
|
@@ -419,13 +422,20 @@ declare type DownloadButtonProps = {
|
|
|
419
422
|
export declare const DragHandleToolbarButton: ({ tooltip, icon, setActivatorNodeRef, draggableProps, }: DragHandleToolbarButtonProps) => JSX_2.Element;
|
|
420
423
|
|
|
421
424
|
export declare type DragHandleToolbarButtonProps = {
|
|
422
|
-
icon
|
|
425
|
+
icon?: ReactNode;
|
|
423
426
|
tooltip?: string;
|
|
424
427
|
draggableProps: Record<string, unknown>;
|
|
425
428
|
setActivatorNodeRef?: (node: HTMLElement | null) => void;
|
|
426
429
|
};
|
|
427
430
|
|
|
428
|
-
export declare type
|
|
431
|
+
export declare type DragHandleToolbarItem = {
|
|
432
|
+
type: 'dragHandle';
|
|
433
|
+
} & DragHandleToolbarButtonProps;
|
|
434
|
+
|
|
435
|
+
export declare const DragPreviewContextProvider: ({ children, isDragPreview, }: {
|
|
436
|
+
children: ReactNode;
|
|
437
|
+
isDragPreview: boolean;
|
|
438
|
+
}) => JSX_2.Element;
|
|
429
439
|
|
|
430
440
|
export declare type DropdownBlock = DropdownBlock_2<AppBridgeBlock>;
|
|
431
441
|
|
|
@@ -446,7 +456,9 @@ export declare type FlyoutToolbarButtonProps = {
|
|
|
446
456
|
flyoutHeader?: ReactNode;
|
|
447
457
|
};
|
|
448
458
|
|
|
449
|
-
export declare type FlyoutToolbarItem =
|
|
459
|
+
export declare type FlyoutToolbarItem = {
|
|
460
|
+
type: 'flyout';
|
|
461
|
+
} & FlyoutToolbarButtonProps;
|
|
450
462
|
|
|
451
463
|
export declare type FontInputBlock = FontInputBlock_2<AppBridgeBlock>;
|
|
452
464
|
|
|
@@ -730,6 +742,10 @@ export declare type MenuToolbarButtonProps = {
|
|
|
730
742
|
tooltip?: string;
|
|
731
743
|
};
|
|
732
744
|
|
|
745
|
+
export declare type MenuToolbarItem = {
|
|
746
|
+
type: 'menu';
|
|
747
|
+
} & MenuToolbarButtonProps;
|
|
748
|
+
|
|
733
749
|
/**
|
|
734
750
|
* Moves an item from the 'from' position to the 'to' position and updates the array
|
|
735
751
|
*
|
|
@@ -740,6 +756,15 @@ export declare type MenuToolbarButtonProps = {
|
|
|
740
756
|
*/
|
|
741
757
|
export declare const moveItemInArray: <T>(array: T[], from: number, to: number) => T[];
|
|
742
758
|
|
|
759
|
+
export declare const MultiFlyoutContextProvider: ({ children, openFlyoutIds, setOpenFlyoutIds, }: {
|
|
760
|
+
children: ReactNode;
|
|
761
|
+
} & MultiFlyoutContextType) => JSX_2.Element;
|
|
762
|
+
|
|
763
|
+
export declare type MultiFlyoutContextType = {
|
|
764
|
+
openFlyoutIds: string[];
|
|
765
|
+
setOpenFlyoutIds: Dispatch<SetStateAction<string[]>>;
|
|
766
|
+
};
|
|
767
|
+
|
|
743
768
|
export declare type MultiInputBlock = MultiInputBlock_2<AppBridgeBlock>;
|
|
744
769
|
|
|
745
770
|
export declare type NotificationBlock = NotificationBlock_2<AppBridgeBlock>;
|
|
@@ -967,7 +992,7 @@ export declare const toHex8String: (color: Color) => string;
|
|
|
967
992
|
*/
|
|
968
993
|
export declare const toHexString: (color: Color) => string;
|
|
969
994
|
|
|
970
|
-
export declare const Toolbar: ({ items,
|
|
995
|
+
export declare const Toolbar: ({ items, attachments }: ToolbarProps) => JSX_2.Element;
|
|
971
996
|
|
|
972
997
|
declare type ToolbarButtonProps = {
|
|
973
998
|
icon: JSX_2.Element;
|
|
@@ -975,20 +1000,24 @@ declare type ToolbarButtonProps = {
|
|
|
975
1000
|
onClick: () => void;
|
|
976
1001
|
};
|
|
977
1002
|
|
|
978
|
-
declare
|
|
1003
|
+
export declare const ToolbarFlyoutMenu: ({ items, flyoutId }: ToolbarFlyoutMenuProps) => JSX_2.Element;
|
|
1004
|
+
|
|
1005
|
+
export declare type ToolbarFlyoutMenuItem = {
|
|
979
1006
|
title: string;
|
|
980
1007
|
onClick: () => void;
|
|
981
1008
|
icon: JSX_2.Element;
|
|
982
1009
|
style?: MenuItemStyle;
|
|
983
1010
|
};
|
|
984
1011
|
|
|
985
|
-
export declare type
|
|
1012
|
+
export declare type ToolbarFlyoutMenuProps = {
|
|
1013
|
+
items: ToolbarFlyoutMenuItem[][];
|
|
1014
|
+
flyoutId: string;
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
export declare type ToolbarItem = DragHandleToolbarItem | ButtonToolbarItem | FlyoutToolbarItem | MenuToolbarItem;
|
|
986
1018
|
|
|
987
1019
|
export declare type ToolbarProps = {
|
|
988
1020
|
items: ToolbarItem[];
|
|
989
|
-
flyoutMenu: {
|
|
990
|
-
items: ToolbarFlyoutMenuItem[][];
|
|
991
|
-
};
|
|
992
1021
|
attachments: {
|
|
993
1022
|
isEnabled: boolean;
|
|
994
1023
|
};
|
|
@@ -1113,6 +1142,15 @@ export declare const useAttachmentsContext: () => {
|
|
|
1113
1142
|
|
|
1114
1143
|
export declare const useDndSensors: (columnGap?: number, rowGap?: number) => SensorDescriptor<SensorOptions>[];
|
|
1115
1144
|
|
|
1145
|
+
export declare const useDragPreviewContext: () => boolean;
|
|
1146
|
+
|
|
1147
|
+
export declare const useMultiFlyoutContext: () => MultiFlyoutContextType;
|
|
1148
|
+
|
|
1149
|
+
export declare const useMultiFlyoutState: (flyoutId: string) => {
|
|
1150
|
+
isOpen: boolean;
|
|
1151
|
+
onOpenChange: (isFlyoutOpen: boolean) => void;
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1116
1154
|
export declare type ValueOrPromisedValue<T> = ValueOrPromisedValue_2<AppBridgeBlock, T>;
|
|
1117
1155
|
|
|
1118
1156
|
/**
|
package/dist/index.es.js
CHANGED
|
@@ -1,207 +1,217 @@
|
|
|
1
1
|
import "./styles.css.es.js";
|
|
2
2
|
export * from "@frontify/sidebar-settings";
|
|
3
3
|
import { BlockInjectButton as m } from "./components/BlockInjectButton/BlockInjectButton.es.js";
|
|
4
|
-
import { BlockItemWrapper as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
4
|
+
import { BlockItemWrapper as g } from "./components/BlockItemWrapper/BlockItemWrapper.es.js";
|
|
5
|
+
import { DragPreviewContextProvider as u, useDragPreviewContext as f } from "./components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js";
|
|
6
|
+
import { MultiFlyoutContextProvider as d, useMultiFlyoutContext as S } from "./components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js";
|
|
7
|
+
import { useMultiFlyoutState as B } from "./components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js";
|
|
8
|
+
import { Toolbar as y } from "./components/BlockItemWrapper/Toolbar/Toolbar.es.js";
|
|
9
|
+
import { AttachmentsToolbarButton as A, DEFAULT_ATTACHMENTS_BUTTON_ID as E } from "./components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js";
|
|
10
|
+
import { DragHandleToolbarButton as h } from "./components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js";
|
|
11
|
+
import { FlyoutToolbarButton as F } from "./components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js";
|
|
12
|
+
import { DEFAULT_MENU_BUTTON_ID as k, MenuToolbarButton as I } from "./components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js";
|
|
13
|
+
import { ToolbarFlyoutMenu as D } from "./components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js";
|
|
14
|
+
import { DEFAULT_DRAGGING_TOOLTIP as U, DEFAULT_DRAG_TOOLTIP as _ } from "./components/BlockItemWrapper/constants.es.js";
|
|
15
|
+
import { Attachments as G } from "./components/Attachments/Attachments.es.js";
|
|
16
|
+
import { DownloadButton as O } from "./components/DownloadButton/DownloadButton.es.js";
|
|
17
|
+
import { RichTextEditor as w } from "./components/RichTextEditor/RichTextEditor.es.js";
|
|
18
|
+
import { LinkPlugin as W, createLinkPlugin as j } from "./components/RichTextEditor/plugins/LinkPlugin/index.es.js";
|
|
19
|
+
import { BUTTON_PLUGIN as X, ButtonPlugin as q, ELEMENT_BUTTON as z, createButtonPlugin as J } from "./components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
20
|
+
import { withButton as Y } from "./components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js";
|
|
21
|
+
import { insertButton as $ } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js";
|
|
22
|
+
import { submitFloatingButton as rt } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js";
|
|
23
|
+
import { unwrapButton as et } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js";
|
|
24
|
+
import { upsertButton as at } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js";
|
|
25
|
+
import { upsertButtonText as pt } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js";
|
|
26
|
+
import { wrapButton as lt } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js";
|
|
27
|
+
import { getUrlFromEditor as xt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js";
|
|
28
|
+
import { createButtonNode as ft } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js";
|
|
29
|
+
import { triggerFloatingButton as dt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js";
|
|
30
|
+
import { triggerFloatingButtonEdit as Pt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js";
|
|
31
|
+
import { triggerFloatingButtonInsert as Tt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js";
|
|
32
|
+
import { BlockButtonStyles as ct } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js";
|
|
33
|
+
import { Custom1Plugin as Et } from "./components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js";
|
|
34
|
+
import { Custom2Plugin as ht } from "./components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js";
|
|
35
|
+
import { Custom3Plugin as Ft } from "./components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js";
|
|
36
|
+
import { Heading1Plugin as kt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js";
|
|
37
|
+
import { Heading2Plugin as bt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js";
|
|
38
|
+
import { Heading3Plugin as Rt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js";
|
|
39
|
+
import { Heading4Plugin as _t } from "./components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js";
|
|
40
|
+
import { ImageCaptionPlugin as Gt } from "./components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js";
|
|
41
|
+
import { ImageTitlePlugin as Ot } from "./components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js";
|
|
42
|
+
import { PARAGRAPH_CLASSES as wt, ParagraphMarkupElement as Vt, ParagraphMarkupElementNode as Wt, ParagraphPlugin as jt, createParagraphPlugin as Qt } from "./components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js";
|
|
43
|
+
import { QuoteMarkupElementNode as qt, QuotePlugin as zt, createQuotePlugin as Jt } from "./components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js";
|
|
44
|
+
import { AllTextStylePlugins as Yt, AllTextStyles as Zt, TextStylePluginsWithoutImage as $t, TextStylesWithoutImage as tr } from "./components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js";
|
|
45
|
+
import { BlockStyles as or, TextStyles as er } from "./components/RichTextEditor/plugins/styles.es.js";
|
|
46
|
+
import { getDefaultPluginsWithLinkChooser as ar } from "./components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js";
|
|
47
|
+
import { THEME_PREFIX as pr } from "./components/RichTextEditor/constants.es.js";
|
|
48
|
+
import { LinkSelector as lr } from "./components/Link/LinkSelector/LinkSelector.es.js";
|
|
49
|
+
import { LinkInput as xr } from "./components/Link/LinkInput.es.js";
|
|
50
|
+
import { getLegacyUrl as fr, getLinkFromEditor as sr, getUrl as dr, getUrlFromLinkOrLegacyLink as Sr } from "./components/Link/utils/getUrl.es.js";
|
|
51
|
+
import { relativeUrlRegex as Br } from "./components/Link/utils/relativeUrlRegex.es.js";
|
|
52
|
+
import { isValidUrl as yr, isValidUrlOrEmpty as cr } from "./components/Link/utils/url.es.js";
|
|
53
|
+
import { convertToRteValue as Er } from "./helpers/convertToRichTextValue.es.js";
|
|
54
|
+
import { customCoordinatesGetterFactory as hr } from "./helpers/customCoordinatesGetterFactory.es.js";
|
|
55
|
+
import { hasRichTextValue as Fr } from "./helpers/hasRichTextValue.es.js";
|
|
56
|
+
import { isDownloadable as kr } from "./helpers/isDownloadable.es.js";
|
|
57
|
+
import { mapAppBridgeColorPaletteToFonduePalette as br, mapAppBridgeColorPalettesToFonduePalettes as Dr } from "./helpers/mapColorPalettes.es.js";
|
|
58
|
+
import { addHttps as Ur } from "./helpers/addHttps.es.js";
|
|
59
|
+
import { AttachmentsProvider as Nr, useAttachments as Gr, useAttachmentsContext as Hr, withAttachmentsProvider as Or } from "./hooks/useAttachments.es.js";
|
|
60
|
+
import { useDndSensors as wr } from "./hooks/useDndSensors.es.js";
|
|
61
|
+
import { getBackgroundSettings as Wr } from "./settings/background.es.js";
|
|
62
|
+
import { getBorderSettings as Qr } from "./settings/border.es.js";
|
|
63
|
+
import { getBorderRadiusSettings as qr, getBorderRadiusSlider as zr } from "./settings/borderRadius.es.js";
|
|
64
|
+
import { getExtendedBorderRadiusSettings as Kr } from "./settings/borderRadiusExtended.es.js";
|
|
65
|
+
import { getGutterSettings as Zr } from "./settings/gutter.es.js";
|
|
66
|
+
import { getMarginSettings as to, getMarginSlider as ro } from "./settings/margin.es.js";
|
|
67
|
+
import { getMarginExtendedSettings as eo } from "./settings/marginExtended.es.js";
|
|
68
|
+
import { getPaddingSettings as ao, getPaddingSlider as io } from "./settings/padding.es.js";
|
|
69
|
+
import { getPaddingExtendedSettings as mo } from "./settings/paddingExtended.es.js";
|
|
70
|
+
import { BorderStyle as go, GutterSpacing as xo, Margin as uo, Padding as fo, Radius as so, Security as So, borderStyleMap as Po, gutterSpacingStyleMap as Bo, marginStyleMap as To, paddingStyleMap as yo, radiusStyleMap as co } from "./settings/types.es.js";
|
|
71
|
+
import { getSecurityDownloadableSetting as Eo, getSecurityGlobalControlId as Mo } from "./settings/securityDownloadable.es.js";
|
|
72
|
+
import { getSecurityGlobalControlSetting as Co } from "./settings/securityGlobalControl.es.js";
|
|
73
|
+
import { isDark as Lo } from "./utilities/color/isDark.es.js";
|
|
74
|
+
import { toHex8String as Io } from "./utilities/color/toHex8String.es.js";
|
|
75
|
+
import { toHexString as Do } from "./utilities/color/toHexString.es.js";
|
|
76
|
+
import { toRgbaString as Uo } from "./utilities/color/toRgbaString.es.js";
|
|
77
|
+
import { setAlpha as No } from "./utilities/color/setAlpha.es.js";
|
|
78
|
+
import { toColorObject as Ho } from "./utilities/color/toColorObject.es.js";
|
|
79
|
+
import { getReadableColor as vo } from "./utilities/color/getReadableColor.es.js";
|
|
80
|
+
import { toShortRgba as Vo } from "./utilities/color/toShortRgba.es.js";
|
|
81
|
+
import { moveItemInArray as jo } from "./utilities/moveItemInArray.es.js";
|
|
82
|
+
import { getBackgroundColorStyles as Xo } from "./utilities/react/getBackgroundColorStyles.es.js";
|
|
83
|
+
import { getBorderStyles as zo } from "./utilities/react/getBorderStyles.es.js";
|
|
84
|
+
import { getRadiusStyles as Ko } from "./utilities/react/getRadiusStyles.es.js";
|
|
85
|
+
import { joinClassNames as Zo } from "./utilities/react/joinClassNames.es.js";
|
|
82
86
|
var r = /* @__PURE__ */ ((t) => (t.Main = "main", t.Basics = "basics", t.Layout = "layout", t.Style = "style", t.Security = "security", t.Targets = "targets", t))(r || {});
|
|
83
87
|
const e = (t) => t, n = (t) => t;
|
|
84
88
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
Yt as AllTextStylePlugins,
|
|
90
|
+
Zt as AllTextStyles,
|
|
91
|
+
G as Attachments,
|
|
92
|
+
Nr as AttachmentsProvider,
|
|
93
|
+
A as AttachmentsToolbarButton,
|
|
94
|
+
X as BUTTON_PLUGIN,
|
|
95
|
+
ct as BlockButtonStyles,
|
|
92
96
|
m as BlockInjectButton,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
97
|
+
g as BlockItemWrapper,
|
|
98
|
+
or as BlockStyles,
|
|
99
|
+
go as BorderStyle,
|
|
100
|
+
q as ButtonPlugin,
|
|
101
|
+
Et as Custom1Plugin,
|
|
102
|
+
ht as Custom2Plugin,
|
|
103
|
+
Ft as Custom3Plugin,
|
|
104
|
+
E as DEFAULT_ATTACHMENTS_BUTTON_ID,
|
|
105
|
+
U as DEFAULT_DRAGGING_TOOLTIP,
|
|
106
|
+
_ as DEFAULT_DRAG_TOOLTIP,
|
|
107
|
+
k as DEFAULT_MENU_BUTTON_ID,
|
|
108
|
+
O as DownloadButton,
|
|
109
|
+
h as DragHandleToolbarButton,
|
|
110
|
+
u as DragPreviewContextProvider,
|
|
111
|
+
z as ELEMENT_BUTTON,
|
|
112
|
+
F as FlyoutToolbarButton,
|
|
113
|
+
xo as GutterSpacing,
|
|
114
|
+
kt as Heading1Plugin,
|
|
115
|
+
bt as Heading2Plugin,
|
|
116
|
+
Rt as Heading3Plugin,
|
|
117
|
+
_t as Heading4Plugin,
|
|
118
|
+
Gt as ImageCaptionPlugin,
|
|
119
|
+
Ot as ImageTitlePlugin,
|
|
120
|
+
xr as LinkInput,
|
|
121
|
+
W as LinkPlugin,
|
|
122
|
+
lr as LinkSelector,
|
|
123
|
+
uo as Margin,
|
|
124
|
+
I as MenuToolbarButton,
|
|
125
|
+
d as MultiFlyoutContextProvider,
|
|
126
|
+
wt as PARAGRAPH_CLASSES,
|
|
127
|
+
fo as Padding,
|
|
128
|
+
Vt as ParagraphMarkupElement,
|
|
129
|
+
Wt as ParagraphMarkupElementNode,
|
|
130
|
+
jt as ParagraphPlugin,
|
|
131
|
+
qt as QuoteMarkupElementNode,
|
|
132
|
+
zt as QuotePlugin,
|
|
133
|
+
so as Radius,
|
|
134
|
+
w as RichTextEditor,
|
|
129
135
|
r as Sections,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
So as Security,
|
|
137
|
+
pr as THEME_PREFIX,
|
|
138
|
+
$t as TextStylePluginsWithoutImage,
|
|
139
|
+
er as TextStyles,
|
|
140
|
+
tr as TextStylesWithoutImage,
|
|
141
|
+
y as Toolbar,
|
|
142
|
+
D as ToolbarFlyoutMenu,
|
|
143
|
+
Ur as addHttps,
|
|
144
|
+
Po as borderStyleMap,
|
|
145
|
+
Er as convertToRteValue,
|
|
146
|
+
ft as createButtonNode,
|
|
147
|
+
J as createButtonPlugin,
|
|
148
|
+
j as createLinkPlugin,
|
|
149
|
+
Qt as createParagraphPlugin,
|
|
150
|
+
Jt as createQuotePlugin,
|
|
151
|
+
hr as customCoordinatesGetterFactory,
|
|
145
152
|
e as defineBlock,
|
|
146
153
|
n as defineSettings,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
154
|
+
Xo as getBackgroundColorStyles,
|
|
155
|
+
Wr as getBackgroundSettings,
|
|
156
|
+
qr as getBorderRadiusSettings,
|
|
157
|
+
zr as getBorderRadiusSlider,
|
|
158
|
+
Qr as getBorderSettings,
|
|
159
|
+
zo as getBorderStyles,
|
|
160
|
+
ar as getDefaultPluginsWithLinkChooser,
|
|
161
|
+
Kr as getExtendedBorderRadiusSettings,
|
|
162
|
+
Zr as getGutterSettings,
|
|
163
|
+
fr as getLegacyUrl,
|
|
164
|
+
sr as getLinkFromEditor,
|
|
165
|
+
eo as getMarginExtendedSettings,
|
|
166
|
+
to as getMarginSettings,
|
|
167
|
+
ro as getMarginSlider,
|
|
168
|
+
mo as getPaddingExtendedSettings,
|
|
169
|
+
ao as getPaddingSettings,
|
|
170
|
+
io as getPaddingSlider,
|
|
171
|
+
Ko as getRadiusStyles,
|
|
172
|
+
vo as getReadableColor,
|
|
173
|
+
Eo as getSecurityDownloadableSetting,
|
|
174
|
+
Mo as getSecurityGlobalControlId,
|
|
175
|
+
Co as getSecurityGlobalControlSetting,
|
|
176
|
+
dr as getUrl,
|
|
177
|
+
xt as getUrlFromEditor,
|
|
178
|
+
Sr as getUrlFromLinkOrLegacyLink,
|
|
179
|
+
Bo as gutterSpacingStyleMap,
|
|
180
|
+
Fr as hasRichTextValue,
|
|
181
|
+
$ as insertButton,
|
|
182
|
+
Lo as isDark,
|
|
183
|
+
kr as isDownloadable,
|
|
184
|
+
yr as isValidUrl,
|
|
185
|
+
cr as isValidUrlOrEmpty,
|
|
186
|
+
Zo as joinClassNames,
|
|
187
|
+
br as mapAppBridgeColorPaletteToFonduePalette,
|
|
188
|
+
Dr as mapAppBridgeColorPalettesToFonduePalettes,
|
|
189
|
+
To as marginStyleMap,
|
|
190
|
+
jo as moveItemInArray,
|
|
191
|
+
yo as paddingStyleMap,
|
|
192
|
+
co as radiusStyleMap,
|
|
193
|
+
Br as relativeUrlRegex,
|
|
194
|
+
No as setAlpha,
|
|
195
|
+
rt as submitFloatingButton,
|
|
196
|
+
Ho as toColorObject,
|
|
197
|
+
Io as toHex8String,
|
|
198
|
+
Do as toHexString,
|
|
199
|
+
Uo as toRgbaString,
|
|
200
|
+
Vo as toShortRgba,
|
|
201
|
+
dt as triggerFloatingButton,
|
|
202
|
+
Pt as triggerFloatingButtonEdit,
|
|
203
|
+
Tt as triggerFloatingButtonInsert,
|
|
204
|
+
et as unwrapButton,
|
|
205
|
+
at as upsertButton,
|
|
206
|
+
pt as upsertButtonText,
|
|
207
|
+
Gr as useAttachments,
|
|
208
|
+
Hr as useAttachmentsContext,
|
|
209
|
+
wr as useDndSensors,
|
|
210
|
+
f as useDragPreviewContext,
|
|
211
|
+
S as useMultiFlyoutContext,
|
|
212
|
+
B as useMultiFlyoutState,
|
|
213
|
+
Or as withAttachmentsProvider,
|
|
214
|
+
Y as withButton,
|
|
215
|
+
lt as wrapButton
|
|
206
216
|
};
|
|
207
217
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport './styles.css';\n\nimport type { FC } from 'react';\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n AssetInputBlock as AssetInputBlockSidebarSettings,\n BaseBlock as BaseBlockSidebarSettings,\n Bundle as BundleSidebarSettings,\n ChecklistBlock as ChecklistBlockSidebarSettings,\n ChoicesType as ChoicesTypeSidebarSettings,\n ColorInputBlock as ColorInputBlockSidebarSettings,\n DropdownBlock as DropdownBlockSidebarSettings,\n DynamicSettingBlock as DynamicSettingBlockSidebarSettings,\n DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n FontInputBlock as FontInputBlockSidebarSettings,\n InputBlock as InputBlockSidebarSettings,\n LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n LinkBlock as LinkBlockSidebarSettings,\n LinkChooserBlock as LinkChooserBlockSidebarSettings,\n MultiInputBlock as MultiInputBlockSidebarSettings,\n NotificationBlock as NotificationBlockSidebarSettings,\n SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n SegmentedControlsBlock as SegmentedControlsBlockSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n SimpleSettingBlock as SimpleSettingBlockSidebarSettings,\n SwitchBlock as SwitchBlockSidebarSettings,\n TemplateInputBlock as TemplateInputBlockSidebarSettings,\n TextareaBlock as TextareaBlockSidebarSettings,\n ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type AssetInputBlock = AssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type BaseBlock<T = undefined> = BaseBlockSidebarSettings<AppBridgeBlock, T>;\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type ChecklistBlock = ChecklistBlockSidebarSettings<AppBridgeBlock>;\nexport type ChoicesType = ChoicesTypeSidebarSettings<AppBridgeBlock>;\nexport type ColorInputBlock = ColorInputBlockSidebarSettings<AppBridgeBlock>;\nexport type DropdownBlock = DropdownBlockSidebarSettings<AppBridgeBlock>;\nexport type DynamicSettingBlock<Block extends DynamicSupportedBlock = DynamicSupportedBlock> =\n DynamicSettingBlockSidebarSettings<AppBridgeBlock, Block>;\nexport type DynamicSupportedBlock = DynamicSupportedBlockSidebarSettings<AppBridgeBlock>;\nexport type FontInputBlock = FontInputBlockSidebarSettings<AppBridgeBlock>;\nexport type InputBlock = InputBlockSidebarSettings<AppBridgeBlock>;\nexport type LegacyAssetInputBlock = LegacyAssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkBlock = LinkBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkChooserBlock = LinkChooserBlockSidebarSettings<AppBridgeBlock>;\nexport type MultiInputBlock = MultiInputBlockSidebarSettings<AppBridgeBlock>;\nexport type NotificationBlock = NotificationBlockSidebarSettings<AppBridgeBlock>;\nexport type SectionHeadingBlock = SectionHeadingBlockSidebarSettings<AppBridgeBlock>;\nexport type SegmentedControlsBlock = SegmentedControlsBlockSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SimpleSettingBlock = SimpleSettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SwitchBlock = SwitchBlockSidebarSettings<AppBridgeBlock>;\nexport type TemplateInputBlock = TemplateInputBlockSidebarSettings<AppBridgeBlock>;\nexport type TextareaBlock = TextareaBlockSidebarSettings<AppBridgeBlock>;\nexport type ValueOrPromisedValue<T> = ValueOrPromisedValueSidebarSettings<AppBridgeBlock, T>;\n\nexport enum Sections {\n Main = 'main',\n Basics = 'basics',\n Layout = 'layout',\n Style = 'style',\n Security = 'security',\n Targets = 'targets',\n}\n\nexport type BlockSettingsStructureExport = {\n [Sections.Main]?: SettingBlock[];\n [Sections.Basics]?: SettingBlock[];\n [Sections.Layout]?: SettingBlock[];\n [Sections.Style]?: SettingBlock[];\n [Sections.Security]?: SettingBlock[];\n} & { [customSectionName: string]: SettingBlock[] };\n\nexport type BlockProps = {\n /**\n * The Frontify App Bridge provides an interface to the Frontify app internals.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/content-blocks/introducing-the-app-bridge}\n */\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n /**\n * Block component to render.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/content-blocks}\n */\n block: FC<BlockProps>;\n /**\n * Contains the block settings and its structure.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-settings-1}\n */\n settings: ReturnType<typeof defineSettings>;\n /**\n * Block lifecycle hook ran before the block gets added in the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-lifecycle/on-block-creation}\n */\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n /**\n * Block lifecycle hook ran before the block gets deleted from the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-lifecycle/on-block-deletion}\n */\n onBlockDeleted?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n};\n\n/**\n * Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.\n */\nexport const defineBlock = (config: BlockConfigExport): BlockConfigExport => config;\n\n/**\n * Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object\n * or a function return a direct {@link BlockSettingsStructureExport} or a function returning a Promise of {@link BlockSettingsStructureExport}.\n */\nexport const defineSettings = <\n T extends\n | BlockSettingsStructureExport\n | (() => Promise<BlockSettingsStructureExport>)\n | (() => BlockSettingsStructureExport),\n>(\n settingsStructure: T,\n): T => settingsStructure;\n\nexport * from './components';\nexport * from './helpers';\nexport * from './hooks';\nexport * from './settings';\nexport * from './utilities';\n"],"names":["Sections","defineBlock","config","defineSettings","settingsStructure"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport './styles.css';\n\nimport type { FC } from 'react';\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n AssetInputBlock as AssetInputBlockSidebarSettings,\n BaseBlock as BaseBlockSidebarSettings,\n Bundle as BundleSidebarSettings,\n ChecklistBlock as ChecklistBlockSidebarSettings,\n ChoicesType as ChoicesTypeSidebarSettings,\n ColorInputBlock as ColorInputBlockSidebarSettings,\n DropdownBlock as DropdownBlockSidebarSettings,\n DynamicSettingBlock as DynamicSettingBlockSidebarSettings,\n DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n FontInputBlock as FontInputBlockSidebarSettings,\n InputBlock as InputBlockSidebarSettings,\n LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n LinkBlock as LinkBlockSidebarSettings,\n LinkChooserBlock as LinkChooserBlockSidebarSettings,\n MultiInputBlock as MultiInputBlockSidebarSettings,\n NotificationBlock as NotificationBlockSidebarSettings,\n SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n SegmentedControlsBlock as SegmentedControlsBlockSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n SimpleSettingBlock as SimpleSettingBlockSidebarSettings,\n SwitchBlock as SwitchBlockSidebarSettings,\n TemplateInputBlock as TemplateInputBlockSidebarSettings,\n TextareaBlock as TextareaBlockSidebarSettings,\n ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type AssetInputBlock = AssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type BaseBlock<T = undefined> = BaseBlockSidebarSettings<AppBridgeBlock, T>;\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type ChecklistBlock = ChecklistBlockSidebarSettings<AppBridgeBlock>;\nexport type ChoicesType = ChoicesTypeSidebarSettings<AppBridgeBlock>;\nexport type ColorInputBlock = ColorInputBlockSidebarSettings<AppBridgeBlock>;\nexport type DropdownBlock = DropdownBlockSidebarSettings<AppBridgeBlock>;\nexport type DynamicSettingBlock<Block extends DynamicSupportedBlock = DynamicSupportedBlock> =\n DynamicSettingBlockSidebarSettings<AppBridgeBlock, Block>;\nexport type DynamicSupportedBlock = DynamicSupportedBlockSidebarSettings<AppBridgeBlock>;\nexport type FontInputBlock = FontInputBlockSidebarSettings<AppBridgeBlock>;\nexport type InputBlock = InputBlockSidebarSettings<AppBridgeBlock>;\nexport type LegacyAssetInputBlock = LegacyAssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkBlock = LinkBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkChooserBlock = LinkChooserBlockSidebarSettings<AppBridgeBlock>;\nexport type MultiInputBlock = MultiInputBlockSidebarSettings<AppBridgeBlock>;\nexport type NotificationBlock = NotificationBlockSidebarSettings<AppBridgeBlock>;\nexport type SectionHeadingBlock = SectionHeadingBlockSidebarSettings<AppBridgeBlock>;\nexport type SegmentedControlsBlock = SegmentedControlsBlockSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SimpleSettingBlock = SimpleSettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SwitchBlock = SwitchBlockSidebarSettings<AppBridgeBlock>;\nexport type TemplateInputBlock = TemplateInputBlockSidebarSettings<AppBridgeBlock>;\nexport type TextareaBlock = TextareaBlockSidebarSettings<AppBridgeBlock>;\nexport type ValueOrPromisedValue<T> = ValueOrPromisedValueSidebarSettings<AppBridgeBlock, T>;\n\nexport enum Sections {\n Main = 'main',\n Basics = 'basics',\n Layout = 'layout',\n Style = 'style',\n Security = 'security',\n Targets = 'targets',\n}\n\nexport type BlockSettingsStructureExport = {\n [Sections.Main]?: SettingBlock[];\n [Sections.Basics]?: SettingBlock[];\n [Sections.Layout]?: SettingBlock[];\n [Sections.Style]?: SettingBlock[];\n [Sections.Security]?: SettingBlock[];\n} & { [customSectionName: string]: SettingBlock[] };\n\nexport type BlockProps = {\n /**\n * The Frontify App Bridge provides an interface to the Frontify app internals.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/content-blocks/introducing-the-app-bridge}\n */\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n /**\n * Block component to render.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/content-blocks}\n */\n block: FC<BlockProps>;\n /**\n * Contains the block settings and its structure.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-settings-1}\n */\n settings: ReturnType<typeof defineSettings>;\n /**\n * Block lifecycle hook ran before the block gets added in the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-lifecycle/on-block-creation}\n */\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n /**\n * Block lifecycle hook ran before the block gets deleted from the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-lifecycle/on-block-deletion}\n */\n onBlockDeleted?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n};\n\n/**\n * Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.\n */\nexport const defineBlock = (config: BlockConfigExport): BlockConfigExport => config;\n\n/**\n * Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object\n * or a function return a direct {@link BlockSettingsStructureExport} or a function returning a Promise of {@link BlockSettingsStructureExport}.\n */\nexport const defineSettings = <\n T extends\n | BlockSettingsStructureExport\n | (() => Promise<BlockSettingsStructureExport>)\n | (() => BlockSettingsStructureExport),\n>(\n settingsStructure: T,\n): T => settingsStructure;\n\nexport * from './components';\nexport * from './helpers';\nexport * from './hooks';\nexport * from './settings';\nexport * from './utilities';\n"],"names":["Sections","defineBlock","config","defineSettings","settingsStructure"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DY,IAAAA,sBAAAA,OACRA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,UAAU,WANFA,IAAAA,KAAA,CAAA,CAAA;AAyDC,MAAAC,IAAc,CAACC,MAAiDA,GAMhEC,IAAiB,CAM1BC,MACIA;"}
|