@frontify/guideline-blocks-settings 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/useAttachments.es.js +49 -30
- package/dist/hooks/useAttachments.es.js.map +1 -1
- package/dist/index.cjs.js +15 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +21 -5
- package/dist/index.es.js +102 -100
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +15 -15
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ import { TextStyleRenderElementProps } from '@frontify/fondue';
|
|
|
57
57
|
import { TLinkElement } from '@frontify/fondue';
|
|
58
58
|
import { TText } from '@frontify/fondue';
|
|
59
59
|
import { UnwrapNodesOptions } from '@frontify/fondue';
|
|
60
|
+
import { useBlockAssets } from '@frontify/app-bridge';
|
|
60
61
|
import { Value } from '@frontify/fondue';
|
|
61
62
|
import { ValueOrPromisedValue as ValueOrPromisedValue_2 } from '@frontify/sidebar-settings';
|
|
62
63
|
import { WithOverride } from '@frontify/fondue';
|
|
@@ -77,6 +78,13 @@ export declare type AttachmentItemProps = SortableAttachmentItemProps & {
|
|
|
77
78
|
isOverlay?: boolean;
|
|
78
79
|
};
|
|
79
80
|
|
|
81
|
+
export declare const AttachmentOperationsProvider: ({ blockAssetBundle, appBridge, children, assetId, }: {
|
|
82
|
+
blockAssetBundle: ReturnType<typeof useBlockAssets>;
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
assetId: string;
|
|
85
|
+
appBridge: AppBridgeBlock;
|
|
86
|
+
}) => JSX_2.Element;
|
|
87
|
+
|
|
80
88
|
export declare const Attachments: ({ items, onDelete, onReplaceWithBrowse, onReplaceWithUpload, onBrowse, onUpload, onSorted, appBridge, triggerComponent: TriggerComponent, isOpen, onOpenChange, }: AttachmentsProps) => JSX_2.Element | null;
|
|
81
89
|
|
|
82
90
|
export declare type AttachmentsProps = {
|
|
@@ -132,18 +140,18 @@ export declare const BlockButtonStyles: Record<string, CSSProperties & {
|
|
|
132
140
|
export declare type BlockConfigExport = {
|
|
133
141
|
/**
|
|
134
142
|
* Block component to render.
|
|
135
|
-
* {@link https://developer.frontify.com/
|
|
143
|
+
* {@link https://developer.frontify.com/document/2569#/details-concepts-1/content-blocks}
|
|
136
144
|
*/
|
|
137
145
|
block: FC<BlockProps>;
|
|
138
146
|
/**
|
|
139
147
|
* Contains the block settings and its structure.
|
|
140
|
-
* {@link https://developer.frontify.com/
|
|
148
|
+
* {@link https://developer.frontify.com/document/2569#/details-concepts-1/block-settings-1}
|
|
141
149
|
*/
|
|
142
150
|
settings: ReturnType<typeof defineSettings>;
|
|
143
151
|
/**
|
|
144
152
|
* Block lifecycle hook ran before the block gets added in the Guideline.
|
|
145
153
|
* The hook support both synchronous or asynchronous execution.
|
|
146
|
-
* {@link https://developer.frontify.com/
|
|
154
|
+
* {@link https://developer.frontify.com/document/2569#/details-concepts-1/block-lifecycle/on-block-creation}
|
|
147
155
|
*/
|
|
148
156
|
onBlockCreated?: (({ appBridge }: {
|
|
149
157
|
appBridge: AppBridgeBlock;
|
|
@@ -153,7 +161,7 @@ export declare type BlockConfigExport = {
|
|
|
153
161
|
/**
|
|
154
162
|
* Block lifecycle hook ran before the block gets deleted from the Guideline.
|
|
155
163
|
* The hook support both synchronous or asynchronous execution.
|
|
156
|
-
* {@link https://developer.frontify.com/
|
|
164
|
+
* {@link https://developer.frontify.com/document/2569#/details-concepts-1/block-lifecycle/on-block-deletion}
|
|
157
165
|
*/
|
|
158
166
|
onBlockDeleted?: (({ appBridge }: {
|
|
159
167
|
appBridge: AppBridgeBlock;
|
|
@@ -201,7 +209,7 @@ export declare type BlockItemWrapperProps = {
|
|
|
201
209
|
export declare type BlockProps = {
|
|
202
210
|
/**
|
|
203
211
|
* The Frontify App Bridge provides an interface to the Frontify app internals.
|
|
204
|
-
* {@link https://developer.frontify.com/
|
|
212
|
+
* {@link https://developer.frontify.com/document/2569#/details-concepts-1/content-blocks/introducing-the-app-bridge}
|
|
205
213
|
*/
|
|
206
214
|
appBridge: AppBridgeBlock;
|
|
207
215
|
};
|
|
@@ -1094,6 +1102,14 @@ export declare type UpsertButtonOptions<V extends Value = Value> = CreateButtonN
|
|
|
1094
1102
|
*/
|
|
1095
1103
|
export declare const upsertButtonText: <V extends Value>(editor: PlateEditor<V>, { text }: UpsertButtonOptions<V>) => void;
|
|
1096
1104
|
|
|
1105
|
+
export declare const useAttachmentOperations: (attachmentKey: string, blockAssetBundle: ReturnType<typeof useBlockAssets>) => {
|
|
1106
|
+
onAttachmentsAdd: (newAssets: Asset[]) => Promise<void>;
|
|
1107
|
+
onAttachmentDelete: (assetToDelete: Asset) => Promise<void>;
|
|
1108
|
+
onAttachmentReplace: (attachmentToReplace: Asset, newAsset: Asset) => Promise<void>;
|
|
1109
|
+
onAttachmentsSorted: (assets: Asset[]) => Promise<void>;
|
|
1110
|
+
attachments: Asset[];
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1097
1113
|
export declare const useAttachments: (appBridge: AppBridgeBlock, attachmentKey: string) => {
|
|
1098
1114
|
onAttachmentsAdd: (newAssets: Asset[]) => Promise<void>;
|
|
1099
1115
|
onAttachmentDelete: (assetToDelete: Asset) => Promise<void>;
|
package/dist/index.es.js
CHANGED
|
@@ -6,14 +6,14 @@ import { DragPreviewContextProvider as u, useDragPreviewContext as f } from "./c
|
|
|
6
6
|
import { MultiFlyoutContextProvider as d, useMultiFlyoutContext as P } from "./components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js";
|
|
7
7
|
import { useMultiFlyoutState as B } from "./components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js";
|
|
8
8
|
import { Toolbar as c } from "./components/BlockItemWrapper/Toolbar/Toolbar.es.js";
|
|
9
|
-
import { AttachmentsToolbarButton as
|
|
10
|
-
import { DragHandleToolbarButton as
|
|
11
|
-
import { FlyoutToolbarButton as
|
|
9
|
+
import { AttachmentsToolbarButton as A, DEFAULT_ATTACHMENTS_BUTTON_ID as E } from "./components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js";
|
|
10
|
+
import { DragHandleToolbarButton as L } from "./components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js";
|
|
11
|
+
import { FlyoutToolbarButton as C } from "./components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js";
|
|
12
12
|
import { DEFAULT_MENU_BUTTON_ID as k, MenuToolbarButton as R } from "./components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js";
|
|
13
13
|
import { DEFAULT_DRAGGING_TOOLTIP as _, DEFAULT_DRAG_TOOLTIP as D } from "./components/BlockItemWrapper/constants.es.js";
|
|
14
14
|
import { Attachments as b } from "./components/Attachments/Attachments.es.js";
|
|
15
|
-
import { DownloadButton as
|
|
16
|
-
import { RichTextEditor as
|
|
15
|
+
import { DownloadButton as O } from "./components/DownloadButton/DownloadButton.es.js";
|
|
16
|
+
import { RichTextEditor as v } from "./components/RichTextEditor/RichTextEditor.es.js";
|
|
17
17
|
import { LinkPlugin as w, createLinkPlugin as V } from "./components/RichTextEditor/plugins/LinkPlugin/index.es.js";
|
|
18
18
|
import { BUTTON_PLUGIN as j, ButtonPlugin as Q, ELEMENT_BUTTON as K, createButtonPlugin as X } from "./components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
19
19
|
import { withButton as q } from "./components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js";
|
|
@@ -29,15 +29,15 @@ import { triggerFloatingButton as ft } from "./components/RichTextEditor/plugins
|
|
|
29
29
|
import { triggerFloatingButtonEdit as dt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js";
|
|
30
30
|
import { triggerFloatingButtonInsert as St } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js";
|
|
31
31
|
import { BlockButtonStyles as Tt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js";
|
|
32
|
-
import { BreakAfterPlugin as yt, GAP_DEFAULT as
|
|
33
|
-
import { Custom1Plugin as
|
|
34
|
-
import { Custom2Plugin as
|
|
32
|
+
import { BreakAfterPlugin as yt, GAP_DEFAULT as At, KEY_ELEMENT_BREAK_AFTER_COLUMN as Et } from "./components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js";
|
|
33
|
+
import { Custom1Plugin as Lt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js";
|
|
34
|
+
import { Custom2Plugin as Ct } from "./components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js";
|
|
35
35
|
import { Custom3Plugin as kt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js";
|
|
36
36
|
import { Heading1Plugin as Ut } from "./components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js";
|
|
37
37
|
import { Heading2Plugin as Dt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js";
|
|
38
38
|
import { Heading3Plugin as bt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js";
|
|
39
|
-
import { Heading4Plugin as
|
|
40
|
-
import { ImageCaptionPlugin as
|
|
39
|
+
import { Heading4Plugin as Ot } from "./components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js";
|
|
40
|
+
import { ImageCaptionPlugin as vt } from "./components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js";
|
|
41
41
|
import { ImageTitlePlugin as wt } from "./components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js";
|
|
42
42
|
import { PARAGRAPH_CLASSES as Wt, ParagraphMarkupElement as jt, ParagraphMarkupElementNode as Qt, ParagraphPlugin as Kt, createParagraphPlugin as Xt } from "./components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js";
|
|
43
43
|
import { QuoteMarkupElementNode as qt, QuotePlugin as zt, createQuotePlugin as Jt } from "./components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js";
|
|
@@ -49,170 +49,172 @@ import { LinkSelector as xr } from "./components/Link/LinkSelector/LinkSelector.
|
|
|
49
49
|
import { LinkInput as fr } from "./components/Link/LinkInput.es.js";
|
|
50
50
|
import { getLegacyUrl as dr, getLinkFromEditor as Pr, getUrl as Sr, getUrlFromLinkOrLegacyLink as Br } from "./components/Link/utils/getUrl.es.js";
|
|
51
51
|
import { relativeUrlRegex as cr } from "./components/Link/utils/relativeUrlRegex.es.js";
|
|
52
|
-
import { isValidUrl as
|
|
53
|
-
import { convertToRteValue as
|
|
54
|
-
import { customCoordinatesGetterFactory as
|
|
52
|
+
import { isValidUrl as Ar, isValidUrlOrEmpty as Er } from "./components/Link/utils/url.es.js";
|
|
53
|
+
import { convertToRteValue as Lr } from "./helpers/convertToRichTextValue.es.js";
|
|
54
|
+
import { customCoordinatesGetterFactory as Cr } from "./helpers/customCoordinatesGetterFactory.es.js";
|
|
55
55
|
import { hasRichTextValue as kr } from "./helpers/hasRichTextValue.es.js";
|
|
56
56
|
import { isDownloadable as Ur } from "./helpers/isDownloadable.es.js";
|
|
57
57
|
import { mapAppBridgeColorPaletteToFonduePalette as Dr, mapAppBridgeColorPalettesToFonduePalettes as Ir } from "./helpers/mapColorPalettes.es.js";
|
|
58
58
|
import { addHttps as Nr } from "./helpers/addHttps.es.js";
|
|
59
|
-
import { AttachmentsProvider as
|
|
60
|
-
import { useDndSensors as
|
|
61
|
-
import { getBackgroundSettings as
|
|
62
|
-
import { getBorderSettings as
|
|
63
|
-
import { getBorderRadiusSettings as
|
|
64
|
-
import { getExtendedBorderRadiusSettings as
|
|
65
|
-
import { getGutterSettings as
|
|
66
|
-
import { getMarginSettings as
|
|
67
|
-
import { getMarginExtendedSettings as
|
|
68
|
-
import { getPaddingSettings as
|
|
69
|
-
import { getPaddingExtendedSettings as
|
|
70
|
-
import { BorderStyle as
|
|
71
|
-
import { getSecurityDownloadableSetting as
|
|
72
|
-
import { getSecurityGlobalControlSetting as
|
|
73
|
-
import { isDark as
|
|
74
|
-
import { toHex8String as
|
|
75
|
-
import { toHexString as
|
|
76
|
-
import { toRgbaString as
|
|
77
|
-
import { setAlpha as
|
|
78
|
-
import { toColorObject as
|
|
79
|
-
import { getReadableColor as
|
|
80
|
-
import { toShortRgba as
|
|
81
|
-
import { moveItemInArray as
|
|
82
|
-
import { getBackgroundColorStyles as
|
|
83
|
-
import { getBorderStyles as
|
|
84
|
-
import { getRadiusStyles as
|
|
85
|
-
import { joinClassNames as
|
|
59
|
+
import { AttachmentOperationsProvider as Gr, AttachmentsProvider as vr, useAttachmentOperations as Hr, useAttachments as wr, useAttachmentsContext as Vr, withAttachmentsProvider as Wr } from "./hooks/useAttachments.es.js";
|
|
60
|
+
import { useDndSensors as Qr } from "./hooks/useDndSensors.es.js";
|
|
61
|
+
import { getBackgroundSettings as Xr } from "./settings/background.es.js";
|
|
62
|
+
import { getBorderSettings as qr } from "./settings/border.es.js";
|
|
63
|
+
import { getBorderRadiusSettings as Jr, getBorderRadiusSlider as Zr } from "./settings/borderRadius.es.js";
|
|
64
|
+
import { getExtendedBorderRadiusSettings as to } from "./settings/borderRadiusExtended.es.js";
|
|
65
|
+
import { getGutterSettings as oo } from "./settings/gutter.es.js";
|
|
66
|
+
import { getMarginSettings as no, getMarginSlider as ao } from "./settings/margin.es.js";
|
|
67
|
+
import { getMarginExtendedSettings as po } from "./settings/marginExtended.es.js";
|
|
68
|
+
import { getPaddingSettings as go, getPaddingSlider as lo } from "./settings/padding.es.js";
|
|
69
|
+
import { getPaddingExtendedSettings as uo } from "./settings/paddingExtended.es.js";
|
|
70
|
+
import { BorderStyle as so, GutterSpacing as Po, Margin as So, Padding as Bo, Radius as To, Security as co, borderStyleMap as yo, gutterSpacingStyleMap as Ao, marginStyleMap as Eo, paddingStyleMap as ho, radiusStyleMap as Lo } from "./settings/types.es.js";
|
|
71
|
+
import { getSecurityDownloadableSetting as Co, getSecurityGlobalControlId as Fo } from "./settings/securityDownloadable.es.js";
|
|
72
|
+
import { getSecurityGlobalControlSetting as Ro } from "./settings/securityGlobalControl.es.js";
|
|
73
|
+
import { isDark as _o } from "./utilities/color/isDark.es.js";
|
|
74
|
+
import { toHex8String as Io } from "./utilities/color/toHex8String.es.js";
|
|
75
|
+
import { toHexString as No } from "./utilities/color/toHexString.es.js";
|
|
76
|
+
import { toRgbaString as Go } from "./utilities/color/toRgbaString.es.js";
|
|
77
|
+
import { setAlpha as Ho } from "./utilities/color/setAlpha.es.js";
|
|
78
|
+
import { toColorObject as Vo } from "./utilities/color/toColorObject.es.js";
|
|
79
|
+
import { getReadableColor as jo } from "./utilities/color/getReadableColor.es.js";
|
|
80
|
+
import { toShortRgba as Ko } from "./utilities/color/toShortRgba.es.js";
|
|
81
|
+
import { moveItemInArray as Yo } from "./utilities/moveItemInArray.es.js";
|
|
82
|
+
import { getBackgroundColorStyles as zo } from "./utilities/react/getBackgroundColorStyles.es.js";
|
|
83
|
+
import { getBorderStyles as Zo } from "./utilities/react/getBorderStyles.es.js";
|
|
84
|
+
import { getRadiusStyles as te } from "./utilities/react/getRadiusStyles.es.js";
|
|
85
|
+
import { joinClassNames as oe } from "./utilities/react/joinClassNames.es.js";
|
|
86
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 || {});
|
|
87
87
|
const e = (t) => t, n = (t) => t;
|
|
88
88
|
export {
|
|
89
89
|
$t as AllTextStylePlugins,
|
|
90
90
|
tr as AllTextStyles,
|
|
91
|
+
Gr as AttachmentOperationsProvider,
|
|
91
92
|
b as Attachments,
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
vr as AttachmentsProvider,
|
|
94
|
+
A as AttachmentsToolbarButton,
|
|
94
95
|
j as BUTTON_PLUGIN,
|
|
95
96
|
Tt as BlockButtonStyles,
|
|
96
97
|
m as BlockInjectButton,
|
|
97
98
|
l as BlockItemWrapper,
|
|
98
99
|
nr as BlockStyles,
|
|
99
|
-
|
|
100
|
+
so as BorderStyle,
|
|
100
101
|
yt as BreakAfterPlugin,
|
|
101
102
|
Q as ButtonPlugin,
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
Lt as Custom1Plugin,
|
|
104
|
+
Ct as Custom2Plugin,
|
|
104
105
|
kt as Custom3Plugin,
|
|
105
|
-
|
|
106
|
+
E as DEFAULT_ATTACHMENTS_BUTTON_ID,
|
|
106
107
|
_ as DEFAULT_DRAGGING_TOOLTIP,
|
|
107
108
|
D as DEFAULT_DRAG_TOOLTIP,
|
|
108
109
|
k as DEFAULT_MENU_BUTTON_ID,
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
O as DownloadButton,
|
|
111
|
+
L as DragHandleToolbarButton,
|
|
111
112
|
u as DragPreviewContextProvider,
|
|
112
113
|
K as ELEMENT_BUTTON,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
C as FlyoutToolbarButton,
|
|
115
|
+
At as GAP_DEFAULT,
|
|
116
|
+
Po as GutterSpacing,
|
|
116
117
|
Ut as Heading1Plugin,
|
|
117
118
|
Dt as Heading2Plugin,
|
|
118
119
|
bt as Heading3Plugin,
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
Ot as Heading4Plugin,
|
|
121
|
+
vt as ImageCaptionPlugin,
|
|
121
122
|
wt as ImageTitlePlugin,
|
|
122
|
-
|
|
123
|
+
Et as KEY_ELEMENT_BREAK_AFTER_COLUMN,
|
|
123
124
|
fr as LinkInput,
|
|
124
125
|
w as LinkPlugin,
|
|
125
126
|
xr as LinkSelector,
|
|
126
|
-
|
|
127
|
+
So as Margin,
|
|
127
128
|
R as MenuToolbarButton,
|
|
128
129
|
d as MultiFlyoutContextProvider,
|
|
129
130
|
Wt as PARAGRAPH_CLASSES,
|
|
130
|
-
|
|
131
|
+
Bo as Padding,
|
|
131
132
|
jt as ParagraphMarkupElement,
|
|
132
133
|
Qt as ParagraphMarkupElementNode,
|
|
133
134
|
Kt as ParagraphPlugin,
|
|
134
135
|
qt as QuoteMarkupElementNode,
|
|
135
136
|
zt as QuotePlugin,
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
To as Radius,
|
|
138
|
+
v as RichTextEditor,
|
|
138
139
|
r as Sections,
|
|
139
|
-
|
|
140
|
+
co as Security,
|
|
140
141
|
gr as THEME_PREFIX,
|
|
141
142
|
rr as TextStylePluginsWithoutImage,
|
|
142
143
|
ar as TextStyles,
|
|
143
144
|
or as TextStylesWithoutImage,
|
|
144
145
|
c as Toolbar,
|
|
145
146
|
Nr as addHttps,
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
yo as borderStyleMap,
|
|
148
|
+
Lr as convertToRteValue,
|
|
148
149
|
xt as createButtonNode,
|
|
149
150
|
X as createButtonPlugin,
|
|
150
151
|
V as createLinkPlugin,
|
|
151
152
|
Xt as createParagraphPlugin,
|
|
152
153
|
Jt as createQuotePlugin,
|
|
153
|
-
|
|
154
|
+
Cr as customCoordinatesGetterFactory,
|
|
154
155
|
e as defineBlock,
|
|
155
156
|
n as defineSettings,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
zo as getBackgroundColorStyles,
|
|
158
|
+
Xr as getBackgroundSettings,
|
|
159
|
+
Jr as getBorderRadiusSettings,
|
|
160
|
+
Zr as getBorderRadiusSlider,
|
|
161
|
+
qr as getBorderSettings,
|
|
162
|
+
Zo as getBorderStyles,
|
|
162
163
|
pr as getDefaultPluginsWithLinkChooser,
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
to as getExtendedBorderRadiusSettings,
|
|
165
|
+
oo as getGutterSettings,
|
|
165
166
|
dr as getLegacyUrl,
|
|
166
167
|
Pr as getLinkFromEditor,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
168
|
+
po as getMarginExtendedSettings,
|
|
169
|
+
no as getMarginSettings,
|
|
170
|
+
ao as getMarginSlider,
|
|
171
|
+
uo as getPaddingExtendedSettings,
|
|
172
|
+
go as getPaddingSettings,
|
|
173
|
+
lo as getPaddingSlider,
|
|
174
|
+
te as getRadiusStyles,
|
|
175
|
+
jo as getReadableColor,
|
|
176
|
+
Co as getSecurityDownloadableSetting,
|
|
177
|
+
Fo as getSecurityGlobalControlId,
|
|
178
|
+
Ro as getSecurityGlobalControlSetting,
|
|
178
179
|
Sr as getUrl,
|
|
179
180
|
gt as getUrlFromEditor,
|
|
180
181
|
Br as getUrlFromLinkOrLegacyLink,
|
|
181
|
-
|
|
182
|
+
Ao as gutterSpacingStyleMap,
|
|
182
183
|
kr as hasRichTextValue,
|
|
183
184
|
J as insertButton,
|
|
184
|
-
|
|
185
|
+
_o as isDark,
|
|
185
186
|
Ur as isDownloadable,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
Ar as isValidUrl,
|
|
188
|
+
Er as isValidUrlOrEmpty,
|
|
189
|
+
oe as joinClassNames,
|
|
189
190
|
Dr as mapAppBridgeColorPaletteToFonduePalette,
|
|
190
191
|
Ir as mapAppBridgeColorPalettesToFonduePalettes,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
Eo as marginStyleMap,
|
|
193
|
+
Yo as moveItemInArray,
|
|
194
|
+
ho as paddingStyleMap,
|
|
195
|
+
Lo as radiusStyleMap,
|
|
195
196
|
cr as relativeUrlRegex,
|
|
196
|
-
|
|
197
|
+
Ho as setAlpha,
|
|
197
198
|
$ as submitFloatingButton,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
Vo as toColorObject,
|
|
200
|
+
Io as toHex8String,
|
|
201
|
+
No as toHexString,
|
|
202
|
+
Go as toRgbaString,
|
|
203
|
+
Ko as toShortRgba,
|
|
203
204
|
ft as triggerFloatingButton,
|
|
204
205
|
dt as triggerFloatingButtonEdit,
|
|
205
206
|
St as triggerFloatingButtonInsert,
|
|
206
207
|
rt as unwrapButton,
|
|
207
208
|
et as upsertButton,
|
|
208
209
|
at as upsertButtonText,
|
|
209
|
-
Hr as
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
Hr as useAttachmentOperations,
|
|
211
|
+
wr as useAttachments,
|
|
212
|
+
Vr as useAttachmentsContext,
|
|
213
|
+
Qr as useDndSensors,
|
|
212
214
|
f as useDragPreviewContext,
|
|
213
215
|
P as useMultiFlyoutContext,
|
|
214
216
|
B as useMultiFlyoutState,
|
|
215
|
-
|
|
217
|
+
Wr as withAttachmentsProvider,
|
|
216
218
|
q as withButton,
|
|
217
219
|
pt as wrapButton
|
|
218
220
|
};
|
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 AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n type AssetInputBlock as AssetInputBlockSidebarSettings,\n type BaseBlock as BaseBlockSidebarSettings,\n type Bundle as BundleSidebarSettings,\n type ChecklistBlock as ChecklistBlockSidebarSettings,\n type ChoicesType as ChoicesTypeSidebarSettings,\n type ColorInputBlock as ColorInputBlockSidebarSettings,\n type DropdownBlock as DropdownBlockSidebarSettings,\n type DynamicSettingBlock as DynamicSettingBlockSidebarSettings,\n type DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n type FontInputBlock as FontInputBlockSidebarSettings,\n type InputBlock as InputBlockSidebarSettings,\n type LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n type LinkBlock as LinkBlockSidebarSettings,\n type LinkChooserBlock as LinkChooserBlockSidebarSettings,\n type MultiInputBlock as MultiInputBlockSidebarSettings,\n type NotificationBlock as NotificationBlockSidebarSettings,\n type SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n type SegmentedControlsBlock as SegmentedControlsBlockSidebarSettings,\n type SettingBlock as SettingBlockSidebarSettings,\n type SimpleSettingBlock as SimpleSettingBlockSidebarSettings,\n type SwitchBlock as SwitchBlockSidebarSettings,\n type TemplateInputBlock as TemplateInputBlockSidebarSettings,\n type TextareaBlock as TextareaBlockSidebarSettings,\n type ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\nimport { type FC } from 'react';\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/
|
|
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 AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n type AssetInputBlock as AssetInputBlockSidebarSettings,\n type BaseBlock as BaseBlockSidebarSettings,\n type Bundle as BundleSidebarSettings,\n type ChecklistBlock as ChecklistBlockSidebarSettings,\n type ChoicesType as ChoicesTypeSidebarSettings,\n type ColorInputBlock as ColorInputBlockSidebarSettings,\n type DropdownBlock as DropdownBlockSidebarSettings,\n type DynamicSettingBlock as DynamicSettingBlockSidebarSettings,\n type DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n type FontInputBlock as FontInputBlockSidebarSettings,\n type InputBlock as InputBlockSidebarSettings,\n type LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n type LinkBlock as LinkBlockSidebarSettings,\n type LinkChooserBlock as LinkChooserBlockSidebarSettings,\n type MultiInputBlock as MultiInputBlockSidebarSettings,\n type NotificationBlock as NotificationBlockSidebarSettings,\n type SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n type SegmentedControlsBlock as SegmentedControlsBlockSidebarSettings,\n type SettingBlock as SettingBlockSidebarSettings,\n type SimpleSettingBlock as SimpleSettingBlockSidebarSettings,\n type SwitchBlock as SwitchBlockSidebarSettings,\n type TemplateInputBlock as TemplateInputBlockSidebarSettings,\n type TextareaBlock as TextareaBlockSidebarSettings,\n type ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\nimport { type FC } from 'react';\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/document/2569#/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/document/2569#/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/document/2569#/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/document/2569#/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/document/2569#/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;"}
|