@frontify/guideline-blocks-settings 0.28.4 → 0.28.5
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 +9 -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 +60 -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 +1 -1
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/DocumentLinks.tsx +1 -1
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/LinkSelector.tsx +10 -4
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/PageLink.tsx +1 -1
- package/src/components/{RichTextEditor/plugins/shared → Link}/LinkSelector/PageLinks.tsx +8 -2
- 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
|
@@ -6,6 +6,8 @@ import { Asset } from '@frontify/app-bridge';
|
|
|
6
6
|
import type { AssetInputBlock as AssetInputBlock_2 } from '@frontify/sidebar-settings';
|
|
7
7
|
import type { BaseBlock as BaseBlock_2 } from '@frontify/sidebar-settings';
|
|
8
8
|
import type { Bundle as Bundle_2 } from '@frontify/sidebar-settings';
|
|
9
|
+
import { ButtonSize } from '@frontify/fondue';
|
|
10
|
+
import { CheckboxState } from '@frontify/fondue';
|
|
9
11
|
import type { ChecklistBlock as ChecklistBlock_2 } from '@frontify/sidebar-settings';
|
|
10
12
|
import type { ChoicesType as ChoicesType_2 } from '@frontify/sidebar-settings';
|
|
11
13
|
import { Color } from '@frontify/fondue';
|
|
@@ -24,6 +26,7 @@ import { InsertNodesOptions } from '@udecode/plate';
|
|
|
24
26
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
25
27
|
import { KeyboardCoordinateGetter } from '@dnd-kit/core';
|
|
26
28
|
import type { LegacyAssetInputBlock as LegacyAssetInputBlock_2 } from '@frontify/sidebar-settings';
|
|
29
|
+
import type { LinkBlock as LinkBlock_2 } from '@frontify/sidebar-settings';
|
|
27
30
|
import type { LinkChooserBlock as LinkChooserBlock_2 } from '@frontify/sidebar-settings';
|
|
28
31
|
import { MarkupElement } from '@frontify/fondue';
|
|
29
32
|
import { MenuItemStyle } from '@frontify/fondue';
|
|
@@ -37,6 +40,7 @@ import { PluginComposer } from '@frontify/fondue';
|
|
|
37
40
|
import { PluginProps } from '@frontify/fondue';
|
|
38
41
|
import { PropsWithChildren } from 'react';
|
|
39
42
|
import { RangeBeforeOptions } from '@udecode/plate';
|
|
43
|
+
import { ReactElement } from 'react';
|
|
40
44
|
import { ReactNode } from 'react';
|
|
41
45
|
import type { SectionHeadingBlock as SectionHeadingBlock_2 } from '@frontify/sidebar-settings';
|
|
42
46
|
import type { SegmentedControlsBlock as SegmentedControlsBlock_2 } from '@frontify/sidebar-settings';
|
|
@@ -426,6 +430,8 @@ export declare const getExtendedBorderRadiusSettings: (options?: BorderRadiusSet
|
|
|
426
430
|
|
|
427
431
|
export declare const getGutterSettings: (options?: GutterSettingsType) => SettingBlock;
|
|
428
432
|
|
|
433
|
+
export declare const getLegacyUrl: (editor: PlateEditor) => string;
|
|
434
|
+
|
|
429
435
|
/**
|
|
430
436
|
* Returns margin settings: margin switch, margin slider, custom margin input for every direction
|
|
431
437
|
*
|
|
@@ -482,8 +488,12 @@ export declare const getSecurityGlobalControlId: (id?: string) => string;
|
|
|
482
488
|
*/
|
|
483
489
|
export declare const getSecurityGlobalControlSetting: (id?: string) => SettingBlock[];
|
|
484
490
|
|
|
491
|
+
export declare const getUrl: (editor: PlateEditor) => string;
|
|
492
|
+
|
|
485
493
|
export declare const getUrlFromEditor: (editor: PlateEditor) => string;
|
|
486
494
|
|
|
495
|
+
export declare const getUrlFromLinkOrLegacyLink: (link: TLinkElement_2) => string;
|
|
496
|
+
|
|
487
497
|
/**
|
|
488
498
|
* Returns gutter settings: gutter switch, gutter choices or gutter custom input
|
|
489
499
|
*
|
|
@@ -549,6 +559,11 @@ export declare class ImageTitlePlugin extends Plugin_2 {
|
|
|
549
559
|
plugins(): PlatePlugin<AnyObject, Value, PlateEditor<Value>>[];
|
|
550
560
|
}
|
|
551
561
|
|
|
562
|
+
export declare type InitiallyExpandedItems = {
|
|
563
|
+
documentId?: number;
|
|
564
|
+
pageId?: number;
|
|
565
|
+
};
|
|
566
|
+
|
|
552
567
|
export declare type InputBlock = InputBlock_2<AppBridgeBlock>;
|
|
553
568
|
|
|
554
569
|
export declare const insertButton: <V extends Value>(editor: PlateEditor<V>, createButtonNodeOptions: CreateButtonNodeOptions, options?: InsertNodesOptions<V> | undefined) => void;
|
|
@@ -557,6 +572,10 @@ export declare const isDark: (color: unknown, threshold?: number) => boolean;
|
|
|
557
572
|
|
|
558
573
|
export declare const isDownloadable: (security: Security, downloadable: boolean, globalAssetDownloadEnabled: boolean) => boolean;
|
|
559
574
|
|
|
575
|
+
export declare const isValidUrl: (url: string) => boolean;
|
|
576
|
+
|
|
577
|
+
export declare const isValidUrlOrEmpty: (url: string) => boolean;
|
|
578
|
+
|
|
560
579
|
/**
|
|
561
580
|
* Cleans and joins an array of inputs with possible undefined or boolean values.
|
|
562
581
|
*
|
|
@@ -567,8 +586,29 @@ export declare const joinClassNames: (classNames: (string | undefined | boolean)
|
|
|
567
586
|
|
|
568
587
|
export declare type LegacyAssetInputBlock = LegacyAssetInputBlock_2<AppBridgeBlock>;
|
|
569
588
|
|
|
589
|
+
export declare type LinkBlock = LinkBlock_2<AppBridgeBlock>;
|
|
590
|
+
|
|
570
591
|
export declare type LinkChooserBlock = LinkChooserBlock_2<AppBridgeBlock>;
|
|
571
592
|
|
|
593
|
+
export declare const LinkInput: ({ onUrlChange, onToggleTab, isValidUrlOrEmpty, appBridge, clearable, placeholder, newTab, openInNewTab, url, required, info, label, buttonSize, hideInternalLinkButton, }: LinkInputProps) => JSX_2.Element;
|
|
594
|
+
|
|
595
|
+
declare type LinkInputProps = {
|
|
596
|
+
url?: string;
|
|
597
|
+
info?: string;
|
|
598
|
+
label?: string;
|
|
599
|
+
required?: boolean;
|
|
600
|
+
newTab?: CheckboxState;
|
|
601
|
+
openInNewTab?: boolean;
|
|
602
|
+
onUrlChange?: (value: string) => void;
|
|
603
|
+
onToggleTab?: (checked: boolean) => void;
|
|
604
|
+
isValidUrlOrEmpty?: (url: string) => boolean;
|
|
605
|
+
appBridge: AppBridgeBlock;
|
|
606
|
+
clearable?: boolean;
|
|
607
|
+
placeholder?: string;
|
|
608
|
+
buttonSize?: ButtonSize;
|
|
609
|
+
hideInternalLinkButton?: boolean;
|
|
610
|
+
};
|
|
611
|
+
|
|
572
612
|
export declare class LinkPlugin extends Plugin_2 {
|
|
573
613
|
private appBridge;
|
|
574
614
|
styles: CSSProperties;
|
|
@@ -582,6 +622,15 @@ export declare type LinkPluginProps = PluginProps & {
|
|
|
582
622
|
appBridge: AppBridgeBlock;
|
|
583
623
|
};
|
|
584
624
|
|
|
625
|
+
export declare const LinkSelector: ({ appBridge, url, onUrlChange, buttonSize, }: LinkSelectorProps) => ReactElement;
|
|
626
|
+
|
|
627
|
+
declare type LinkSelectorProps = {
|
|
628
|
+
appBridge: AppBridgeBlock;
|
|
629
|
+
url: string;
|
|
630
|
+
onUrlChange?: (value: string) => void;
|
|
631
|
+
buttonSize?: ButtonSize;
|
|
632
|
+
};
|
|
633
|
+
|
|
585
634
|
export declare const mapAppBridgeColorPalettesToFonduePalettes: (colorPalettes: ColorPalette[]) => Palette[];
|
|
586
635
|
|
|
587
636
|
export declare const mapAppBridgeColorPaletteToFonduePalette: (colorPalette: ColorPalette) => Palette;
|
|
@@ -712,6 +761,8 @@ export declare type RadiusSettings = {
|
|
|
712
761
|
|
|
713
762
|
export declare const radiusStyleMap: Record<Radius, string>;
|
|
714
763
|
|
|
764
|
+
export declare const relativeUrlRegex: RegExp;
|
|
765
|
+
|
|
715
766
|
export declare type RichTextButtonStyle = 'primary' | 'secondary' | 'tertiary';
|
|
716
767
|
|
|
717
768
|
export declare const RichTextEditor: ({ id, isEditing, value, columns, gap, placeholder, plugins, onTextChange, showSerializedText, }: RichTextEditorProps) => JSX_2.Element;
|
|
@@ -823,6 +874,15 @@ export declare const TextStylesWithoutImage: TextStyles[];
|
|
|
823
874
|
|
|
824
875
|
export declare const THEME_PREFIX = "--f-theme-settings-";
|
|
825
876
|
|
|
877
|
+
declare type TLinkElement_2 = TLinkElement & {
|
|
878
|
+
chosenLink?: {
|
|
879
|
+
searchResult?: {
|
|
880
|
+
link?: string;
|
|
881
|
+
};
|
|
882
|
+
openInNewTab?: boolean;
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
|
|
826
886
|
/**
|
|
827
887
|
* Maps color strings to color objects.
|
|
828
888
|
*
|
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;"}
|