@frontify/guideline-blocks-settings 0.34.10 → 0.34.11
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/components/Attachments/AttachmentItem.es.js +21 -21
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +1 -1
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +20 -23
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +5 -5
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +6 -6
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +9 -9
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +4 -4
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +5 -5
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.es.js +7 -7
- package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -1
- package/dist/components/Link/LinkInput.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/DocumentLink.es.js +7 -7
- package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js +4 -4
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +56 -53
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/PageLink.es.js +4 -4
- package/dist/components/Link/LinkSelector/PageLink.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/PageLinks.es.js +4 -4
- package/dist/components/Link/LinkSelector/PageLinks.es.js.map +1 -1
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +1 -1
- package/dist/components/Link/utils/getUrl.es.js.map +1 -1
- package/dist/components/Link/utils/url.es.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +9 -9
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
- package/dist/components/RichTextEditor/SerializedText.es.js +5 -5
- package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +6 -6
- 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.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +1 -1
- 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 +9 -9
- 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.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
- 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 +8 -8
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +8 -8
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -1
- package/dist/helpers/mapColorPalettes.es.js.map +1 -1
- package/dist/hooks/useAttachments.es.js.map +1 -1
- package/dist/hooks/useDndSensors.es.js.map +1 -1
- package/dist/hooks/useIsInViewport.es.js.map +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +34 -34
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/gutter.es.js.map +1 -1
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityDownloadable.es.js.map +1 -1
- package/dist/settings/securityGlobalControl.es.js +1 -1
- package/dist/settings/securityGlobalControl.es.js.map +1 -1
- package/dist/settings/types.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/color/getReadableColor.es.js.map +1 -1
- package/dist/utilities/color/isDark.es.js.map +1 -1
- package/dist/utilities/color/toColorObject.es.js.map +1 -1
- package/dist/utilities/color/toHex8String.es.js.map +1 -1
- package/dist/utilities/color/toHexString.es.js.map +1 -1
- package/dist/utilities/color/toRgbaString.es.js.map +1 -1
- package/dist/utilities/color/toShortRgba.es.js.map +1 -1
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
- package/dist/utilities/react/getBorderStyles.es.js +4 -4
- package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
- package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
- package/package.json +28 -28
|
@@ -1 +1 @@
|
|
|
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
|
|
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, ButtonEmphasis, ButtonSize, ButtonStyle, ButtonType, IconLink, Modal } from '@frontify/fondue';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport { type KeyboardEvent, type ReactElement, useEffect, useState } from 'react';\n\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n url: string;\n onUrlChange?: (value: string) => void;\n buttonSize?: ButtonSize;\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 = ButtonSize.Medium,\n getAllDocuments,\n getDocumentPagesByDocumentId,\n getDocumentSectionsByDocumentPageId,\n}: LinkSelectorProps): ReactElement => {\n const { open: openLinkTree, isOpen: isLinkTreeOpen, close: closeLinkTree } = useOverlayTriggerState({});\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 saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange?.(selectedUrl);\n closeLinkTree();\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n onPointerDown={(event) => event.preventDefault()}\n data-test-id=\"internal-link-selector\"\n onKeyDown={onPressEnter}\n >\n <Button\n icon={<IconLink />}\n size={buttonSize}\n type={ButtonType.Button}\n style={ButtonStyle.Default}\n emphasis={ButtonEmphasis.Default}\n onClick={() => openLinkTree()}\n >\n Internal link\n </Button>\n <Modal zIndex={1001} onClose={() => closeLinkTree()} isOpen={isLinkTreeOpen} isDismissable>\n <Modal.Header title=\"Select internal link\" />\n <Modal.Body>\n <DocumentLinks\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n getAllDocuments={getAllDocuments}\n getDocumentPagesByDocumentId={getDocumentPagesByDocumentId}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n />\n </Modal.Body>\n <Modal.Footer\n buttons={[\n {\n children: 'Cancel',\n onClick: () => closeLinkTree(),\n style: ButtonStyle.Default,\n emphasis: ButtonEmphasis.Default,\n },\n {\n children: 'Choose',\n onClick: (event) => {\n event?.preventDefault();\n saveLink();\n },\n style: ButtonStyle.Default,\n emphasis: ButtonEmphasis.Strong,\n disabled: !selectedUrl,\n },\n ]}\n />\n </Modal>\n </div>\n );\n};\n"],"names":["LinkSelector","url","onUrlChange","buttonSize","ButtonSize","getAllDocuments","getDocumentPagesByDocumentId","getDocumentSectionsByDocumentPageId","openLinkTree","isLinkTreeOpen","closeLinkTree","useOverlayTriggerState","selectedUrl","setSelectedUrl","useState","onSelectUrl","onPressEnter","event","saveLink","useEffect","jsxs","jsx","Button","IconLink","ButtonType","ButtonStyle","ButtonEmphasis","Modal","DocumentLinks"],"mappings":";;;;;AAkBO,MAAMA,IAAe,CAAC;AAAA,EACzB,KAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAaC,EAAW;AAAA,EACxB,iBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,qCAAAC;AACJ,MAAuC;AAC7B,QAAA,EAAE,MAAMC,GAAc,QAAQC,GAAgB,OAAOC,EAAc,IAAIC,EAAuB,CAAA,CAAE,GAChG,CAACC,GAAaC,CAAc,IAAIC,EAAiBb,CAAG,GAEpDc,IAAc,CAACd,MAAgB;AACjC,IAAAY,EAAeZ,CAAG;AAAA,EAAA,GAGhBe,IAAe,CAACC,MAA2C;AACzD,IAAAA,EAAM,QAAQ,WACLC;EACb;AAGJ,EAAAC,EAAU,MAAM;AACR,IAAAlB,KAAO,CAACW,KACRC,EAAeZ,CAAG;AAAA,EACtB,GACD,CAACA,GAAKW,CAAW,CAAC;AAErB,QAAMM,IAAW,MAAM;AACnB,IAAAhB,KAAA,QAAAA,EAAcU,IACAF;EAAA;AAGlB;AAAA;AAAA,IAEI,gBAAAU;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,eAAe,CAACH,MAAUA,EAAM,eAAe;AAAA,QAC/C,gBAAa;AAAA,QACb,WAAWD;AAAA,QAEX,UAAA;AAAA,UAAA,gBAAAK;AAAA,YAACC;AAAA,YAAA;AAAA,cACG,wBAAOC,GAAS,EAAA;AAAA,cAChB,MAAMpB;AAAA,cACN,MAAMqB,EAAW;AAAA,cACjB,OAAOC,EAAY;AAAA,cACnB,UAAUC,EAAe;AAAA,cACzB,SAAS,MAAMlB,EAAa;AAAA,cAC/B,UAAA;AAAA,YAAA;AAAA,UAED;AAAA,UACA,gBAAAY,EAACO,GAAM,EAAA,QAAQ,MAAM,SAAS,MAAMjB,EAAiB,GAAA,QAAQD,GAAgB,eAAa,IACtF,UAAA;AAAA,YAAA,gBAAAY,EAACM,EAAM,QAAN,EAAa,OAAM,uBAAuB,CAAA;AAAA,YAC3C,gBAAAN,EAACM,EAAM,MAAN,EACG,UAAA,gBAAAN;AAAA,cAACO;AAAA,cAAA;AAAA,gBACG,aAAAhB;AAAA,gBACA,aAAAG;AAAA,gBACA,iBAAAV;AAAA,gBACA,8BAAAC;AAAA,gBACA,qCAAAC;AAAA,cAAA;AAAA,YAAA,GAER;AAAA,YACA,gBAAAc;AAAA,cAACM,EAAM;AAAA,cAAN;AAAA,gBACG,SAAS;AAAA,kBACL;AAAA,oBACI,UAAU;AAAA,oBACV,SAAS,MAAMjB,EAAc;AAAA,oBAC7B,OAAOe,EAAY;AAAA,oBACnB,UAAUC,EAAe;AAAA,kBAC7B;AAAA,kBACA;AAAA,oBACI,UAAU;AAAA,oBACV,SAAS,CAACT,MAAU;AAChB,sBAAAA,KAAA,QAAAA,EAAO,kBACEC;oBACb;AAAA,oBACA,OAAOO,EAAY;AAAA,oBACnB,UAAUC,EAAe;AAAA,oBACzB,UAAU,CAACd;AAAA,kBACf;AAAA,gBACJ;AAAA,cAAA;AAAA,YACJ;AAAA,UAAA,GACJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACJ;AAAA;AAER;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as d, Fragment as v, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { merge as m } from "@frontify/fondue";
|
|
3
3
|
import { useState as h, useEffect as x } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { filterDocumentSectionsWithUnreadableTitles as g } from "../helpers/filterDocumentSectionsWithUnreadableTitles.es.js";
|
|
5
|
+
import { SectionLink as k } from "./SectionLink.es.js";
|
|
6
6
|
const D = ({
|
|
7
7
|
page: t,
|
|
8
8
|
selectedUrl: i,
|
|
@@ -13,7 +13,7 @@ const D = ({
|
|
|
13
13
|
const [n, a] = h(t.id === r.documentId), [o, b] = h([]), f = t.permanentLink === i;
|
|
14
14
|
x(() => {
|
|
15
15
|
(async () => {
|
|
16
|
-
const p = await w(t.id), u =
|
|
16
|
+
const p = await w(t.id), u = g(p);
|
|
17
17
|
b(u);
|
|
18
18
|
})();
|
|
19
19
|
}, [t.id, w]), x(() => {
|
|
@@ -55,7 +55,7 @@ const D = ({
|
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
57
|
n && o.length > 0 && o.map((s) => /* @__PURE__ */ e(
|
|
58
|
-
|
|
58
|
+
k,
|
|
59
59
|
{
|
|
60
60
|
section: s,
|
|
61
61
|
selectedUrl: i,
|
|
@@ -1 +1 @@
|
|
|
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 { merge } from '@frontify/fondue';\nimport { useEffect, useState } from 'react';\nimport { DocumentSectionWithTitle, InitiallyExpandedItems } from '../';\nimport {
|
|
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 { merge } from '@frontify/fondue';\nimport { useEffect, useState } from 'react';\n\nimport { type DocumentSectionWithTitle, type InitiallyExpandedItems } from '../';\nimport { filterDocumentSectionsWithUnreadableTitles } from '../helpers/filterDocumentSectionsWithUnreadableTitles';\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 setIsExpanded(true);\n }\n }, [itemsToExpandInitially, page.id]);\n\n const hasSections = documentSections.length > 0;\n\n return (\n <>\n <button\n data-test-id=\"internal-link-selector-page-link\"\n className={merge([\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 isActive\n ? 'tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover'\n : 'hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover',\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 data-test-id=\"tree-item-toggle\"\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 >\n <div\n className={merge([\n '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 ></div>\n </button>\n )}\n <span className=\"tw-text-s\">{page.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs 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","merge","section","SectionLink"],"mappings":";;;;;AAuBO,MAAMA,IAAW,CAAC;AAAA,EACrB,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AACJ,MAAqB;AACX,QAAA,CAACC,GAAYC,CAAa,IAAIC,EAASP,EAAK,OAAOG,EAAuB,UAAU,GACpF,CAACK,GAAkBC,CAAmB,IAAIF,EAAqC,CAAE,CAAA,GACjFG,IAAWV,EAAK,kBAAkBC;AAExC,EAAAU,EAAU,MAAM;AAOU,KANQ,YAAY;AACtC,YAAMC,IAAW,MAAMR,EAAoCJ,EAAK,EAAE,GAC5Da,IAA6BC,EAA2CF,CAAQ;AACtF,MAAAH,EAAoBI,CAA0B;AAAA,IAAA;EAInD,GAAA,CAACb,EAAK,IAAII,CAAmC,CAAC,GAEjDO,EAAU,MAAM;AACR,IAAAX,EAAK,OAAOG,EAAuB,UACnCG,EAAc,EAAI;AAAA,EAEvB,GAAA,CAACH,GAAwBH,EAAK,EAAE,CAAC;AAE9B,QAAAe,IAAcP,EAAiB,SAAS;AAE9C,SAEQ,gBAAAQ,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,gBAAa;AAAA,QACb,WAAWC,EAAM;AAAA,UACb;AAAA,UACAJ,IAAc,YAAY;AAAA,UAC1BL,IACM,oKACA;AAAA,QAAA,CACT;AAAA,QACD,SAAS,MAAMR,EAAYF,EAAK,aAAa;AAAA,QAE7C,UAAA,gBAAAgB,EAAC,OAAkB,EAAA,WAAU,yDACxB,UAAA;AAAA,UACGD,KAAA,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,gBAAa;AAAA,cACb,WAAU;AAAA,cACV,SAAS,MAAMZ,EAAc,CAACD,CAAU;AAAA,cAExC,UAAA,gBAAAa;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAWC,EAAM;AAAA,oBACb;AAAA,oBACAd,IAAa,iBAAiB;AAAA,kBAAA,CACjC;AAAA,gBAAA;AAAA,cACJ;AAAA,YAAA;AAAA,UACL;AAAA,UAEH,gBAAAa,EAAA,QAAA,EAAK,WAAU,aAAa,YAAK,OAAM;AAAA,UACvC,gBAAAA,EAAA,QAAA,EAAK,WAAU,sDAAqD,UAAI,QAAA;AAAA,QAAA,EAAA,GAhBnElB,EAAK,EAiBf;AAAA,MAAA;AAAA,IACJ;AAAA,IACCK,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,EACT,EAAA,CAAA;AAER;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, Fragment as x } from "react/jsx-runtime";
|
|
2
2
|
import { useState as n, useEffect as L } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { LoadingIndicator as P } from "./LoadingIndicator.es.js";
|
|
4
|
+
import { PageLink as k } from "./PageLink.es.js";
|
|
5
5
|
const j = ({
|
|
6
6
|
documentId: i,
|
|
7
7
|
selectedUrl: c,
|
|
@@ -20,8 +20,8 @@ const j = ({
|
|
|
20
20
|
}).finally(() => {
|
|
21
21
|
h(!1);
|
|
22
22
|
});
|
|
23
|
-
}, []), s ? /* @__PURE__ */ o(
|
|
24
|
-
|
|
23
|
+
}, []), s ? /* @__PURE__ */ o(P, {}) : u ? /* @__PURE__ */ o(x, { children: a.map((e) => /* @__PURE__ */ o(
|
|
24
|
+
k,
|
|
25
25
|
{
|
|
26
26
|
page: e,
|
|
27
27
|
selectedUrl: c,
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 '../';\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 }, []);\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-s tw-text-text-weak\">\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,CAAE,CAAA,GAC/C,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAI,GACzCG,IAAa,CAAC,GAAGL,EAAM,OAAQ,CAAA,GAC/BM,IAAW,CAACH,KAAaE,EAAW,SAAS;AAkBnD,SAhBAE,EAAU,MAAM;AACZ,IAAAR,EAA6BL,CAAU,EAClC,KAAK,CAACc,MAAW;AACR,YAAAC,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,IAAA,CAC/D,EACA,QAAQ,MAAM;AACX,MAAAT,EAAa,EAAK;AAAA,IAAA,CACrB;AAAA,EACT,GAAG,CAAE,CAAA,GAEDD,sBACQW,GAAiB,CAAA,CAAA,IAGtBR,IACH,gBAAAS,EAAAC,GAAA,EACK,UAAWX,EAAA,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,EACL,CAAA,sBAEC,OAAI,EAAA,WAAU,8FAA6F,UAE5G,4CAAA,CAAA;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
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';\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","_a"],"mappings":"
|
|
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","_a"],"mappings":"AAMO,MAAMA,IAA6C,CAACC,MACvDA,EAAS,OAAO,CAACC,MAAY;AAD1B,MAAAC;AAC0B,UAAC,GAACA,IAAAD,EAAQ,UAAR,QAAAC,EAAe;AAAA,CAAM;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUrl.es.js","sources":["../../../../src/components/Link/utils/getUrl.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, PlateEditor, getAboveNode } from '@frontify/fondue';\nimport { TLinkElement } from '../../RichTextEditor/plugins/LinkPlugin/types';\n\nconst getLinkNode = (editor: PlateEditor, cb: (link: TLinkElement) => string): string => {\n const linkNode = getAboveNode<TLinkElement>(editor, { match: { type: ELEMENT_LINK } });\n\n if (!Array.isArray(linkNode)) {\n return '';\n }\n\n return cb(linkNode[0]);\n};\n\nexport const getLegacyUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.chosenLink?.searchResult?.link || '');\n};\n\nexport const getUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.url || '');\n};\n\nexport const getUrlFromLinkOrLegacyLink = (link: TLinkElement): string => {\n return link.url || link.chosenLink?.searchResult?.link || '';\n};\n\nexport const getLinkFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, getUrlFromLinkOrLegacyLink);\n};\n"],"names":["getLinkNode","editor","cb","linkNode","getAboveNode","ELEMENT_LINK","getLegacyUrl","link","_b","_a","getUrl","getUrlFromLinkOrLegacyLink","getLinkFromEditor"],"mappings":";
|
|
1
|
+
{"version":3,"file":"getUrl.es.js","sources":["../../../../src/components/Link/utils/getUrl.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, type PlateEditor, getAboveNode } from '@frontify/fondue';\n\nimport { type TLinkElement } from '../../RichTextEditor/plugins/LinkPlugin/types';\n\nconst getLinkNode = (editor: PlateEditor, cb: (link: TLinkElement) => string): string => {\n const linkNode = getAboveNode<TLinkElement>(editor, { match: { type: ELEMENT_LINK } });\n\n if (!Array.isArray(linkNode)) {\n return '';\n }\n\n return cb(linkNode[0]);\n};\n\nexport const getLegacyUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.chosenLink?.searchResult?.link || '');\n};\n\nexport const getUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.url || '');\n};\n\nexport const getUrlFromLinkOrLegacyLink = (link: TLinkElement): string => {\n return link.url || link.chosenLink?.searchResult?.link || '';\n};\n\nexport const getLinkFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, getUrlFromLinkOrLegacyLink);\n};\n"],"names":["getLinkNode","editor","cb","linkNode","getAboveNode","ELEMENT_LINK","getLegacyUrl","link","_b","_a","getUrl","getUrlFromLinkOrLegacyLink","getLinkFromEditor"],"mappings":";AAMA,MAAMA,IAAc,CAACC,GAAqBC,MAA+C;AAC/E,QAAAC,IAAWC,EAA2BH,GAAQ,EAAE,OAAO,EAAE,MAAMI,EAAa,EAAA,CAAG;AAErF,SAAK,MAAM,QAAQF,CAAQ,IAIpBD,EAAGC,EAAS,CAAC,CAAC,IAHV;AAIf,GAEaG,IAAe,CAACL,MAClBD,EAAYC,GAAQ,CAACM,MAAS;;AAAA,WAAAC,KAAAC,IAAAF,EAAK,eAAL,gBAAAE,EAAiB,iBAAjB,gBAAAD,EAA+B,SAAQ;AAAA,CAAE,GAGrEE,IAAS,CAACT,MACZD,EAAYC,GAAQ,CAACM,MAASA,EAAK,OAAO,EAAE,GAG1CI,IAA6B,CAACJ,MAA+B;;AACtE,SAAOA,EAAK,SAAOC,KAAAC,IAAAF,EAAK,eAAL,gBAAAE,EAAiB,iBAAjB,gBAAAD,EAA+B,SAAQ;AAC9D,GAEaI,IAAoB,CAACX,MACvBD,EAAYC,GAAQU,CAA0B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.es.js","sources":["../../../../src/components/Link/utils/url.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { addHttps } from '../../../helpers';\nimport { relativeUrlRegex } from './relativeUrlRegex';\n\nexport const isValidUrl = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return true;\n }\n try {\n const parsedUrl = new URL(url);\n const validProtocols = ['http:', 'https:', 'mailto:', 'tel:'];\n return validProtocols.includes(parsedUrl.protocol) && parsedUrl.pathname !== '';\n } catch (error) {\n return false;\n }\n};\n\nexport const isValidUrlOrEmpty = (url: string): boolean => {\n return isValidUrl(addHttps(url)) || url === '';\n};\n"],"names":["isValidUrl","url","relativeUrlRegex","parsedUrl","isValidUrlOrEmpty","addHttps"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"url.es.js","sources":["../../../../src/components/Link/utils/url.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { addHttps } from '../../../helpers';\n\nimport { relativeUrlRegex } from './relativeUrlRegex';\n\nexport const isValidUrl = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return true;\n }\n try {\n const parsedUrl = new URL(url);\n const validProtocols = ['http:', 'https:', 'mailto:', 'tel:'];\n return validProtocols.includes(parsedUrl.protocol) && parsedUrl.pathname !== '';\n } catch (error) {\n return false;\n }\n};\n\nexport const isValidUrlOrEmpty = (url: string): boolean => {\n return isValidUrl(addHttps(url)) || url === '';\n};\n"],"names":["isValidUrl","url","relativeUrlRegex","parsedUrl","isValidUrlOrEmpty","addHttps"],"mappings":";;AAMa,MAAAA,IAAa,CAACC,MAAgB;AACnC,MAAAC,EAAiB,KAAKD,CAAG;AAClB,WAAA;AAEP,MAAA;AACM,UAAAE,IAAY,IAAI,IAAIF,CAAG;AAE7B,WADuB,CAAC,SAAS,UAAU,WAAW,MAAM,EACtC,SAASE,EAAU,QAAQ,KAAKA,EAAU,aAAa;AAAA,UACjE;AACL,WAAA;AAAA,EACX;AACJ,GAEaC,IAAoB,CAACH,MACvBD,EAAWK,EAASJ,CAAG,CAAC,KAAKA,MAAQ;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { RichTextEditor as x } from "@frontify/fondue";
|
|
3
|
+
import { memo as R, useState as h, useCallback as a, useEffect as p, useRef as v } from "react";
|
|
4
|
+
import { useIsInViewport as P } from "../../hooks/useIsInViewport.es.js";
|
|
5
|
+
import { SerializedText as I } from "./SerializedText.es.js";
|
|
6
6
|
import { floatingButtonSelectors as L, floatingButtonActions as S } from "./plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js";
|
|
7
|
-
const E =
|
|
7
|
+
const E = R(
|
|
8
8
|
({
|
|
9
9
|
id: d = "rte",
|
|
10
10
|
isEnabled: i,
|
|
@@ -30,7 +30,7 @@ const E = x(
|
|
|
30
30
|
};
|
|
31
31
|
return c && window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
32
32
|
}, [c]), i ? /* @__PURE__ */ l(
|
|
33
|
-
|
|
33
|
+
x,
|
|
34
34
|
{
|
|
35
35
|
id: d,
|
|
36
36
|
value: t,
|
|
@@ -41,15 +41,15 @@ const E = x(
|
|
|
41
41
|
onTextChange: b,
|
|
42
42
|
hideExternalFloatingModals: V
|
|
43
43
|
}
|
|
44
|
-
) : /* @__PURE__ */ l(
|
|
44
|
+
) : /* @__PURE__ */ l(I, { value: t, columns: n, gap: r, show: w, plugins: s });
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
E.displayName = "InternalRichTextEditor";
|
|
48
48
|
const M = (d) => {
|
|
49
|
-
const i =
|
|
49
|
+
const i = v(null), [t, n] = h(!1), { isEditing: r, ...f } = d, s = a((o) => {
|
|
50
50
|
o && n(!0);
|
|
51
51
|
}, []);
|
|
52
|
-
return
|
|
52
|
+
return P({ ref: i, disabled: !r, onChange: s }), p(() => {
|
|
53
53
|
r || n(!1);
|
|
54
54
|
}, [r]), /* @__PURE__ */ l("div", { className: "tw-block tw-w-full", ref: i, children: /* @__PURE__ */ l(E, { ...f, isEnabled: r && t }) });
|
|
55
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.es.js","sources":["../../../src/components/RichTextEditor/RichTextEditor.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { memo, useCallback, useEffect, useRef, useState } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"RichTextEditor.es.js","sources":["../../../src/components/RichTextEditor/RichTextEditor.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { RichTextEditor as FondueRichTextEditor } from '@frontify/fondue';\nimport { memo, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { useIsInViewport } from '../../hooks/useIsInViewport';\n\nimport { SerializedText } from './SerializedText';\nimport { floatingButtonActions, floatingButtonSelectors } from './plugins/ButtonPlugin/components';\nimport { type RichTextEditorProps } from './types';\n\nconst InternalRichTextEditor = memo(\n ({\n id = 'rte',\n isEnabled,\n value,\n columns,\n gap,\n placeholder,\n plugins,\n onTextChange,\n showSerializedText,\n }: Omit<RichTextEditorProps, 'isEditing'> & { isEnabled: boolean }) => {\n const [shouldPreventPageLeave, setShouldPreventPageLeave] = useState(false);\n\n const handleTextChange = useCallback(\n (newContent: string) => {\n if (newContent !== value) {\n onTextChange?.(newContent);\n }\n setShouldPreventPageLeave(false);\n },\n [onTextChange, value],\n );\n\n const handleValueChange = useCallback(() => setShouldPreventPageLeave(true), []);\n\n const handleHideExternalFloatingModals = useCallback((editorId: string) => {\n if (floatingButtonSelectors.isOpen(editorId)) {\n floatingButtonActions.reset();\n }\n }, []);\n\n useEffect(() => {\n const unloadHandler = (event: BeforeUnloadEvent) => {\n event.preventDefault();\n event.returnValue = 'Unprocessed changes';\n };\n\n if (shouldPreventPageLeave) {\n window.addEventListener('beforeunload', unloadHandler);\n }\n\n return () => window.removeEventListener('beforeunload', unloadHandler);\n }, [shouldPreventPageLeave]);\n\n if (isEnabled) {\n return (\n <FondueRichTextEditor\n id={id}\n value={value}\n border={false}\n placeholder={placeholder}\n plugins={plugins}\n onValueChanged={handleValueChange}\n onTextChange={handleTextChange}\n hideExternalFloatingModals={handleHideExternalFloatingModals}\n />\n );\n }\n return <SerializedText value={value} columns={columns} gap={gap} show={showSerializedText} plugins={plugins} />;\n },\n);\nInternalRichTextEditor.displayName = 'InternalRichTextEditor';\n\nexport const RichTextEditor = (props: RichTextEditorProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const [hasEnteredViewport, setHasEnteredViewport] = useState(false);\n\n const { isEditing, ...internalRteProps } = props;\n\n const onViewportVisibilityChange = useCallback((isInViewport: boolean) => {\n if (isInViewport) {\n setHasEnteredViewport(true);\n }\n }, []);\n\n useIsInViewport({ ref, disabled: !isEditing, onChange: onViewportVisibilityChange });\n\n useEffect(() => {\n if (!isEditing) {\n setHasEnteredViewport(false);\n }\n }, [isEditing]);\n\n return (\n <div className=\"tw-block tw-w-full\" ref={ref}>\n <InternalRichTextEditor {...internalRteProps} isEnabled={isEditing && hasEnteredViewport} />\n </div>\n );\n};\n"],"names":["InternalRichTextEditor","memo","id","isEnabled","value","columns","gap","placeholder","plugins","onTextChange","showSerializedText","shouldPreventPageLeave","setShouldPreventPageLeave","useState","handleTextChange","useCallback","newContent","handleValueChange","handleHideExternalFloatingModals","editorId","floatingButtonSelectors","floatingButtonActions","useEffect","unloadHandler","event","jsx","FondueRichTextEditor","SerializedText","RichTextEditor","props","ref","useRef","hasEnteredViewport","setHasEnteredViewport","isEditing","internalRteProps","onViewportVisibilityChange","isInViewport","useIsInViewport"],"mappings":";;;;;;AAWA,MAAMA,IAAyBC;AAAA,EAC3B,CAAC;AAAA,IACG,IAAAC,IAAK;AAAA,IACL,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,KAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,MACmE;AACnE,UAAM,CAACC,GAAwBC,CAAyB,IAAIC,EAAS,EAAK,GAEpEC,IAAmBC;AAAA,MACrB,CAACC,MAAuB;AACpB,QAAIA,MAAeZ,MACfK,KAAA,QAAAA,EAAeO,KAEnBJ,EAA0B,EAAK;AAAA,MACnC;AAAA,MACA,CAACH,GAAcL,CAAK;AAAA,IAAA,GAGlBa,IAAoBF,EAAY,MAAMH,EAA0B,EAAI,GAAG,CAAA,CAAE,GAEzEM,IAAmCH,EAAY,CAACI,MAAqB;AACnE,MAAAC,EAAwB,OAAOD,CAAQ,KACvCE,EAAsB,MAAM;AAAA,IAEpC,GAAG,CAAE,CAAA;AAeL,WAbAC,EAAU,MAAM;AACN,YAAAC,IAAgB,CAACC,MAA6B;AAChD,QAAAA,EAAM,eAAe,GACrBA,EAAM,cAAc;AAAA,MAAA;AAGxB,aAAIb,KACO,OAAA,iBAAiB,gBAAgBY,CAAa,GAGlD,MAAM,OAAO,oBAAoB,gBAAgBA,CAAa;AAAA,IAAA,GACtE,CAACZ,CAAsB,CAAC,GAEvBR,IAEI,gBAAAsB;AAAA,MAACC;AAAAA,MAAA;AAAA,QACG,IAAAxB;AAAA,QACA,OAAAE;AAAA,QACA,QAAQ;AAAA,QACR,aAAAG;AAAA,QACA,SAAAC;AAAA,QACA,gBAAgBS;AAAA,QAChB,cAAcH;AAAA,QACd,4BAA4BI;AAAA,MAAA;AAAA,IAAA,sBAIhCS,GAAe,EAAA,OAAAvB,GAAc,SAAAC,GAAkB,KAAAC,GAAU,MAAMI,GAAoB,SAAAF,EAAkB,CAAA;AAAA,EACjH;AACJ;AACAR,EAAuB,cAAc;AAExB,MAAA4B,IAAiB,CAACC,MAA+B;AACpD,QAAAC,IAAMC,EAAuB,IAAI,GACjC,CAACC,GAAoBC,CAAqB,IAAIpB,EAAS,EAAK,GAE5D,EAAE,WAAAqB,GAAW,GAAGC,EAAA,IAAqBN,GAErCO,IAA6BrB,EAAY,CAACsB,MAA0B;AACtE,IAAIA,KACAJ,EAAsB,EAAI;AAAA,EAElC,GAAG,CAAE,CAAA;AAEL,SAAAK,EAAgB,EAAE,KAAAR,GAAK,UAAU,CAACI,GAAW,UAAUE,GAA4B,GAEnFd,EAAU,MAAM;AACZ,IAAKY,KACDD,EAAsB,EAAK;AAAA,EAC/B,GACD,CAACC,CAAS,CAAC,GAGT,gBAAAT,EAAA,OAAA,EAAI,WAAU,sBAAqB,KAAAK,GAChC,UAAA,gBAAAL,EAACzB,GAAwB,EAAA,GAAGmC,GAAkB,WAAWD,KAAaF,EAAA,CAAoB,EAC9F,CAAA;AAER;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { serializeRawToHtmlAsync as i } from "@frontify/fondue";
|
|
3
|
+
import { useState as w, useEffect as o } from "react";
|
|
4
4
|
const d = ({ value: e = "", gap: l, columns: r, show: m = !0, plugins: a }) => {
|
|
5
|
-
const [t, n] =
|
|
6
|
-
return
|
|
7
|
-
(async () => n(await
|
|
5
|
+
const [t, n] = w(null);
|
|
6
|
+
return o(() => {
|
|
7
|
+
(async () => n(await i(e, a, r, l)))();
|
|
8
8
|
}, [e, r, l, a]), !m || t === "<br />" ? null : t !== null ? /* @__PURE__ */ s(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerializedText.es.js","sources":["../../../src/components/RichTextEditor/SerializedText.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {
|
|
1
|
+
{"version":3,"file":"SerializedText.es.js","sources":["../../../src/components/RichTextEditor/SerializedText.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { serializeRawToHtmlAsync } from '@frontify/fondue';\nimport { useEffect, useState } from 'react';\n\nimport { type SerializedTextProps } from './types';\n\nexport const SerializedText = ({ value = '', gap, columns, show = true, plugins }: SerializedTextProps) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n (async () => {\n setHtml(await serializeRawToHtmlAsync(value, plugins, columns, gap));\n })();\n }, [value, columns, gap, plugins]);\n\n if (!show || html === '<br />') {\n return null;\n }\n\n return html !== null ? (\n <div\n className=\"tw-w-full tw-whitespace-pre-wrap\"\n data-test-id=\"rte-content-html\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n ) : (\n <div className=\"tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full\" />\n );\n};\n"],"names":["SerializedText","value","gap","columns","show","plugins","html","setHtml","useState","useEffect","serializeRawToHtmlAsync","jsx"],"mappings":";;;AAOa,MAAAA,IAAiB,CAAC,EAAE,OAAAC,IAAQ,IAAI,KAAAC,GAAK,SAAAC,GAAS,MAAAC,IAAO,IAAM,SAAAC,QAAmC;AACvG,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAwB,IAAI;AAQhD,SANJC,EAAU,MAAM;AACZ,KAAC,YACGF,EAAQ,MAAMG,EAAwBT,GAAOI,GAASF,GAASD,CAAG,CAAC;AAAA,KAExE,CAACD,GAAOE,GAASD,GAAKG,CAAO,CAAC,GAE7B,CAACD,KAAQE,MAAS,WACX,OAGJA,MAAS,OACZ,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,gBAAa;AAAA,MACb,yBAAyB,EAAE,QAAQL,EAAK;AAAA,IAAA;AAAA,EAG5C,IAAA,gBAAAK,EAAC,OAAI,EAAA,WAAU,oFAAoF,CAAA;AAE3G;"}
|
package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultPluginsWithLinkChooser.es.js","sources":["../../../../src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n AutoformatPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n OrderedListPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n UnorderedListPlugin,\n} from '@frontify/fondue';\nimport { ButtonPlugin, LinkPlugin, TextStylePluginsWithoutImage, TextStylesWithoutImage } from '../plugins';\n\nexport const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {\n return new PluginComposer()\n .setPlugin(\n new SoftBreakPlugin(),\n new TextStylePlugin({\n textStyles: TextStylePluginsWithoutImage,\n }),\n )\n .setPlugin(\n [\n new BoldPlugin(),\n new ItalicPlugin(),\n new UnderlinePlugin(),\n new StrikethroughPlugin(),\n new LinkPlugin({ appBridge }),\n new ButtonPlugin({ appBridge }),\n new CodePlugin(),\n ],\n [\n new AlignLeftPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignCenterPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignRightPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignJustifyPlugin({ validTypes: TextStylesWithoutImage }),\n new UnorderedListPlugin(),\n new CheckboxListPlugin(),\n new OrderedListPlugin(),\n new ResetFormattingPlugin(),\n new AutoformatPlugin(),\n ],\n );\n};\n"],"names":["getDefaultPluginsWithLinkChooser","appBridge","PluginComposer","SoftBreakPlugin","TextStylePlugin","TextStylePluginsWithoutImage","BoldPlugin","ItalicPlugin","UnderlinePlugin","StrikethroughPlugin","LinkPlugin","ButtonPlugin","CodePlugin","AlignLeftPlugin","TextStylesWithoutImage","AlignCenterPlugin","AlignRightPlugin","AlignJustifyPlugin","UnorderedListPlugin","CheckboxListPlugin","OrderedListPlugin","ResetFormattingPlugin","AutoformatPlugin"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"defaultPluginsWithLinkChooser.es.js","sources":["../../../../src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n AutoformatPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n OrderedListPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n UnorderedListPlugin,\n} from '@frontify/fondue';\n\nimport { ButtonPlugin, LinkPlugin, TextStylePluginsWithoutImage, TextStylesWithoutImage } from '../plugins';\n\nexport const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {\n return new PluginComposer()\n .setPlugin(\n new SoftBreakPlugin(),\n new TextStylePlugin({\n textStyles: TextStylePluginsWithoutImage,\n }),\n )\n .setPlugin(\n [\n new BoldPlugin(),\n new ItalicPlugin(),\n new UnderlinePlugin(),\n new StrikethroughPlugin(),\n new LinkPlugin({ appBridge }),\n new ButtonPlugin({ appBridge }),\n new CodePlugin(),\n ],\n [\n new AlignLeftPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignCenterPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignRightPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignJustifyPlugin({ validTypes: TextStylesWithoutImage }),\n new UnorderedListPlugin(),\n new CheckboxListPlugin(),\n new OrderedListPlugin(),\n new ResetFormattingPlugin(),\n new AutoformatPlugin(),\n ],\n );\n};\n"],"names":["getDefaultPluginsWithLinkChooser","appBridge","PluginComposer","SoftBreakPlugin","TextStylePlugin","TextStylePluginsWithoutImage","BoldPlugin","ItalicPlugin","UnderlinePlugin","StrikethroughPlugin","LinkPlugin","ButtonPlugin","CodePlugin","AlignLeftPlugin","TextStylesWithoutImage","AlignCenterPlugin","AlignRightPlugin","AlignJustifyPlugin","UnorderedListPlugin","CheckboxListPlugin","OrderedListPlugin","ResetFormattingPlugin","AutoformatPlugin"],"mappings":";;;;AAyBa,MAAAA,IAAmC,CAACC,MACtC,IAAIC,IACN;AAAA,EACG,IAAIC,EAAgB;AAAA,EACpB,IAAIC,EAAgB;AAAA,IAChB,YAAYC;AAAA,EAAA,CACf;AAAA,EAEJ;AAAA,EACG;AAAA,IACI,IAAIC,EAAW;AAAA,IACf,IAAIC,EAAa;AAAA,IACjB,IAAIC,EAAgB;AAAA,IACpB,IAAIC,EAAoB;AAAA,IACxB,IAAIC,EAAW,EAAE,WAAAT,GAAW;AAAA,IAC5B,IAAIU,EAAa,EAAE,WAAAV,GAAW;AAAA,IAC9B,IAAIW,EAAW;AAAA,EACnB;AAAA,EACA;AAAA,IACI,IAAIC,EAAgB,EAAE,YAAYC,GAAwB;AAAA,IAC1D,IAAIC,EAAkB,EAAE,YAAYD,GAAwB;AAAA,IAC5D,IAAIE,EAAiB,EAAE,YAAYF,GAAwB;AAAA,IAC3D,IAAIG,EAAmB,EAAE,YAAYH,GAAwB;AAAA,IAC7D,IAAII,EAAoB;AAAA,IACxB,IAAIC,EAAmB;AAAA,IACvB,IAAIC,EAAkB;AAAA,IACtB,IAAIC,EAAsB;AAAA,IAC1B,IAAIC,EAAiB;AAAA,EACzB;AAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonMarkupElementNode.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlateRenderElementProps, Value } from '@frontify/fondue';\nimport { CSSProperties, HTMLAttributeAnchorTarget, ReactElement, ReactNode, useState } from 'react';\nimport { TButtonElement } from '../types';\nimport { BlockButtonStyles } from '../utils';\n\nexport type ButtonRootProps = PlateRenderElementProps<Value, TButtonElement>;\n\nexport const ButtonMarkupElementNode = (props: ButtonRootProps) => {\n const { attributes, children } = props;\n const href = props.element.url || props.element.chosenLink?.searchResult?.link || '';\n const target = props.element.target || '_self';\n const buttonStyle = String(props.element.buttonStyle) || 'primary';\n return (\n <HoverableButtonLink\n attributes={attributes}\n href={href}\n target={target}\n styles={BlockButtonStyles[`button${buttonStyle.charAt(0).toUpperCase() + buttonStyle.slice(1)}`]}\n >\n {children}\n </HoverableButtonLink>\n );\n};\n\ntype Props = {\n attributes: ButtonRootProps['attributes'];\n children: ReactNode;\n styles?: CSSProperties & { hover?: CSSProperties };\n href?: string;\n target?: HTMLAttributeAnchorTarget;\n};\n\nconst HoverableButtonLink = ({\n attributes,\n styles = { hover: {} },\n children,\n href = '#',\n target,\n}: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n\n return (\n <a\n {...attributes}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n href={href}\n target={target}\n style={hovered ? { ...styles, ...styles.hover } : styles}\n >\n {children}\n </a>\n );\n};\n"],"names":["ButtonMarkupElementNode","props","attributes","children","href","_b","_a","target","buttonStyle","jsx","HoverableButtonLink","BlockButtonStyles","styles","hovered","setHovered","useState"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ButtonMarkupElementNode.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlateRenderElementProps, type Value } from '@frontify/fondue';\nimport { type CSSProperties, type HTMLAttributeAnchorTarget, type ReactElement, type ReactNode, useState } from 'react';\n\nimport { type TButtonElement } from '../types';\nimport { BlockButtonStyles } from '../utils';\n\nexport type ButtonRootProps = PlateRenderElementProps<Value, TButtonElement>;\n\nexport const ButtonMarkupElementNode = (props: ButtonRootProps) => {\n const { attributes, children } = props;\n const href = props.element.url || props.element.chosenLink?.searchResult?.link || '';\n const target = props.element.target || '_self';\n const buttonStyle = String(props.element.buttonStyle) || 'primary';\n return (\n <HoverableButtonLink\n attributes={attributes}\n href={href}\n target={target}\n styles={BlockButtonStyles[`button${buttonStyle.charAt(0).toUpperCase() + buttonStyle.slice(1)}`]}\n >\n {children}\n </HoverableButtonLink>\n );\n};\n\ntype Props = {\n attributes: ButtonRootProps['attributes'];\n children: ReactNode;\n styles?: CSSProperties & { hover?: CSSProperties };\n href?: string;\n target?: HTMLAttributeAnchorTarget;\n};\n\nconst HoverableButtonLink = ({\n attributes,\n styles = { hover: {} },\n children,\n href = '#',\n target,\n}: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n\n return (\n <a\n {...attributes}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n href={href}\n target={target}\n style={hovered ? { ...styles, ...styles.hover } : styles}\n >\n {children}\n </a>\n );\n};\n"],"names":["ButtonMarkupElementNode","props","attributes","children","href","_b","_a","target","buttonStyle","jsx","HoverableButtonLink","BlockButtonStyles","styles","hovered","setHovered","useState"],"mappings":";;;AAUa,MAAAA,IAA0B,CAACC,MAA2B;;AACzD,QAAA,EAAE,YAAAC,GAAY,UAAAC,EAAa,IAAAF,GAC3BG,IAAOH,EAAM,QAAQ,SAAOI,KAAAC,IAAAL,EAAM,QAAQ,eAAd,gBAAAK,EAA0B,iBAA1B,gBAAAD,EAAwC,SAAQ,IAC5EE,IAASN,EAAM,QAAQ,UAAU,SACjCO,IAAc,OAAOP,EAAM,QAAQ,WAAW,KAAK;AAErD,SAAA,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,YAAAR;AAAA,MACA,MAAAE;AAAA,MACA,QAAAG;AAAA,MACA,QAAQI,EAAkB,SAASH,EAAY,OAAO,CAAC,EAAE,YAAgB,IAAAA,EAAY,MAAM,CAAC,CAAC,EAAE;AAAA,MAE9F,UAAAL;AAAA,IAAA;AAAA,EAAA;AAGb,GAUMO,IAAsB,CAAC;AAAA,EACzB,YAAAR;AAAA,EACA,QAAAU,IAAS,EAAE,OAAO,GAAG;AAAA,EACrB,UAAAT;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAG;AACJ,MAA2B;AACvB,QAAM,CAACM,GAASC,CAAU,IAAIC,EAAS,EAAK;AAGxC,SAAA,gBAAAN;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGP;AAAA,MACJ,cAAc,MAAMY,EAAW,EAAI;AAAA,MACnC,cAAc,MAAMA,EAAW,EAAK;AAAA,MACpC,MAAAV;AAAA,MACA,QAAAG;AAAA,MACA,OAAOM,IAAU,EAAE,GAAGD,GAAQ,GAAGA,EAAO,UAAUA;AAAA,MAEjD,UAAAT;AAAA,IAAA;AAAA,EAAA;AAGb;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MarkupElement } from '@frontify/fondue';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { ButtonMarkupElementNode } from './ButtonMarkupElementNode';\n\nexport class ButtonMarkupElement extends MarkupElement {\n constructor(id = ELEMENT_BUTTON, node = ButtonMarkupElementNode) {\n super(id, node);\n }\n}\n"],"names":["ButtonMarkupElement","MarkupElement","id","ELEMENT_BUTTON","node","ButtonMarkupElementNode"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MarkupElement } from '@frontify/fondue';\n\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nimport { ButtonMarkupElementNode } from './ButtonMarkupElementNode';\n\nexport class ButtonMarkupElement extends MarkupElement {\n constructor(id = ELEMENT_BUTTON, node = ButtonMarkupElementNode) {\n super(id, node);\n }\n}\n"],"names":["ButtonMarkupElement","MarkupElement","id","ELEMENT_BUTTON","node","ButtonMarkupElementNode"],"mappings":";;;AAQO,MAAMA,UAA4BC,EAAc;AAAA,EACnD,YAAYC,IAAKC,GAAgBC,IAAOC,GAAyB;AAC7D,UAAMH,GAAIE,CAAI;AAAA,EAClB;AACJ;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n PluginButtonProps,\n getHotkeyByPlatform,\n getPluginType,\n getTooltip,\n isRangeInSameBlock,\n someNode,\n useEditorState,\n useEventPlateId,\n} from '@frontify/fondue';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { ButtonToolbarButton } from './ButtonToolbarButton';\n\nexport const ButtonButton = ({ editorId, id }: PluginButtonProps) => {\n const editor = useEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n const type = getPluginType(editor, ELEMENT_BUTTON);\n const isLink = !!editor?.selection && someNode(editor, { match: { type } });\n\n return (\n <div data-plugin-id={id}>\n <ButtonToolbarButton\n pressed={isLink}\n disabled={!isEnabled} // maybe pressed\n tooltip={getTooltip(\n isEnabled\n ? `Button\\n${getHotkeyByPlatform('Ctrl+Shift+K')}`\n : 'Buttons can only be set for a single text block.',\n )}\n />\n </div>\n );\n};\n"],"names":["ButtonButton","editorId","id","editor","useEditorState","useEventPlateId","isEnabled","isRangeInSameBlock","type","getPluginType","ELEMENT_BUTTON","isLink","someNode","jsx","ButtonToolbarButton","getTooltip","getHotkeyByPlatform"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ButtonButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PluginButtonProps,\n getHotkeyByPlatform,\n getPluginType,\n getTooltip,\n isRangeInSameBlock,\n someNode,\n useEditorState,\n useEventPlateId,\n} from '@frontify/fondue';\n\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nimport { ButtonToolbarButton } from './ButtonToolbarButton';\n\nexport const ButtonButton = ({ editorId, id }: PluginButtonProps) => {\n const editor = useEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n const type = getPluginType(editor, ELEMENT_BUTTON);\n const isLink = !!editor?.selection && someNode(editor, { match: { type } });\n\n return (\n <div data-plugin-id={id}>\n <ButtonToolbarButton\n pressed={isLink}\n disabled={!isEnabled} // maybe pressed\n tooltip={getTooltip(\n isEnabled\n ? `Button\\n${getHotkeyByPlatform('Ctrl+Shift+K')}`\n : 'Buttons can only be set for a single text block.',\n )}\n />\n </div>\n );\n};\n"],"names":["ButtonButton","editorId","id","editor","useEditorState","useEventPlateId","isEnabled","isRangeInSameBlock","type","getPluginType","ELEMENT_BUTTON","isLink","someNode","jsx","ButtonToolbarButton","getTooltip","getHotkeyByPlatform"],"mappings":";;;;AAiBO,MAAMA,IAAe,CAAC,EAAE,UAAAC,GAAU,IAAAC,QAA4B;AACjE,QAAMC,IAASC,EAAeC,EAAgBJ,CAAQ,CAAC,GACjDK,IAAY,CAAC,CAACC,EAAmBJ,GAAQ;AAAA,IAC3C,IAAIA,EAAO;AAAA,EAAA,CACd,GACKK,IAAOC,EAAcN,GAAQO,CAAc,GAC3CC,IAAS,CAAC,EAACR,KAAA,QAAAA,EAAQ,cAAaS,EAAST,GAAQ,EAAE,OAAO,EAAE,MAAAK,EAAK,EAAG,CAAA;AAGtE,SAAA,gBAAAK,EAAC,OAAI,EAAA,kBAAgBX,GACjB,UAAA,gBAAAW;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,SAASH;AAAA,MACT,UAAU,CAACL;AAAA,MACX,SAASS;AAAA,QACLT,IACM;AAAA,EAAWU,EAAoB,cAAc,CAAC,KAC9C;AAAA,MACV;AAAA,IAAA;AAAA,EAER,EAAA,CAAA;AAER;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonToolbarButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconButton16, IconStylingWrapper, ToolbarButton, focusEditor, useEditorRef } from '@frontify/fondue';\
|
|
1
|
+
{"version":3,"file":"ButtonToolbarButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconButton16, IconStylingWrapper, ToolbarButton, focusEditor, useEditorRef } from '@frontify/fondue';\nimport { type ReactNode, forwardRef } from 'react';\n\nimport { triggerFloatingButton } from '../utils';\n\nexport const ButtonToolbarButton = forwardRef<\n HTMLButtonElement,\n { disabled: boolean; tooltip: ReactNode; pressed: boolean }\n>((rootProps, ref) => {\n const editor = useEditorRef();\n\n return (\n <ToolbarButton\n ref={ref}\n {...rootProps}\n onMouseDown={() => {\n focusEditor(editor, editor.selection ?? editor.prevSelection ?? undefined);\n }}\n onClick={() => {\n triggerFloatingButton(editor, { focused: true });\n }}\n >\n <IconStylingWrapper icon={<IconButton16 />} />\n </ToolbarButton>\n );\n});\n\nButtonToolbarButton.displayName = 'ButtonToolbarButton';\n"],"names":["ButtonToolbarButton","forwardRef","rootProps","ref","editor","useEditorRef","jsx","ToolbarButton","focusEditor","triggerFloatingButton","IconStylingWrapper","IconButton16"],"mappings":";;;;AAOO,MAAMA,IAAsBC,EAGjC,CAACC,GAAWC,MAAQ;AAClB,QAAMC,IAASC;AAGX,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAAJ;AAAA,MACC,GAAGD;AAAA,MACJ,aAAa,MAAM;AACf,QAAAM,EAAYJ,GAAQA,EAAO,aAAaA,EAAO,iBAAiB,MAAS;AAAA,MAC7E;AAAA,MACA,SAAS,MAAM;AACX,QAAAK,EAAsBL,GAAQ,EAAE,SAAS,GAAM,CAAA;AAAA,MACnD;AAAA,MAEA,UAAC,gBAAAE,EAAAI,GAAA,EAAmB,MAAM,gBAAAJ,EAACK,IAAa,CAAA,GAAI;AAAA,IAAA;AAAA,EAAA;AAGxD,CAAC;AAEDX,EAAoB,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as l, Fragment as u, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { offset as g, flip as B, useEditorRef as E } from "@frontify/fondue";
|
|
3
|
+
import { EditModal as F } from "./EditButtonModal/EditModal.es.js";
|
|
4
|
+
import { InsertButtonModal as b } from "./InsertButtonModal/InsertButtonModal.es.js";
|
|
5
5
|
import { useFloatingButtonInsert as h } from "./useFloatingButtonInsert.es.js";
|
|
6
6
|
import { useFloatingButtonEdit as x } from "./useFloatingButtonEdit.es.js";
|
|
7
7
|
import { useFloatingButtonSelectors as O } from "./floatingButtonStore.es.js";
|
|
@@ -9,14 +9,14 @@ const r = {
|
|
|
9
9
|
placement: "bottom-start",
|
|
10
10
|
strategy: "absolute",
|
|
11
11
|
middleware: [
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
g(12),
|
|
13
|
+
B({
|
|
14
14
|
padding: 12,
|
|
15
15
|
fallbackPlacements: ["bottom-end", "top-start", "top-end"]
|
|
16
16
|
})
|
|
17
17
|
]
|
|
18
18
|
}, k = () => {
|
|
19
|
-
const { ref: s, ...d } = h(r), { ref: m, ...a } = x(r), f =
|
|
19
|
+
const { ref: s, ...d } = h(r), { ref: m, ...a } = x(r), f = E(), o = O(), e = o.isOpen(f.id), p = o.isEditing(), n = o.mode(), i = /* @__PURE__ */ t(b, {}), c = p ? i : /* @__PURE__ */ t(F, {});
|
|
20
20
|
return /* @__PURE__ */ l(u, { children: [
|
|
21
21
|
e && n === "insert" && /* @__PURE__ */ t("div", { ref: s, ...d, children: i }),
|
|
22
22
|
e && n === "edit" && /* @__PURE__ */ t("div", { ref: m, ...a, children: c })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFloatingButton.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {
|
|
1
|
+
{"version":3,"file":"CustomFloatingButton.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type UseVirtualFloatingOptions, flip, offset, useEditorRef } from '@frontify/fondue';\n\nimport { useFloatingButtonEdit, useFloatingButtonInsert, useFloatingButtonSelectors } from '../FloatingButton';\n\nimport { EditModal } from './EditButtonModal/EditModal';\nimport { InsertButtonModal } from './InsertButtonModal/InsertButtonModal';\n\nconst floatingOptions: UseVirtualFloatingOptions = {\n placement: 'bottom-start',\n strategy: 'absolute',\n middleware: [\n offset(12),\n flip({\n padding: 12,\n fallbackPlacements: ['bottom-end', 'top-start', 'top-end'],\n }),\n ],\n};\n\nexport const CustomFloatingButton = () => {\n const { ref: insertRef, ...insertProps } = useFloatingButtonInsert(floatingOptions);\n const { ref: editRef, ...editProps } = useFloatingButtonEdit(floatingOptions);\n const editor = useEditorRef();\n const state = useFloatingButtonSelectors();\n const isOpen = state.isOpen(editor.id);\n const isEditing = state.isEditing();\n const mode = state.mode();\n\n const input = <InsertButtonModal />;\n const editContent = isEditing ? input : <EditModal />;\n\n return (\n <>\n {isOpen && mode === 'insert' && (\n <div ref={insertRef} {...insertProps}>\n {input}\n </div>\n )}\n\n {isOpen && mode === 'edit' && (\n <div ref={editRef} {...editProps}>\n {editContent}\n </div>\n )}\n </>\n );\n};\n"],"names":["floatingOptions","offset","flip","CustomFloatingButton","insertRef","insertProps","useFloatingButtonInsert","editRef","editProps","useFloatingButtonEdit","editor","useEditorRef","state","useFloatingButtonSelectors","isOpen","isEditing","mode","input","InsertButtonModal","editContent","jsx","EditModal","jsxs","Fragment"],"mappings":";;;;;;;AASA,MAAMA,IAA6C;AAAA,EAC/C,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,IACRC,EAAO,EAAE;AAAA,IACTC,EAAK;AAAA,MACD,SAAS;AAAA,MACT,oBAAoB,CAAC,cAAc,aAAa,SAAS;AAAA,IAAA,CAC5D;AAAA,EACL;AACJ,GAEaC,IAAuB,MAAM;AACtC,QAAM,EAAE,KAAKC,GAAW,GAAGC,EAAY,IAAIC,EAAwBN,CAAe,GAC5E,EAAE,KAAKO,GAAS,GAAGC,EAAU,IAAIC,EAAsBT,CAAe,GACtEU,IAASC,KACTC,IAAQC,KACRC,IAASF,EAAM,OAAOF,EAAO,EAAE,GAC/BK,IAAYH,EAAM,aAClBI,IAAOJ,EAAM,QAEbK,sBAASC,GAAkB,CAAA,CAAA,GAC3BC,IAAcJ,IAAYE,IAAQ,gBAAAG,EAACC,GAAU,CAAA,CAAA;AAEnD,SAES,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAUT,KAAAE,MAAS,YACf,gBAAAI,EAAA,OAAA,EAAI,KAAKhB,GAAY,GAAGC,GACpB,UACLY,EAAA,CAAA;AAAA,IAGHH,KAAUE,MAAS,UAChB,gBAAAI,EAAC,SAAI,KAAKb,GAAU,GAAGC,GAClB,UACLW,EAAA,CAAA;AAAA,EAER,EAAA,CAAA;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FloatingModalWrapper, IconPen16, IconTrashBin16, focusEditor, useEditorRef } from '@frontify/fondue';\n\nimport {
|
|
1
|
+
{"version":3,"file":"EditModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FloatingModalWrapper, IconPen16, IconTrashBin16, focusEditor, useEditorRef } from '@frontify/fondue';\n\nimport { unwrapButton } from '../../../transforms';\nimport { triggerFloatingButtonEdit } from '../../../utils';\nimport { floatingButtonSelectors } from '../floatingButtonStore';\n\nexport const EditModal = () => {\n const editor = useEditorRef();\n return (\n <FloatingModalWrapper padding=\"16px\" minWidth=\"400px\" data-test-id=\"floating-button-edit\">\n <span data-test-id=\"preview-button-flyout\" className=\"tw-flex tw-justify-between tw-items-center\">\n <span className=\"tw-pointer-events-none\">{floatingButtonSelectors.url()}</span>\n <span className=\"tw-flex tw-gap-2\">\n <button\n onClick={() => {\n triggerFloatingButtonEdit(editor);\n }}\n tabIndex={0}\n data-test-id=\"edit-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <IconPen16 />\n </button>\n\n <button\n onClick={() => {\n unwrapButton(editor);\n focusEditor(editor, editor.selection ?? undefined);\n }}\n tabIndex={0}\n data-test-id=\"remove-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <IconTrashBin16 />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"names":["EditModal","editor","useEditorRef","jsx","FloatingModalWrapper","jsxs","floatingButtonSelectors","triggerFloatingButtonEdit","IconPen16","unwrapButton","focusEditor","IconTrashBin16"],"mappings":";;;;;AAQO,MAAMA,IAAY,MAAM;AAC3B,QAAMC,IAASC;AACf,SACK,gBAAAC,EAAAC,GAAA,EAAqB,SAAQ,QAAO,UAAS,SAAQ,gBAAa,wBAC/D,UAAC,gBAAAC,EAAA,QAAA,EAAK,gBAAa,yBAAwB,WAAU,8CACjD,UAAA;AAAA,IAAA,gBAAAF,EAAC,QAAK,EAAA,WAAU,0BAA0B,UAAAG,EAAwB,OAAM;AAAA,IACxE,gBAAAD,EAAC,QAAK,EAAA,WAAU,oBACZ,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,SAAS,MAAM;AACX,YAAAI,EAA0BN,CAAM;AAAA,UACpC;AAAA,UACA,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UAEV,4BAACO,GAAU,EAAA;AAAA,QAAA;AAAA,MACf;AAAA,MAEA,gBAAAL;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,SAAS,MAAM;AACX,YAAAM,EAAaR,CAAM,GACPS,EAAAT,GAAQA,EAAO,aAAa,MAAS;AAAA,UACrD;AAAA,UACA,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UAEV,4BAACU,GAAe,EAAA;AAAA,QAAA;AAAA,MACpB;AAAA,IAAA,GACJ;AAAA,EAAA,EACJ,CAAA,EACJ,CAAA;AAER;"}
|
|
@@ -2,8 +2,8 @@ import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
|
2
2
|
import { FormControl as m } from "@frontify/fondue";
|
|
3
3
|
import { useState as y } from "react";
|
|
4
4
|
import { InsertModal as f } from "../../../../LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js";
|
|
5
|
-
import { useInsertModal as p } from "./useInsertModal.es.js";
|
|
6
5
|
import { BlockStyles as n } from "../../../../styles.es.js";
|
|
6
|
+
import { useInsertModal as p } from "./useInsertModal.es.js";
|
|
7
7
|
const g = () => {
|
|
8
8
|
const r = p(), { state: t, onButtonStyleChange: o } = r;
|
|
9
9
|
return /* @__PURE__ */ e(f, { ...r, testId: "floating-button-insert", children: /* @__PURE__ */ e("div", { className: "tw-pt-5", children: /* @__PURE__ */ d(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsertButtonModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FormControl } from '@frontify/fondue';\nimport { CSSProperties, ReactElement, ReactNode, useState } from 'react';\nimport { InsertModal } from '../../../../LinkPlugin/FloatingLink/InsertLinkModal/InsertModal';\nimport {
|
|
1
|
+
{"version":3,"file":"InsertButtonModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FormControl } from '@frontify/fondue';\nimport { type CSSProperties, type ReactElement, type ReactNode, useState } from 'react';\n\nimport { InsertModal } from '../../../../LinkPlugin/FloatingLink/InsertLinkModal/InsertModal';\nimport { BlockStyles } from '../../../../styles';\n\nimport { useInsertModal } from './useInsertModal';\n\nexport const InsertButtonModal = () => {\n const modalProps = useInsertModal();\n const { state, onButtonStyleChange } = modalProps;\n\n return (\n <InsertModal {...modalProps} testId=\"floating-button-insert\">\n <div className=\"tw-pt-5\">\n <FormControl\n label={{\n children: 'Button Style',\n htmlFor: 'buttonStyle',\n required: true,\n }}\n >\n <HoverableButton\n id=\"primary\"\n styles={BlockStyles.buttonPrimary}\n isActive={state.buttonStyle === 'primary'}\n onClick={() => onButtonStyleChange('primary')}\n >\n {state.text || 'Primary Button'}\n </HoverableButton>\n\n <HoverableButton\n id=\"secondary\"\n styles={BlockStyles.buttonSecondary}\n isActive={state.buttonStyle === 'secondary'}\n onClick={() => onButtonStyleChange('secondary')}\n >\n {state.text || 'Secondary Button'}\n </HoverableButton>\n\n <HoverableButton\n id=\"tertiary\"\n styles={BlockStyles.buttonTertiary}\n isActive={state.buttonStyle === 'tertiary'}\n onClick={() => onButtonStyleChange('tertiary')}\n >\n {state.text || 'Tertiary Button'}\n </HoverableButton>\n </FormControl>\n </div>\n </InsertModal>\n );\n};\n\ntype Props = {\n id: string;\n styles?: CSSProperties & { hover?: CSSProperties };\n isActive: boolean;\n onClick: () => void;\n children: ReactNode;\n};\n\nconst HoverableButton = ({ id, styles, isActive, onClick, children }: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n const getStyles = () => (styles && styles.hover && hovered ? { ...styles, ...styles.hover } : styles);\n\n return (\n <button\n data-test-id={`floating-button-insert-${id}`}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={onClick}\n style={{ ...getStyles(), marginTop: 0, marginBottom: 0 }}\n className={\n isActive ? 'tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit' : 'tw-w-fit'\n }\n >\n {children}\n </button>\n );\n};\n"],"names":["InsertButtonModal","modalProps","useInsertModal","state","onButtonStyleChange","jsx","InsertModal","jsxs","FormControl","HoverableButton","BlockStyles","id","styles","isActive","onClick","children","hovered","setHovered","useState","getStyles"],"mappings":";;;;;;AAUO,MAAMA,IAAoB,MAAM;AACnC,QAAMC,IAAaC,KACb,EAAE,OAAAC,GAAO,qBAAAC,EAAwB,IAAAH;AAGnC,SAAA,gBAAAI,EAACC,KAAa,GAAGL,GAAY,QAAO,0BAChC,UAAA,gBAAAI,EAAC,OAAI,EAAA,WAAU,WACX,UAAA,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,OAAO;AAAA,QACH,UAAU;AAAA,QACV,SAAS;AAAA,QACT,UAAU;AAAA,MACd;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAH;AAAA,UAACI;AAAA,UAAA;AAAA,YACG,IAAG;AAAA,YACH,QAAQC,EAAY;AAAA,YACpB,UAAUP,EAAM,gBAAgB;AAAA,YAChC,SAAS,MAAMC,EAAoB,SAAS;AAAA,YAE3C,YAAM,QAAQ;AAAA,UAAA;AAAA,QACnB;AAAA,QAEA,gBAAAC;AAAA,UAACI;AAAA,UAAA;AAAA,YACG,IAAG;AAAA,YACH,QAAQC,EAAY;AAAA,YACpB,UAAUP,EAAM,gBAAgB;AAAA,YAChC,SAAS,MAAMC,EAAoB,WAAW;AAAA,YAE7C,YAAM,QAAQ;AAAA,UAAA;AAAA,QACnB;AAAA,QAEA,gBAAAC;AAAA,UAACI;AAAA,UAAA;AAAA,YACG,IAAG;AAAA,YACH,QAAQC,EAAY;AAAA,YACpB,UAAUP,EAAM,gBAAgB;AAAA,YAChC,SAAS,MAAMC,EAAoB,UAAU;AAAA,YAE5C,YAAM,QAAQ;AAAA,UAAA;AAAA,QACnB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,EAER,CAAA,EACJ,CAAA;AAER,GAUMK,IAAkB,CAAC,EAAE,IAAAE,GAAI,QAAAC,GAAQ,UAAAC,GAAU,SAAAC,GAAS,UAAAC,QAAoC;AAC1F,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtCC,IAAY,MAAOP,KAAUA,EAAO,SAASI,IAAU,EAAE,GAAGJ,GAAQ,GAAGA,EAAO,MAAA,IAAUA;AAG1F,SAAA,gBAAAP;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,gBAAc,0BAA0BM,CAAE;AAAA,MAC1C,cAAc,MAAMM,EAAW,EAAI;AAAA,MACnC,cAAc,MAAMA,EAAW,EAAK;AAAA,MACpC,SAAAH;AAAA,MACA,OAAO,EAAE,GAAGK,KAAa,WAAW,GAAG,cAAc,EAAE;AAAA,MACvD,WACIN,IAAW,8EAA8E;AAAA,MAG5F,UAAAE;AAAA,IAAA;AAAA,EAAA;AAGb;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CheckboxState as r, useEditorRef as S, getPluginOptions as b, useHotkeys as h } from "@frontify/fondue";
|
|
2
|
+
import { useEffect as E, useReducer as g } from "react";
|
|
3
|
+
import { isValidUrlOrEmpty as i } from "../../../../../../Link/utils/url.es.js";
|
|
4
4
|
import { ELEMENT_BUTTON as B } from "../../../createButtonPlugin.es.js";
|
|
5
5
|
import { submitFloatingButton as U } from "../../../transforms/submitFloatingButton.es.js";
|
|
6
6
|
import { getButtonStyle as x } from "../../../utils/getButtonStyle.es.js";
|
|
7
|
-
import {
|
|
7
|
+
import { floatingButtonSelectors as u, floatingButtonActions as a } from "../floatingButtonStore.es.js";
|
|
8
8
|
import { addHttps as N } from "../../../../../../../helpers/addHttps.es.js";
|
|
9
9
|
const k = {
|
|
10
10
|
url: "",
|
|
@@ -12,7 +12,7 @@ const k = {
|
|
|
12
12
|
buttonStyle: "primary",
|
|
13
13
|
newTab: r.Unchecked
|
|
14
14
|
}, w = () => {
|
|
15
|
-
const [n, o] =
|
|
15
|
+
const [n, o] = g((e, s) => {
|
|
16
16
|
const { type: c, payload: l } = s;
|
|
17
17
|
switch (c) {
|
|
18
18
|
case "NEW_TAB":
|
|
@@ -39,8 +39,8 @@ const k = {
|
|
|
39
39
|
}, k);
|
|
40
40
|
return [n, o];
|
|
41
41
|
}, F = () => {
|
|
42
|
-
const n =
|
|
43
|
-
|
|
42
|
+
const n = S(), [o, e] = w();
|
|
43
|
+
E(() => {
|
|
44
44
|
const t = x(n);
|
|
45
45
|
e({
|
|
46
46
|
type: "INIT",
|
|
@@ -76,8 +76,8 @@ const k = {
|
|
|
76
76
|
return;
|
|
77
77
|
const f = N(o.url);
|
|
78
78
|
a.text(o.text), a.url(f), a.buttonStyle(o.buttonStyle), a.newTab(o.newTab === r.Checked), U(n) && (t == null || t.preventDefault());
|
|
79
|
-
}, p = o.url !== "" && o.text !== "", { appBridge: m } =
|
|
80
|
-
return
|
|
79
|
+
}, p = o.url !== "" && o.text !== "", { appBridge: m } = b(n, B);
|
|
80
|
+
return h(
|
|
81
81
|
"enter",
|
|
82
82
|
T,
|
|
83
83
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInsertModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {
|
|
1
|
+
{"version":3,"file":"useInsertModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport { CheckboxState, getPluginOptions, useEditorRef, useHotkeys } from '@frontify/fondue';\nimport { type Dispatch, type Reducer, useEffect, useReducer } from 'react';\n\nimport { addHttps } from '../../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../../../../../Link/utils/url';\nimport { ELEMENT_BUTTON } from '../../../createButtonPlugin';\nimport { submitFloatingButton } from '../../../transforms/submitFloatingButton';\nimport { type RichTextButtonStyle } from '../../../types';\nimport { getButtonStyle } from '../../../utils/getButtonStyle';\nimport { floatingButtonActions, floatingButtonSelectors } from '../floatingButtonStore';\n\nimport { type InsertModalDispatchType, type InsertModalStateProps } from './types';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n buttonStyle: 'primary',\n newTab: CheckboxState.Unchecked,\n};\n\nexport const InsertModalState = (): [InsertModalStateProps, Dispatch<InsertModalDispatchType>] => {\n const [state, dispatch] = useReducer<Reducer<InsertModalStateProps, InsertModalDispatchType>>((state, action) => {\n const { type, payload } = action;\n\n switch (type) {\n case 'NEW_TAB':\n return {\n ...state,\n newTab: CheckboxState.Checked,\n };\n case 'SAME_TAB':\n return {\n ...state,\n newTab: CheckboxState.Unchecked,\n };\n case 'URL':\n case 'TEXT':\n case 'BUTTON_STYLE':\n case 'INIT':\n return {\n ...state,\n ...payload,\n };\n default:\n return state;\n }\n }, initialState);\n\n return [state, dispatch];\n};\n\nexport const useInsertModal = () => {\n const editor = useEditorRef();\n const [state, dispatch] = InsertModalState();\n\n useEffect(() => {\n const buttonStyle = getButtonStyle(editor);\n\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingButtonSelectors.text(),\n buttonStyle,\n newTab: floatingButtonSelectors.newTab() ? CheckboxState.Checked : CheckboxState.Unchecked,\n url: floatingButtonSelectors.url(),\n },\n });\n }, [dispatch, editor]);\n\n const onTextChange = (value: string) => {\n dispatch({\n type: 'TEXT',\n payload: { text: value },\n });\n };\n\n const onButtonStyleChange = (value: RichTextButtonStyle) => {\n dispatch({\n type: 'BUTTON_STYLE',\n payload: { buttonStyle: value },\n });\n };\n\n const onUrlChange = (value: string) => {\n dispatch({\n type: 'URL',\n payload: { url: value },\n });\n };\n\n const onToggleTab = (checked: boolean) => {\n checked ? dispatch({ type: 'NEW_TAB' }) : dispatch({ type: 'SAME_TAB' });\n };\n\n const onCancel = () => {\n floatingButtonActions.reset();\n };\n\n const onSave = (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n const urlToSave = addHttps(state.url);\n\n floatingButtonActions.text(state.text);\n floatingButtonActions.url(urlToSave);\n floatingButtonActions.buttonStyle(state.buttonStyle);\n floatingButtonActions.newTab(state.newTab === CheckboxState.Checked);\n\n if (submitFloatingButton(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_BUTTON);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return {\n state,\n onTextChange,\n onButtonStyleChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n hasValues,\n isValidUrlOrEmpty,\n appBridge,\n };\n};\n"],"names":["initialState","CheckboxState","InsertModalState","state","dispatch","useReducer","action","type","payload","useInsertModal","editor","useEditorRef","useEffect","buttonStyle","getButtonStyle","floatingButtonSelectors","onTextChange","value","onButtonStyleChange","onUrlChange","onToggleTab","checked","onCancel","floatingButtonActions","onSave","event","isValidUrlOrEmpty","hasValues","urlToSave","addHttps","submitFloatingButton","appBridge","getPluginOptions","ELEMENT_BUTTON","useHotkeys"],"mappings":";;;;;;;;AAgBA,MAAMA,IAAsC;AAAA,EACxC,KAAK;AAAA,EACL,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQC,EAAc;AAC1B,GAEaC,IAAmB,MAAkE;AAC9F,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAoE,CAACF,GAAOG,MAAW;AACvG,UAAA,EAAE,MAAAC,GAAM,SAAAC,EAAY,IAAAF;AAE1B,YAAQC,GAAM;AAAA,MACV,KAAK;AACM,eAAA;AAAA,UACH,GAAGJ;AAAAA,UACH,QAAQF,EAAc;AAAA,QAAA;AAAA,MAE9B,KAAK;AACM,eAAA;AAAA,UACH,GAAGE;AAAAA,UACH,QAAQF,EAAc;AAAA,QAAA;AAAA,MAE9B,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACM,eAAA;AAAA,UACH,GAAGE;AAAAA,UACH,GAAGK;AAAA,QAAA;AAAA,MAEX;AACWL,eAAAA;AAAAA,IACf;AAAA,KACDH,CAAY;AAER,SAAA,CAACG,GAAOC,CAAQ;AAC3B,GAEaK,IAAiB,MAAM;AAChC,QAAMC,IAASC,KACT,CAACR,GAAOC,CAAQ,IAAIF,EAAiB;AAE3C,EAAAU,EAAU,MAAM;AACN,UAAAC,IAAcC,EAAeJ,CAAM;AAEhC,IAAAN,EAAA;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,QACL,MAAMW,EAAwB,KAAK;AAAA,QACnC,aAAAF;AAAA,QACA,QAAQE,EAAwB,OAAA,IAAWd,EAAc,UAAUA,EAAc;AAAA,QACjF,KAAKc,EAAwB,IAAI;AAAA,MACrC;AAAA,IAAA,CACH;AAAA,EAAA,GACF,CAACX,GAAUM,CAAM,CAAC;AAEf,QAAAM,IAAe,CAACC,MAAkB;AAC3B,IAAAb,EAAA;AAAA,MACL,MAAM;AAAA,MACN,SAAS,EAAE,MAAMa,EAAM;AAAA,IAAA,CAC1B;AAAA,EAAA,GAGCC,IAAsB,CAACD,MAA+B;AAC/C,IAAAb,EAAA;AAAA,MACL,MAAM;AAAA,MACN,SAAS,EAAE,aAAaa,EAAM;AAAA,IAAA,CACjC;AAAA,EAAA,GAGCE,IAAc,CAACF,MAAkB;AAC1B,IAAAb,EAAA;AAAA,MACL,MAAM;AAAA,MACN,SAAS,EAAE,KAAKa,EAAM;AAAA,IAAA,CACzB;AAAA,EAAA,GAGCG,IAAc,CAACC,MAAqB;AAC5B,IAAAjB,EAAAiB,IAAS,EAAE,MAAM,UAAU,IAAc,EAAE,MAAM,WAAA,CAArB;AAAA,EAAiC,GAGrEC,IAAW,MAAM;AACnB,IAAAC,EAAsB,MAAM;AAAA,EAAA,GAG1BC,IAAS,CAACC,MAAuF;AACnG,QAAI,CAACC,EAAkBvB,EAAM,GAAG,KAAK,CAACwB;AAClC;AAGE,UAAAC,IAAYC,EAAS1B,EAAM,GAAG;AAEd,IAAAoB,EAAA,KAAKpB,EAAM,IAAI,GACrCoB,EAAsB,IAAIK,CAAS,GACbL,EAAA,YAAYpB,EAAM,WAAW,GACnDoB,EAAsB,OAAOpB,EAAM,WAAWF,EAAc,OAAO,GAE/D6B,EAAqBpB,CAAM,MAC3Be,KAAA,QAAAA,EAAO;AAAA,EACX,GAGEE,IAAYxB,EAAM,QAAQ,MAAMA,EAAM,SAAS,IAE/C,EAAE,WAAA4B,EAAc,IAAAC,EAAgDtB,GAAQuB,CAAc;AAE5F,SAAAC;AAAA,IACI;AAAA,IACAV;AAAA,IACA;AAAA,MACI,kBAAkB,CAAC,OAAO;AAAA,IAC9B;AAAA,IACA,CAAC;AAAA,EAAA,GAGE;AAAA,IACH,OAAArB;AAAA,IACA,cAAAa;AAAA,IACA,qBAAAE;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAE;AAAA,IACA,QAAAE;AAAA,IACA,WAAAG;AAAA,IACA,mBAAAD;AAAA,IACA,WAAAK;AAAA,EAAA;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floatingButtonStore.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createStore } from '@frontify/fondue';\nimport { RichTextButtonStyle } from '../../types';\n\nexport type FloatingButtonMode = '' | 'insert' | 'edit';\n\nexport const floatingButtonStore: any = createStore('floatingButton')({\n openEditorId: null as null | string,\n mouseDown: false,\n updated: false,\n url: '',\n text: '',\n buttonStyle: 'primary' as RichTextButtonStyle,\n newTab: false,\n mode: '' as FloatingButtonMode,\n isEditing: false,\n})\n .extendActions((set) => ({\n reset: () => {\n set.url('');\n set.text('');\n set.buttonStyle('primary');\n set.newTab(false);\n set.mode('');\n set.isEditing(false);\n },\n }))\n .extendActions((set) => ({\n show: (mode: FloatingButtonMode, editorId: string) => {\n set.mode(mode);\n set.isEditing(false);\n set.openEditorId(editorId);\n },\n hide: () => {\n set.reset();\n set.openEditorId(null);\n },\n }))\n .extendSelectors((state) => ({\n isOpen: (editorId: string) => state.openEditorId === editorId,\n }));\n\nexport const floatingButtonActions = floatingButtonStore.set;\nexport const floatingButtonSelectors = floatingButtonStore.get;\nexport const useFloatingButtonSelectors = () => floatingButtonStore.use;\n"],"names":["floatingButtonStore","createStore","set","mode","editorId","state","floatingButtonActions","floatingButtonSelectors","useFloatingButtonSelectors"],"mappings":";
|
|
1
|
+
{"version":3,"file":"floatingButtonStore.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createStore } from '@frontify/fondue';\n\nimport { type RichTextButtonStyle } from '../../types';\n\nexport type FloatingButtonMode = '' | 'insert' | 'edit';\n\nexport const floatingButtonStore: any = createStore('floatingButton')({\n openEditorId: null as null | string,\n mouseDown: false,\n updated: false,\n url: '',\n text: '',\n buttonStyle: 'primary' as RichTextButtonStyle,\n newTab: false,\n mode: '' as FloatingButtonMode,\n isEditing: false,\n})\n .extendActions((set) => ({\n reset: () => {\n set.url('');\n set.text('');\n set.buttonStyle('primary');\n set.newTab(false);\n set.mode('');\n set.isEditing(false);\n },\n }))\n .extendActions((set) => ({\n show: (mode: FloatingButtonMode, editorId: string) => {\n set.mode(mode);\n set.isEditing(false);\n set.openEditorId(editorId);\n },\n hide: () => {\n set.reset();\n set.openEditorId(null);\n },\n }))\n .extendSelectors((state) => ({\n isOpen: (editorId: string) => state.openEditorId === editorId,\n }));\n\nexport const floatingButtonActions = floatingButtonStore.set;\nexport const floatingButtonSelectors = floatingButtonStore.get;\nexport const useFloatingButtonSelectors = () => floatingButtonStore.use;\n"],"names":["floatingButtonStore","createStore","set","mode","editorId","state","floatingButtonActions","floatingButtonSelectors","useFloatingButtonSelectors"],"mappings":";AAQa,MAAAA,IAA2BC,EAAY,gBAAgB,EAAE;AAAA,EAClE,cAAc;AAAA,EACd,WAAW;AAAA,EACX,SAAS;AAAA,EACT,KAAK;AAAA,EACL,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,WAAW;AACf,CAAC,EACI,cAAc,CAACC,OAAS;AAAA,EACrB,OAAO,MAAM;AACT,IAAAA,EAAI,IAAI,EAAE,GACVA,EAAI,KAAK,EAAE,GACXA,EAAI,YAAY,SAAS,GACzBA,EAAI,OAAO,EAAK,GAChBA,EAAI,KAAK,EAAE,GACXA,EAAI,UAAU,EAAK;AAAA,EACvB;AACJ,EAAE,EACD,cAAc,CAACA,OAAS;AAAA,EACrB,MAAM,CAACC,GAA0BC,MAAqB;AAClD,IAAAF,EAAI,KAAKC,CAAI,GACbD,EAAI,UAAU,EAAK,GACnBA,EAAI,aAAaE,CAAQ;AAAA,EAC7B;AAAA,EACA,MAAM,MAAM;AACR,IAAAF,EAAI,MAAM,GACVA,EAAI,aAAa,IAAI;AAAA,EACzB;AACJ,EAAE,EACD,gBAAgB,CAACG,OAAW;AAAA,EACzB,QAAQ,CAACD,MAAqBC,EAAM,iBAAiBD;AACzD,EAAE,GAEOE,IAAwBN,EAAoB,KAC5CO,IAA0BP,EAAoB,KAC9CQ,IAA6B,MAAMR,EAAoB;"}
|