@frontify/guideline-blocks-settings 3.0.2 → 4.0.0-alpha.0
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/_virtual/_rolldown/runtime.es.js +17 -0
- package/dist/components/Attachments/AttachmentItem.es.js +116 -168
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +145 -137
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +25 -28
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +1 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +114 -126
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +53 -74
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +26 -31
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js +22 -25
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js +17 -28
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +25 -35
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +41 -34
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +41 -36
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +24 -33
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +20 -11
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js +18 -10
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js +10 -12
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js +13 -13
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +21 -19
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +18 -25
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js +18 -17
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/constants.es.js +6 -6
- package/dist/components/BlockItemWrapper/constants.es.js.map +1 -1
- package/dist/components/Link/LinkInput.es.js +70 -63
- package/dist/components/Link/LinkInput.es.js.map +1 -1
- package/dist/components/Link/utils/getUrl.es.js +10 -12
- package/dist/components/Link/utils/getUrl.es.js.map +1 -1
- package/dist/components/Link/utils/relativeUrlRegex.es.js +6 -5
- package/dist/components/Link/utils/relativeUrlRegex.es.js.map +1 -1
- package/dist/components/Link/utils/url.es.js +21 -17
- package/dist/components/Link/utils/url.es.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +61 -68
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
- package/dist/components/RichTextEditor/SerializedText.es.js +25 -22
- package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
- package/dist/components/RichTextEditor/constants.es.js +6 -5
- package/dist/components/RichTextEditor/constants.es.js.map +1 -1
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +30 -37
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +31 -39
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -11
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +19 -23
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +24 -26
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +46 -53
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +52 -54
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +68 -68
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +91 -103
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +26 -32
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +47 -53
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +12 -18
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +21 -25
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +29 -37
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +13 -17
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +56 -62
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +9 -12
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +23 -24
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +28 -33
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +61 -80
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +23 -23
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +18 -18
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -12
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +9 -8
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +11 -10
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +85 -84
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +13 -16
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +13 -16
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +10 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +45 -51
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js +20 -22
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js +12 -12
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +48 -57
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +46 -48
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +12 -8
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +62 -71
- 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 +76 -77
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +17 -21
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +17 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +11 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js +22 -26
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +6 -5
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -40
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js +26 -26
- package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +40 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +40 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +40 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +44 -38
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +40 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +45 -41
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +40 -48
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js +29 -29
- package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/styles.es.js +167 -166
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
- package/dist/helpers/addHttps.es.js +12 -12
- package/dist/helpers/addHttps.es.js.map +1 -1
- package/dist/helpers/convertToRichTextValue.es.js +14 -6
- package/dist/helpers/convertToRichTextValue.es.js.map +1 -1
- package/dist/helpers/hasRichTextValue.es.js +13 -14
- package/dist/helpers/hasRichTextValue.es.js.map +1 -1
- package/dist/helpers/isDownloadable.es.js +6 -5
- package/dist/helpers/isDownloadable.es.js.map +1 -1
- package/dist/hooks/useAttachments.es.js +65 -73
- package/dist/hooks/useAttachments.es.js.map +1 -1
- package/dist/hooks/useIsInViewport.es.js +20 -21
- package/dist/hooks/useIsInViewport.es.js.map +1 -1
- package/dist/index.cjs.js +2 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +16 -34
- package/dist/index.es.js +219 -213
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js +20 -21
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js +62 -64
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js +49 -52
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js +58 -60
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/defaultValues.es.js +16 -19
- package/dist/settings/defaultValues.es.js.map +1 -1
- package/dist/settings/gutter.es.js +48 -52
- package/dist/settings/gutter.es.js.map +1 -1
- package/dist/settings/margin.es.js +49 -52
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js +62 -64
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js +49 -52
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js +62 -64
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityDownloadable.es.js +16 -16
- package/dist/settings/securityDownloadable.es.js.map +1 -1
- package/dist/settings/securityGlobalControl.es.js +26 -32
- package/dist/settings/securityGlobalControl.es.js.map +1 -1
- package/dist/settings/types.es.js +41 -47
- package/dist/settings/types.es.js.map +1 -1
- package/dist/styles.css +2 -1
- package/dist/utilities/color/getReadableColor.es.js +15 -13
- package/dist/utilities/color/getReadableColor.es.js.map +1 -1
- package/dist/utilities/color/isDark.es.js +14 -9
- package/dist/utilities/color/isDark.es.js.map +1 -1
- package/dist/utilities/color/setAlpha.es.js +7 -6
- package/dist/utilities/color/setAlpha.es.js.map +1 -1
- package/dist/utilities/color/toColorObject.es.js +14 -8
- package/dist/utilities/color/toColorObject.es.js.map +1 -1
- package/dist/utilities/color/toHex8String.es.js +7 -6
- package/dist/utilities/color/toHex8String.es.js.map +1 -1
- package/dist/utilities/color/toHexString.es.js +7 -6
- package/dist/utilities/color/toHexString.es.js.map +1 -1
- package/dist/utilities/color/toRgbaString.es.js +7 -6
- package/dist/utilities/color/toRgbaString.es.js.map +1 -1
- package/dist/utilities/color/toShortRgba.es.js +18 -11
- package/dist/utilities/color/toShortRgba.es.js.map +1 -1
- package/dist/utilities/react/getBackgroundColorStyles.es.js +7 -8
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
- package/dist/utilities/react/getBorderStyles.es.js +12 -11
- package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
- package/dist/utilities/react/getRadiusStyles.es.js +7 -8
- package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
- package/dist/utilities/react/joinClassNames.es.js +6 -5
- package/dist/utilities/react/joinClassNames.es.js.map +1 -1
- package/package.json +7 -9
- package/dist/components/Link/LinkSelector/DocumentLink.es.js +0 -64
- package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js +0 -65
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -72
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +0 -7
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/PageLink.es.js +0 -69
- package/dist/components/Link/LinkSelector/PageLink.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/PageLinks.es.js +0 -38
- package/dist/components/Link/LinkSelector/PageLinks.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/SectionLink.es.js +0 -26
- package/dist/components/Link/LinkSelector/SectionLink.es.js.map +0 -1
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js +0 -5
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog as n, Button as d, ScrollArea as C } from "@frontify/fondue/components";
|
|
3
|
-
import { IconLink as P } from "@frontify/fondue/icons";
|
|
4
|
-
import { useState as p, useEffect as x } from "react";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import { DocumentLinks as L } from "./DocumentLinks.es.js";
|
|
7
|
-
const I = ({
|
|
8
|
-
url: t,
|
|
9
|
-
onUrlChange: h,
|
|
10
|
-
buttonSize: s = "medium",
|
|
11
|
-
getAllDocuments: m,
|
|
12
|
-
getDocumentPagesByDocumentId: f,
|
|
13
|
-
getDocumentSectionsByDocumentPageId: u
|
|
14
|
-
}) => {
|
|
15
|
-
const [g, l] = p(!1), [r, a] = p(t), k = (o) => {
|
|
16
|
-
a(o);
|
|
17
|
-
}, D = (o) => {
|
|
18
|
-
o.key === "Enter" && (o.preventDefault(), c());
|
|
19
|
-
};
|
|
20
|
-
x(() => {
|
|
21
|
-
t && !r && a(t);
|
|
22
|
-
}, [t, r]);
|
|
23
|
-
const c = () => {
|
|
24
|
-
h?.(r), l(!1);
|
|
25
|
-
}, y = {
|
|
26
|
-
onOpenAutoFocus: () => {
|
|
27
|
-
},
|
|
28
|
-
showUnderlay: !0,
|
|
29
|
-
"data-is-underlay": !0,
|
|
30
|
-
minWidth: "800px"
|
|
31
|
-
};
|
|
32
|
-
return (
|
|
33
|
-
// oxlint-disable-next-line jsx-a11y-x/no-static-element-interactions
|
|
34
|
-
/* @__PURE__ */ e(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
onPointerDown: (o) => {
|
|
38
|
-
o.preventDefault();
|
|
39
|
-
},
|
|
40
|
-
"data-test-id": "internal-link-selector",
|
|
41
|
-
onKeyDown: D,
|
|
42
|
-
children: /* @__PURE__ */ i(n.Root, { modal: !0, open: g, onOpenChange: l, children: [
|
|
43
|
-
/* @__PURE__ */ e(n.Trigger, { asChild: !0, children: /* @__PURE__ */ i(d, { size: s, emphasis: "default", children: [
|
|
44
|
-
/* @__PURE__ */ e(P, { size: "20" }),
|
|
45
|
-
"Internal link"
|
|
46
|
-
] }) }),
|
|
47
|
-
/* @__PURE__ */ i(n.Content, { ...y, children: [
|
|
48
|
-
/* @__PURE__ */ e(n.Header, { children: /* @__PURE__ */ e(n.Title, { children: "Select internal link" }) }),
|
|
49
|
-
/* @__PURE__ */ e(n.Body, { padding: "none", children: /* @__PURE__ */ e(C, { padding: "compact", children: /* @__PURE__ */ e(
|
|
50
|
-
L,
|
|
51
|
-
{
|
|
52
|
-
selectedUrl: r,
|
|
53
|
-
onSelectUrl: k,
|
|
54
|
-
getAllDocuments: m,
|
|
55
|
-
getDocumentPagesByDocumentId: f,
|
|
56
|
-
getDocumentSectionsByDocumentPageId: u
|
|
57
|
-
}
|
|
58
|
-
) }) }),
|
|
59
|
-
/* @__PURE__ */ i(n.Footer, { children: [
|
|
60
|
-
/* @__PURE__ */ e(d, { size: s, emphasis: "default", onPress: () => l(!1), children: "Cancel" }),
|
|
61
|
-
/* @__PURE__ */ e(d, { size: s, disabled: !r, emphasis: "strong", onPress: () => c(), children: "Choose" })
|
|
62
|
-
] })
|
|
63
|
-
] })
|
|
64
|
-
] })
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
export {
|
|
70
|
-
I as LinkSelector
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=LinkSelector.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkSelector.es.js","sources":["../../../../src/components/Link/LinkSelector/LinkSelector.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Document, type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { Button, Dialog, ScrollArea } from '@frontify/fondue/components';\nimport { IconLink } from '@frontify/fondue/icons';\nimport { type KeyboardEvent, type ReactElement, useEffect, useState } from 'react';\n\nimport './LinkSelector.css';\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n url: string;\n onUrlChange?: (value: string) => void;\n buttonSize?: 'small' | 'medium' | 'large';\n getAllDocuments: () => Promise<Document[]>;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const LinkSelector = ({\n url,\n onUrlChange,\n buttonSize = 'medium',\n getAllDocuments,\n getDocumentPagesByDocumentId,\n getDocumentSectionsByDocumentPageId,\n}: LinkSelectorProps): ReactElement => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [selectedUrl, setSelectedUrl] = useState<string>(url);\n\n const onSelectUrl = (url: string) => {\n setSelectedUrl(url);\n };\n\n const onPressEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n // oxlint-disable-next-line @eslint-react/set-state-in-effect\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange?.(selectedUrl);\n setIsModalOpen(false);\n };\n\n const dialogProps = {\n onOpenAutoFocus: () => {},\n showUnderlay: true,\n 'data-is-underlay': true,\n minWidth: '800px',\n };\n\n return (\n // oxlint-disable-next-line jsx-a11y-x/no-static-element-interactions\n <div\n onPointerDown={(event) => {\n event.preventDefault();\n }}\n data-test-id=\"internal-link-selector\"\n onKeyDown={onPressEnter}\n >\n <Dialog.Root modal open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Dialog.Trigger asChild>\n <Button size={buttonSize} emphasis=\"default\">\n <IconLink size=\"20\" />\n Internal link\n </Button>\n </Dialog.Trigger>\n <Dialog.Content {...dialogProps}>\n <Dialog.Header>\n <Dialog.Title>Select internal link</Dialog.Title>\n </Dialog.Header>\n <Dialog.Body padding=\"none\">\n <ScrollArea padding=\"compact\">\n <DocumentLinks\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n getAllDocuments={getAllDocuments}\n getDocumentPagesByDocumentId={getDocumentPagesByDocumentId}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n />\n </ScrollArea>\n </Dialog.Body>\n <Dialog.Footer>\n <Button size={buttonSize} emphasis=\"default\" onPress={() => setIsModalOpen(false)}>\n Cancel\n </Button>\n <Button size={buttonSize} disabled={!selectedUrl} emphasis=\"strong\" onPress={() => saveLink()}>\n Choose\n </Button>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog.Root>\n </div>\n );\n};\n"],"names":["LinkSelector","url","onUrlChange","buttonSize","getAllDocuments","getDocumentPagesByDocumentId","getDocumentSectionsByDocumentPageId","isModalOpen","setIsModalOpen","useState","selectedUrl","setSelectedUrl","onSelectUrl","onPressEnter","event","saveLink","useEffect","dialogProps","jsx","jsxs","Dialog","Button","IconLink","ScrollArea","DocumentLinks"],"mappings":";;;;;;AAmBO,MAAMA,IAAe,CAAC;AAAA,EACzB,KAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,iBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,qCAAAC;AACJ,MAAuC;AACnC,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAaC,CAAc,IAAIF,EAAiBR,CAAG,GAEpDW,IAAc,CAACX,MAAgB;AACjC,IAAAU,EAAeV,CAAG;AAAA,EACtB,GAEMY,IAAe,CAACC,MAA2C;AAC7D,IAAIA,EAAM,QAAQ,YACdA,EAAM,eAAA,GACNC,EAAA;AAAA,EAER;AAEA,EAAAC,EAAU,MAAM;AACZ,IAAIf,KAAO,CAACS,KAERC,EAAeV,CAAG;AAAA,EAE1B,GAAG,CAACA,GAAKS,CAAW,CAAC;AAErB,QAAMK,IAAW,MAAM;AACnB,IAAAb,IAAcQ,CAAW,GACzBF,EAAe,EAAK;AAAA,EACxB,GAEMS,IAAc;AAAA,IAChB,iBAAiB,MAAM;AAAA,IAAC;AAAA,IACxB,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,UAAU;AAAA,EAAA;AAGd;AAAA;AAAA,IAEI,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,eAAe,CAACJ,MAAU;AACtB,UAAAA,EAAM,eAAA;AAAA,QACV;AAAA,QACA,gBAAa;AAAA,QACb,WAAWD;AAAA,QAEX,UAAA,gBAAAM,EAACC,EAAO,MAAP,EAAY,OAAK,IAAC,MAAMb,GAAa,cAAcC,GAChD,UAAA;AAAA,UAAA,gBAAAU,EAACE,EAAO,SAAP,EAAe,SAAO,IACnB,4BAACC,GAAA,EAAO,MAAMlB,GAAY,UAAS,WAC/B,UAAA;AAAA,YAAA,gBAAAe,EAACI,GAAA,EAAS,MAAK,KAAA,CAAK;AAAA,YAAE;AAAA,UAAA,EAAA,CAE1B,EAAA,CACJ;AAAA,UACA,gBAAAH,EAACC,EAAO,SAAP,EAAgB,GAAGH,GAChB,UAAA;AAAA,YAAA,gBAAAC,EAACE,EAAO,QAAP,EACG,UAAA,gBAAAF,EAACE,EAAO,OAAP,EAAa,kCAAoB,EAAA,CACtC;AAAA,YACA,gBAAAF,EAACE,EAAO,MAAP,EAAY,SAAQ,QACjB,UAAA,gBAAAF,EAACK,GAAA,EAAW,SAAQ,WAChB,UAAA,gBAAAL;AAAA,cAACM;AAAA,cAAA;AAAA,gBACG,aAAAd;AAAA,gBACA,aAAAE;AAAA,gBACA,iBAAAR;AAAA,gBACA,8BAAAC;AAAA,gBACA,qCAAAC;AAAA,cAAA;AAAA,YAAA,GAER,EAAA,CACJ;AAAA,YACA,gBAAAa,EAACC,EAAO,QAAP,EACG,UAAA;AAAA,cAAA,gBAAAF,EAACG,GAAA,EAAO,MAAMlB,GAAY,UAAS,WAAU,SAAS,MAAMK,EAAe,EAAK,GAAG,UAAA,SAAA,CAEnF;AAAA,cACA,gBAAAU,EAACG,GAAA,EAAO,MAAMlB,GAAY,UAAU,CAACO,GAAa,UAAS,UAAS,SAAS,MAAMK,EAAA,GAAY,UAAA,SAAA,CAE/F;AAAA,YAAA,EAAA,CACJ;AAAA,UAAA,EAAA,CACJ;AAAA,QAAA,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA;AAGZ;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { LoadingCircle as e } from "@frontify/fondue/components";
|
|
3
|
-
const o = () => /* @__PURE__ */ t("div", { className: "tw-flex tw-justify-center tw-h-10 tw-items-center", children: /* @__PURE__ */ t(e, { size: "small" }) });
|
|
4
|
-
export {
|
|
5
|
-
o as LoadingIndicator
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=LoadingIndicator.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingIndicator.es.js","sources":["../../../../src/components/Link/LinkSelector/LoadingIndicator.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { LoadingCircle } from '@frontify/fondue/components';\n\nexport const LoadingIndicator = () => {\n return (\n <div className=\"tw-flex tw-justify-center tw-h-10 tw-items-center\">\n <LoadingCircle size=\"small\" />\n </div>\n );\n};\n"],"names":["LoadingIndicator","jsx","LoadingCircle"],"mappings":";;AAIO,MAAMA,IAAmB,MAExB,gBAAAC,EAAC,SAAI,WAAU,qDACX,4BAACC,GAAA,EAAc,MAAK,SAAQ,EAAA,CAChC;"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, Fragment as x, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useState as d, useEffect as m } from "react";
|
|
3
|
-
import { filterDocumentSectionsWithUnreadableTitles as g } from "../helpers/filterDocumentSectionsWithUnreadableTitles.es.js";
|
|
4
|
-
import { SectionLink as v } from "./SectionLink.es.js";
|
|
5
|
-
const L = ({
|
|
6
|
-
page: t,
|
|
7
|
-
selectedUrl: s,
|
|
8
|
-
onSelectUrl: c,
|
|
9
|
-
itemsToExpandInitially: r,
|
|
10
|
-
getDocumentSectionsByDocumentPageId: w
|
|
11
|
-
}) => {
|
|
12
|
-
const [o, a] = d(t.id === r.documentId), [i, p] = d([]), f = t.permanentLink === s;
|
|
13
|
-
m(() => {
|
|
14
|
-
(async () => {
|
|
15
|
-
const b = await w(t.id), u = g(b);
|
|
16
|
-
p(u);
|
|
17
|
-
})();
|
|
18
|
-
}, [t.id, w]), m(() => {
|
|
19
|
-
t.id === r.pageId && a(!0);
|
|
20
|
-
}, [r, t.id]);
|
|
21
|
-
const h = i.length > 0;
|
|
22
|
-
return /* @__PURE__ */ l(x, { children: [
|
|
23
|
-
/* @__PURE__ */ n(
|
|
24
|
-
"button",
|
|
25
|
-
{
|
|
26
|
-
type: "button",
|
|
27
|
-
"data-test-id": "internal-link-selector-page-link",
|
|
28
|
-
className: `
|
|
29
|
-
tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-flex tw-w-full
|
|
30
|
-
${h ? "tw-pl-7 " : "tw-pl-12 "}
|
|
31
|
-
${f ? "tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover " : "hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container "}`,
|
|
32
|
-
onClick: () => c(t.permanentLink),
|
|
33
|
-
children: /* @__PURE__ */ l("div", { className: "tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6", children: [
|
|
34
|
-
h && /* @__PURE__ */ n(
|
|
35
|
-
"button",
|
|
36
|
-
{
|
|
37
|
-
type: "button",
|
|
38
|
-
className: "tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",
|
|
39
|
-
onClick: () => a(!o),
|
|
40
|
-
onKeyDown: (e) => e.key === "Enter" && e.stopPropagation(),
|
|
41
|
-
children: /* @__PURE__ */ n(
|
|
42
|
-
"div",
|
|
43
|
-
{
|
|
44
|
-
className: `tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong
|
|
45
|
-
${o ? "tw-rotate-90 " : ""}`
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ n("span", { className: "tw-text-small", children: t.title }),
|
|
51
|
-
/* @__PURE__ */ n("span", { className: "tw-flex-auto tw-font-sans tw-text-x-small tw-text-right", children: "Page" })
|
|
52
|
-
] }, t.id)
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
o && i.length > 0 && i.map((e) => /* @__PURE__ */ n(
|
|
56
|
-
v,
|
|
57
|
-
{
|
|
58
|
-
section: e,
|
|
59
|
-
selectedUrl: s,
|
|
60
|
-
onSelectUrl: c
|
|
61
|
-
},
|
|
62
|
-
e.id
|
|
63
|
-
))
|
|
64
|
-
] });
|
|
65
|
-
};
|
|
66
|
-
export {
|
|
67
|
-
L as PageLink
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=PageLink.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageLink.es.js","sources":["../../../../src/components/Link/LinkSelector/PageLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentSection } from '@frontify/app-bridge';\nimport { useEffect, useState } from 'react';\n\nimport { filterDocumentSectionsWithUnreadableTitles } from '../helpers/filterDocumentSectionsWithUnreadableTitles';\nimport { type DocumentSectionWithTitle, type InitiallyExpandedItems } from '../types';\n\nimport { SectionLink } from './SectionLink';\n\ntype PageLinkProps = {\n page: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n};\n\nexport const PageLink = ({\n page,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n}: PageLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(page.id === itemsToExpandInitially.documentId);\n const [documentSections, setDocumentSections] = useState<DocumentSectionWithTitle[]>([]);\n const isActive = page.permanentLink === selectedUrl;\n\n useEffect(() => {\n const fetchDocumentSections = async () => {\n const sections = await getDocumentSectionsByDocumentPageId(page.id);\n const sectionsWithReadableTitles = filterDocumentSectionsWithUnreadableTitles(sections);\n setDocumentSections(sectionsWithReadableTitles);\n };\n\n fetchDocumentSections();\n }, [page.id, getDocumentSectionsByDocumentPageId]);\n\n useEffect(() => {\n if (page.id === itemsToExpandInitially.pageId) {\n // oxlint-disable-next-line @eslint-react/set-state-in-effect\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, page.id]);\n\n const hasSections = documentSections.length > 0;\n\n return (\n <>\n <button\n type=\"button\"\n data-test-id=\"internal-link-selector-page-link\"\n className={`\n tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-flex tw-w-full \n ${hasSections ? 'tw-pl-7 ' : 'tw-pl-12 '}\n ${\n isActive\n ? 'tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover '\n : 'hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container '\n }`}\n onClick={() => onSelectUrl(page.permanentLink)}\n >\n <div key={page.id} className=\"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6\">\n {hasSections && (\n <button\n type=\"button\"\n className=\"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onKeyDown={(event) => event.key === 'Enter' && event.stopPropagation()}\n >\n <div\n className={`tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong \n ${isExpanded ? 'tw-rotate-90 ' : ''}`}\n />\n </button>\n )}\n <span className=\"tw-text-small\">{page.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-x-small tw-text-right\">Page</span>\n </div>\n </button>\n {isExpanded &&\n documentSections.length > 0 &&\n documentSections.map((section) => {\n return (\n <SectionLink\n key={section.id}\n section={section}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n />\n );\n })}\n </>\n );\n};\n"],"names":["PageLink","page","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","isExpanded","setIsExpanded","useState","documentSections","setDocumentSections","isActive","useEffect","sections","sectionsWithReadableTitles","filterDocumentSectionsWithUnreadableTitles","hasSections","jsxs","Fragment","jsx","event","section","SectionLink"],"mappings":";;;;AAsBO,MAAMA,IAAW,CAAC;AAAA,EACrB,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AACJ,MAAqB;AACjB,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAASP,EAAK,OAAOG,EAAuB,UAAU,GACpF,CAACK,GAAkBC,CAAmB,IAAIF,EAAqC,CAAA,CAAE,GACjFG,IAAWV,EAAK,kBAAkBC;AAExC,EAAAU,EAAU,MAAM;AAOZ,KAN8B,YAAY;AACtC,YAAMC,IAAW,MAAMR,EAAoCJ,EAAK,EAAE,GAC5Da,IAA6BC,EAA2CF,CAAQ;AACtF,MAAAH,EAAoBI,CAA0B;AAAA,IAClD,GAEA;AAAA,EACJ,GAAG,CAACb,EAAK,IAAII,CAAmC,CAAC,GAEjDO,EAAU,MAAM;AACZ,IAAIX,EAAK,OAAOG,EAAuB,UAEnCG,EAAc,EAAI;AAAA,EAE1B,GAAG,CAACH,GAAwBH,EAAK,EAAE,CAAC;AAEpC,QAAMe,IAAcP,EAAiB,SAAS;AAE9C,SACI,gBAAAQ,EAAAC,GAAA,EACI,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,gBAAa;AAAA,QACb,WAAW;AAAA;AAAA,sBAELH,IAAc,aAAa,WAAW;AAAA,sBAEpCL,IACM,iIACA,iGACV;AAAA,QACJ,SAAS,MAAMR,EAAYF,EAAK,aAAa;AAAA,QAE7C,UAAA,gBAAAgB,EAAC,OAAA,EAAkB,WAAU,yDACxB,UAAA;AAAA,UAAAD,KACG,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS,MAAMZ,EAAc,CAACD,CAAU;AAAA,cACxC,WAAW,CAACc,MAAUA,EAAM,QAAQ,WAAWA,EAAM,gBAAA;AAAA,cAErD,UAAA,gBAAAD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW;AAAA,kCACTb,IAAa,kBAAkB,EAAE;AAAA,gBAAA;AAAA,cAAA;AAAA,YACvC;AAAA,UAAA;AAAA,UAGR,gBAAAa,EAAC,QAAA,EAAK,WAAU,iBAAiB,YAAK,OAAM;AAAA,UAC5C,gBAAAA,EAAC,QAAA,EAAK,WAAU,2DAA0D,UAAA,OAAA,CAAI;AAAA,QAAA,EAAA,GAfxElB,EAAK,EAgBf;AAAA,MAAA;AAAA,IAAA;AAAA,IAEHK,KACGG,EAAiB,SAAS,KAC1BA,EAAiB,IAAI,CAACY,MAEd,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QAEG,SAAAD;AAAA,QACA,aAAAnB;AAAA,QACA,aAAAC;AAAA,MAAA;AAAA,MAHKkB,EAAQ;AAAA,IAAA,CAMxB;AAAA,EAAA,GACT;AAER;"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as o, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { useState as n, useEffect as L } from "react";
|
|
3
|
-
import { LoadingIndicator as P } from "./LoadingIndicator.es.js";
|
|
4
|
-
import { PageLink as k } from "./PageLink.es.js";
|
|
5
|
-
const j = ({
|
|
6
|
-
documentId: i,
|
|
7
|
-
selectedUrl: c,
|
|
8
|
-
onSelectUrl: g,
|
|
9
|
-
itemsToExpandInitially: l,
|
|
10
|
-
getDocumentSectionsByDocumentPageId: m,
|
|
11
|
-
getDocumentPagesByDocumentId: d
|
|
12
|
-
}) => {
|
|
13
|
-
const [f, p] = n([]), [s, y] = n(!0), a = [...f.values()], h = !s && a.length > 0;
|
|
14
|
-
return L(() => {
|
|
15
|
-
d(i).then((e) => {
|
|
16
|
-
const u = e.filter((t) => !!t.category).sort(
|
|
17
|
-
(t, r) => t.category.sort === r.category.sort ? t.sort - r.sort : t.category.sort - r.category.sort
|
|
18
|
-
), w = e.filter((t) => !t.category).sort((t, r) => t.sort - r.sort);
|
|
19
|
-
p([...u, ...w]);
|
|
20
|
-
}).finally(() => {
|
|
21
|
-
y(!1);
|
|
22
|
-
});
|
|
23
|
-
}, []), s ? /* @__PURE__ */ o(P, {}) : h ? /* @__PURE__ */ o(x, { children: a.map((e) => /* @__PURE__ */ o(
|
|
24
|
-
k,
|
|
25
|
-
{
|
|
26
|
-
page: e,
|
|
27
|
-
selectedUrl: c,
|
|
28
|
-
onSelectUrl: g,
|
|
29
|
-
itemsToExpandInitially: l,
|
|
30
|
-
getDocumentSectionsByDocumentPageId: m
|
|
31
|
-
},
|
|
32
|
-
e.id
|
|
33
|
-
)) }) : /* @__PURE__ */ o("div", { className: "tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-small tw-text-secondary", children: "This document does not contain any pages." });
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
j as PageLinks
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=PageLinks.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageLinks.es.js","sources":["../../../../src/components/Link/LinkSelector/PageLinks.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { type ReactElement, useEffect, useState } from 'react';\n\nimport { type InitiallyExpandedItems } from '../types';\n\nimport { LoadingIndicator } from './LoadingIndicator';\nimport { PageLink } from './PageLink';\n\ntype PageLinksProps = {\n documentId: number;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const PageLinks = ({\n documentId,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n getDocumentPagesByDocumentId,\n}: PageLinksProps): ReactElement => {\n const [pages, setPages] = useState<DocumentPage[]>([]);\n const [isLoading, setIsLoading] = useState(true);\n const pagesArray = [...pages.values()];\n const hasPages = !isLoading && pagesArray.length > 0;\n\n useEffect(() => {\n getDocumentPagesByDocumentId(documentId)\n .then((_pages) => {\n const pagesWithCategories = _pages\n .filter((page) => !!page.category)\n .sort((a, b) =>\n a.category.sort === b.category.sort ? a.sort - b.sort : a.category.sort - b.category.sort,\n );\n const pagesWithoutCategories = _pages.filter((page) => !page.category).sort((a, b) => a.sort - b.sort);\n setPages([...pagesWithCategories, ...pagesWithoutCategories]);\n })\n .finally(() => {\n setIsLoading(false);\n });\n // oxlint-disable-next-line @eslint-react/exhaustive-deps\n }, []);\n\n if (isLoading) {\n return <LoadingIndicator />;\n }\n\n return hasPages ? (\n <>\n {pagesArray.map((page) => {\n return (\n <PageLink\n key={page.id}\n page={page}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n />\n );\n })}\n </>\n ) : (\n <div className=\"tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-small tw-text-secondary\">\n This document does not contain any pages.\n </div>\n );\n};\n"],"names":["PageLinks","documentId","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","getDocumentPagesByDocumentId","pages","setPages","useState","isLoading","setIsLoading","pagesArray","hasPages","useEffect","_pages","pagesWithCategories","page","a","b","pagesWithoutCategories","LoadingIndicator","jsx","Fragment","PageLink"],"mappings":";;;;AAmBO,MAAMA,IAAY,CAAC;AAAA,EACtB,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AAAA,EACA,8BAAAC;AACJ,MAAoC;AAChC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAyB,CAAA,CAAE,GAC/C,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAI,GACzCG,IAAa,CAAC,GAAGL,EAAM,QAAQ,GAC/BM,IAAW,CAACH,KAAaE,EAAW,SAAS;AAmBnD,SAjBAE,EAAU,MAAM;AACZ,IAAAR,EAA6BL,CAAU,EAClC,KAAK,CAACc,MAAW;AACd,YAAMC,IAAsBD,EACvB,OAAO,CAACE,MAAS,CAAC,CAACA,EAAK,QAAQ,EAChC;AAAA,QAAK,CAACC,GAAGC,MACND,EAAE,SAAS,SAASC,EAAE,SAAS,OAAOD,EAAE,OAAOC,EAAE,OAAOD,EAAE,SAAS,OAAOC,EAAE,SAAS;AAAA,MAAA,GAEvFC,IAAyBL,EAAO,OAAO,CAACE,MAAS,CAACA,EAAK,QAAQ,EAAE,KAAK,CAACC,GAAGC,MAAMD,EAAE,OAAOC,EAAE,IAAI;AACrG,MAAAX,EAAS,CAAC,GAAGQ,GAAqB,GAAGI,CAAsB,CAAC;AAAA,IAChE,CAAC,EACA,QAAQ,MAAM;AACX,MAAAT,EAAa,EAAK;AAAA,IACtB,CAAC;AAAA,EAET,GAAG,CAAA,CAAE,GAEDD,sBACQW,GAAA,EAAiB,IAGtBR,IACH,gBAAAS,EAAAC,GAAA,EACK,UAAAX,EAAW,IAAI,CAACK,MAET,gBAAAK;AAAA,IAACE;AAAA,IAAA;AAAA,MAEG,MAAAP;AAAA,MACA,aAAAf;AAAA,MACA,aAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,qCAAAC;AAAA,IAAA;AAAA,IALKY,EAAK;AAAA,EAAA,CAQrB,EAAA,CACL,sBAEC,OAAA,EAAI,WAAU,kGAAiG,UAAA,6CAEhH;AAER;"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import { IconDocumentText as h } from "@frontify/fondue/icons";
|
|
3
|
-
const s = ({ section: e, selectedUrl: i, onSelectUrl: o }) => {
|
|
4
|
-
const n = e.permanentLink === i;
|
|
5
|
-
return /* @__PURE__ */ t(
|
|
6
|
-
"button",
|
|
7
|
-
{
|
|
8
|
-
"data-test-id": "internal-link-selector-section-link",
|
|
9
|
-
type: "button",
|
|
10
|
-
"data-is-active": n,
|
|
11
|
-
className: `
|
|
12
|
-
tw-py-2 tw-pr-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full
|
|
13
|
-
${n ? "tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover" : "hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container"}`,
|
|
14
|
-
onClick: () => o(e.permanentLink),
|
|
15
|
-
children: /* @__PURE__ */ r("div", { className: "tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6", children: [
|
|
16
|
-
/* @__PURE__ */ t(h, { size: 16 }),
|
|
17
|
-
/* @__PURE__ */ t("span", { className: "tw-text-small", children: e.title }),
|
|
18
|
-
/* @__PURE__ */ t("span", { className: "tw-flex-auto tw-font-sans tw-text-x-small tw-text-right", children: "Section" })
|
|
19
|
-
] })
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
s as SectionLink
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=SectionLink.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SectionLink.es.js","sources":["../../../../src/components/Link/LinkSelector/SectionLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDocumentText } from '@frontify/fondue/icons';\n\ntype SectionLinkProps = {\n section: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n};\n\nexport const SectionLink = ({ section, selectedUrl, onSelectUrl }: SectionLinkProps) => {\n const isActive = section.permanentLink === selectedUrl;\n\n return (\n <button\n data-test-id=\"internal-link-selector-section-link\"\n type=\"button\"\n data-is-active={isActive}\n className={`\n tw-py-2 tw-pr-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full \n ${\n isActive\n ? 'tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover'\n : 'hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container'\n }`}\n onClick={() => onSelectUrl(section.permanentLink)}\n >\n <div className=\"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6\">\n <IconDocumentText size={16} />\n <span className=\"tw-text-small\">{section.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-x-small tw-text-right\">Section</span>\n </div>\n </button>\n );\n};\n"],"names":["SectionLink","section","selectedUrl","onSelectUrl","isActive","jsx","jsxs","IconDocumentText"],"mappings":";;AAcO,MAAMA,IAAc,CAAC,EAAE,SAAAC,GAAS,aAAAC,GAAa,aAAAC,QAAoC;AACpF,QAAMC,IAAWH,EAAQ,kBAAkBC;AAE3C,SACI,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,gBAAa;AAAA,MACb,MAAK;AAAA,MACL,kBAAgBD;AAAA,MAChB,WAAW;AAAA;AAAA,kBAGHA,IACM,gIACA,gGACV;AAAA,MACJ,SAAS,MAAMD,EAAYF,EAAQ,aAAa;AAAA,MAEhD,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAU,yDACX,UAAA;AAAA,QAAA,gBAAAD,EAACE,GAAA,EAAiB,MAAM,GAAA,CAAI;AAAA,QAC5B,gBAAAF,EAAC,QAAA,EAAK,WAAU,iBAAiB,YAAQ,OAAM;AAAA,QAC/C,gBAAAA,EAAC,QAAA,EAAK,WAAU,2DAA0D,UAAA,UAAA,CAAO;AAAA,MAAA,EAAA,CACrF;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filterDocumentSectionsWithUnreadableTitles.es.js","sources":["../../../../src/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentSection } from '@frontify/app-bridge';\n\nimport { type DocumentSectionWithTitle } from '../types';\n\nexport const filterDocumentSectionsWithUnreadableTitles = (sections: DocumentSection[]) =>\n sections.filter((section) => !!section.title?.trim()) as DocumentSectionWithTitle[];\n"],"names":["filterDocumentSectionsWithUnreadableTitles","sections","section"],"mappings":"AAMO,MAAMA,IAA6C,CAACC,MACvDA,EAAS,OAAO,CAACC,MAAY,CAAC,CAACA,EAAQ,OAAO,KAAA,CAAM;"}
|