@frontify/guideline-blocks-settings 0.28.1 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/components/Attachments/AttachmentItem.es.js +78 -78
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +86 -86
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +68 -68
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +34 -34
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar.es.js +33 -33
- package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.es.js +12 -12
- package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +22 -22
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
- package/dist/components/RichTextEditor/SerializedText.es.js +8 -8
- 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 +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +8 -8
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +10 -10
- 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 +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +19 -19
- 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 +30 -30
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +7 -7
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +30 -30
- 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 +8 -8
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.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/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/triggerFloatingButton.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 +11 -11
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +15 -15
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +3 -3
- 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 +40 -40
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +7 -7
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +29 -29
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +4 -4
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +20 -20
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +18 -18
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +16 -16
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +19 -19
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +15 -15
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +34 -34
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +28 -28
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +36 -36
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js +5 -5
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js +1 -1
- package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js.map +1 -1
- package/dist/helpers/addHttps.es.js.map +1 -1
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -1
- package/dist/helpers/hasRichTextValue.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/index.cjs.js +13 -246
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +13 -246
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js +1 -1
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js +1 -1
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js +1 -1
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/gutter.es.js +1 -1
- package/dist/settings/margin.es.js +1 -1
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js +1 -1
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js +1 -1
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js +1 -1
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityGlobalControl.es.js +1 -1
- package/dist/styles.css +1 -0
- package/dist/styles.css.es.js +5 -0
- package/dist/styles.css.es.js.map +1 -0
- package/dist/utilities/moveItemInArray.es.js.map +1 -1
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
- package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
- package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
- package/package.json +26 -24
- package/src/components/Attachments/AttachmentItem.tsx +2 -2
- package/src/components/Attachments/Attachments.spec.ct.tsx +4 -4
- package/src/components/Attachments/Attachments.tsx +2 -2
- package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +2 -2
- package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +8 -8
- package/src/components/BlockItemWrapper/Toolbar.tsx +1 -1
- package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +8 -8
- package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +3 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +5 -5
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +2 -2
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +2 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.spec.ts +24 -27
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/styles.ts +1 -1
- package/src/components/RichTextEditor/serializer/nodes/button.ts +2 -1
- package/src/components/RichTextEditor/serializer/nodes/checkItemNode.ts +3 -2
- package/src/components/RichTextEditor/serializer/nodes/default.ts +5 -4
- package/src/components/RichTextEditor/serializer/nodes/link.ts +4 -3
- package/src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts +5 -5
- package/src/components/RichTextEditor/serializer/serializeToHtml.ts +2 -2
- package/src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts +1 -1
- package/src/hooks/useAttachments.ts +1 -1
- package/src/hooks/useDndSensors.ts +1 -1
- package/src/index.ts +3 -3
- package/src/settings/background.spec.ts +1 -1
- package/src/settings/border.spec.ts +1 -1
- package/src/settings/borderRadiusExtended.spec.ts +4 -4
- package/src/settings/marginExtended.spec.ts +4 -4
- package/src/settings/paddingExtended.spec.ts +4 -4
- package/src/styles.css +3 -0
- package/src/utilities/react/getBackgroundColorStyles.ts +2 -3
- package/src/utilities/react/getBorderStyles.ts +3 -4
- package/src/utilities/react/getRadiusStyles.ts +1 -1
- package/vite.config.ts +25 -3
- package/dist/_virtual/_commonjsHelpers.es.js +0 -7
- package/dist/_virtual/_commonjsHelpers.es.js.map +0 -1
- package/dist/_virtual/index.es.js +0 -5
- package/dist/_virtual/index.es.js.map +0 -1
- package/dist/_virtual/index.es2.js +0 -5
- package/dist/_virtual/index.es2.js.map +0 -1
- package/dist/_virtual/index.es3.js +0 -5
- package/dist/_virtual/index.es3.js.map +0 -1
- package/dist/_virtual/jsx-runtime.es.js +0 -5
- package/dist/_virtual/jsx-runtime.es.js.map +0 -1
- package/dist/_virtual/react-dom.development.es.js +0 -5
- package/dist/_virtual/react-dom.development.es.js.map +0 -1
- package/dist/_virtual/react-dom.production.min.es.js +0 -5
- package/dist/_virtual/react-dom.production.min.es.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.development.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.development.es.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.production.min.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +0 -1
- package/dist/_virtual/react.development.es.js +0 -5
- package/dist/_virtual/react.development.es.js.map +0 -1
- package/dist/_virtual/react.production.min.es.js +0 -5
- package/dist/_virtual/react.production.min.es.js.map +0 -1
- package/dist/_virtual/scheduler.development.es.js +0 -5
- package/dist/_virtual/scheduler.development.es.js.map +0 -1
- package/dist/_virtual/scheduler.production.min.es.js +0 -5
- package/dist/_virtual/scheduler.production.min.es.js.map +0 -1
- package/dist/style.css +0 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as d, Fragment as b, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useDocumentSection as u } from "@frontify/app-bridge";
|
|
3
|
-
import { merge as
|
|
4
|
-
import {
|
|
5
|
-
import { SectionLink as
|
|
6
|
-
const
|
|
7
|
-
const [r,
|
|
8
|
-
return
|
|
9
|
-
t.id ===
|
|
10
|
-
}, [
|
|
11
|
-
/* @__PURE__ */ e
|
|
3
|
+
import { merge as l } from "@frontify/fondue";
|
|
4
|
+
import { useState as v, useEffect as f } from "react";
|
|
5
|
+
import { SectionLink as p } from "./SectionLink.es.js";
|
|
6
|
+
const F = ({ page: t, selectedUrl: c, onSelectUrl: n, itemsToExpandInitially: o, appBridge: m }) => {
|
|
7
|
+
const [r, s] = v(t.id === o.documentId), x = t.permanentLink === c, { documentSections: h } = u(m, t.id), i = [...h.values()], w = i.length > 0;
|
|
8
|
+
return f(() => {
|
|
9
|
+
t.id === o.pageId && s(!0);
|
|
10
|
+
}, [o, t.id]), /* @__PURE__ */ d(b, { children: [
|
|
11
|
+
/* @__PURE__ */ e(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
14
|
tabIndex: 0,
|
|
15
15
|
"data-test-id": "internal-link-selector-page-link",
|
|
16
|
-
className:
|
|
16
|
+
className: l([
|
|
17
17
|
"tw-py-2 tw-px-2.5 tw-leading-5 tw-cursor-pointer",
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
w ? "tw-pl-7" : "tw-pl-12",
|
|
19
|
+
x ? "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" : "hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"
|
|
20
20
|
]),
|
|
21
|
-
onClick: () =>
|
|
22
|
-
onFocus: () =>
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
|
|
21
|
+
onClick: () => n(t.permanentLink),
|
|
22
|
+
onFocus: () => n(t.permanentLink),
|
|
23
|
+
children: /* @__PURE__ */ d("div", { className: "tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6", children: [
|
|
24
|
+
w && /* @__PURE__ */ e(
|
|
25
25
|
"button",
|
|
26
26
|
{
|
|
27
27
|
"data-test-id": "tree-item-toggle",
|
|
28
28
|
className: "tw-flex tw-items-center tw-justify-center tw-p-1.5 tw-cursor-pointer",
|
|
29
|
-
onClick: () =>
|
|
30
|
-
onFocus: () =>
|
|
31
|
-
children: /* @__PURE__ */ e
|
|
29
|
+
onClick: () => s(!r),
|
|
30
|
+
onFocus: () => s(!r),
|
|
31
|
+
children: /* @__PURE__ */ e(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
34
|
+
className: l([
|
|
35
35
|
"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",
|
|
36
36
|
r ? "tw-rotate-90" : ""
|
|
37
37
|
])
|
|
@@ -39,23 +39,23 @@ const k = ({ page: t, selectedUrl: a, onSelectUrl: s, itemsToExpandInitially: n,
|
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
|
-
/* @__PURE__ */ e
|
|
43
|
-
/* @__PURE__ */ e
|
|
42
|
+
/* @__PURE__ */ e("span", { className: "tw-text-s", children: t.title }),
|
|
43
|
+
/* @__PURE__ */ e("span", { className: "tw-flex-auto tw-font-sans tw-text-xs tw-text-right", children: "Page" })
|
|
44
44
|
] }, t.id)
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
|
-
r && i.length > 0 && i.map((
|
|
48
|
-
|
|
47
|
+
r && i.length > 0 && i.map((a) => /* @__PURE__ */ e(
|
|
48
|
+
p,
|
|
49
49
|
{
|
|
50
|
-
section:
|
|
51
|
-
selectedUrl:
|
|
52
|
-
onSelectUrl:
|
|
50
|
+
section: a,
|
|
51
|
+
selectedUrl: c,
|
|
52
|
+
onSelectUrl: n
|
|
53
53
|
},
|
|
54
|
-
|
|
54
|
+
a.id
|
|
55
55
|
))
|
|
56
56
|
] });
|
|
57
57
|
};
|
|
58
58
|
export {
|
|
59
|
-
|
|
59
|
+
F as PageLink
|
|
60
60
|
};
|
|
61
61
|
//# sourceMappingURL=PageLink.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, useDocumentSection } from '@frontify/app-bridge';\nimport { merge } from '@frontify/fondue';\nimport { useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { SectionLink } from './SectionLink';\n\ntype DocumentLinkProps = {\n page: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n appBridge: AppBridgeBlock;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const PageLink = ({ page, selectedUrl, onSelectUrl, itemsToExpandInitially, appBridge }: DocumentLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(page.id === itemsToExpandInitially.documentId);\n const isActive = page.permanentLink === selectedUrl;\n const { documentSections } = useDocumentSection(appBridge, page.id);\n const sectionsArray = [...documentSections.values()];\n const hasSections = sectionsArray.length > 0;\n\n useEffect(() => {\n if (page.id === itemsToExpandInitially.pageId) {\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, page.id]);\n\n return (\n <>\n <div\n tabIndex={0}\n data-test-id=\"internal-link-selector-page-link\"\n className={merge([\n 'tw-py-2 tw-px-2.5 tw-leading-5 tw-cursor-pointer',\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 onFocus={() => 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-p-1.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onFocus={() => 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 </div>\n {isExpanded &&\n sectionsArray.length > 0 &&\n sectionsArray.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","appBridge","isExpanded","setIsExpanded","useState","isActive","documentSections","useDocumentSection","sectionsArray","hasSections","useEffect","jsxs","Fragment","jsx","merge","section","SectionLink"],"mappings":";;;;;AAoBa,MAAAA,IAAW,CAAC,EAAE,MAAAC,GAAM,aAAAC,GAAa,aAAAC,GAAa,wBAAAC,GAAwB,WAAAC,QAAmC;AAC5G,QAAA,CAACC,GAAYC,CAAa,IAAIC,
|
|
1
|
+
{"version":3,"file":"PageLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, useDocumentSection } from '@frontify/app-bridge';\nimport { merge } from '@frontify/fondue';\nimport { useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { SectionLink } from './SectionLink';\n\ntype DocumentLinkProps = {\n page: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n appBridge: AppBridgeBlock;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const PageLink = ({ page, selectedUrl, onSelectUrl, itemsToExpandInitially, appBridge }: DocumentLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(page.id === itemsToExpandInitially.documentId);\n const isActive = page.permanentLink === selectedUrl;\n const { documentSections } = useDocumentSection(appBridge, page.id);\n const sectionsArray = [...documentSections.values()];\n const hasSections = sectionsArray.length > 0;\n\n useEffect(() => {\n if (page.id === itemsToExpandInitially.pageId) {\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, page.id]);\n\n return (\n <>\n <div\n tabIndex={0}\n data-test-id=\"internal-link-selector-page-link\"\n className={merge([\n 'tw-py-2 tw-px-2.5 tw-leading-5 tw-cursor-pointer',\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 onFocus={() => 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-p-1.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onFocus={() => 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 </div>\n {isExpanded &&\n sectionsArray.length > 0 &&\n sectionsArray.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","appBridge","isExpanded","setIsExpanded","useState","isActive","documentSections","useDocumentSection","sectionsArray","hasSections","useEffect","jsxs","Fragment","jsx","merge","section","SectionLink"],"mappings":";;;;;AAoBa,MAAAA,IAAW,CAAC,EAAE,MAAAC,GAAM,aAAAC,GAAa,aAAAC,GAAa,wBAAAC,GAAwB,WAAAC,QAAmC;AAC5G,QAAA,CAACC,GAAYC,CAAa,IAAIC,EAASP,EAAK,OAAOG,EAAuB,UAAU,GACpFK,IAAWR,EAAK,kBAAkBC,GAClC,EAAE,kBAAAQ,EAAiB,IAAIC,EAAmBN,GAAWJ,EAAK,EAAE,GAC5DW,IAAgB,CAAC,GAAGF,EAAiB,OAAQ,CAAA,GAC7CG,IAAcD,EAAc,SAAS;AAE3C,SAAAE,EAAU,MAAM;AACR,IAAAb,EAAK,OAAOG,EAAuB,UACnCG,EAAc,EAAI;AAAA,EAEvB,GAAA,CAACH,GAAwBH,EAAK,EAAE,CAAC,GAI5B,gBAAAc,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,UAAU;AAAA,QACV,gBAAa;AAAA,QACb,WAAWC,EAAM;AAAA,UACb;AAAA,UACAL,IAAc,YAAY;AAAA,UAC1BJ,IACM,oKACA;AAAA,QAAA,CACT;AAAA,QACD,SAAS,MAAMN,EAAYF,EAAK,aAAa;AAAA,QAC7C,SAAS,MAAME,EAAYF,EAAK,aAAa;AAAA,QAE7C,UAAA,gBAAAc,EAAC,OAAkB,EAAA,WAAU,yDACxB,UAAA;AAAA,UACGF,KAAA,gBAAAI;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,gBAAa;AAAA,cACb,WAAU;AAAA,cACV,SAAS,MAAMV,EAAc,CAACD,CAAU;AAAA,cACxC,SAAS,MAAMC,EAAc,CAACD,CAAU;AAAA,cAExC,UAAA,gBAAAW;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAWC,EAAM;AAAA,oBACb;AAAA,oBACAZ,IAAa,iBAAiB;AAAA,kBAAA,CACjC;AAAA,gBAAA;AAAA,cACJ;AAAA,YAAA;AAAA,UACL;AAAA,UAEH,gBAAAW,EAAA,QAAA,EAAK,WAAU,aAAa,YAAK,OAAM;AAAA,UACvC,gBAAAA,EAAA,QAAA,EAAK,WAAU,sDAAqD,UAAI,QAAA;AAAA,QAAA,EAAA,GAjBnEhB,EAAK,EAkBf;AAAA,MAAA;AAAA,IACJ;AAAA,IACCK,KACGM,EAAc,SAAS,KACvBA,EAAc,IAAI,CAACO,MAEX,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QAEG,SAAAD;AAAA,QACA,aAAAjB;AAAA,QACA,aAAAC;AAAA,MAAA;AAAA,MAHKgB,EAAQ;AAAA,IAAA,CAMxB;AAAA,EACT,EAAA,CAAA;AAER;"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LoadingCircle as
|
|
3
|
-
import {
|
|
4
|
-
import { PageLink as
|
|
5
|
-
const
|
|
6
|
-
appBridge:
|
|
7
|
-
documentId:
|
|
1
|
+
import { jsx as t, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingCircle as p } from "@frontify/fondue";
|
|
3
|
+
import { useState as o, useEffect as w } from "react";
|
|
4
|
+
import { PageLink as h } from "./PageLink.es.js";
|
|
5
|
+
const k = ({
|
|
6
|
+
appBridge: s,
|
|
7
|
+
documentId: r,
|
|
8
8
|
selectedUrl: i,
|
|
9
9
|
onSelectUrl: c,
|
|
10
10
|
itemsToExpandInitially: m
|
|
11
11
|
}) => {
|
|
12
|
-
const [l,
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const [l, g] = o([]), [n, d] = o(!0), a = [...l.values()], f = !n && a.length > 0;
|
|
13
|
+
return w(() => {
|
|
14
|
+
s.getDocumentPagesByDocumentId(r).then((e) => {
|
|
15
|
+
g(e);
|
|
16
16
|
}).finally(() => {
|
|
17
|
-
|
|
17
|
+
d(!1);
|
|
18
18
|
});
|
|
19
|
-
}, []),
|
|
20
|
-
|
|
19
|
+
}, []), n ? /* @__PURE__ */ t("div", { className: "tw-flex tw-justify-center tw-p-4", children: /* @__PURE__ */ t(p, {}) }) : f ? /* @__PURE__ */ t(u, { children: a.map((e) => /* @__PURE__ */ t(
|
|
20
|
+
h,
|
|
21
21
|
{
|
|
22
22
|
page: e,
|
|
23
|
-
appBridge:
|
|
23
|
+
appBridge: s,
|
|
24
24
|
selectedUrl: i,
|
|
25
25
|
onSelectUrl: c,
|
|
26
26
|
itemsToExpandInitially: m
|
|
27
27
|
},
|
|
28
28
|
e.id
|
|
29
|
-
)) }) : /* @__PURE__ */ t
|
|
29
|
+
)) }) : /* @__PURE__ */ t("div", { className: "tw-py-2 tw-px-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak", children: "This document does not contain any pages." });
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
k as PageLinks
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=PageLinks.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLinks.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, DocumentPage } from '@frontify/app-bridge';\nimport { LoadingCircle } from '@frontify/fondue';\nimport { ReactElement, useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { PageLink } from './PageLink';\n\ntype PageLinksProps = {\n appBridge: AppBridgeBlock;\n documentId: number;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const PageLinks = ({\n appBridge,\n documentId,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\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 appBridge\n .getDocumentPagesByDocumentId(documentId)\n .then((_pages) => {\n setPages(_pages);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n if (isLoading) {\n return (\n <div className=\"tw-flex tw-justify-center tw-p-4\">\n <LoadingCircle />\n </div>\n );\n }\n\n return hasPages ? (\n <>\n {pagesArray.map((page) => {\n return (\n <PageLink\n key={page.id}\n page={page}\n appBridge={appBridge}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n );\n })}\n </>\n ) : (\n <div className=\"tw-py-2 tw-px-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","appBridge","documentId","selectedUrl","onSelectUrl","itemsToExpandInitially","pages","setPages","useState","isLoading","setIsLoading","pagesArray","hasPages","useEffect","_pages","jsx","LoadingCircle","Fragment","page","PageLink"],"mappings":";;;;AAgBO,MAAMA,IAAY,CAAC;AAAA,EACtB,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AACJ,MAAoC;AAChC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,
|
|
1
|
+
{"version":3,"file":"PageLinks.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, DocumentPage } from '@frontify/app-bridge';\nimport { LoadingCircle } from '@frontify/fondue';\nimport { ReactElement, useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { PageLink } from './PageLink';\n\ntype PageLinksProps = {\n appBridge: AppBridgeBlock;\n documentId: number;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const PageLinks = ({\n appBridge,\n documentId,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\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 appBridge\n .getDocumentPagesByDocumentId(documentId)\n .then((_pages) => {\n setPages(_pages);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n if (isLoading) {\n return (\n <div className=\"tw-flex tw-justify-center tw-p-4\">\n <LoadingCircle />\n </div>\n );\n }\n\n return hasPages ? (\n <>\n {pagesArray.map((page) => {\n return (\n <PageLink\n key={page.id}\n page={page}\n appBridge={appBridge}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n );\n })}\n </>\n ) : (\n <div className=\"tw-py-2 tw-px-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","appBridge","documentId","selectedUrl","onSelectUrl","itemsToExpandInitially","pages","setPages","useState","isLoading","setIsLoading","pagesArray","hasPages","useEffect","_pages","jsx","LoadingCircle","Fragment","page","PageLink"],"mappings":";;;;AAgBO,MAAMA,IAAY,CAAC;AAAA,EACtB,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;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;AAanD,SAXAE,EAAU,MAAM;AACZ,IAAAZ,EACK,6BAA6BC,CAAU,EACvC,KAAK,CAACY,MAAW;AACd,MAAAP,EAASO,CAAM;AAAA,IAAA,CAClB,EACA,QAAQ,MAAM;AACX,MAAAJ,EAAa,EAAK;AAAA,IAAA,CACrB;AAAA,EACT,GAAG,CAAE,CAAA,GAEDD,sBAEK,OAAI,EAAA,WAAU,oCACX,UAAA,gBAAAM,EAACC,KAAc,EACnB,CAAA,IAIDJ,IACH,gBAAAG,EAAAE,GAAA,EACK,UAAWN,EAAA,IAAI,CAACO,MAET,gBAAAH;AAAA,IAACI;AAAA,IAAA;AAAA,MAEG,MAAAD;AAAA,MACA,WAAAjB;AAAA,MACA,aAAAE;AAAA,MACA,aAAAC;AAAA,MACA,wBAAAC;AAAA,IAAA;AAAA,IALKa,EAAK;AAAA,EAAA,CAQrB,EACL,CAAA,sBAEC,OAAI,EAAA,WAAU,sEAAqE,UAEpF,4CAAA,CAAA;AAER;"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { merge as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { merge as i, IconDocumentText16 as l } from "@frontify/fondue";
|
|
3
|
+
const c = ({ section: t, selectedUrl: r, onSelectUrl: n }) => {
|
|
4
|
+
const o = t.permanentLink === r;
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
6
|
"button",
|
|
7
7
|
{
|
|
8
8
|
"data-test-id": "internal-link-selector-section-link",
|
|
9
|
-
className:
|
|
9
|
+
className: i([
|
|
10
10
|
"tw-py-2 tw-px-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full",
|
|
11
|
-
|
|
11
|
+
o ? "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" : "hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"
|
|
12
12
|
]),
|
|
13
|
-
onClick: () => n(
|
|
14
|
-
onFocus: () => n(
|
|
15
|
-
children: /* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
13
|
+
onClick: () => n(t.permanentLink),
|
|
14
|
+
onFocus: () => n(t.permanentLink),
|
|
15
|
+
children: /* @__PURE__ */ s("div", { className: "tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6", children: [
|
|
16
|
+
/* @__PURE__ */ e(l, {}),
|
|
17
|
+
/* @__PURE__ */ e("span", { className: "tw-text-s", children: t.title }),
|
|
18
|
+
/* @__PURE__ */ e("span", { className: "tw-flex-auto tw-font-sans tw-text-xs tw-text-right", children: "Section" })
|
|
19
19
|
] })
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
};
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
c as SectionLink
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=SectionLink.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDocumentText16, merge } from '@frontify/fondue';\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 className={merge([\n 'tw-py-2 tw-px-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full',\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(section.permanentLink)}\n onFocus={() => onSelectUrl(section.permanentLink)}\n >\n <div className=\"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6\">\n <IconDocumentText16 />\n <span className=\"tw-text-s\">{section.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Section</span>\n </div>\n </button>\n );\n};\n"],"names":["SectionLink","section","selectedUrl","onSelectUrl","isActive","jsx","merge","jsxs","IconDocumentText16"],"mappings":";;AAcO,MAAMA,IAAc,CAAC,EAAE,SAAAC,GAAS,aAAAC,GAAa,aAAAC,QAAoC;AAC9E,QAAAC,IAAWH,EAAQ,kBAAkBC;AAGvC,
|
|
1
|
+
{"version":3,"file":"SectionLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDocumentText16, merge } from '@frontify/fondue';\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 className={merge([\n 'tw-py-2 tw-px-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full',\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(section.permanentLink)}\n onFocus={() => onSelectUrl(section.permanentLink)}\n >\n <div className=\"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6\">\n <IconDocumentText16 />\n <span className=\"tw-text-s\">{section.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Section</span>\n </div>\n </button>\n );\n};\n"],"names":["SectionLink","section","selectedUrl","onSelectUrl","isActive","jsx","merge","jsxs","IconDocumentText16"],"mappings":";;AAcO,MAAMA,IAAc,CAAC,EAAE,SAAAC,GAAS,aAAAC,GAAa,aAAAC,QAAoC;AAC9E,QAAAC,IAAWH,EAAQ,kBAAkBC;AAGvC,SAAA,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,gBAAa;AAAA,MACb,WAAWC,EAAM;AAAA,QACb;AAAA,QACAF,IACM,oKACA;AAAA,MAAA,CACT;AAAA,MACD,SAAS,MAAMD,EAAYF,EAAQ,aAAa;AAAA,MAChD,SAAS,MAAME,EAAYF,EAAQ,aAAa;AAAA,MAEhD,UAAA,gBAAAM,EAAC,OAAI,EAAA,WAAU,yDACX,UAAA;AAAA,QAAA,gBAAAF,EAACG,GAAmB,EAAA;AAAA,QACnB,gBAAAH,EAAA,QAAA,EAAK,WAAU,aAAa,YAAQ,OAAM;AAAA,QAC1C,gBAAAA,EAAA,QAAA,EAAK,WAAU,sDAAqD,UAAO,WAAA;AAAA,MAAA,GAChF;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.es.js","sources":["../../../../src/components/RichTextEditor/plugins/styles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\nimport { LINK_PLUGIN } from './LinkPlugin/id';\nimport { BlockButtonStyles } from './ButtonPlugin';\n\nexport const enum TextStyles {\n heading1 = 'heading1',\n heading2 = 'heading2',\n heading3 = 'heading3',\n heading4 = 'heading4',\n custom1 = 'custom1',\n custom2 = 'custom2',\n custom3 = 'custom3',\n quote = 'quote',\n imageCaption = 'imageCaption',\n imageTitle = 'imageTitle',\n p = 'p',\n}\nexport const BlockStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n [TextStyles.heading1]: {\n display: 'inline-block',\n fontSize: 'var(--f-theme-settings-heading1-font-size)',\n lineHeight: 'var(--f-theme-settings-heading1-line-height)',\n marginTop: 'var(--f-theme-settings-heading1-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading1-font-style)',\n textTransform: 'var(--f-theme-settings-heading1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading1-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading1-font-family)',\n color: 'var(--f-theme-settings-heading1-color)',\n },\n [TextStyles.heading2]: {\n fontSize: 'var(--f-theme-settings-heading2-font-size)',\n lineHeight: 'var(--f-theme-settings-heading2-line-height)',\n marginTop: 'var(--f-theme-settings-heading2-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading2-font-style)',\n textTransform: 'var(--f-theme-settings-heading2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading2-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading2-font-family)',\n color: 'var(--f-theme-settings-heading2-color)',\n },\n [TextStyles.heading3]: {\n fontSize: 'var(--f-theme-settings-heading3-font-size)',\n lineHeight: 'var(--f-theme-settings-heading3-line-height)',\n marginTop: 'var(--f-theme-settings-heading3-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading3-font-style)',\n textTransform: 'var(--f-theme-settings-heading3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading3-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading3-font-family)',\n color: 'var(--f-theme-settings-heading3-color)',\n },\n [TextStyles.heading4]: {\n fontSize: 'var(--f-theme-settings-heading4-font-size)',\n lineHeight: 'var(--f-theme-settings-heading4-line-height)',\n marginTop: 'var(--f-theme-settings-heading4-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading4-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading4-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading4-font-style)',\n textTransform: 'var(--f-theme-settings-heading4-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading4-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading4-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading4-font-family)',\n color: 'var(--f-theme-settings-heading4-color)',\n },\n [TextStyles.custom1]: {\n fontSize: 'var(--f-theme-settings-custom1-font-size)',\n lineHeight: 'var(--f-theme-settings-custom1-line-height)',\n marginTop: 'var(--f-theme-settings-custom1-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom1-font-style)',\n textTransform: 'var(--f-theme-settings-custom1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom1-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom1-font-family)',\n color: 'var(--f-theme-settings-custom1-color)',\n },\n [TextStyles.custom2]: {\n fontSize: 'var(--f-theme-settings-custom2-font-size)',\n lineHeight: 'var(--f-theme-settings-custom2-line-height)',\n marginTop: 'var(--f-theme-settings-custom2-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom2-font-style)',\n textTransform: 'var(--f-theme-settings-custom2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom2-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom2-font-family)',\n color: 'var(--f-theme-settings-custom2-color)',\n },\n [TextStyles.custom3]: {\n fontSize: 'var(--f-theme-settings-custom3-font-size)',\n lineHeight: 'var(--f-theme-settings-custom3-line-height)',\n marginTop: 'var(--f-theme-settings-custom3-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom3-font-style)',\n textTransform: 'var(--f-theme-settings-custom3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom3-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom3-font-family)',\n color: 'var(--f-theme-settings-custom3-color)',\n },\n [TextStyles.p]: {\n fontSize: 'var(--f-theme-settings-body-font-size)',\n lineHeight: 'var(--f-theme-settings-body-line-height)',\n marginTop: 'var(--f-theme-settings-body-margin-top)',\n marginBottom: 'var(--f-theme-settings-body-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-body-text-decoration)',\n fontStyle: 'var(--f-theme-settings-body-font-style)',\n textTransform: 'var(--f-theme-settings-body-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-body-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-body-font-weight)',\n fontFamily: 'var(--f-theme-settings-body-font-family)',\n color: 'var(--f-theme-settings-body-color)',\n },\n [TextStyles.quote]: {\n fontSize: 'var(--f-theme-settings-quote-font-size)',\n lineHeight: 'var(--f-theme-settings-quote-line-height)',\n marginTop: 'var(--f-theme-settings-quote-margin-top)',\n marginBottom: 'var(--f-theme-settings-quote-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-quote-text-decoration)',\n fontStyle: 'var(--f-theme-settings-quote-font-style)',\n textTransform: 'var(--f-theme-settings-quote-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-quote-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-quote-font-weight)',\n fontFamily: 'var(--f-theme-settings-quote-font-family)',\n color: 'var(--f-theme-settings-quote-color)',\n },\n [TextStyles.imageCaption]: {\n fontSize: 'var(--f-theme-settings-image-caption-font-size)',\n lineHeight: 'var(--f-theme-settings-image-caption-line-height)',\n marginTop: 'var(--f-theme-settings-image-caption-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-caption-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-caption-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-caption-font-style)',\n textTransform: 'var(--f-theme-settings-image-caption-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-caption-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-caption-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-caption-font-family)',\n color: 'var(--f-theme-settings-image-caption-color)',\n },\n [TextStyles.imageTitle]: {\n fontSize: 'var(--f-theme-settings-image-title-font-size)',\n lineHeight: 'var(--f-theme-settings-image-title-line-height)',\n marginTop: 'var(--f-theme-settings-image-title-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-title-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-title-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-title-font-style)',\n textTransform: 'var(--f-theme-settings-image-title-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-title-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-title-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-title-font-family)',\n color: 'var(--f-theme-settings-image-title-color)',\n },\n [LINK_PLUGIN]: {\n fontSize: 'var(--f-theme-settings-link-font-size)',\n lineHeight: 'var(--f-theme-settings-link-line-height)',\n marginTop: 'var(--f-theme-settings-link-margin-top)',\n marginBottom: 'var(--f-theme-settings-link-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-link-text-decoration)',\n fontStyle: 'var(--f-theme-settings-link-font-style)',\n textTransform: 'var(--f-theme-settings-link-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-link-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-link-font-weight)',\n fontFamily: 'var(--f-theme-settings-link-font-family)',\n color: 'var(--f-theme-settings-link-color)',\n },\n ...BlockButtonStyles,\n};\n"],"names":["TextStyles","BlockStyles","LINK_PLUGIN","BlockButtonStyles"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"styles.es.js","sources":["../../../../src/components/RichTextEditor/plugins/styles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\nimport { LINK_PLUGIN } from './LinkPlugin/id';\nimport { BlockButtonStyles } from './ButtonPlugin';\n\nexport const enum TextStyles {\n heading1 = 'heading1',\n heading2 = 'heading2',\n heading3 = 'heading3',\n heading4 = 'heading4',\n custom1 = 'custom1',\n custom2 = 'custom2',\n custom3 = 'custom3',\n quote = 'quote',\n imageCaption = 'imageCaption',\n imageTitle = 'imageTitle',\n p = 'p',\n}\nexport const BlockStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n [TextStyles.heading1]: {\n display: 'inline-block',\n fontSize: 'var(--f-theme-settings-heading1-font-size)',\n lineHeight: 'var(--f-theme-settings-heading1-line-height)',\n marginTop: 'var(--f-theme-settings-heading1-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading1-font-style)',\n textTransform: 'var(--f-theme-settings-heading1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading1-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading1-font-family)',\n color: 'var(--f-theme-settings-heading1-color)',\n },\n [TextStyles.heading2]: {\n fontSize: 'var(--f-theme-settings-heading2-font-size)',\n lineHeight: 'var(--f-theme-settings-heading2-line-height)',\n marginTop: 'var(--f-theme-settings-heading2-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading2-font-style)',\n textTransform: 'var(--f-theme-settings-heading2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading2-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading2-font-family)',\n color: 'var(--f-theme-settings-heading2-color)',\n },\n [TextStyles.heading3]: {\n fontSize: 'var(--f-theme-settings-heading3-font-size)',\n lineHeight: 'var(--f-theme-settings-heading3-line-height)',\n marginTop: 'var(--f-theme-settings-heading3-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading3-font-style)',\n textTransform: 'var(--f-theme-settings-heading3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading3-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading3-font-family)',\n color: 'var(--f-theme-settings-heading3-color)',\n },\n [TextStyles.heading4]: {\n fontSize: 'var(--f-theme-settings-heading4-font-size)',\n lineHeight: 'var(--f-theme-settings-heading4-line-height)',\n marginTop: 'var(--f-theme-settings-heading4-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading4-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading4-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading4-font-style)',\n textTransform: 'var(--f-theme-settings-heading4-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading4-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading4-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading4-font-family)',\n color: 'var(--f-theme-settings-heading4-color)',\n },\n [TextStyles.custom1]: {\n fontSize: 'var(--f-theme-settings-custom1-font-size)',\n lineHeight: 'var(--f-theme-settings-custom1-line-height)',\n marginTop: 'var(--f-theme-settings-custom1-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom1-font-style)',\n textTransform: 'var(--f-theme-settings-custom1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom1-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom1-font-family)',\n color: 'var(--f-theme-settings-custom1-color)',\n },\n [TextStyles.custom2]: {\n fontSize: 'var(--f-theme-settings-custom2-font-size)',\n lineHeight: 'var(--f-theme-settings-custom2-line-height)',\n marginTop: 'var(--f-theme-settings-custom2-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom2-font-style)',\n textTransform: 'var(--f-theme-settings-custom2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom2-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom2-font-family)',\n color: 'var(--f-theme-settings-custom2-color)',\n },\n [TextStyles.custom3]: {\n fontSize: 'var(--f-theme-settings-custom3-font-size)',\n lineHeight: 'var(--f-theme-settings-custom3-line-height)',\n marginTop: 'var(--f-theme-settings-custom3-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom3-font-style)',\n textTransform: 'var(--f-theme-settings-custom3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom3-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom3-font-family)',\n color: 'var(--f-theme-settings-custom3-color)',\n },\n [TextStyles.p]: {\n fontSize: 'var(--f-theme-settings-body-font-size)',\n lineHeight: 'var(--f-theme-settings-body-line-height)',\n marginTop: 'var(--f-theme-settings-body-margin-top)',\n marginBottom: 'var(--f-theme-settings-body-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-body-text-decoration)',\n fontStyle: 'var(--f-theme-settings-body-font-style)',\n textTransform: 'var(--f-theme-settings-body-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-body-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-body-font-weight)',\n fontFamily: 'var(--f-theme-settings-body-font-family)',\n color: 'var(--f-theme-settings-body-color)',\n },\n [TextStyles.quote]: {\n fontSize: 'var(--f-theme-settings-quote-font-size)',\n lineHeight: 'var(--f-theme-settings-quote-line-height)',\n marginTop: 'var(--f-theme-settings-quote-margin-top)',\n marginBottom: 'var(--f-theme-settings-quote-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-quote-text-decoration)',\n fontStyle: 'var(--f-theme-settings-quote-font-style)',\n textTransform: 'var(--f-theme-settings-quote-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-quote-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-quote-font-weight)',\n fontFamily: 'var(--f-theme-settings-quote-font-family)',\n color: 'var(--f-theme-settings-quote-color)',\n },\n [TextStyles.imageCaption]: {\n fontSize: 'var(--f-theme-settings-image-caption-font-size)',\n lineHeight: 'var(--f-theme-settings-image-caption-line-height)',\n marginTop: 'var(--f-theme-settings-image-caption-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-caption-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-caption-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-caption-font-style)',\n textTransform: 'var(--f-theme-settings-image-caption-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-caption-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-caption-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-caption-font-family)',\n color: 'var(--f-theme-settings-image-caption-color)',\n },\n [TextStyles.imageTitle]: {\n fontSize: 'var(--f-theme-settings-image-title-font-size)',\n lineHeight: 'var(--f-theme-settings-image-title-line-height)',\n marginTop: 'var(--f-theme-settings-image-title-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-title-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-title-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-title-font-style)',\n textTransform: 'var(--f-theme-settings-image-title-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-title-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-title-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-title-font-family)',\n color: 'var(--f-theme-settings-image-title-color)',\n },\n [LINK_PLUGIN]: {\n fontSize: 'var(--f-theme-settings-link-font-size)',\n lineHeight: 'var(--f-theme-settings-link-line-height)',\n marginTop: 'var(--f-theme-settings-link-margin-top)',\n marginBottom: 'var(--f-theme-settings-link-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-link-text-decoration)',\n fontStyle: 'var(--f-theme-settings-link-font-style)',\n textTransform: 'var(--f-theme-settings-link-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-link-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-link-font-weight)',\n fontFamily: 'var(--f-theme-settings-link-font-family)',\n color: 'var(--f-theme-settings-link-color)',\n },\n ...BlockButtonStyles,\n};\n"],"names":["TextStyles","BlockStyles","LINK_PLUGIN","BlockButtonStyles"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/button.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {
|
|
1
|
+
{"version":3,"file":"button.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/button.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\nimport { TElement } from '@udecode/plate';\n\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport { BUTTON_PLUGIN } from '../../plugins';\n\nexport type ButtonStylesType = Record<string, Record<string, CSSProperties & { hover?: CSSProperties }>>;\n\nexport const buttonNode = (node: TElement, children: string, defaultClassNames: string, styles: ButtonStylesType) => {\n const buttonStyles = styles[BUTTON_PLUGIN];\n const buttonTypeString = (node.buttonStyle as string) ?? 'primary';\n const buttonType = `button${buttonTypeString.charAt(0).toUpperCase()}${buttonTypeString.slice(1)}`;\n const buttonStyle = buttonStyles[buttonType];\n\n const defaultStyles = reactCssPropsToCss(buttonStyle);\n\n return `<a href=\"${node.url}\"\n target=\"${node.target ?? '_blank'}\"\n style=\"${defaultStyles}\"\n class=\"${defaultClassNames}\"\n onmouseenter=\"this.setAttribute('style', '${defaultStyles} ${reactCssPropsToCss(buttonStyle?.hover)}');\"\n onmouseleave=\"this.setAttribute('style', '${reactCssPropsToCss(buttonStyle)}');\"\n >${children}</a>`;\n};\n"],"names":["buttonNode","node","children","defaultClassNames","styles","buttonStyles","BUTTON_PLUGIN","buttonTypeString","buttonType","buttonStyle","defaultStyles","reactCssPropsToCss"],"mappings":";;AAUO,MAAMA,IAAa,CAACC,GAAgBC,GAAkBC,GAA2BC,MAA6B;AAC3G,QAAAC,IAAeD,EAAOE,CAAa,GACnCC,IAAoBN,EAAK,eAA0B,WACnDO,IAAa,SAASD,EAAiB,OAAO,CAAC,EAAE,YAAY,CAAC,GAAGA,EAAiB,MAAM,CAAC,CAAC,IAC1FE,IAAcJ,EAAaG,CAAU,GAErCE,IAAgBC,EAAmBF,CAAW;AAE7C,SAAA,YAAYR,EAAK,GAAG;AAAA,0BACLA,EAAK,UAAU,QAAQ;AAAA,yBACxBS,CAAa;AAAA,yBACbP,CAAiB;AAAA,4DACkBO,CAAa,IAAIC,EAAmBF,KAAA,gBAAAA,EAAa,KAAK,CAAC;AAAA,4DACvDE,EAAmBF,CAAW,CAAC;AAAA,mBACxEP,CAAQ;AAC3B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkItemNode.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/checkItemNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {
|
|
1
|
+
{"version":3,"file":"checkItemNode.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/checkItemNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\nimport { merge } from '@frontify/fondue';\nimport { TElement } from '@udecode/plate';\n\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\n\nexport const checkItemNode = (\n node: TElement,\n children: string,\n defaultClassNames: string,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }>,\n) => {\n return `<div disabled class=\"tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${defaultClassNames}\" style=\"margin-left:${\n ((node.indent as number) ?? 0) * 24\n }px;\">\n <div class=\"tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5\">\n <input\n class=\"tw-w-4 tw-h-4 tw-m-0\"\n type=\"checkbox\"\n ${node.checked ? 'checked' : ''}\n onclick=\"return false;\" />\n </div>\n <span class=\"${merge([\n 'tw-flex-1 tw-focus:outline-none',\n node.checked ? '!tw-line-through' : '',\n ])}\" style=\"${reactCssPropsToCss(styles[node.children[0].textStyle as string])}\">${children}</span>\n</div>`;\n};\n"],"names":["checkItemNode","node","children","defaultClassNames","styles","merge","reactCssPropsToCss"],"mappings":";;AAQO,MAAMA,IAAgB,CACzBC,GACAC,GACAC,GACAC,MAEO,0EAA0ED,CAAiB,yBAC5FF,EAAK,UAAqB,KAAK,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA,cAKUA,EAAK,UAAU,YAAY,EAAE;AAAA;AAAA;AAAA,mBAGxBI,EAAM;AAAA,EACjB;AAAA,EACAJ,EAAK,UAAU,qBAAqB;AACvC,CAAA,CAAC,YAAYK,EAAmBF,EAAOH,EAAK,SAAS,CAAC,EAAE,SAAmB,CAAC,CAAC,KAAKC,CAAQ;AAAA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { reactCssPropsToCss as s } from "../utlis/reactCssPropsToCss.es.js";
|
|
2
1
|
import { merge as y } from "@frontify/fondue";
|
|
2
|
+
import { reactCssPropsToCss as s } from "../utlis/reactCssPropsToCss.es.js";
|
|
3
3
|
import { TextStyles as o } from "../../plugins/styles.es.js";
|
|
4
4
|
const m = (p, t, c, $) => {
|
|
5
5
|
const r = s(c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/default.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {
|
|
1
|
+
{"version":3,"file":"default.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/default.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\nimport { merge } from '@frontify/fondue';\nimport { TElement } from '@udecode/plate';\n\nimport { TextStyles } from '../../plugins';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\n\nexport const defaultNode = (node: TElement, children: string, styles: CSSProperties, defaultClassNames: string) => {\n const defaultStyles = reactCssPropsToCss(styles);\n\n if (node.type === TextStyles.heading1) {\n return `<h1 class=\"${merge([defaultClassNames, 'a-h1'])}\">${getStyledChild(children, defaultStyles)}</h1>`;\n }\n if (node.type === TextStyles.heading2) {\n return `<h2 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h2>`;\n }\n if (node.type === TextStyles.heading3) {\n return `<h3 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h3>`;\n }\n if (node.type === TextStyles.heading4) {\n return `<h4 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h4>`;\n }\n if (node.type === TextStyles.custom1) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom1'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.custom2) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom2'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.custom3) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom3'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.quote) {\n return `<p class=\"${merge([defaultClassNames, 'a-quote'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.imageTitle) {\n return `<p class=\"${merge([defaultClassNames, 'a-image-title'])}\">${getStyledChild(\n children,\n defaultStyles,\n )}</p>`;\n }\n if (node.type === TextStyles.imageCaption) {\n return `<p class=\"${merge([defaultClassNames, 'a-image-caption'])}\">${getStyledChild(\n children,\n defaultStyles,\n )}</p>`;\n }\n\n return `<p class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</p>`;\n};\n\nconst getStyledChild = (children: string, styles: string) => `<span style=\"${styles}\">${children}</span>`;\n"],"names":["defaultNode","node","children","styles","defaultClassNames","defaultStyles","reactCssPropsToCss","TextStyles","merge","getStyledChild"],"mappings":";;;AASO,MAAMA,IAAc,CAACC,GAAgBC,GAAkBC,GAAuBC,MAA8B;AACzG,QAAAC,IAAgBC,EAAmBH,CAAM;AAE3C,SAAAF,EAAK,SAASM,EAAW,WAClB,cAAcC,EAAM,CAACJ,GAAmB,MAAM,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,UAEnGJ,EAAK,SAASM,EAAW,WAClB,cAAcH,CAAiB,KAAKK,EAAeP,GAAUG,CAAa,CAAC,UAElFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,CAAiB,KAAKK,EAAeP,GAAUG,CAAa,CAAC,UAElFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,CAAiB,KAAKK,EAAeP,GAAUG,CAAa,CAAC,UAElFJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,SAEvGJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,SAEvGJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,SAEvGJ,EAAK,SAASM,EAAW,QAClB,aAAaC,EAAM,CAACJ,GAAmB,SAAS,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,SAErGJ,EAAK,SAASM,EAAW,aAClB,aAAaC,EAAM,CAACJ,GAAmB,eAAe,CAAC,CAAC,KAAKK;AAAA,IAChEP;AAAA,IACAG;AAAA,EACH,CAAA,SAEDJ,EAAK,SAASM,EAAW,eAClB,aAAaC,EAAM,CAACJ,GAAmB,iBAAiB,CAAC,CAAC,KAAKK;AAAA,IAClEP;AAAA,IACAG;AAAA,EACH,CAAA,SAGE,aAAaD,CAAiB,KAAKK,EAAeP,GAAUG,CAAa,CAAC;AACrF,GAEMI,IAAiB,CAACP,GAAkBC,MAAmB,gBAAgBA,CAAM,KAAKD,CAAQ;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import f from "
|
|
1
|
+
import p from "escape-html";
|
|
2
|
+
import { LINK_PLUGIN as e } from "../../plugins/LinkPlugin/id.es.js";
|
|
3
|
+
import { reactCssPropsToCss as f } from "../utlis/reactCssPropsToCss.es.js";
|
|
4
4
|
const _ = (r, a, s, $) => {
|
|
5
5
|
var l;
|
|
6
6
|
if (r.chosenLink) {
|
|
7
7
|
const { chosenLink: t } = r;
|
|
8
|
-
return `<a class="${s}" style="${
|
|
8
|
+
return `<a class="${s}" style="${f($[e])}" target=${t != null && t.openInNewTab ? "_blank" : "_self"} href="${p((l = t == null ? void 0 : t.searchResult) == null ? void 0 : l.link)}">${a}</a>`;
|
|
9
9
|
}
|
|
10
|
-
return `<a class="${s}" style="${
|
|
10
|
+
return `<a class="${s}" style="${f($[e])}" target="${(r == null ? void 0 : r.target) ?? "_blank"}" href="${p(r.url)}">${a}</a>`;
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
13
|
_ as linkNode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/link.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { LINK_PLUGIN } from '../../plugins/LinkPlugin/id';\nimport { TLinkElement } from '../../plugins/LinkPlugin/types';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\
|
|
1
|
+
{"version":3,"file":"link.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/link.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\nimport escapeHtml from 'escape-html';\nimport { TElement } from '@udecode/plate';\n\nimport { LINK_PLUGIN } from '../../plugins/LinkPlugin/id';\nimport { TLinkElement } from '../../plugins/LinkPlugin/types';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\n\nexport const linkNode = (\n node: TElement,\n children: string,\n defaultClassNames: string,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }>,\n) => {\n if (node.chosenLink) {\n const { chosenLink } = node as TLinkElement;\n return `<a class=\"${defaultClassNames}\" style=\"${reactCssPropsToCss(styles[LINK_PLUGIN])}\" target=${\n chosenLink?.openInNewTab ? '_blank' : '_self'\n } href=\"${escapeHtml(chosenLink?.searchResult?.link)}\">${children}</a>`;\n }\n return `<a class=\"${defaultClassNames}\" style=\"${reactCssPropsToCss(styles[LINK_PLUGIN])}\" target=\"${\n node?.target ?? '_blank'\n }\" href=\"${escapeHtml(node.url as string)}\">${children}</a>`;\n};\n"],"names":["linkNode","node","children","defaultClassNames","styles","chosenLink","reactCssPropsToCss","LINK_PLUGIN","escapeHtml","_a"],"mappings":";;;AAUO,MAAMA,IAAW,CACpBC,GACAC,GACAC,GACAC,MACC;;AACD,MAAIH,EAAK,YAAY;AACX,UAAA,EAAE,YAAAI,EAAe,IAAAJ;AAChB,WAAA,aAAaE,CAAiB,YAAYG,EAAmBF,EAAOG,CAAW,CAAC,CAAC,YACpFF,KAAA,QAAAA,EAAY,eAAe,WAAW,OAC1C,UAAUG,GAAWC,IAAAJ,KAAA,gBAAAA,EAAY,iBAAZ,gBAAAI,EAA0B,IAAI,CAAC,KAAKP,CAAQ;AAAA,EACrE;AACA,SAAO,aAAaC,CAAiB,YAAYG,EAAmBF,EAAOG,CAAW,CAAC,CAAC,cACpFN,KAAA,gBAAAA,EAAM,WAAU,QACpB,WAAWO,EAAWP,EAAK,GAAa,CAAC,KAAKC,CAAQ;AAC1D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeNodesToHtmlRecursive.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_CHECK_ITEM,\n LI_CLASSNAMES,\n MappedMentionableItems,\n OL_STYLES,\n UL_CLASSES,\n alignmentClassnames,\n getLiStyles,\n getLicElementClassNames,\n getOrderedListClasses,\n merge,\n} from '@frontify/fondue';\nimport {\n ELEMENT_LI,\n ELEMENT_LIC,\n ELEMENT_LINK,\n ELEMENT_MENTION,\n ELEMENT_OL,\n ELEMENT_UL,\n TDescendant,\n TElement,\n isText,\n} from '@udecode/plate';\nimport { serializeLeafToHtml } from './utlis/serializeLeafToHtml';\nimport { reactCssPropsToCss } from './utlis/reactCssPropsToCss';\nimport { CSSProperties } from 'react';\nimport { ButtonStylesType, buttonNode } from './nodes/button';\nimport { linkNode } from './nodes/link';\nimport { defaultNode } from './nodes/default';\nimport { checkItemNode } from './nodes/checkItemNode';\nimport { mentionHtmlNode } from './nodes/mentionHtmlNode';\nimport { ELEMENT_BUTTON } from '../plugins';\n\nconst countNodesOfType = (nodes: TDescendant[], type: string): number => {\n return nodes.reduce((acc, node) => {\n if (node.type === type) {\n acc++;\n }\n if (node.children) {\n return acc + countNodesOfType(node.children as TDescendant[], type);\n }\n return acc;\n }, 0);\n};\n\ntype NestingCount = {\n [type: string]: number;\n};\n\ntype SerializeNodeToHtmlRecursiveOptions = {\n mappedMentionable?: MappedMentionableItems;\n nestingCount?: NestingCount;\n};\n\nexport const serializeNodeToHtmlRecursive = (\n node: TDescendant,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType,\n { mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions
|
|
1
|
+
{"version":3,"file":"serializeNodesToHtmlRecursive.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_CHECK_ITEM,\n LI_CLASSNAMES,\n MappedMentionableItems,\n OL_STYLES,\n UL_CLASSES,\n alignmentClassnames,\n getLiStyles,\n getLicElementClassNames,\n getOrderedListClasses,\n merge,\n} from '@frontify/fondue';\nimport {\n ELEMENT_LI,\n ELEMENT_LIC,\n ELEMENT_LINK,\n ELEMENT_MENTION,\n ELEMENT_OL,\n ELEMENT_UL,\n TDescendant,\n TElement,\n isText,\n} from '@udecode/plate';\nimport { serializeLeafToHtml } from './utlis/serializeLeafToHtml';\nimport { reactCssPropsToCss } from './utlis/reactCssPropsToCss';\nimport type { CSSProperties } from 'react';\nimport { ButtonStylesType, buttonNode } from './nodes/button';\nimport { linkNode } from './nodes/link';\nimport { defaultNode } from './nodes/default';\nimport { checkItemNode } from './nodes/checkItemNode';\nimport { mentionHtmlNode } from './nodes/mentionHtmlNode';\nimport { ELEMENT_BUTTON } from '../plugins';\n\nconst countNodesOfType = (nodes: TDescendant[], type: string): number => {\n return nodes.reduce((acc, node) => {\n if (node.type === type) {\n acc++;\n }\n if (node.children) {\n return acc + countNodesOfType(node.children as TDescendant[], type);\n }\n return acc;\n }, 0);\n};\n\ntype NestingCount = {\n [type: string]: number;\n};\n\ntype SerializeNodeToHtmlRecursiveOptions = {\n mappedMentionable?: MappedMentionableItems;\n nestingCount?: NestingCount;\n};\n\nexport const serializeNodeToHtmlRecursive = (\n node: TDescendant,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType,\n { mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions,\n): string => {\n if (isText(node)) {\n return serializeLeafToHtml(node);\n }\n\n const rootNestingCount = nestingCount[node.type] || countNodesOfType([node], node.type);\n let children = '';\n for (const element of node.children) {\n children += serializeNodeToHtmlRecursive(element, styles, {\n nestingCount: {\n ...nestingCount,\n [element.type as string]: rootNestingCount,\n },\n mappedMentionable,\n });\n }\n\n const htmlMapper = MapNodeTypesToHtml[node.type];\n if (typeof htmlMapper !== 'undefined') {\n return htmlMapper({\n classNames: getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),\n children,\n rootNestingCount,\n node,\n mappedMentionable,\n styles,\n });\n } else {\n return defaultNode(\n node,\n children,\n styles[node.type],\n getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),\n );\n }\n};\n\ntype Arguments = {\n classNames: string;\n children: string;\n rootNestingCount: number;\n node: TElement;\n mappedMentionable?: MappedMentionableItems;\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType;\n};\n\nconst MapNodeTypesToHtml: { [key: string]: ({ ...args }: Arguments) => string } = {\n [ELEMENT_UL]: (args) => `<ul class=\"${UL_CLASSES} ${args.classNames}\">${args.children}</ul>`,\n [ELEMENT_OL]: ({ classNames, children, node, rootNestingCount }) => {\n const nestingLevel = Math.max(rootNestingCount - countNodesOfType([node], ELEMENT_OL), 0);\n return `<ol class=\"${getOrderedListClasses(nestingLevel)} ${classNames}\" style=\"${reactCssPropsToCss(\n OL_STYLES,\n )}\">${children}</ol>`;\n },\n [ELEMENT_LI]: ({ classNames, children, node, styles }) =>\n `<li class=\"${classNames} ${LI_CLASSNAMES}\" style=\"${reactCssPropsToCss(\n getLiStyles(node, styles),\n )}\">${children}</li>`,\n [ELEMENT_LIC]: ({ classNames, children, node }) =>\n `<p class=\"${classNames} ${getLicElementClassNames(node)}\"><span>${children}</span></p>`,\n [ELEMENT_LINK]: ({ node, children, classNames, styles }) => linkNode(node, children, classNames, styles),\n [ELEMENT_BUTTON]: ({ node, children, classNames, styles }) =>\n buttonNode(node, children, classNames, styles as ButtonStylesType),\n [ELEMENT_CHECK_ITEM]: ({ node, children, classNames, styles }) => checkItemNode(node, children, classNames, styles),\n [ELEMENT_MENTION]: ({ node, mappedMentionable }) => mentionHtmlNode(node, { mentionable: mappedMentionable }),\n};\n\nconst getClassNames = (breakAfterColumn?: string, align?: string) => {\n const breakWordsClass = 'tw-break-words';\n const columnBreakClasses =\n breakAfterColumn === 'active' ? 'tw-break-after-column tw-break-inside-avoid-column' : '';\n const alignClass = align ? alignmentClassnames[align] : '';\n return merge([alignClass, breakWordsClass, columnBreakClasses]);\n};\n"],"names":["countNodesOfType","nodes","type","acc","node","serializeNodeToHtmlRecursive","styles","mappedMentionable","nestingCount","isText","serializeLeafToHtml","rootNestingCount","children","element","htmlMapper","MapNodeTypesToHtml","getClassNames","defaultNode","ELEMENT_UL","args","UL_CLASSES","ELEMENT_OL","classNames","nestingLevel","getOrderedListClasses","reactCssPropsToCss","OL_STYLES","ELEMENT_LI","LI_CLASSNAMES","getLiStyles","ELEMENT_LIC","getLicElementClassNames","ELEMENT_LINK","linkNode","ELEMENT_BUTTON","buttonNode","ELEMENT_CHECK_ITEM","checkItemNode","ELEMENT_MENTION","mentionHtmlNode","breakAfterColumn","align","breakWordsClass","columnBreakClasses","alignClass","alignmentClassnames","merge"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeToHtml.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TDescendant } from '@udecode/plate';\nimport { PluginComposer, SerializeNodesToHtmlOptions, mapMentionable, parseRawValue } from '@frontify/fondue';\nimport { BlockStyles } from '../plugins';\nimport { serializeNodeToHtmlRecursive } from './serializeNodesToHtmlRecursive';\n\nexport const serializeRawToHtmlAsync = async (\n raw: string,\n columns: SerializeNodesToHtmlOptions['columns'] = 1,\n columnGap: SerializeNodesToHtmlOptions['columnGap'] = 'normal',\n plugins: PluginComposer = new PluginComposer()
|
|
1
|
+
{"version":3,"file":"serializeToHtml.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TDescendant } from '@udecode/plate';\nimport { PluginComposer, SerializeNodesToHtmlOptions, mapMentionable, parseRawValue } from '@frontify/fondue';\nimport { BlockStyles } from '../plugins';\nimport { serializeNodeToHtmlRecursive } from './serializeNodesToHtmlRecursive';\n\nexport const serializeRawToHtmlAsync = async (\n raw: string,\n columns: SerializeNodesToHtmlOptions['columns'] = 1,\n columnGap: SerializeNodesToHtmlOptions['columnGap'] = 'normal',\n plugins: PluginComposer = new PluginComposer(),\n): Promise<string> => {\n const nodes = parseRawValue({ raw, plugins });\n const styles = plugins.getStyles;\n return Promise.resolve(serializeNodesToHtml(nodes, { columns, columnGap, styles }));\n};\n\nexport const serializeNodesToHtml = (\n nodes: TDescendant[],\n { mentionable, columns = 1, columnGap = 'normal', styles = BlockStyles }: SerializeNodesToHtmlOptions = {},\n): string => {\n const mappedMentionable = mentionable ? mapMentionable(mentionable) : new Map();\n\n let html = '';\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n if (isEmptyNode(node)) {\n html += '<br />';\n } else {\n html += serializeNodeToHtmlRecursive(node, styles, {\n mappedMentionable,\n });\n }\n }\n\n if (columns > 1) {\n return `<div style=\"columns:${columns}; column-gap:${columnGap};\">${html}</div>`;\n }\n\n return html;\n};\n\nconst isEmptyNode = (node: TDescendant): boolean => {\n if (!Array.isArray(node?.children)) {\n return false;\n }\n return node?.children?.every((child) => child.text === '');\n};\n"],"names":["serializeRawToHtmlAsync","raw","columns","columnGap","plugins","PluginComposer","nodes","parseRawValue","styles","serializeNodesToHtml","mentionable","BlockStyles","mappedMentionable","mapMentionable","html","i","len","node","isEmptyNode","serializeNodeToHtmlRecursive","_a","child"],"mappings":";;;AAOa,MAAAA,IAA0B,OACnCC,GACAC,IAAkD,GAClDC,IAAsD,UACtDC,IAA0B,IAAIC,QACZ;AAClB,QAAMC,IAAQC,EAAc,EAAE,KAAAN,GAAK,SAAAG,EAAS,CAAA,GACtCI,IAASJ,EAAQ;AAChB,SAAA,QAAQ,QAAQK,EAAqBH,GAAO,EAAE,SAAAJ,GAAS,WAAAC,GAAW,QAAAK,EAAQ,CAAA,CAAC;AACtF,GAEaC,IAAuB,CAChCH,GACA,EAAE,aAAAI,GAAa,SAAAR,IAAU,GAAG,WAAAC,IAAY,UAAU,QAAAK,IAASG,EAAY,IAAiC,CAAA,MAC/F;AACT,QAAMC,IAAoBF,IAAcG,EAAeH,CAAW,wBAAQ;AAE1E,MAAII,IAAO;AACX,WAASC,IAAI,GAAGC,IAAMV,EAAM,QAAQS,IAAIC,GAAKD,KAAK;AACxC,UAAAE,IAAOX,EAAMS,CAAC;AAChB,IAAAG,EAAYD,CAAI,IACRH,KAAA,WAEAA,KAAAK,EAA6BF,GAAMT,GAAQ;AAAA,MAC/C,mBAAAI;AAAA,IAAA,CACH;AAAA,EAET;AAEA,SAAIV,IAAU,IACH,uBAAuBA,CAAO,gBAAgBC,CAAS,MAAMW,CAAI,WAGrEA;AACX,GAEMI,IAAc,CAACD,MAA+B;;AAChD,SAAK,MAAM,QAAQA,KAAA,gBAAAA,EAAM,QAAQ,KAG1BG,IAAAH,KAAA,gBAAAA,EAAM,aAAN,gBAAAG,EAAgB,MAAM,CAACC,MAAUA,EAAM,SAAS,MAF5C;AAGf;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactCssPropsToCss.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nexport const reactCssPropsToCss = (props?: CSSProperties): string => {\n if (!props) {\n return '';\n }\n\n return Object.keys(props)\n .reduce<string>((acc, key) => {\n const value = props[key as keyof CSSProperties];\n return value ? `${acc}${convertCamelCaseToKebabCase(key)}: ${value}; ` : acc;\n }, '')\n .trim()\n .replaceAll('\"', \"'\");\n};\n\nconst convertCamelCaseToKebabCase = (str: string): string => {\n return str.replaceAll(/([A-Z])/g, '-$1').toLowerCase();\n};\n"],"names":["reactCssPropsToCss","props","acc","key","value","convertCamelCaseToKebabCase","str"],"mappings":"AAIa,MAAAA,IAAqB,CAACC,MAC1BA,IAIE,OAAO,KAAKA,CAAK,EACnB,OAAe,CAACC,GAAKC,MAAQ;AACpB,QAAAC,IAAQH,EAAME,CAA0B;
|
|
1
|
+
{"version":3,"file":"reactCssPropsToCss.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { CSSProperties } from 'react';\n\nexport const reactCssPropsToCss = (props?: CSSProperties): string => {\n if (!props) {\n return '';\n }\n\n return Object.keys(props)\n .reduce<string>((acc, key) => {\n const value = props[key as keyof CSSProperties];\n return value ? `${acc}${convertCamelCaseToKebabCase(key)}: ${value}; ` : acc;\n }, '')\n .trim()\n .replaceAll('\"', \"'\");\n};\n\nconst convertCamelCaseToKebabCase = (str: string): string => {\n return str.replaceAll(/([A-Z])/g, '-$1').toLowerCase();\n};\n"],"names":["reactCssPropsToCss","props","acc","key","value","convertCamelCaseToKebabCase","str"],"mappings":"AAIa,MAAAA,IAAqB,CAACC,MAC1BA,IAIE,OAAO,KAAKA,CAAK,EACnB,OAAe,CAACC,GAAKC,MAAQ;AACpB,QAAAC,IAAQH,EAAME,CAA0B;AACvC,SAAAC,IAAQ,GAAGF,CAAG,GAAGG,EAA4BF,CAAG,CAAC,KAAKC,CAAK,OAAOF;AAAA,GAC1E,EAAE,EACJ,OACA,WAAW,KAAK,GAAG,IATb,IAYTG,IAA8B,CAACC,MAC1BA,EAAI,WAAW,YAAY,KAAK,EAAE,YAAY;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeLeafToHtml.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { BOLD_CLASSES, CODE_CLASSES, ITALIC_CLASSES, STRIKETHROUGH_CLASSES, UNDERLINE_CLASSES } from '@frontify/fondue';\nimport { TText } from '@udecode/plate';\nimport escapeHtml from 'escape-html';\n\nexport const serializeLeafToHtml = (node: TText): string => {\n let string = escapeHtml(node.text);\n string = string.replaceAll('\\n', '<br />');\n const { bold, italic, underline, strikethrough, code, subscript, superscript } = node;\n if (bold) {\n string = `<span class=\"${BOLD_CLASSES}\">${string}</span>`;\n }\n if (italic) {\n string = `<span class=\"${ITALIC_CLASSES}\">${string}</span>`;\n }\n if (underline) {\n string = `<span class=\"${UNDERLINE_CLASSES}\">${string}</span>`;\n }\n if (strikethrough) {\n string = `<span class=\"${STRIKETHROUGH_CLASSES}\">${string}</span>`;\n }\n if (code) {\n string = `<span class=\"${CODE_CLASSES}\">${string}</span>`;\n }\n if (subscript) {\n string = `<sub>${string}</sub>`;\n } else if (superscript) {\n string = `<sup>${string}</sup>`;\n }\n return string;\n};\n"],"names":["serializeLeafToHtml","node","string","escapeHtml","bold","italic","underline","strikethrough","code","subscript","superscript","BOLD_CLASSES","ITALIC_CLASSES","UNDERLINE_CLASSES","STRIKETHROUGH_CLASSES","CODE_CLASSES"],"mappings":";;AAMa,MAAAA,IAAsB,CAACC,MAAwB;AACpD,MAAAC,IAASC,EAAWF,EAAK,IAAI;AACxB,EAAAC,IAAAA,EAAO,WAAW;AAAA,GAAM,QAAQ;AACnC,QAAA,EAAE,MAAAE,GAAM,QAAAC,GAAQ,WAAAC,GAAW,eAAAC,GAAe,MAAAC,GAAM,WAAAC,GAAW,aAAAC,EAAgB,IAAAT;AACjF,SAAIG,
|
|
1
|
+
{"version":3,"file":"serializeLeafToHtml.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { BOLD_CLASSES, CODE_CLASSES, ITALIC_CLASSES, STRIKETHROUGH_CLASSES, UNDERLINE_CLASSES } from '@frontify/fondue';\nimport { TText } from '@udecode/plate';\nimport escapeHtml from 'escape-html';\n\nexport const serializeLeafToHtml = (node: TText): string => {\n let string = escapeHtml(node.text);\n string = string.replaceAll('\\n', '<br />');\n const { bold, italic, underline, strikethrough, code, subscript, superscript } = node;\n if (bold) {\n string = `<span class=\"${BOLD_CLASSES}\">${string}</span>`;\n }\n if (italic) {\n string = `<span class=\"${ITALIC_CLASSES}\">${string}</span>`;\n }\n if (underline) {\n string = `<span class=\"${UNDERLINE_CLASSES}\">${string}</span>`;\n }\n if (strikethrough) {\n string = `<span class=\"${STRIKETHROUGH_CLASSES}\">${string}</span>`;\n }\n if (code) {\n string = `<span class=\"${CODE_CLASSES}\">${string}</span>`;\n }\n if (subscript) {\n string = `<sub>${string}</sub>`;\n } else if (superscript) {\n string = `<sup>${string}</sup>`;\n }\n return string;\n};\n"],"names":["serializeLeafToHtml","node","string","escapeHtml","bold","italic","underline","strikethrough","code","subscript","superscript","BOLD_CLASSES","ITALIC_CLASSES","UNDERLINE_CLASSES","STRIKETHROUGH_CLASSES","CODE_CLASSES"],"mappings":";;AAMa,MAAAA,IAAsB,CAACC,MAAwB;AACpD,MAAAC,IAASC,EAAWF,EAAK,IAAI;AACxB,EAAAC,IAAAA,EAAO,WAAW;AAAA,GAAM,QAAQ;AACnC,QAAA,EAAE,MAAAE,GAAM,QAAAC,GAAQ,WAAAC,GAAW,eAAAC,GAAe,MAAAC,GAAM,WAAAC,GAAW,aAAAC,EAAgB,IAAAT;AACjF,SAAIG,MACSF,IAAA,gBAAgBS,CAAY,KAAKT,CAAM,YAEhDG,MACSH,IAAA,gBAAgBU,CAAc,KAAKV,CAAM,YAElDI,MACSJ,IAAA,gBAAgBW,CAAiB,KAAKX,CAAM,YAErDK,MACSL,IAAA,gBAAgBY,CAAqB,KAAKZ,CAAM,YAEzDM,MACSN,IAAA,gBAAgBa,CAAY,KAAKb,CAAM,YAEhDO,IACAP,IAAS,QAAQA,CAAM,WAChBQ,MACPR,IAAS,QAAQA,CAAM,WAEpBA;AACX;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addHttps.es.js","sources":["../../src/helpers/addHttps.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { relativeUrlRegex } from '../components/RichTextEditor/plugins/LinkPlugin/utils';\n\nexport const addHttps = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return url;\n }\n try {\n new URL(url);\n return url;\n } catch {\n return `https://${url}`;\n }\n};\n"],"names":["addHttps","url","relativeUrlRegex"],"mappings":";AAIa,MAAAA,IAAW,CAACC,MAAgB;AACjC,MAAAC,EAAiB,KAAKD,CAAG;AAClB,WAAAA;AAEP,MAAA;AACA,eAAI,IAAIA,CAAG,GACJA;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"addHttps.es.js","sources":["../../src/helpers/addHttps.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { relativeUrlRegex } from '../components/RichTextEditor/plugins/LinkPlugin/utils';\n\nexport const addHttps = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return url;\n }\n try {\n new URL(url);\n return url;\n } catch {\n return `https://${url}`;\n }\n};\n"],"names":["addHttps","url","relativeUrlRegex"],"mappings":";AAIa,MAAAA,IAAW,CAACC,MAAgB;AACjC,MAAAC,EAAiB,KAAKD,CAAG;AAClB,WAAAA;AAEP,MAAA;AACA,eAAI,IAAIA,CAAG,GACJA;AAAA,EAAA,QACH;AACJ,WAAO,WAAWA,CAAG;AAAA,EACzB;AACJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customCoordinatesGetterFactory.es.js","sources":["../../src/helpers/customCoordinatesGetterFactory.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { KeyboardCode, KeyboardCoordinateGetter } from '@dnd-kit/core';\n\nconst directions: string[] = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];\n\nexport const customCoordinatesGetterFactory =\n (columnGap: number, rowGap: number): KeyboardCoordinateGetter =>\n (event, { currentCoordinates, context: { activeNode } }) => {\n event.preventDefault();\n if (directions.includes(event.code)) {\n const width = activeNode?.offsetWidth ?? 0;\n const height = activeNode?.offsetHeight ?? 0;\n\n switch (event.code) {\n case KeyboardCode.Right:\n return {\n ...currentCoordinates,\n x: currentCoordinates.x + width + columnGap,\n };\n case KeyboardCode.Left:\n return {\n ...currentCoordinates,\n x: currentCoordinates.x - width - columnGap,\n };\n case KeyboardCode.Down:\n return {\n ...currentCoordinates,\n y: currentCoordinates.y + height + rowGap,\n };\n case KeyboardCode.Up:\n return {\n ...currentCoordinates,\n y: currentCoordinates.y - height - rowGap,\n };\n }\n }\n return undefined;\n };\n"],"names":["directions","KeyboardCode","customCoordinatesGetterFactory","columnGap","rowGap","event","currentCoordinates","activeNode","width","height"],"mappings":";AAIA,MAAMA,IAAuB,CAACC,EAAa,MAAMA,EAAa,OAAOA,EAAa,IAAIA,EAAa,IAAI,GAE1FC,IACT,CAACC,GAAmBC,MACpB,CAACC,GAAO,EAAE,oBAAAC,GAAoB,SAAS,EAAE,YAAAC,EAAW,QAAQ;AAExD,MADAF,EAAM,eAAe,GACjBL,EAAW,SAASK,EAAM,IAAI,GAAG;AAC3B,UAAAG,KAAQD,KAAA,gBAAAA,EAAY,gBAAe,GACnCE,KAASF,KAAA,gBAAAA,EAAY,iBAAgB;AAE3C,YAAQF,EAAM,MAAM;AAAA,MAChB,KAAKJ,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIE,IAAQL;AAAA,QAAA;AAAA,MAE1C,KAAKF,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIE,IAAQL;AAAA,QAAA;AAAA,MAE1C,KAAKF,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIG,IAASL;AAAA,QAAA;AAAA,MAE3C,KAAKH,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIG,IAASL;AAAA,QAAA;AAAA,IAE/C;AAAA;
|
|
1
|
+
{"version":3,"file":"customCoordinatesGetterFactory.es.js","sources":["../../src/helpers/customCoordinatesGetterFactory.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { KeyboardCode, KeyboardCoordinateGetter } from '@dnd-kit/core';\n\nconst directions: string[] = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];\n\nexport const customCoordinatesGetterFactory =\n (columnGap: number, rowGap: number): KeyboardCoordinateGetter =>\n (event, { currentCoordinates, context: { activeNode } }) => {\n event.preventDefault();\n if (directions.includes(event.code)) {\n const width = activeNode?.offsetWidth ?? 0;\n const height = activeNode?.offsetHeight ?? 0;\n\n switch (event.code) {\n case KeyboardCode.Right:\n return {\n ...currentCoordinates,\n x: currentCoordinates.x + width + columnGap,\n };\n case KeyboardCode.Left:\n return {\n ...currentCoordinates,\n x: currentCoordinates.x - width - columnGap,\n };\n case KeyboardCode.Down:\n return {\n ...currentCoordinates,\n y: currentCoordinates.y + height + rowGap,\n };\n case KeyboardCode.Up:\n return {\n ...currentCoordinates,\n y: currentCoordinates.y - height - rowGap,\n };\n }\n }\n return undefined;\n };\n"],"names":["directions","KeyboardCode","customCoordinatesGetterFactory","columnGap","rowGap","event","currentCoordinates","activeNode","width","height"],"mappings":";AAIA,MAAMA,IAAuB,CAACC,EAAa,MAAMA,EAAa,OAAOA,EAAa,IAAIA,EAAa,IAAI,GAE1FC,IACT,CAACC,GAAmBC,MACpB,CAACC,GAAO,EAAE,oBAAAC,GAAoB,SAAS,EAAE,YAAAC,EAAW,QAAQ;AAExD,MADAF,EAAM,eAAe,GACjBL,EAAW,SAASK,EAAM,IAAI,GAAG;AAC3B,UAAAG,KAAQD,KAAA,gBAAAA,EAAY,gBAAe,GACnCE,KAASF,KAAA,gBAAAA,EAAY,iBAAgB;AAE3C,YAAQF,EAAM,MAAM;AAAA,MAChB,KAAKJ,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIE,IAAQL;AAAA,QAAA;AAAA,MAE1C,KAAKF,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIE,IAAQL;AAAA,QAAA;AAAA,MAE1C,KAAKF,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIG,IAASL;AAAA,QAAA;AAAA,MAE3C,KAAKH,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIG,IAASL;AAAA,QAAA;AAAA,IAE/C;AAAA,EACJ;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasRichTextValue.es.js","sources":["../../src/helpers/hasRichTextValue.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\ntype TextElement = {\n text: string;\n children?: TextElement[];\n};\n\nexport const hasRichTextValue = (string?: string): boolean => {\n if (!string) {\n return false;\n }\n const hasText = (children: TextElement[]): boolean =>\n children.some((child: TextElement) => {\n if (child.text) {\n return child.text !== '';\n }\n if (child.children) {\n return hasText(child.children);\n }\n return false;\n });\n\n try {\n const json = JSON.parse(string);\n return hasText(json);\n } catch (error) {\n return false;\n }\n};\n"],"names":["hasRichTextValue","string","hasText","children","child","json"],"mappings":"AAOa,MAAAA,IAAmB,CAACC,MAA6B;AAC1D,MAAI,CAACA;AACM,WAAA;AAEX,QAAMC,IAAU,CAACC,MACbA,EAAS,KAAK,CAACC,MACPA,EAAM,OACCA,EAAM,SAAS,KAEtBA,EAAM,WACCF,EAAQE,EAAM,QAAQ,IAE1B,EACV;AAED,MAAA;AACM,UAAAC,IAAO,KAAK,MAAMJ,CAAM;AAC9B,WAAOC,EAAQG,CAAI;AAAA;
|
|
1
|
+
{"version":3,"file":"hasRichTextValue.es.js","sources":["../../src/helpers/hasRichTextValue.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\ntype TextElement = {\n text: string;\n children?: TextElement[];\n};\n\nexport const hasRichTextValue = (string?: string): boolean => {\n if (!string) {\n return false;\n }\n const hasText = (children: TextElement[]): boolean =>\n children.some((child: TextElement) => {\n if (child.text) {\n return child.text !== '';\n }\n if (child.children) {\n return hasText(child.children);\n }\n return false;\n });\n\n try {\n const json = JSON.parse(string);\n return hasText(json);\n } catch (error) {\n return false;\n }\n};\n"],"names":["hasRichTextValue","string","hasText","children","child","json"],"mappings":"AAOa,MAAAA,IAAmB,CAACC,MAA6B;AAC1D,MAAI,CAACA;AACM,WAAA;AAEX,QAAMC,IAAU,CAACC,MACbA,EAAS,KAAK,CAACC,MACPA,EAAM,OACCA,EAAM,SAAS,KAEtBA,EAAM,WACCF,EAAQE,EAAM,QAAQ,IAE1B,EACV;AAED,MAAA;AACM,UAAAC,IAAO,KAAK,MAAMJ,CAAM;AAC9B,WAAOC,EAAQG,CAAI;AAAA,UACP;AACL,WAAA;AAAA,EACX;AACJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachments.es.js","sources":["../../src/hooks/useAttachments.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, Asset, useBlockAssets } from '@frontify/app-bridge';\n\nexport const useAttachments = (appBridge: AppBridgeBlock, assetId: string) => {\n const { blockAssets, updateAssetIdsFromKey } = useBlockAssets(appBridge);\n const attachments = blockAssets?.[assetId] || [];\n\n const onAddAttachments = async (newAssets: Asset[]) => {\n const newAssetIds = attachments.map((attachment) => attachment.id);\n for (const asset of newAssets) {\n newAssetIds.push(asset.id);\n }\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n const onAttachmentDelete = async (assetToDelete: Asset) => {\n const newAssetIds = attachments\n .filter((attachment) => attachment.id !== assetToDelete.id)\n .map((attachment) => attachment.id);\n\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n const onAttachmentReplace = async (attachmentToReplace: Asset, newAsset: Asset) => {\n const newAssetIds = attachments.map((attachment) =>\n attachment.id === attachmentToReplace.id ? newAsset.id : attachment.id
|
|
1
|
+
{"version":3,"file":"useAttachments.es.js","sources":["../../src/hooks/useAttachments.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, Asset, useBlockAssets } from '@frontify/app-bridge';\n\nexport const useAttachments = (appBridge: AppBridgeBlock, assetId: string) => {\n const { blockAssets, updateAssetIdsFromKey } = useBlockAssets(appBridge);\n const attachments = blockAssets?.[assetId] || [];\n\n const onAddAttachments = async (newAssets: Asset[]) => {\n const newAssetIds = attachments.map((attachment) => attachment.id);\n for (const asset of newAssets) {\n newAssetIds.push(asset.id);\n }\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n const onAttachmentDelete = async (assetToDelete: Asset) => {\n const newAssetIds = attachments\n .filter((attachment) => attachment.id !== assetToDelete.id)\n .map((attachment) => attachment.id);\n\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n const onAttachmentReplace = async (attachmentToReplace: Asset, newAsset: Asset) => {\n const newAssetIds = attachments.map((attachment) =>\n attachment.id === attachmentToReplace.id ? newAsset.id : attachment.id,\n );\n\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n const onAttachmentsSorted = async (assets: Asset[]) => {\n const newAssetIds = assets.map((asset) => asset.id);\n\n await updateAssetIdsFromKey(assetId, newAssetIds);\n };\n\n return {\n onAddAttachments,\n onAttachmentDelete,\n onAttachmentReplace,\n onAttachmentsSorted,\n attachments,\n };\n};\n"],"names":["useAttachments","appBridge","assetId","blockAssets","updateAssetIdsFromKey","useBlockAssets","attachments","newAssets","newAssetIds","attachment","asset","assetToDelete","attachmentToReplace","newAsset","assets"],"mappings":";AAIa,MAAAA,IAAiB,CAACC,GAA2BC,MAAoB;AAC1E,QAAM,EAAE,aAAAC,GAAa,uBAAAC,EAAsB,IAAIC,EAAeJ,CAAS,GACjEK,KAAcH,KAAA,gBAAAA,EAAcD,OAAY,CAAA;AAgCvC,SAAA;AAAA,IACH,kBA/BqB,OAAOK,MAAuB;AACnD,YAAMC,IAAcF,EAAY,IAAI,CAACG,MAAeA,EAAW,EAAE;AACjE,iBAAWC,KAASH;AACJ,QAAAC,EAAA,KAAKE,EAAM,EAAE;AAEvB,YAAAN,EAAsBF,GAASM,CAAW;AAAA,IAAA;AAAA,IA2BhD,oBAxBuB,OAAOG,MAAyB;AACvD,YAAMH,IAAcF,EACf,OAAO,CAACG,MAAeA,EAAW,OAAOE,EAAc,EAAE,EACzD,IAAI,CAACF,MAAeA,EAAW,EAAE;AAEhC,YAAAL,EAAsBF,GAASM,CAAW;AAAA,IAAA;AAAA,IAoBhD,qBAjBwB,OAAOI,GAA4BC,MAAoB;AAC/E,YAAML,IAAcF,EAAY;AAAA,QAAI,CAACG,MACjCA,EAAW,OAAOG,EAAoB,KAAKC,EAAS,KAAKJ,EAAW;AAAA,MAAA;AAGlE,YAAAL,EAAsBF,GAASM,CAAW;AAAA,IAAA;AAAA,IAahD,qBAVwB,OAAOM,MAAoB;AACnD,YAAMN,IAAcM,EAAO,IAAI,CAACJ,MAAUA,EAAM,EAAE;AAE5C,YAAAN,EAAsBF,GAASM,CAAW;AAAA,IAAA;AAAA,IAQhD,aAAAF;AAAA,EAAA;AAER;"}
|