@frontify/guideline-blocks-settings 0.28.4 → 0.28.6
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 +20 -0
- package/dist/components/Attachments/Attachments.es.js +55 -55
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar.es.js +1 -1
- package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.es.js +3 -3
- package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -1
- package/dist/components/Link/LinkInput.es.js +61 -0
- package/dist/components/Link/LinkInput.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +67 -0
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/PageLink.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/PageLinks.es.js +37 -0
- package/dist/components/Link/LinkSelector/PageLinks.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/SectionLink.es.js.map +1 -0
- package/dist/components/Link/utils/getUrl.es.js +17 -0
- package/dist/components/Link/utils/getUrl.es.js.map +1 -0
- package/dist/components/Link/utils/relativeUrlRegex.es.js.map +1 -0
- package/dist/components/{RichTextEditor/plugins/LinkPlugin → Link}/utils/url.es.js +1 -1
- package/dist/components/Link/utils/url.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +39 -53
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +2 -2
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/helpers/addHttps.es.js +1 -1
- package/dist/helpers/addHttps.es.js.map +1 -1
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +61 -0
- package/dist/index.es.js +134 -121
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/components/Attachments/Attachments.tsx +1 -1
- package/src/components/BlockItemWrapper/Toolbar.tsx +1 -1
- package/src/components/DownloadButton/DownloadButton.tsx +1 -1
- package/src/components/Link/LinkInput.spec.ct.tsx +142 -0
- package/src/components/Link/LinkInput.tsx +80 -0
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/DocumentLink.tsx +3 -3
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/DocumentLinks.tsx +3 -3
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/LinkSelector.tsx +12 -6
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/PageLink.tsx +3 -3
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/PageLinks.tsx +10 -4
- package/src/components/Link/index.ts +6 -0
- package/src/components/Link/types.ts +6 -0
- package/src/components/{RichTextEditor/plugins/LinkPlugin → Link}/utils/getUrl.ts +1 -5
- package/src/components/{RichTextEditor/plugins/LinkPlugin → Link}/utils/index.ts +1 -0
- package/src/components/{RichTextEditor/plugins/LinkPlugin → Link}/utils/url.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +11 -28
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/types.ts +0 -5
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +2 -2
- package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +1 -1
- package/src/components/index.ts +1 -0
- package/src/helpers/addHttps.ts +1 -1
- package/src/index.ts +2 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +0 -18
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +0 -62
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +0 -34
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +0 -1
- /package/dist/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/DocumentLink.es.js +0 -0
- /package/dist/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/DocumentLinks.es.js +0 -0
- /package/dist/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/PageLink.es.js +0 -0
- /package/dist/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/SectionLink.es.js +0 -0
- /package/dist/components/{RichTextEditor/plugins/LinkPlugin → Link}/utils/relativeUrlRegex.es.js +0 -0
- /package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/LinkSelector.spec.ct.tsx +0 -0
- /package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/SectionLink.tsx +0 -0
- /package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/index.ts +0 -0
- /package/src/components/{RichTextEditor/plugins/LinkPlugin → Link}/utils/relativeUrlRegex.spec.ts +0 -0
- /package/src/components/{RichTextEditor/plugins/LinkPlugin → Link}/utils/relativeUrlRegex.ts +0 -0
- /package/src/components/{RichTextEditor/plugins/LinkPlugin → Link}/utils/url.spec.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { AnyObject } from '@udecode/plate';
|
|
4
4
|
import { AppBridgeBlock } from '@frontify/app-bridge';
|
|
5
|
+
import type { AppBridgeTheme } from '@frontify/app-bridge';
|
|
5
6
|
import { Asset } from '@frontify/app-bridge';
|
|
6
7
|
import type { AssetInputBlock as AssetInputBlock_2 } from '@frontify/sidebar-settings';
|
|
7
8
|
import type { BaseBlock as BaseBlock_2 } from '@frontify/sidebar-settings';
|
|
8
9
|
import type { Bundle as Bundle_2 } from '@frontify/sidebar-settings';
|
|
10
|
+
import { ButtonSize } from '@frontify/fondue';
|
|
11
|
+
import { CheckboxState } from '@frontify/fondue';
|
|
9
12
|
import type { ChecklistBlock as ChecklistBlock_2 } from '@frontify/sidebar-settings';
|
|
10
13
|
import type { ChoicesType as ChoicesType_2 } from '@frontify/sidebar-settings';
|
|
11
14
|
import { Color } from '@frontify/fondue';
|
|
@@ -24,6 +27,7 @@ import { InsertNodesOptions } from '@udecode/plate';
|
|
|
24
27
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
25
28
|
import { KeyboardCoordinateGetter } from '@dnd-kit/core';
|
|
26
29
|
import type { LegacyAssetInputBlock as LegacyAssetInputBlock_2 } from '@frontify/sidebar-settings';
|
|
30
|
+
import type { LinkBlock as LinkBlock_2 } from '@frontify/sidebar-settings';
|
|
27
31
|
import type { LinkChooserBlock as LinkChooserBlock_2 } from '@frontify/sidebar-settings';
|
|
28
32
|
import { MarkupElement } from '@frontify/fondue';
|
|
29
33
|
import { MenuItemStyle } from '@frontify/fondue';
|
|
@@ -37,6 +41,7 @@ import { PluginComposer } from '@frontify/fondue';
|
|
|
37
41
|
import { PluginProps } from '@frontify/fondue';
|
|
38
42
|
import { PropsWithChildren } from 'react';
|
|
39
43
|
import { RangeBeforeOptions } from '@udecode/plate';
|
|
44
|
+
import { ReactElement } from 'react';
|
|
40
45
|
import { ReactNode } from 'react';
|
|
41
46
|
import type { SectionHeadingBlock as SectionHeadingBlock_2 } from '@frontify/sidebar-settings';
|
|
42
47
|
import type { SegmentedControlsBlock as SegmentedControlsBlock_2 } from '@frontify/sidebar-settings';
|
|
@@ -426,6 +431,8 @@ export declare const getExtendedBorderRadiusSettings: (options?: BorderRadiusSet
|
|
|
426
431
|
|
|
427
432
|
export declare const getGutterSettings: (options?: GutterSettingsType) => SettingBlock;
|
|
428
433
|
|
|
434
|
+
export declare const getLegacyUrl: (editor: PlateEditor) => string;
|
|
435
|
+
|
|
429
436
|
/**
|
|
430
437
|
* Returns margin settings: margin switch, margin slider, custom margin input for every direction
|
|
431
438
|
*
|
|
@@ -482,8 +489,12 @@ export declare const getSecurityGlobalControlId: (id?: string) => string;
|
|
|
482
489
|
*/
|
|
483
490
|
export declare const getSecurityGlobalControlSetting: (id?: string) => SettingBlock[];
|
|
484
491
|
|
|
492
|
+
export declare const getUrl: (editor: PlateEditor) => string;
|
|
493
|
+
|
|
485
494
|
export declare const getUrlFromEditor: (editor: PlateEditor) => string;
|
|
486
495
|
|
|
496
|
+
export declare const getUrlFromLinkOrLegacyLink: (link: TLinkElement_2) => string;
|
|
497
|
+
|
|
487
498
|
/**
|
|
488
499
|
* Returns gutter settings: gutter switch, gutter choices or gutter custom input
|
|
489
500
|
*
|
|
@@ -549,6 +560,11 @@ export declare class ImageTitlePlugin extends Plugin_2 {
|
|
|
549
560
|
plugins(): PlatePlugin<AnyObject, Value, PlateEditor<Value>>[];
|
|
550
561
|
}
|
|
551
562
|
|
|
563
|
+
export declare type InitiallyExpandedItems = {
|
|
564
|
+
documentId?: number;
|
|
565
|
+
pageId?: number;
|
|
566
|
+
};
|
|
567
|
+
|
|
552
568
|
export declare type InputBlock = InputBlock_2<AppBridgeBlock>;
|
|
553
569
|
|
|
554
570
|
export declare const insertButton: <V extends Value>(editor: PlateEditor<V>, createButtonNodeOptions: CreateButtonNodeOptions, options?: InsertNodesOptions<V> | undefined) => void;
|
|
@@ -557,6 +573,10 @@ export declare const isDark: (color: unknown, threshold?: number) => boolean;
|
|
|
557
573
|
|
|
558
574
|
export declare const isDownloadable: (security: Security, downloadable: boolean, globalAssetDownloadEnabled: boolean) => boolean;
|
|
559
575
|
|
|
576
|
+
export declare const isValidUrl: (url: string) => boolean;
|
|
577
|
+
|
|
578
|
+
export declare const isValidUrlOrEmpty: (url: string) => boolean;
|
|
579
|
+
|
|
560
580
|
/**
|
|
561
581
|
* Cleans and joins an array of inputs with possible undefined or boolean values.
|
|
562
582
|
*
|
|
@@ -567,8 +587,29 @@ export declare const joinClassNames: (classNames: (string | undefined | boolean)
|
|
|
567
587
|
|
|
568
588
|
export declare type LegacyAssetInputBlock = LegacyAssetInputBlock_2<AppBridgeBlock>;
|
|
569
589
|
|
|
590
|
+
export declare type LinkBlock = LinkBlock_2<AppBridgeBlock>;
|
|
591
|
+
|
|
570
592
|
export declare type LinkChooserBlock = LinkChooserBlock_2<AppBridgeBlock>;
|
|
571
593
|
|
|
594
|
+
export declare const LinkInput: ({ onUrlChange, onToggleTab, isValidUrlOrEmpty, appBridge, clearable, placeholder, newTab, openInNewTab, url, required, info, label, buttonSize, hideInternalLinkButton, }: LinkInputProps) => JSX_2.Element;
|
|
595
|
+
|
|
596
|
+
declare type LinkInputProps = {
|
|
597
|
+
url?: string;
|
|
598
|
+
info?: string;
|
|
599
|
+
label?: string;
|
|
600
|
+
required?: boolean;
|
|
601
|
+
newTab?: CheckboxState;
|
|
602
|
+
openInNewTab?: boolean;
|
|
603
|
+
onUrlChange?: (value: string) => void;
|
|
604
|
+
onToggleTab?: (checked: boolean) => void;
|
|
605
|
+
isValidUrlOrEmpty?: (url: string) => boolean;
|
|
606
|
+
appBridge: AppBridgeBlock | AppBridgeTheme;
|
|
607
|
+
clearable?: boolean;
|
|
608
|
+
placeholder?: string;
|
|
609
|
+
buttonSize?: ButtonSize;
|
|
610
|
+
hideInternalLinkButton?: boolean;
|
|
611
|
+
};
|
|
612
|
+
|
|
572
613
|
export declare class LinkPlugin extends Plugin_2 {
|
|
573
614
|
private appBridge;
|
|
574
615
|
styles: CSSProperties;
|
|
@@ -582,6 +623,15 @@ export declare type LinkPluginProps = PluginProps & {
|
|
|
582
623
|
appBridge: AppBridgeBlock;
|
|
583
624
|
};
|
|
584
625
|
|
|
626
|
+
export declare const LinkSelector: ({ appBridge, url, onUrlChange, buttonSize, }: LinkSelectorProps) => ReactElement;
|
|
627
|
+
|
|
628
|
+
declare type LinkSelectorProps = {
|
|
629
|
+
appBridge: AppBridgeBlock | AppBridgeTheme;
|
|
630
|
+
url: string;
|
|
631
|
+
onUrlChange?: (value: string) => void;
|
|
632
|
+
buttonSize?: ButtonSize;
|
|
633
|
+
};
|
|
634
|
+
|
|
585
635
|
export declare const mapAppBridgeColorPalettesToFonduePalettes: (colorPalettes: ColorPalette[]) => Palette[];
|
|
586
636
|
|
|
587
637
|
export declare const mapAppBridgeColorPaletteToFonduePalette: (colorPalette: ColorPalette) => Palette;
|
|
@@ -712,6 +762,8 @@ export declare type RadiusSettings = {
|
|
|
712
762
|
|
|
713
763
|
export declare const radiusStyleMap: Record<Radius, string>;
|
|
714
764
|
|
|
765
|
+
export declare const relativeUrlRegex: RegExp;
|
|
766
|
+
|
|
715
767
|
export declare type RichTextButtonStyle = 'primary' | 'secondary' | 'tertiary';
|
|
716
768
|
|
|
717
769
|
export declare const RichTextEditor: ({ id, isEditing, value, columns, gap, placeholder, plugins, onTextChange, showSerializedText, }: RichTextEditorProps) => JSX_2.Element;
|
|
@@ -823,6 +875,15 @@ export declare const TextStylesWithoutImage: TextStyles[];
|
|
|
823
875
|
|
|
824
876
|
export declare const THEME_PREFIX = "--f-theme-settings-";
|
|
825
877
|
|
|
878
|
+
declare type TLinkElement_2 = TLinkElement & {
|
|
879
|
+
chosenLink?: {
|
|
880
|
+
searchResult?: {
|
|
881
|
+
link?: string;
|
|
882
|
+
};
|
|
883
|
+
openInNewTab?: boolean;
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
|
|
826
887
|
/**
|
|
827
888
|
* Maps color strings to color objects.
|
|
828
889
|
*
|
package/dist/index.es.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import "./styles.css.es.js";
|
|
2
2
|
export * from "@frontify/sidebar-settings";
|
|
3
|
-
import { BlockInjectButton as
|
|
3
|
+
import { BlockInjectButton as g } from "./components/BlockInjectButton/BlockInjectButton.es.js";
|
|
4
4
|
import { BlockItemWrapper as l } from "./components/BlockItemWrapper/BlockItemWrapper.es.js";
|
|
5
5
|
import { DEFAULT_DRAGGING_TOOLTIP as u, DEFAULT_DRAG_TOOLTIP as f } from "./components/BlockItemWrapper/constants.es.js";
|
|
6
6
|
import { Attachments as s } from "./components/Attachments/Attachments.es.js";
|
|
7
7
|
import { DownloadButton as P } from "./components/DownloadButton/DownloadButton.es.js";
|
|
8
8
|
import { RichTextEditor as c } from "./components/RichTextEditor/RichTextEditor.es.js";
|
|
9
9
|
import { LinkPlugin as T, createLinkPlugin as E } from "./components/RichTextEditor/plugins/LinkPlugin/index.es.js";
|
|
10
|
-
import { BUTTON_PLUGIN as
|
|
11
|
-
import { withButton as
|
|
10
|
+
import { BUTTON_PLUGIN as L, ButtonPlugin as R, ELEMENT_BUTTON as h, createButtonPlugin as A } from "./components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
11
|
+
import { withButton as C } from "./components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js";
|
|
12
12
|
import { insertButton as F } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js";
|
|
13
|
-
import { submitFloatingButton as
|
|
14
|
-
import { unwrapButton as
|
|
15
|
-
import { upsertButton as
|
|
16
|
-
import { upsertButtonText as
|
|
17
|
-
import { wrapButton as
|
|
18
|
-
import { getUrlFromEditor as
|
|
19
|
-
import { createButtonNode as
|
|
13
|
+
import { submitFloatingButton as b } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js";
|
|
14
|
+
import { unwrapButton as D } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js";
|
|
15
|
+
import { upsertButton as N } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js";
|
|
16
|
+
import { upsertButtonText as _ } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js";
|
|
17
|
+
import { wrapButton as v } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js";
|
|
18
|
+
import { getUrlFromEditor as W } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js";
|
|
19
|
+
import { createButtonNode as Q } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js";
|
|
20
20
|
import { triggerFloatingButton as q } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js";
|
|
21
21
|
import { triggerFloatingButtonEdit as J } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js";
|
|
22
22
|
import { triggerFloatingButtonInsert as Y } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js";
|
|
@@ -24,63 +24,68 @@ import { BlockButtonStyles as $ } from "./components/RichTextEditor/plugins/Butt
|
|
|
24
24
|
import { Custom1Plugin as rt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js";
|
|
25
25
|
import { Custom2Plugin as ot } from "./components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js";
|
|
26
26
|
import { Custom3Plugin as pt } from "./components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js";
|
|
27
|
-
import { Heading1Plugin as
|
|
27
|
+
import { Heading1Plugin as it } from "./components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js";
|
|
28
28
|
import { Heading2Plugin as mt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js";
|
|
29
29
|
import { Heading3Plugin as xt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js";
|
|
30
30
|
import { Heading4Plugin as ft } from "./components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js";
|
|
31
31
|
import { ImageCaptionPlugin as st } from "./components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js";
|
|
32
32
|
import { ImageTitlePlugin as Pt } from "./components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js";
|
|
33
|
-
import { PARAGRAPH_CLASSES as ct, ParagraphMarkupElement as yt, ParagraphMarkupElementNode as Tt, ParagraphPlugin as Et, createParagraphPlugin as
|
|
34
|
-
import { QuoteMarkupElementNode as Rt, QuotePlugin as
|
|
35
|
-
import { AllTextStylePlugins as
|
|
36
|
-
import { BlockStyles as
|
|
37
|
-
import { getDefaultPluginsWithLinkChooser as
|
|
38
|
-
import { THEME_PREFIX as
|
|
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 {
|
|
33
|
+
import { PARAGRAPH_CLASSES as ct, ParagraphMarkupElement as yt, ParagraphMarkupElementNode as Tt, ParagraphPlugin as Et, createParagraphPlugin as kt } from "./components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js";
|
|
34
|
+
import { QuoteMarkupElementNode as Rt, QuotePlugin as ht, createQuotePlugin as At } from "./components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js";
|
|
35
|
+
import { AllTextStylePlugins as Ct, AllTextStyles as Mt, TextStylePluginsWithoutImage as Ft, TextStylesWithoutImage as Ut } from "./components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js";
|
|
36
|
+
import { BlockStyles as Gt, TextStyles as Dt } from "./components/RichTextEditor/plugins/styles.es.js";
|
|
37
|
+
import { getDefaultPluginsWithLinkChooser as Nt } from "./components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js";
|
|
38
|
+
import { THEME_PREFIX as _t } from "./components/RichTextEditor/constants.es.js";
|
|
39
|
+
import { LinkSelector as vt } from "./components/Link/LinkSelector/LinkSelector.es.js";
|
|
40
|
+
import { LinkInput as Wt } from "./components/Link/LinkInput.es.js";
|
|
41
|
+
import { getLegacyUrl as Qt, getUrl as Xt, getUrlFromLinkOrLegacyLink as qt } from "./components/Link/utils/getUrl.es.js";
|
|
42
|
+
import { relativeUrlRegex as Jt } from "./components/Link/utils/relativeUrlRegex.es.js";
|
|
43
|
+
import { isValidUrl as Yt, isValidUrlOrEmpty as Zt } from "./components/Link/utils/url.es.js";
|
|
44
|
+
import { convertToRteValue as tr } from "./helpers/convertToRichTextValue.es.js";
|
|
45
|
+
import { customCoordinatesGetterFactory as er } from "./helpers/customCoordinatesGetterFactory.es.js";
|
|
46
|
+
import { hasRichTextValue as nr } from "./helpers/hasRichTextValue.es.js";
|
|
47
|
+
import { isDownloadable as ar } from "./helpers/isDownloadable.es.js";
|
|
48
|
+
import { mapAppBridgeColorPaletteToFonduePalette as gr, mapAppBridgeColorPalettesToFonduePalettes as mr } from "./helpers/mapColorPalettes.es.js";
|
|
49
|
+
import { addHttps as xr } from "./helpers/addHttps.es.js";
|
|
50
|
+
import { useAttachments as fr } from "./hooks/useAttachments.es.js";
|
|
51
|
+
import { useDndSensors as sr } from "./hooks/useDndSensors.es.js";
|
|
52
|
+
import { getBackgroundSettings as Pr } from "./settings/background.es.js";
|
|
53
|
+
import { getBorderSettings as cr } from "./settings/border.es.js";
|
|
54
|
+
import { getBorderRadiusSettings as Tr, getBorderRadiusSlider as Er } from "./settings/borderRadius.es.js";
|
|
55
|
+
import { getExtendedBorderRadiusSettings as Lr } from "./settings/borderRadiusExtended.es.js";
|
|
56
|
+
import { getGutterSettings as hr } from "./settings/gutter.es.js";
|
|
57
|
+
import { getMarginSettings as Ir, getMarginSlider as Cr } from "./settings/margin.es.js";
|
|
58
|
+
import { getMarginExtendedSettings as Fr } from "./settings/marginExtended.es.js";
|
|
59
|
+
import { getPaddingSettings as br, getPaddingSlider as Gr } from "./settings/padding.es.js";
|
|
60
|
+
import { getPaddingExtendedSettings as Hr } from "./settings/paddingExtended.es.js";
|
|
61
|
+
import { BorderStyle as Or, GutterSpacing as _r, Margin as wr, Padding as vr, Radius as Vr, Security as Wr, borderStyleMap as jr, gutterSpacingStyleMap as Qr, marginStyleMap as Xr, paddingStyleMap as qr, radiusStyleMap as zr } from "./settings/types.es.js";
|
|
62
|
+
import { getSecurityDownloadableSetting as Kr, getSecurityGlobalControlId as Yr } from "./settings/securityDownloadable.es.js";
|
|
63
|
+
import { getSecurityGlobalControlSetting as $r } from "./settings/securityGlobalControl.es.js";
|
|
64
|
+
import { isDark as re } from "./utilities/color/isDark.es.js";
|
|
65
|
+
import { toHex8String as oe } from "./utilities/color/toHex8String.es.js";
|
|
66
|
+
import { toHexString as pe } from "./utilities/color/toHexString.es.js";
|
|
67
|
+
import { toRgbaString as ie } from "./utilities/color/toRgbaString.es.js";
|
|
68
|
+
import { setAlpha as me } from "./utilities/color/setAlpha.es.js";
|
|
69
|
+
import { toColorObject as xe } from "./utilities/color/toColorObject.es.js";
|
|
70
|
+
import { getReadableColor as fe } from "./utilities/color/getReadableColor.es.js";
|
|
71
|
+
import { toShortRgba as se } from "./utilities/color/toShortRgba.es.js";
|
|
72
|
+
import { moveItemInArray as Pe } from "./utilities/moveItemInArray.es.js";
|
|
73
|
+
import { getBackgroundColorStyles as ce } from "./utilities/react/getBackgroundColorStyles.es.js";
|
|
74
|
+
import { getBorderStyles as Te } from "./utilities/react/getBorderStyles.es.js";
|
|
75
|
+
import { getRadiusStyles as ke } from "./utilities/react/getRadiusStyles.es.js";
|
|
76
|
+
import { joinClassNames as Re } from "./utilities/react/joinClassNames.es.js";
|
|
72
77
|
var r = /* @__PURE__ */ ((t) => (t.Main = "main", t.Basics = "basics", t.Layout = "layout", t.Style = "style", t.Security = "security", t.Targets = "targets", t))(r || {});
|
|
73
78
|
const o = (t) => t, n = (t) => t;
|
|
74
79
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
Ct as AllTextStylePlugins,
|
|
81
|
+
Mt as AllTextStyles,
|
|
77
82
|
s as Attachments,
|
|
78
|
-
|
|
83
|
+
L as BUTTON_PLUGIN,
|
|
79
84
|
$ as BlockButtonStyles,
|
|
80
|
-
|
|
85
|
+
g as BlockInjectButton,
|
|
81
86
|
l as BlockItemWrapper,
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
Gt as BlockStyles,
|
|
88
|
+
Or as BorderStyle,
|
|
84
89
|
R as ButtonPlugin,
|
|
85
90
|
rt as Custom1Plugin,
|
|
86
91
|
ot as Custom2Plugin,
|
|
@@ -88,91 +93,99 @@ export {
|
|
|
88
93
|
u as DEFAULT_DRAGGING_TOOLTIP,
|
|
89
94
|
f as DEFAULT_DRAG_TOOLTIP,
|
|
90
95
|
P as DownloadButton,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
h as ELEMENT_BUTTON,
|
|
97
|
+
_r as GutterSpacing,
|
|
98
|
+
it as Heading1Plugin,
|
|
94
99
|
mt as Heading2Plugin,
|
|
95
100
|
xt as Heading3Plugin,
|
|
96
101
|
ft as Heading4Plugin,
|
|
97
102
|
st as ImageCaptionPlugin,
|
|
98
103
|
Pt as ImageTitlePlugin,
|
|
104
|
+
Wt as LinkInput,
|
|
99
105
|
T as LinkPlugin,
|
|
100
|
-
|
|
106
|
+
vt as LinkSelector,
|
|
107
|
+
wr as Margin,
|
|
101
108
|
ct as PARAGRAPH_CLASSES,
|
|
102
|
-
|
|
109
|
+
vr as Padding,
|
|
103
110
|
yt as ParagraphMarkupElement,
|
|
104
111
|
Tt as ParagraphMarkupElementNode,
|
|
105
112
|
Et as ParagraphPlugin,
|
|
106
113
|
Rt as QuoteMarkupElementNode,
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
ht as QuotePlugin,
|
|
115
|
+
Vr as Radius,
|
|
109
116
|
c as RichTextEditor,
|
|
110
117
|
r as Sections,
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
Wr as Security,
|
|
119
|
+
_t as THEME_PREFIX,
|
|
113
120
|
Ft as TextStylePluginsWithoutImage,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
Dt as TextStyles,
|
|
122
|
+
Ut as TextStylesWithoutImage,
|
|
123
|
+
xr as addHttps,
|
|
124
|
+
jr as borderStyleMap,
|
|
125
|
+
tr as convertToRteValue,
|
|
126
|
+
Q as createButtonNode,
|
|
127
|
+
A as createButtonPlugin,
|
|
121
128
|
E as createLinkPlugin,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
kt as createParagraphPlugin,
|
|
130
|
+
At as createQuotePlugin,
|
|
131
|
+
er as customCoordinatesGetterFactory,
|
|
125
132
|
o as defineBlock,
|
|
126
133
|
n as defineSettings,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
134
|
+
ce as getBackgroundColorStyles,
|
|
135
|
+
Pr as getBackgroundSettings,
|
|
136
|
+
Tr as getBorderRadiusSettings,
|
|
137
|
+
Er as getBorderRadiusSlider,
|
|
138
|
+
cr as getBorderSettings,
|
|
139
|
+
Te as getBorderStyles,
|
|
140
|
+
Nt as getDefaultPluginsWithLinkChooser,
|
|
141
|
+
Lr as getExtendedBorderRadiusSettings,
|
|
142
|
+
hr as getGutterSettings,
|
|
143
|
+
Qt as getLegacyUrl,
|
|
144
|
+
Fr as getMarginExtendedSettings,
|
|
145
|
+
Ir as getMarginSettings,
|
|
146
|
+
Cr as getMarginSlider,
|
|
147
|
+
Hr as getPaddingExtendedSettings,
|
|
148
|
+
br as getPaddingSettings,
|
|
149
|
+
Gr as getPaddingSlider,
|
|
150
|
+
ke as getRadiusStyles,
|
|
151
|
+
fe as getReadableColor,
|
|
152
|
+
Kr as getSecurityDownloadableSetting,
|
|
153
|
+
Yr as getSecurityGlobalControlId,
|
|
154
|
+
$r as getSecurityGlobalControlSetting,
|
|
155
|
+
Xt as getUrl,
|
|
156
|
+
W as getUrlFromEditor,
|
|
157
|
+
qt as getUrlFromLinkOrLegacyLink,
|
|
158
|
+
Qr as gutterSpacingStyleMap,
|
|
159
|
+
nr as hasRichTextValue,
|
|
150
160
|
F as insertButton,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
re as isDark,
|
|
162
|
+
ar as isDownloadable,
|
|
163
|
+
Yt as isValidUrl,
|
|
164
|
+
Zt as isValidUrlOrEmpty,
|
|
165
|
+
Re as joinClassNames,
|
|
166
|
+
gr as mapAppBridgeColorPaletteToFonduePalette,
|
|
167
|
+
mr as mapAppBridgeColorPalettesToFonduePalettes,
|
|
168
|
+
Xr as marginStyleMap,
|
|
169
|
+
Pe as moveItemInArray,
|
|
170
|
+
qr as paddingStyleMap,
|
|
171
|
+
zr as radiusStyleMap,
|
|
172
|
+
Jt as relativeUrlRegex,
|
|
173
|
+
me as setAlpha,
|
|
174
|
+
b as submitFloatingButton,
|
|
175
|
+
xe as toColorObject,
|
|
176
|
+
oe as toHex8String,
|
|
177
|
+
pe as toHexString,
|
|
178
|
+
ie as toRgbaString,
|
|
179
|
+
se as toShortRgba,
|
|
167
180
|
q as triggerFloatingButton,
|
|
168
181
|
J as triggerFloatingButtonEdit,
|
|
169
182
|
Y as triggerFloatingButtonInsert,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
D as unwrapButton,
|
|
184
|
+
N as upsertButton,
|
|
185
|
+
_ as upsertButtonText,
|
|
186
|
+
fr as useAttachments,
|
|
187
|
+
sr as useDndSensors,
|
|
188
|
+
C as withButton,
|
|
189
|
+
v as wrapButton
|
|
177
190
|
};
|
|
178
191
|
//# 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 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 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;"}
|