@frontify/guideline-blocks-settings 0.32.1 → 0.32.2
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 +40 -0
- package/dist/components/Attachments/AttachmentItem.es.js +128 -109
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +9 -1
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +17 -9
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +37 -39
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +33 -0
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js +26 -0
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js +28 -0
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +35 -0
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +44 -0
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +25 -0
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js +29 -0
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +13 -110
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +12 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js +20 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js +11 -0
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +18 -0
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js +18 -0
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js.map +1 -0
- package/dist/helpers/mapColorPalettes.es.js +20 -8
- package/dist/helpers/mapColorPalettes.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 +57 -23
- package/dist/index.es.js +195 -185
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/setupTests.ts +7 -2
- package/src/components/Attachments/AttachmentItem.tsx +21 -0
- package/src/components/Attachments/Attachments.spec.ct.tsx +20 -1
- package/src/components/Attachments/Attachments.tsx +8 -4
- package/src/components/Attachments/AttachmentsButtonTrigger.tsx +11 -3
- package/src/components/Attachments/types.ts +4 -2
- package/src/components/BlockItemWrapper/BlockItemWrapper.tsx +47 -47
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.spec.tsx +96 -0
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.tsx +42 -0
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.spec.tsx +44 -0
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.tsx +24 -0
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/index.ts +3 -0
- package/src/components/BlockItemWrapper/Toolbar/BaseToolbarButton.spec.tsx +40 -0
- package/src/components/BlockItemWrapper/Toolbar/BaseToolbarButton.tsx +37 -0
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.spec.tsx +89 -0
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.tsx +39 -0
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/index.ts +3 -0
- package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.spec.tsx +140 -0
- package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.tsx +61 -0
- package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/index.ts +3 -0
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.spec.tsx +77 -0
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.tsx +30 -0
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.spec.tsx +63 -0
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.tsx +40 -0
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/index.ts +3 -0
- package/src/components/BlockItemWrapper/Toolbar/Toolbar.spec.tsx +50 -53
- package/src/components/BlockItemWrapper/Toolbar/Toolbar.tsx +24 -126
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.spec.tsx +70 -0
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.tsx +19 -0
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/index.ts +3 -0
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.tsx +25 -0
- package/src/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.tsx +15 -0
- package/src/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.tsx +25 -0
- package/src/components/BlockItemWrapper/Toolbar/helpers.ts +1 -1
- package/src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.spec.tsx +59 -0
- package/src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.ts +24 -0
- package/src/components/BlockItemWrapper/Toolbar/index.ts +4 -0
- package/src/components/BlockItemWrapper/Toolbar/types.ts +8 -27
- package/src/helpers/mapColorPalettes.spec.ts +14 -113
- package/src/helpers/mapColorPalettes.ts +51 -8
- package/src/hooks/useAttachments.spec.tsx +1 -0
- package/tsconfig.json +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarAttachments.es.js +0 -27
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarAttachments.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarAttachmentsTrigger.es.js +0 -12
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarAttachmentsTrigger.es.js.map +0 -1
- package/src/components/BlockItemWrapper/Toolbar/ToolbarAttachments.tsx +0 -29
- package/src/components/BlockItemWrapper/Toolbar/ToolbarAttachmentsTrigger.tsx +0 -14
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import type { DynamicSupportedBlock as DynamicSupportedBlock_2 } from '@frontify
|
|
|
25
25
|
import type { FC } from 'react';
|
|
26
26
|
import type { FileType } from '@frontify/app-bridge';
|
|
27
27
|
import type { FontInputBlock as FontInputBlock_2 } from '@frontify/sidebar-settings';
|
|
28
|
+
import { HTMLAttributes } from 'react';
|
|
28
29
|
import type { InputBlock as InputBlock_2 } from '@frontify/sidebar-settings';
|
|
29
30
|
import { InsertNodesOptions } from '@udecode/plate';
|
|
30
31
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
@@ -35,6 +36,7 @@ import type { LinkChooserBlock as LinkChooserBlock_2 } from '@frontify/sidebar-s
|
|
|
35
36
|
import { MarkupElement } from '@frontify/fondue';
|
|
36
37
|
import { MenuItemStyle } from '@frontify/fondue';
|
|
37
38
|
import type { MultiInputBlock as MultiInputBlock_2 } from '@frontify/sidebar-settings';
|
|
39
|
+
import { MutableRefObject } from 'react';
|
|
38
40
|
import type { NotificationBlock as NotificationBlock_2 } from '@frontify/sidebar-settings';
|
|
39
41
|
import { Palette } from '@frontify/fondue';
|
|
40
42
|
import { PlateEditor } from '@udecode/plate';
|
|
@@ -90,7 +92,7 @@ export declare type AttachmentsProps = {
|
|
|
90
92
|
onUpload: (uploadedAttachments: Asset[]) => Promise<void>;
|
|
91
93
|
onBrowse: (browserAttachments: Asset[]) => void;
|
|
92
94
|
onSorted: (sortedAttachments: Asset[]) => void;
|
|
93
|
-
triggerComponent?: (props: AttachmentsTriggerProps) =>
|
|
95
|
+
triggerComponent?: (props: AttachmentsTriggerProps) => ReactElement;
|
|
94
96
|
} & ({
|
|
95
97
|
isOpen?: never;
|
|
96
98
|
onOpenChange?: never;
|
|
@@ -105,9 +107,17 @@ export declare const AttachmentsProvider: ({ appBridge, children, assetId, }: {
|
|
|
105
107
|
assetId: string;
|
|
106
108
|
}) => JSX_2.Element;
|
|
107
109
|
|
|
110
|
+
export declare const AttachmentsToolbarButton: ({ flyoutId, }: AttachmentsToolbarButtonProps) => JSX_2.Element;
|
|
111
|
+
|
|
112
|
+
declare type AttachmentsToolbarButtonProps = {
|
|
113
|
+
flyoutId?: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
108
116
|
export declare type AttachmentsTriggerProps = {
|
|
109
117
|
children: ReactNode;
|
|
110
118
|
isFlyoutOpen: boolean;
|
|
119
|
+
triggerProps: HTMLAttributes<HTMLButtonElement>;
|
|
120
|
+
triggerRef: MutableRefObject<HTMLButtonElement>;
|
|
111
121
|
};
|
|
112
122
|
|
|
113
123
|
declare type BackgroundSettingsType = {
|
|
@@ -121,11 +131,6 @@ declare type BackgroundSettingsType = {
|
|
|
121
131
|
|
|
122
132
|
export declare type BaseBlock<T = undefined> = BaseBlock_2<AppBridgeBlock, T>;
|
|
123
133
|
|
|
124
|
-
declare type BaseToolbarItem = {
|
|
125
|
-
icon: JSX.Element;
|
|
126
|
-
tooltip?: string;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
134
|
export declare const BlockButtonStyles: Record<string, CSSProperties & {
|
|
130
135
|
hover?: CSSProperties;
|
|
131
136
|
}>;
|
|
@@ -335,9 +340,7 @@ export declare type ButtonPluginProps = Omit<PluginProps, 'styles'> & {
|
|
|
335
340
|
appBridge: AppBridgeBlock;
|
|
336
341
|
};
|
|
337
342
|
|
|
338
|
-
declare type ButtonToolbarItem =
|
|
339
|
-
onClick: () => void;
|
|
340
|
-
};
|
|
343
|
+
export declare type ButtonToolbarItem = ToolbarButtonProps;
|
|
341
344
|
|
|
342
345
|
export declare type ChecklistBlock = ChecklistBlock_2<AppBridgeBlock>;
|
|
343
346
|
|
|
@@ -388,10 +391,14 @@ export declare class Custom3Plugin extends Plugin_2 {
|
|
|
388
391
|
|
|
389
392
|
export declare const customCoordinatesGetterFactory: (columnGap: number, rowGap: number) => KeyboardCoordinateGetter;
|
|
390
393
|
|
|
394
|
+
export declare const DEFAULT_ATTACHMENTS_BUTTON_ID = "attachments";
|
|
395
|
+
|
|
391
396
|
export declare const DEFAULT_DRAG_TOOLTIP = "Drag or press \u21B5 to move";
|
|
392
397
|
|
|
393
398
|
export declare const DEFAULT_DRAGGING_TOOLTIP = "Move with \u2191\u2193\u2190\u2192 and confirm with \u21B5";
|
|
394
399
|
|
|
400
|
+
export declare const DEFAULT_MENU_BUTTON_ID = "menu";
|
|
401
|
+
|
|
395
402
|
/**
|
|
396
403
|
* Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.
|
|
397
404
|
*/
|
|
@@ -409,11 +416,17 @@ declare type DownloadButtonProps = {
|
|
|
409
416
|
onDownload: () => void;
|
|
410
417
|
};
|
|
411
418
|
|
|
412
|
-
declare
|
|
419
|
+
export declare const DragHandleToolbarButton: ({ tooltip, icon, setActivatorNodeRef, draggableProps, }: DragHandleToolbarButtonProps) => JSX_2.Element;
|
|
420
|
+
|
|
421
|
+
export declare type DragHandleToolbarButtonProps = {
|
|
422
|
+
icon: JSX_2.Element;
|
|
423
|
+
tooltip?: string;
|
|
413
424
|
draggableProps: Record<string, unknown>;
|
|
414
425
|
setActivatorNodeRef?: (node: HTMLElement | null) => void;
|
|
415
426
|
};
|
|
416
427
|
|
|
428
|
+
export declare type DraghandleToolbarItem = DragHandleToolbarButtonProps;
|
|
429
|
+
|
|
417
430
|
export declare type DropdownBlock = DropdownBlock_2<AppBridgeBlock>;
|
|
418
431
|
|
|
419
432
|
export declare type DynamicSettingBlock<Block extends DynamicSupportedBlock = DynamicSupportedBlock> = DynamicSettingBlock_2<AppBridgeBlock, Block>;
|
|
@@ -422,13 +435,19 @@ export declare type DynamicSupportedBlock = DynamicSupportedBlock_2<AppBridgeBlo
|
|
|
422
435
|
|
|
423
436
|
export declare const ELEMENT_BUTTON = "button";
|
|
424
437
|
|
|
425
|
-
export declare
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
438
|
+
export declare const FlyoutToolbarButton: ({ content, icon, tooltip, flyoutId, flyoutFooter, flyoutHeader, }: FlyoutToolbarButtonProps) => JSX_2.Element;
|
|
439
|
+
|
|
440
|
+
export declare type FlyoutToolbarButtonProps = {
|
|
441
|
+
content: ReactNode;
|
|
442
|
+
icon: ReactNode;
|
|
443
|
+
tooltip: ReactNode;
|
|
444
|
+
flyoutId: string;
|
|
445
|
+
flyoutFooter?: ReactNode;
|
|
446
|
+
flyoutHeader?: ReactNode;
|
|
430
447
|
};
|
|
431
448
|
|
|
449
|
+
export declare type FlyoutToolbarItem = ToolbarFlyoutMenuItem;
|
|
450
|
+
|
|
432
451
|
export declare type FontInputBlock = FontInputBlock_2<AppBridgeBlock>;
|
|
433
452
|
|
|
434
453
|
export declare const getBackgroundColorStyles: (backgroundColor: Color) => CSSProperties;
|
|
@@ -703,6 +722,14 @@ declare type MarginSettingsType_2 = {
|
|
|
703
722
|
|
|
704
723
|
export declare const marginStyleMap: Record<Margin, string>;
|
|
705
724
|
|
|
725
|
+
export declare const MenuToolbarButton: ({ items, flyoutId, tooltip, }: MenuToolbarButtonProps) => JSX_2.Element;
|
|
726
|
+
|
|
727
|
+
export declare type MenuToolbarButtonProps = {
|
|
728
|
+
items: ToolbarFlyoutMenuItem[][];
|
|
729
|
+
flyoutId?: string;
|
|
730
|
+
tooltip?: string;
|
|
731
|
+
};
|
|
732
|
+
|
|
706
733
|
/**
|
|
707
734
|
* Moves an item from the 'from' position to the 'to' position and updates the array
|
|
708
735
|
*
|
|
@@ -940,24 +967,31 @@ export declare const toHex8String: (color: Color) => string;
|
|
|
940
967
|
*/
|
|
941
968
|
export declare const toHexString: (color: Color) => string;
|
|
942
969
|
|
|
943
|
-
export declare const Toolbar: ({ items, flyoutMenu, attachments
|
|
970
|
+
export declare const Toolbar: ({ items, flyoutMenu, attachments }: ToolbarProps) => JSX_2.Element;
|
|
944
971
|
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
972
|
+
declare type ToolbarButtonProps = {
|
|
973
|
+
icon: JSX_2.Element;
|
|
974
|
+
tooltip?: string;
|
|
975
|
+
onClick: () => void;
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
declare type ToolbarFlyoutMenuItem = {
|
|
979
|
+
title: string;
|
|
980
|
+
onClick: () => void;
|
|
981
|
+
icon: JSX_2.Element;
|
|
982
|
+
style?: MenuItemStyle;
|
|
948
983
|
};
|
|
949
984
|
|
|
950
985
|
export declare type ToolbarItem = DraghandleToolbarItem | ButtonToolbarItem;
|
|
951
986
|
|
|
952
987
|
export declare type ToolbarProps = {
|
|
953
988
|
items: ToolbarItem[];
|
|
954
|
-
flyoutMenu:
|
|
955
|
-
items:
|
|
989
|
+
flyoutMenu: {
|
|
990
|
+
items: ToolbarFlyoutMenuItem[][];
|
|
956
991
|
};
|
|
957
|
-
attachments:
|
|
992
|
+
attachments: {
|
|
958
993
|
isEnabled: boolean;
|
|
959
994
|
};
|
|
960
|
-
isDragging?: boolean;
|
|
961
995
|
};
|
|
962
996
|
|
|
963
997
|
/**
|
package/dist/index.es.js
CHANGED
|
@@ -1,197 +1,207 @@
|
|
|
1
1
|
import "./styles.css.es.js";
|
|
2
2
|
export * from "@frontify/sidebar-settings";
|
|
3
|
-
import { BlockInjectButton as
|
|
3
|
+
import { BlockInjectButton as m } from "./components/BlockInjectButton/BlockInjectButton.es.js";
|
|
4
4
|
import { BlockItemWrapper as l } from "./components/BlockItemWrapper/BlockItemWrapper.es.js";
|
|
5
5
|
import { Toolbar as u } from "./components/BlockItemWrapper/Toolbar/Toolbar.es.js";
|
|
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 {
|
|
6
|
+
import { AttachmentsToolbarButton as s, DEFAULT_ATTACHMENTS_BUTTON_ID as d } from "./components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js";
|
|
7
|
+
import { DragHandleToolbarButton as B } from "./components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js";
|
|
8
|
+
import { FlyoutToolbarButton as T } from "./components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js";
|
|
9
|
+
import { DEFAULT_MENU_BUTTON_ID as y, MenuToolbarButton as A } from "./components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js";
|
|
10
|
+
import { DEFAULT_DRAGGING_TOOLTIP as h, DEFAULT_DRAG_TOOLTIP as L } from "./components/BlockItemWrapper/constants.es.js";
|
|
11
|
+
import { Attachments as I } from "./components/Attachments/Attachments.es.js";
|
|
12
|
+
import { DownloadButton as C } from "./components/DownloadButton/DownloadButton.es.js";
|
|
13
|
+
import { RichTextEditor as U } from "./components/RichTextEditor/RichTextEditor.es.js";
|
|
14
|
+
import { LinkPlugin as F, createLinkPlugin as D } from "./components/RichTextEditor/plugins/LinkPlugin/index.es.js";
|
|
15
|
+
import { BUTTON_PLUGIN as N, ButtonPlugin as G, ELEMENT_BUTTON as H, createButtonPlugin as O } from "./components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
16
|
+
import { withButton as v } from "./components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js";
|
|
17
|
+
import { insertButton as W } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js";
|
|
18
|
+
import { submitFloatingButton as Q } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js";
|
|
19
|
+
import { unwrapButton as q } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js";
|
|
20
|
+
import { upsertButton as J } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js";
|
|
21
|
+
import { upsertButtonText as Y } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js";
|
|
22
|
+
import { wrapButton as $ } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js";
|
|
23
|
+
import { getUrlFromEditor as rt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js";
|
|
24
|
+
import { createButtonNode as et } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js";
|
|
25
|
+
import { triggerFloatingButton as at } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js";
|
|
26
|
+
import { triggerFloatingButtonEdit as it } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js";
|
|
27
|
+
import { triggerFloatingButtonInsert as gt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js";
|
|
28
|
+
import { BlockButtonStyles as xt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js";
|
|
29
|
+
import { Custom1Plugin as ft } from "./components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js";
|
|
30
|
+
import { Custom2Plugin as dt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js";
|
|
31
|
+
import { Custom3Plugin as Bt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js";
|
|
32
|
+
import { Heading1Plugin as Tt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js";
|
|
33
|
+
import { Heading2Plugin as yt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js";
|
|
34
|
+
import { Heading3Plugin as Et } from "./components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js";
|
|
35
|
+
import { Heading4Plugin as Lt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js";
|
|
36
|
+
import { ImageCaptionPlugin as It } from "./components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js";
|
|
37
|
+
import { ImageTitlePlugin as Ct } from "./components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js";
|
|
38
|
+
import { PARAGRAPH_CLASSES as Ut, ParagraphMarkupElement as bt, ParagraphMarkupElementNode as Ft, ParagraphPlugin as Dt, createParagraphPlugin as _t } from "./components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js";
|
|
39
|
+
import { QuoteMarkupElementNode as Gt, QuotePlugin as Ht, createQuotePlugin as Ot } from "./components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js";
|
|
40
|
+
import { AllTextStylePlugins as vt, AllTextStyles as Vt, TextStylePluginsWithoutImage as Wt, TextStylesWithoutImage as jt } from "./components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js";
|
|
41
|
+
import { BlockStyles as Xt, TextStyles as qt } from "./components/RichTextEditor/plugins/styles.es.js";
|
|
42
|
+
import { getDefaultPluginsWithLinkChooser as Jt } from "./components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js";
|
|
43
|
+
import { THEME_PREFIX as Yt } from "./components/RichTextEditor/constants.es.js";
|
|
44
|
+
import { LinkSelector as $t } from "./components/Link/LinkSelector/LinkSelector.es.js";
|
|
45
|
+
import { LinkInput as rr } from "./components/Link/LinkInput.es.js";
|
|
46
|
+
import { getLegacyUrl as er, getLinkFromEditor as nr, getUrl as ar, getUrlFromLinkOrLegacyLink as pr } from "./components/Link/utils/getUrl.es.js";
|
|
47
|
+
import { relativeUrlRegex as mr } from "./components/Link/utils/relativeUrlRegex.es.js";
|
|
48
|
+
import { isValidUrl as lr, isValidUrlOrEmpty as xr } from "./components/Link/utils/url.es.js";
|
|
49
|
+
import { convertToRteValue as fr } from "./helpers/convertToRichTextValue.es.js";
|
|
50
|
+
import { customCoordinatesGetterFactory as dr } from "./helpers/customCoordinatesGetterFactory.es.js";
|
|
51
|
+
import { hasRichTextValue as Br } from "./helpers/hasRichTextValue.es.js";
|
|
52
|
+
import { isDownloadable as Tr } from "./helpers/isDownloadable.es.js";
|
|
53
|
+
import { mapAppBridgeColorPaletteToFonduePalette as yr, mapAppBridgeColorPalettesToFonduePalettes as Ar } from "./helpers/mapColorPalettes.es.js";
|
|
54
|
+
import { addHttps as hr } from "./helpers/addHttps.es.js";
|
|
55
|
+
import { AttachmentsProvider as kr, useAttachments as Ir, useAttachmentsContext as Mr, withAttachmentsProvider as Cr } from "./hooks/useAttachments.es.js";
|
|
56
|
+
import { useDndSensors as Ur } from "./hooks/useDndSensors.es.js";
|
|
57
|
+
import { getBackgroundSettings as Fr } from "./settings/background.es.js";
|
|
58
|
+
import { getBorderSettings as _r } from "./settings/border.es.js";
|
|
59
|
+
import { getBorderRadiusSettings as Gr, getBorderRadiusSlider as Hr } from "./settings/borderRadius.es.js";
|
|
60
|
+
import { getExtendedBorderRadiusSettings as wr } from "./settings/borderRadiusExtended.es.js";
|
|
61
|
+
import { getGutterSettings as Vr } from "./settings/gutter.es.js";
|
|
62
|
+
import { getMarginSettings as jr, getMarginSlider as Qr } from "./settings/margin.es.js";
|
|
63
|
+
import { getMarginExtendedSettings as qr } from "./settings/marginExtended.es.js";
|
|
64
|
+
import { getPaddingSettings as Jr, getPaddingSlider as Kr } from "./settings/padding.es.js";
|
|
65
|
+
import { getPaddingExtendedSettings as Zr } from "./settings/paddingExtended.es.js";
|
|
66
|
+
import { BorderStyle as to, GutterSpacing as ro, Margin as oo, Padding as eo, Radius as no, Security as ao, borderStyleMap as po, gutterSpacingStyleMap as io, marginStyleMap as mo, paddingStyleMap as go, radiusStyleMap as lo } from "./settings/types.es.js";
|
|
67
|
+
import { getSecurityDownloadableSetting as uo, getSecurityGlobalControlId as fo } from "./settings/securityDownloadable.es.js";
|
|
68
|
+
import { getSecurityGlobalControlSetting as So } from "./settings/securityGlobalControl.es.js";
|
|
69
|
+
import { isDark as Po } from "./utilities/color/isDark.es.js";
|
|
70
|
+
import { toHex8String as co } from "./utilities/color/toHex8String.es.js";
|
|
71
|
+
import { toHexString as Ao } from "./utilities/color/toHexString.es.js";
|
|
72
|
+
import { toRgbaString as ho } from "./utilities/color/toRgbaString.es.js";
|
|
73
|
+
import { setAlpha as ko } from "./utilities/color/setAlpha.es.js";
|
|
74
|
+
import { toColorObject as Mo } from "./utilities/color/toColorObject.es.js";
|
|
75
|
+
import { getReadableColor as Ro } from "./utilities/color/getReadableColor.es.js";
|
|
76
|
+
import { toShortRgba as bo } from "./utilities/color/toShortRgba.es.js";
|
|
77
|
+
import { moveItemInArray as Do } from "./utilities/moveItemInArray.es.js";
|
|
78
|
+
import { getBackgroundColorStyles as No } from "./utilities/react/getBackgroundColorStyles.es.js";
|
|
79
|
+
import { getBorderStyles as Ho } from "./utilities/react/getBorderStyles.es.js";
|
|
80
|
+
import { getRadiusStyles as wo } from "./utilities/react/getRadiusStyles.es.js";
|
|
81
|
+
import { joinClassNames as Vo } from "./utilities/react/joinClassNames.es.js";
|
|
78
82
|
var r = /* @__PURE__ */ ((t) => (t.Main = "main", t.Basics = "basics", t.Layout = "layout", t.Style = "style", t.Security = "security", t.Targets = "targets", t))(r || {});
|
|
79
|
-
const
|
|
83
|
+
const e = (t) => t, n = (t) => t;
|
|
80
84
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
vt as AllTextStylePlugins,
|
|
86
|
+
Vt as AllTextStyles,
|
|
87
|
+
I as Attachments,
|
|
88
|
+
kr as AttachmentsProvider,
|
|
89
|
+
s as AttachmentsToolbarButton,
|
|
90
|
+
N as BUTTON_PLUGIN,
|
|
91
|
+
xt as BlockButtonStyles,
|
|
92
|
+
m as BlockInjectButton,
|
|
88
93
|
l as BlockItemWrapper,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
94
|
+
Xt as BlockStyles,
|
|
95
|
+
to as BorderStyle,
|
|
96
|
+
G as ButtonPlugin,
|
|
97
|
+
ft as Custom1Plugin,
|
|
98
|
+
dt as Custom2Plugin,
|
|
99
|
+
Bt as Custom3Plugin,
|
|
100
|
+
d as DEFAULT_ATTACHMENTS_BUTTON_ID,
|
|
101
|
+
h as DEFAULT_DRAGGING_TOOLTIP,
|
|
102
|
+
L as DEFAULT_DRAG_TOOLTIP,
|
|
103
|
+
y as DEFAULT_MENU_BUTTON_ID,
|
|
104
|
+
C as DownloadButton,
|
|
105
|
+
B as DragHandleToolbarButton,
|
|
106
|
+
H as ELEMENT_BUTTON,
|
|
107
|
+
T as FlyoutToolbarButton,
|
|
108
|
+
ro as GutterSpacing,
|
|
109
|
+
Tt as Heading1Plugin,
|
|
110
|
+
yt as Heading2Plugin,
|
|
111
|
+
Et as Heading3Plugin,
|
|
112
|
+
Lt as Heading4Plugin,
|
|
113
|
+
It as ImageCaptionPlugin,
|
|
114
|
+
Ct as ImageTitlePlugin,
|
|
115
|
+
rr as LinkInput,
|
|
116
|
+
F as LinkPlugin,
|
|
117
|
+
$t as LinkSelector,
|
|
118
|
+
oo as Margin,
|
|
119
|
+
A as MenuToolbarButton,
|
|
120
|
+
Ut as PARAGRAPH_CLASSES,
|
|
121
|
+
eo as Padding,
|
|
122
|
+
bt as ParagraphMarkupElement,
|
|
123
|
+
Ft as ParagraphMarkupElementNode,
|
|
124
|
+
Dt as ParagraphPlugin,
|
|
125
|
+
Gt as QuoteMarkupElementNode,
|
|
126
|
+
Ht as QuotePlugin,
|
|
127
|
+
no as Radius,
|
|
128
|
+
U as RichTextEditor,
|
|
119
129
|
r as Sections,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
ao as Security,
|
|
131
|
+
Yt as THEME_PREFIX,
|
|
132
|
+
Wt as TextStylePluginsWithoutImage,
|
|
133
|
+
qt as TextStyles,
|
|
134
|
+
jt as TextStylesWithoutImage,
|
|
125
135
|
u as Toolbar,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
hr as addHttps,
|
|
137
|
+
po as borderStyleMap,
|
|
138
|
+
fr as convertToRteValue,
|
|
139
|
+
et as createButtonNode,
|
|
140
|
+
O as createButtonPlugin,
|
|
141
|
+
D as createLinkPlugin,
|
|
142
|
+
_t as createParagraphPlugin,
|
|
143
|
+
Ot as createQuotePlugin,
|
|
144
|
+
dr as customCoordinatesGetterFactory,
|
|
145
|
+
e as defineBlock,
|
|
136
146
|
n as defineSettings,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
147
|
+
No as getBackgroundColorStyles,
|
|
148
|
+
Fr as getBackgroundSettings,
|
|
149
|
+
Gr as getBorderRadiusSettings,
|
|
150
|
+
Hr as getBorderRadiusSlider,
|
|
151
|
+
_r as getBorderSettings,
|
|
152
|
+
Ho as getBorderStyles,
|
|
153
|
+
Jt as getDefaultPluginsWithLinkChooser,
|
|
154
|
+
wr as getExtendedBorderRadiusSettings,
|
|
155
|
+
Vr as getGutterSettings,
|
|
156
|
+
er as getLegacyUrl,
|
|
157
|
+
nr as getLinkFromEditor,
|
|
158
|
+
qr as getMarginExtendedSettings,
|
|
159
|
+
jr as getMarginSettings,
|
|
160
|
+
Qr as getMarginSlider,
|
|
161
|
+
Zr as getPaddingExtendedSettings,
|
|
162
|
+
Jr as getPaddingSettings,
|
|
163
|
+
Kr as getPaddingSlider,
|
|
164
|
+
wo as getRadiusStyles,
|
|
165
|
+
Ro as getReadableColor,
|
|
166
|
+
uo as getSecurityDownloadableSetting,
|
|
167
|
+
fo as getSecurityGlobalControlId,
|
|
168
|
+
So as getSecurityGlobalControlSetting,
|
|
169
|
+
ar as getUrl,
|
|
170
|
+
rt as getUrlFromEditor,
|
|
171
|
+
pr as getUrlFromLinkOrLegacyLink,
|
|
172
|
+
io as gutterSpacingStyleMap,
|
|
173
|
+
Br as hasRichTextValue,
|
|
174
|
+
W as insertButton,
|
|
175
|
+
Po as isDark,
|
|
176
|
+
Tr as isDownloadable,
|
|
177
|
+
lr as isValidUrl,
|
|
178
|
+
xr as isValidUrlOrEmpty,
|
|
179
|
+
Vo as joinClassNames,
|
|
180
|
+
yr as mapAppBridgeColorPaletteToFonduePalette,
|
|
181
|
+
Ar as mapAppBridgeColorPalettesToFonduePalettes,
|
|
182
|
+
mo as marginStyleMap,
|
|
183
|
+
Do as moveItemInArray,
|
|
184
|
+
go as paddingStyleMap,
|
|
185
|
+
lo as radiusStyleMap,
|
|
186
|
+
mr as relativeUrlRegex,
|
|
187
|
+
ko as setAlpha,
|
|
188
|
+
Q as submitFloatingButton,
|
|
189
|
+
Mo as toColorObject,
|
|
190
|
+
co as toHex8String,
|
|
191
|
+
Ao as toHexString,
|
|
192
|
+
ho as toRgbaString,
|
|
193
|
+
bo as toShortRgba,
|
|
194
|
+
at as triggerFloatingButton,
|
|
195
|
+
it as triggerFloatingButtonEdit,
|
|
196
|
+
gt as triggerFloatingButtonInsert,
|
|
197
|
+
q as unwrapButton,
|
|
198
|
+
J as upsertButton,
|
|
199
|
+
Y as upsertButtonText,
|
|
200
|
+
Ir as useAttachments,
|
|
201
|
+
Mr as useAttachmentsContext,
|
|
202
|
+
Ur as useDndSensors,
|
|
203
|
+
Cr as withAttachmentsProvider,
|
|
204
|
+
v as withButton,
|
|
205
|
+
$ as wrapButton
|
|
196
206
|
};
|
|
197
207
|
//# 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;"}
|