@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,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { createPluginFactory as m, createParagraphPlugin as c } from "@udecode/plate";
|
|
3
|
-
import { Plugin as u, merge as
|
|
4
|
-
import { TextStyles as
|
|
5
|
-
class
|
|
6
|
-
constructor({ styles: e =
|
|
7
|
-
super(
|
|
8
|
-
markupElement: new
|
|
3
|
+
import { Plugin as u, merge as g, alignmentClassnames as i, getColumnBreakClasses as P, MarkupElement as y } from "@frontify/fondue";
|
|
4
|
+
import { TextStyles as s, BlockStyles as h } from "../styles.es.js";
|
|
5
|
+
class A extends u {
|
|
6
|
+
constructor({ styles: e = h.p, ...r } = {}) {
|
|
7
|
+
super(s.p, {
|
|
8
|
+
markupElement: new x(),
|
|
9
9
|
label: "Body Text",
|
|
10
10
|
...r
|
|
11
11
|
}), this.styles = {}, this.styles = e;
|
|
@@ -14,28 +14,28 @@ class w extends u {
|
|
|
14
14
|
return [E(this.styles)];
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
const n = t.align, p =
|
|
19
|
-
return /* @__PURE__ */ l
|
|
17
|
+
const k = "tw-m-0 tw-px-0 tw-py-0", a = ({ element: t, attributes: e, children: r, styles: o }) => {
|
|
18
|
+
const n = t.align, p = g([n && i[n], k, P(t)]);
|
|
19
|
+
return /* @__PURE__ */ l("p", { ...e, className: p, style: o, children: r });
|
|
20
20
|
};
|
|
21
|
-
class
|
|
22
|
-
constructor(e =
|
|
21
|
+
class x extends y {
|
|
22
|
+
constructor(e = s.p, r = a) {
|
|
23
23
|
super(e, r);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
const E = (t) => m({
|
|
27
27
|
...c(),
|
|
28
|
-
key:
|
|
28
|
+
key: s.p,
|
|
29
29
|
isElement: !0,
|
|
30
|
-
component:
|
|
30
|
+
component: a
|
|
31
31
|
})({
|
|
32
|
-
component: (e) => /* @__PURE__ */ l
|
|
32
|
+
component: (e) => /* @__PURE__ */ l(a, { ...e, styles: t })
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
k as PARAGRAPH_CLASSES,
|
|
36
|
+
x as ParagraphMarkupElement,
|
|
37
|
+
a as ParagraphMarkupElementNode,
|
|
38
|
+
A as ParagraphPlugin,
|
|
39
39
|
E as createParagraphPlugin
|
|
40
40
|
};
|
|
41
41
|
//# sourceMappingURL=paragraphPlugin.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraphPlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createParagraphPlugin as createPlateParagraphPlugin, createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nexport class ParagraphPlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.p, ...props }: PluginProps = {}) {\n super(TextStyles.p, {\n markupElement: new ParagraphMarkupElement(),\n label: 'Body Text',\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createParagraphPlugin(this.styles)];\n }\n}\n\nexport const PARAGRAPH_CLASSES = 'tw-m-0 tw-px-0 tw-py-0';\n\nexport const ParagraphMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n const className = merge([align && alignmentClassnames[align], PARAGRAPH_CLASSES, getColumnBreakClasses(element)]);\n return (\n <p {...attributes} className={className} style={styles}>\n {children}\n </p>\n );\n};\n\nexport class ParagraphMarkupElement extends MarkupElement {\n constructor(id = TextStyles.p, node = ParagraphMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const createParagraphPlugin = (styles: CSSProperties) =>\n createPluginFactory({\n ...createPlateParagraphPlugin(),\n key: TextStyles.p,\n isElement: true,\n component: ParagraphMarkupElementNode,\n })({\n component: (props: TextStyleRenderElementProps) => <ParagraphMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ParagraphPlugin","Plugin","styles","BlockStyles","props","TextStyles","ParagraphMarkupElement","createParagraphPlugin","PARAGRAPH_CLASSES","ParagraphMarkupElementNode","element","attributes","children","align","className","merge","alignmentClassnames","getColumnBreakClasses","MarkupElement","id","node","createPluginFactory","createPlateParagraphPlugin"],"mappings":";;;;AAeO,MAAMA,UAAwBC,EAAO;AAAA,EAExC,YAAY,EAAE,QAAAC,IAASC,EAAY,GAAG,GAAGC,EAAuB,IAAA,IAAI;AAChE,UAAMC,EAAW,GAAG;AAAA,MAChB,eAAe,IAAIC,EAAuB;AAAA,MAC1C,OAAO;AAAA,MACP,GAAGF;AAAA,IAAA,CACN,GANL,KAAO,SAAwB,IAO3B,KAAK,SAASF;AAAA,EAClB;AAAA,EAEA,UAAU;AACN,WAAO,CAACK,EAAsB,KAAK,MAAM,CAAC;AAAA,EAC9C;AACJ;AAEO,MAAMC,IAAoB,0BAEpBC,IAA6B,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,UAAAC,GAAU,QAAAV,QAA0C;AAClH,QAAMW,IAAQH,EAAQ,OAChBI,IAAYC,EAAM,CAACF,KAASG,EAAoBH,CAAK,GAAGL,GAAmBS,EAAsBP,CAAO,CAAC,CAAC;AAChH
|
|
1
|
+
{"version":3,"file":"paragraphPlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createParagraphPlugin as createPlateParagraphPlugin, createPluginFactory } from '@udecode/plate';\nimport type { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nexport class ParagraphPlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.p, ...props }: PluginProps = {}) {\n super(TextStyles.p, {\n markupElement: new ParagraphMarkupElement(),\n label: 'Body Text',\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createParagraphPlugin(this.styles)];\n }\n}\n\nexport const PARAGRAPH_CLASSES = 'tw-m-0 tw-px-0 tw-py-0';\n\nexport const ParagraphMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n const className = merge([align && alignmentClassnames[align], PARAGRAPH_CLASSES, getColumnBreakClasses(element)]);\n return (\n <p {...attributes} className={className} style={styles}>\n {children}\n </p>\n );\n};\n\nexport class ParagraphMarkupElement extends MarkupElement {\n constructor(id = TextStyles.p, node = ParagraphMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const createParagraphPlugin = (styles: CSSProperties) =>\n createPluginFactory({\n ...createPlateParagraphPlugin(),\n key: TextStyles.p,\n isElement: true,\n component: ParagraphMarkupElementNode,\n })({\n component: (props: TextStyleRenderElementProps) => <ParagraphMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ParagraphPlugin","Plugin","styles","BlockStyles","props","TextStyles","ParagraphMarkupElement","createParagraphPlugin","PARAGRAPH_CLASSES","ParagraphMarkupElementNode","element","attributes","children","align","className","merge","alignmentClassnames","getColumnBreakClasses","MarkupElement","id","node","createPluginFactory","createPlateParagraphPlugin"],"mappings":";;;;AAeO,MAAMA,UAAwBC,EAAO;AAAA,EAExC,YAAY,EAAE,QAAAC,IAASC,EAAY,GAAG,GAAGC,EAAuB,IAAA,IAAI;AAChE,UAAMC,EAAW,GAAG;AAAA,MAChB,eAAe,IAAIC,EAAuB;AAAA,MAC1C,OAAO;AAAA,MACP,GAAGF;AAAA,IAAA,CACN,GANL,KAAO,SAAwB,IAO3B,KAAK,SAASF;AAAA,EAClB;AAAA,EAEA,UAAU;AACN,WAAO,CAACK,EAAsB,KAAK,MAAM,CAAC;AAAA,EAC9C;AACJ;AAEO,MAAMC,IAAoB,0BAEpBC,IAA6B,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,UAAAC,GAAU,QAAAV,QAA0C;AAClH,QAAMW,IAAQH,EAAQ,OAChBI,IAAYC,EAAM,CAACF,KAASG,EAAoBH,CAAK,GAAGL,GAAmBS,EAAsBP,CAAO,CAAC,CAAC;AAChH,2BACK,KAAG,EAAA,GAAGC,GAAY,WAAAG,GAAsB,OAAOZ,GAC3C,UAAAU,EACL,CAAA;AAER;AAEO,MAAMN,UAA+BY,EAAc;AAAA,EACtD,YAAYC,IAAKd,EAAW,GAAGe,IAAOX,GAA4B;AAC9D,UAAMU,GAAIC,CAAI;AAAA,EAClB;AACJ;AAEa,MAAAb,IAAwB,CAACL,MAClCmB,EAAoB;AAAA,EAChB,GAAGC,EAA2B;AAAA,EAC9B,KAAKjB,EAAW;AAAA,EAChB,WAAW;AAAA,EACX,WAAWI;AACf,CAAC,EAAE;AAAA,EACC,WAAW,CAACL,wBAAwCK,GAA4B,EAAA,GAAGL,GAAO,QAAAF,GAAgB;AAC9G,CAAC;"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { createPluginFactory as a } from "@udecode/plate";
|
|
3
3
|
import { Plugin as m, MarkupElement as i, merge as c, alignmentClassnames as p, getColumnBreakClasses as g } from "@frontify/fondue";
|
|
4
|
-
import { TextStyles as r, BlockStyles as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
7
|
-
constructor({ styles: e =
|
|
4
|
+
import { TextStyles as r, BlockStyles as k } from "../styles.es.js";
|
|
5
|
+
const y = "textstyle-quote-plugin";
|
|
6
|
+
class h extends m {
|
|
7
|
+
constructor({ styles: e = k.quote, ...s } = {}) {
|
|
8
8
|
super(r.quote, {
|
|
9
9
|
label: "Quote",
|
|
10
|
-
markupElement: new
|
|
10
|
+
markupElement: new d(),
|
|
11
11
|
...s
|
|
12
12
|
}), this.styles = {}, this.styles = e;
|
|
13
13
|
}
|
|
14
14
|
plugins() {
|
|
15
|
-
return [
|
|
15
|
+
return [q(this.styles)];
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class
|
|
19
|
-
constructor(e =
|
|
18
|
+
class d extends i {
|
|
19
|
+
constructor(e = y, s = l) {
|
|
20
20
|
super(e, s);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
const l = ({ element: t, attributes: e, children: s, styles: u }) => {
|
|
24
24
|
const n = t.align;
|
|
25
|
-
return /* @__PURE__ */ o
|
|
25
|
+
return /* @__PURE__ */ o(
|
|
26
26
|
"blockquote",
|
|
27
27
|
{
|
|
28
28
|
...e,
|
|
29
29
|
className: c([n && p[n], g(t), "a-quote"]),
|
|
30
|
-
children: /* @__PURE__ */ o
|
|
30
|
+
children: /* @__PURE__ */ o("span", { style: u, children: s })
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
},
|
|
33
|
+
}, q = (t) => a({
|
|
34
34
|
key: r.quote,
|
|
35
35
|
isElement: !0,
|
|
36
36
|
component: l,
|
|
@@ -38,11 +38,11 @@ const l = ({ element: t, attributes: e, children: s, styles: u }) => {
|
|
|
38
38
|
rules: [{ validNodeName: ["blockquote", "BLOCKQUOTE"] }]
|
|
39
39
|
}
|
|
40
40
|
})({
|
|
41
|
-
component: (e) => /* @__PURE__ */ o
|
|
41
|
+
component: (e) => /* @__PURE__ */ o(l, { ...e, styles: t })
|
|
42
42
|
});
|
|
43
43
|
export {
|
|
44
44
|
l as QuoteMarkupElementNode,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
h as QuotePlugin,
|
|
46
|
+
q as createQuotePlugin
|
|
47
47
|
};
|
|
48
48
|
//# sourceMappingURL=quotePlugin.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotePlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-quote-plugin';\n\nexport class QuotePlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.quote, ...props }: PluginProps = {}) {\n super(TextStyles.quote, {\n label: 'Quote',\n markupElement: new QuoteMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createQuotePlugin(this.styles)];\n }\n}\n\nclass QuoteMarkupElement extends MarkupElement {\n constructor(id = ID, node = QuoteMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const QuoteMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <blockquote\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-quote'])}\n >\n <span style={styles}>{children}</span>\n </blockquote>\n );\n};\n\nexport const createQuotePlugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.quote,\n isElement: true,\n component: QuoteMarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['blockquote', 'BLOCKQUOTE'] }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <QuoteMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ID","QuotePlugin","Plugin","styles","BlockStyles","props","TextStyles","QuoteMarkupElement","createQuotePlugin","MarkupElement","id","node","QuoteMarkupElementNode","element","attributes","children","align","jsx","merge","alignmentClassnames","getColumnBreakClasses","createPluginFactory"],"mappings":";;;;AAeA,MAAMA,IAAK;AAEJ,MAAMC,UAAoBC,EAAO;AAAA,EAEpC,YAAY,EAAE,QAAAC,IAASC,EAAY,OAAO,GAAGC,EAAuB,IAAA,IAAI;AACpE,UAAMC,EAAW,OAAO;AAAA,MACpB,OAAO;AAAA,MACP,eAAe,IAAIC,EAAmB;AAAA,MACtC,GAAGF;AAAA,IAAA,CACN,GANL,KAAO,SAAwB,IAO3B,KAAK,SAASF;AAAA,EAClB;AAAA,EAEA,UAAU;AACN,WAAO,CAACK,EAAkB,KAAK,MAAM,CAAC;AAAA,EAC1C;AACJ;AAEA,MAAMD,UAA2BE,EAAc;AAAA,EAC3C,YAAYC,IAAKV,GAAIW,IAAOC,GAAwB;AAChD,UAAMF,GAAIC,CAAI;AAAA,EAClB;AACJ;AAEO,MAAMC,IAAyB,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,UAAAC,GAAU,QAAAZ,QAA0C;AAC9G,QAAMa,IAAQH,EAAQ;AAElB,
|
|
1
|
+
{"version":3,"file":"quotePlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createPluginFactory } from '@udecode/plate';\nimport type { CSSProperties } from 'react';\nimport {\n MarkupElement,\n Plugin,\n PluginProps,\n TextStyleRenderElementProps,\n alignmentClassnames,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue';\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-quote-plugin';\n\nexport class QuotePlugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.quote, ...props }: PluginProps = {}) {\n super(TextStyles.quote, {\n label: 'Quote',\n markupElement: new QuoteMarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins() {\n return [createQuotePlugin(this.styles)];\n }\n}\n\nclass QuoteMarkupElement extends MarkupElement {\n constructor(id = ID, node = QuoteMarkupElementNode) {\n super(id, node);\n }\n}\n\nexport const QuoteMarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <blockquote\n {...attributes}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element), 'a-quote'])}\n >\n <span style={styles}>{children}</span>\n </blockquote>\n );\n};\n\nexport const createQuotePlugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.quote,\n isElement: true,\n component: QuoteMarkupElementNode,\n deserializeHtml: {\n rules: [{ validNodeName: ['blockquote', 'BLOCKQUOTE'] }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <QuoteMarkupElementNode {...props} styles={styles} />,\n });\n"],"names":["ID","QuotePlugin","Plugin","styles","BlockStyles","props","TextStyles","QuoteMarkupElement","createQuotePlugin","MarkupElement","id","node","QuoteMarkupElementNode","element","attributes","children","align","jsx","merge","alignmentClassnames","getColumnBreakClasses","createPluginFactory"],"mappings":";;;;AAeA,MAAMA,IAAK;AAEJ,MAAMC,UAAoBC,EAAO;AAAA,EAEpC,YAAY,EAAE,QAAAC,IAASC,EAAY,OAAO,GAAGC,EAAuB,IAAA,IAAI;AACpE,UAAMC,EAAW,OAAO;AAAA,MACpB,OAAO;AAAA,MACP,eAAe,IAAIC,EAAmB;AAAA,MACtC,GAAGF;AAAA,IAAA,CACN,GANL,KAAO,SAAwB,IAO3B,KAAK,SAASF;AAAA,EAClB;AAAA,EAEA,UAAU;AACN,WAAO,CAACK,EAAkB,KAAK,MAAM,CAAC;AAAA,EAC1C;AACJ;AAEA,MAAMD,UAA2BE,EAAc;AAAA,EAC3C,YAAYC,IAAKV,GAAIW,IAAOC,GAAwB;AAChD,UAAMF,GAAIC,CAAI;AAAA,EAClB;AACJ;AAEO,MAAMC,IAAyB,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,UAAAC,GAAU,QAAAZ,QAA0C;AAC9G,QAAMa,IAAQH,EAAQ;AAElB,SAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGH;AAAA,MACJ,WAAWI,EAAM,CAACF,KAASG,EAAoBH,CAAK,GAAGI,EAAsBP,CAAO,GAAG,SAAS,CAAC;AAAA,MAEjG,UAAC,gBAAAI,EAAA,QAAA,EAAK,OAAOd,GAAS,UAAAY,GAAS;AAAA,IAAA;AAAA,EAAA;AAG3C,GAEaP,IAAoB,CAACL,MAC9BkB,EAAoB;AAAA,EAChB,KAAKf,EAAW;AAAA,EAChB,WAAW;AAAA,EACX,WAAWM;AAAA,EACX,iBAAiB;AAAA,IACb,OAAO,CAAC,EAAE,eAAe,CAAC,cAAc,YAAY,GAAG;AAAA,EAC3D;AACJ,CAAC,EAAE;AAAA,EACC,WAAW,CAACP,wBAAwCO,GAAwB,EAAA,GAAGP,GAAO,QAAAF,GAAgB;AAC1G,CAAC;"}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { PageLinks as
|
|
4
|
-
import { merge as
|
|
5
|
-
const
|
|
6
|
-
document:
|
|
7
|
-
appBridge:
|
|
8
|
-
selectedUrl:
|
|
9
|
-
onSelectUrl:
|
|
1
|
+
import { jsxs as i, Fragment as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useEffect as b } from "react";
|
|
3
|
+
import { PageLinks as m } from "./PageLinks.es.js";
|
|
4
|
+
import { merge as a, IconColorFan16 as h } from "@frontify/fondue";
|
|
5
|
+
const u = ({
|
|
6
|
+
document: t,
|
|
7
|
+
appBridge: c,
|
|
8
|
+
selectedUrl: w,
|
|
9
|
+
onSelectUrl: n,
|
|
10
10
|
itemsToExpandInitially: r
|
|
11
11
|
}) => {
|
|
12
|
-
const [
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
}, [r,
|
|
16
|
-
/* @__PURE__ */
|
|
12
|
+
const [o, s] = x(t.id === r.documentId), d = t.permanentLink === w;
|
|
13
|
+
return b(() => {
|
|
14
|
+
t.id === r.documentId && s(!0);
|
|
15
|
+
}, [r, t.id]), /* @__PURE__ */ i(l, { children: [
|
|
16
|
+
/* @__PURE__ */ i(
|
|
17
17
|
"button",
|
|
18
18
|
{
|
|
19
19
|
"data-test-id": "internal-link-selector-document-link",
|
|
20
|
-
className:
|
|
20
|
+
className: a([
|
|
21
21
|
"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-px-2.5 tw-leading-5 tw-cursor-pointer tw-w-full",
|
|
22
|
-
|
|
22
|
+
d ? "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"
|
|
23
23
|
]),
|
|
24
|
-
onClick: () =>
|
|
25
|
-
onFocus: () =>
|
|
24
|
+
onClick: () => n(t.permanentLink),
|
|
25
|
+
onFocus: () => n(t.permanentLink),
|
|
26
26
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
28
|
"div",
|
|
29
29
|
{
|
|
30
30
|
role: "button",
|
|
31
31
|
tabIndex: 0,
|
|
32
32
|
"data-test-id": "tree-item-toggle",
|
|
33
33
|
className: "tw-flex tw-items-center tw-justify-center tw-p-1.5 tw-cursor-pointer",
|
|
34
|
-
onClick: () =>
|
|
35
|
-
onFocus: () =>
|
|
36
|
-
children: /* @__PURE__ */
|
|
34
|
+
onClick: () => s(!o),
|
|
35
|
+
onFocus: () => s(!o),
|
|
36
|
+
children: /* @__PURE__ */ e(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
|
-
className:
|
|
39
|
+
className: a([
|
|
40
40
|
"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",
|
|
41
|
-
|
|
41
|
+
o ? "tw-rotate-90" : ""
|
|
42
42
|
])
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ e(h, {}),
|
|
48
|
+
/* @__PURE__ */ e("span", { className: "tw-text-s", children: t.title }),
|
|
49
|
+
/* @__PURE__ */ e("span", { className: "tw-flex-auto tw-font-sans tw-text-xs tw-text-right", children: "Document" })
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
o && /* @__PURE__ */ e(
|
|
54
|
+
m,
|
|
55
55
|
{
|
|
56
|
-
appBridge:
|
|
57
|
-
documentId:
|
|
58
|
-
selectedUrl:
|
|
59
|
-
onSelectUrl:
|
|
56
|
+
appBridge: c,
|
|
57
|
+
documentId: t.id,
|
|
58
|
+
selectedUrl: w,
|
|
59
|
+
onSelectUrl: n,
|
|
60
60
|
itemsToExpandInitially: r
|
|
61
61
|
}
|
|
62
62
|
)
|
|
63
63
|
] });
|
|
64
64
|
};
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
u as DocumentLink
|
|
67
67
|
};
|
|
68
68
|
//# sourceMappingURL=DocumentLink.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { useEffect, useState } from 'react';\nimport { PageLinks } from './PageLinks';\nimport { IconColorFan16, merge } from '@frontify/fondue';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\n\ntype DocumentLinkProps = {\n document: {\n id: number;\n title: string;\n permanentLink: string;\n };\n appBridge: AppBridgeBlock;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const DocumentLink = ({\n document,\n appBridge,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n}: DocumentLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(document.id === itemsToExpandInitially.documentId);\n const isActive = document.permanentLink === selectedUrl;\n\n useEffect(() => {\n if (document.id === itemsToExpandInitially.documentId) {\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, document.id]);\n\n return (\n <>\n <button\n data-test-id=\"internal-link-selector-document-link\"\n className={merge([\n 'tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-px-2.5 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(document.permanentLink)}\n onFocus={() => onSelectUrl(document.permanentLink)}\n >\n <div\n role=\"button\"\n tabIndex={0}\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 </div>\n <IconColorFan16 />\n <span className=\"tw-text-s\">{document.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Document</span>\n </button>\n {isExpanded && (\n <PageLinks\n appBridge={appBridge}\n documentId={document.id}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n )}\n </>\n );\n};\n"],"names":["DocumentLink","document","appBridge","selectedUrl","onSelectUrl","itemsToExpandInitially","isExpanded","setIsExpanded","useState","isActive","useEffect","jsxs","Fragment","merge","jsx","IconColorFan16","PageLinks"],"mappings":";;;;AAoBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AACJ,MAAyB;AACf,QAAA,CAACC,GAAYC,CAAa,IAAIC,
|
|
1
|
+
{"version":3,"file":"DocumentLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { useEffect, useState } from 'react';\nimport { PageLinks } from './PageLinks';\nimport { IconColorFan16, merge } from '@frontify/fondue';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\n\ntype DocumentLinkProps = {\n document: {\n id: number;\n title: string;\n permanentLink: string;\n };\n appBridge: AppBridgeBlock;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n};\n\nexport const DocumentLink = ({\n document,\n appBridge,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n}: DocumentLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(document.id === itemsToExpandInitially.documentId);\n const isActive = document.permanentLink === selectedUrl;\n\n useEffect(() => {\n if (document.id === itemsToExpandInitially.documentId) {\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, document.id]);\n\n return (\n <>\n <button\n data-test-id=\"internal-link-selector-document-link\"\n className={merge([\n 'tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-px-2.5 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(document.permanentLink)}\n onFocus={() => onSelectUrl(document.permanentLink)}\n >\n <div\n role=\"button\"\n tabIndex={0}\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 </div>\n <IconColorFan16 />\n <span className=\"tw-text-s\">{document.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Document</span>\n </button>\n {isExpanded && (\n <PageLinks\n appBridge={appBridge}\n documentId={document.id}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n )}\n </>\n );\n};\n"],"names":["DocumentLink","document","appBridge","selectedUrl","onSelectUrl","itemsToExpandInitially","isExpanded","setIsExpanded","useState","isActive","useEffect","jsxs","Fragment","merge","jsx","IconColorFan16","PageLinks"],"mappings":";;;;AAoBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AACJ,MAAyB;AACf,QAAA,CAACC,GAAYC,CAAa,IAAIC,EAASP,EAAS,OAAOI,EAAuB,UAAU,GACxFI,IAAWR,EAAS,kBAAkBE;AAE5C,SAAAO,EAAU,MAAM;AACR,IAAAT,EAAS,OAAOI,EAAuB,cACvCE,EAAc,EAAI;AAAA,EAEvB,GAAA,CAACF,GAAwBJ,EAAS,EAAE,CAAC,GAIhC,gBAAAU,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,gBAAa;AAAA,QACb,WAAWE,EAAM;AAAA,UACb;AAAA,UACAJ,IACM,oKACA;AAAA,QAAA,CACT;AAAA,QACD,SAAS,MAAML,EAAYH,EAAS,aAAa;AAAA,QACjD,SAAS,MAAMG,EAAYH,EAAS,aAAa;AAAA,QAEjD,UAAA;AAAA,UAAA,gBAAAa;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL,UAAU;AAAA,cACV,gBAAa;AAAA,cACb,WAAU;AAAA,cACV,SAAS,MAAMP,EAAc,CAACD,CAAU;AAAA,cACxC,SAAS,MAAMC,EAAc,CAACD,CAAU;AAAA,cAExC,UAAA,gBAAAQ;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAWD,EAAM;AAAA,oBACb;AAAA,oBACAP,IAAa,iBAAiB;AAAA,kBAAA,CACjC;AAAA,gBAAA;AAAA,cACJ;AAAA,YAAA;AAAA,UACL;AAAA,4BACCS,GAAe,EAAA;AAAA,UACf,gBAAAD,EAAA,QAAA,EAAK,WAAU,aAAa,YAAS,OAAM;AAAA,UAC3C,gBAAAA,EAAA,QAAA,EAAK,WAAU,sDAAqD,UAAQ,YAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACjF;AAAA,IACCR,KACG,gBAAAQ;AAAA,MAACE;AAAA,MAAA;AAAA,QACG,WAAAd;AAAA,QACA,YAAYD,EAAS;AAAA,QACrB,aAAAE;AAAA,QACA,aAAAC;AAAA,QACA,wBAAAC;AAAA,MAAA;AAAA,IACJ;AAAA,EAER,EAAA,CAAA;AAER;"}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LoadingCircle as
|
|
3
|
-
import { r as
|
|
4
|
-
import { DocumentLink as
|
|
5
|
-
const
|
|
6
|
-
const [
|
|
1
|
+
import { jsx as i, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingCircle as h } from "@frontify/fondue";
|
|
3
|
+
import { useState as r, useEffect as d } from "react";
|
|
4
|
+
import { DocumentLink as x } from "./DocumentLink.es.js";
|
|
5
|
+
const C = ({ appBridge: e, selectedUrl: n, onSelectUrl: m }) => {
|
|
6
|
+
const [u, l] = r(!0), [f, I] = r([]), [g, p] = r({
|
|
7
7
|
documentId: void 0,
|
|
8
8
|
pageId: void 0
|
|
9
|
-
}),
|
|
10
|
-
|
|
11
|
-
n &&
|
|
12
|
-
|
|
9
|
+
}), o = [...f.values()];
|
|
10
|
+
d(() => {
|
|
11
|
+
n && o.length > 0 && y().then((t) => {
|
|
12
|
+
p(t);
|
|
13
13
|
});
|
|
14
|
-
}, [
|
|
14
|
+
}, [o.length]), d(() => {
|
|
15
15
|
e.getAllDocuments().then((t) => {
|
|
16
|
-
|
|
16
|
+
I(t);
|
|
17
17
|
}).finally(() => {
|
|
18
|
-
|
|
18
|
+
l(!1);
|
|
19
19
|
});
|
|
20
20
|
}, []);
|
|
21
|
-
const
|
|
21
|
+
const y = async () => {
|
|
22
22
|
const t = {
|
|
23
23
|
documentId: void 0,
|
|
24
24
|
pageId: void 0
|
|
25
25
|
};
|
|
26
|
-
if (
|
|
26
|
+
if (o.find((s) => s.permanentLink === n))
|
|
27
27
|
return t;
|
|
28
|
-
for (const
|
|
29
|
-
const
|
|
28
|
+
for (const s of o) {
|
|
29
|
+
const D = await e.getDocumentPagesByDocumentId(s.id);
|
|
30
30
|
e.getAllDocuments();
|
|
31
|
-
const a = [...
|
|
32
|
-
if (!!a.find((
|
|
33
|
-
return t.documentId =
|
|
34
|
-
for (const
|
|
35
|
-
if (!![...(await e.getDocumentSectionsByDocumentPageId(
|
|
36
|
-
return t.documentId =
|
|
31
|
+
const a = [...D.values()];
|
|
32
|
+
if (!!a.find((c) => c.permanentLink === n))
|
|
33
|
+
return t.documentId = s.id, t;
|
|
34
|
+
for (const c of a)
|
|
35
|
+
if (!![...(await e.getDocumentSectionsByDocumentPageId(c.id)).values()].find((L) => L.permanentLink === n))
|
|
36
|
+
return t.documentId = s.id, t.pageId = c.id, t;
|
|
37
37
|
}
|
|
38
38
|
return t;
|
|
39
39
|
};
|
|
40
|
-
return
|
|
41
|
-
|
|
40
|
+
return u ? /* @__PURE__ */ i("div", { className: "tw-flex tw-justify-center tw-p-4", children: /* @__PURE__ */ i(h, {}) }) : /* @__PURE__ */ i(v, { children: o.map((t) => /* @__PURE__ */ i(
|
|
41
|
+
x,
|
|
42
42
|
{
|
|
43
43
|
document: t,
|
|
44
44
|
appBridge: e,
|
|
45
45
|
selectedUrl: n,
|
|
46
|
-
onSelectUrl:
|
|
47
|
-
itemsToExpandInitially:
|
|
46
|
+
onSelectUrl: m,
|
|
47
|
+
itemsToExpandInitially: g
|
|
48
48
|
},
|
|
49
49
|
t.id
|
|
50
50
|
)) });
|
|
51
51
|
};
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
C as DocumentLinks
|
|
54
54
|
};
|
|
55
55
|
//# sourceMappingURL=DocumentLinks.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentLinks.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, Document } from '@frontify/app-bridge';\nimport { LoadingCircle } from '@frontify/fondue';\nimport { ReactElement, useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { DocumentLink } from './DocumentLink';\n\ntype DocumentLinksProps = {\n appBridge: AppBridgeBlock;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n};\n\nexport const DocumentLinks = ({ appBridge, selectedUrl, onSelectUrl }: DocumentLinksProps): ReactElement => {\n const [isLoading, setIsLoading] = useState(true);\n const [documents, setDocuments] = useState<Document[]>([]);\n const [itemsToExpandInitially, setItemsToExpandInitially] = useState<InitiallyExpandedItems>({\n documentId: undefined,\n pageId: undefined,\n });\n\n const documentArray = [...documents.values()];\n\n useEffect(() => {\n if (selectedUrl && documentArray.length > 0) {\n findLocationOfSelectedUrl().then((items) => {\n setItemsToExpandInitially(items);\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [documentArray.length]);\n\n useEffect(() => {\n appBridge\n .getAllDocuments()\n .then((_documents) => {\n setDocuments(_documents);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n const findLocationOfSelectedUrl = async () => {\n const itemsToExpand: InitiallyExpandedItems = {\n documentId: undefined,\n pageId: undefined,\n };\n const selectedUrlIsDocument = documentArray.find((document) => document.permanentLink === selectedUrl);\n if (selectedUrlIsDocument) {\n return itemsToExpand;\n }\n for (const document of documentArray) {\n const pages = await appBridge.getDocumentPagesByDocumentId(document.id);\n appBridge.getAllDocuments();\n const pagesArray = [...pages.values()];\n const selectedUrlIsPage = !!pagesArray.find((page) => page.permanentLink === selectedUrl);\n if (selectedUrlIsPage) {\n itemsToExpand.documentId = document.id;\n return itemsToExpand;\n }\n for (const page of pagesArray) {\n const sections = await appBridge.getDocumentSectionsByDocumentPageId(page.id);\n const sectionsArray = [...sections.values()];\n const selectedUrlIsSection = !!sectionsArray.find((section) => section.permanentLink === selectedUrl);\n if (selectedUrlIsSection) {\n itemsToExpand.documentId = document.id;\n itemsToExpand.pageId = page.id;\n return itemsToExpand;\n }\n }\n }\n return itemsToExpand;\n };\n\n return isLoading ? (\n <div className=\"tw-flex tw-justify-center tw-p-4\">\n <LoadingCircle />\n </div>\n ) : (\n <>\n {documentArray.map((document) => {\n return (\n <DocumentLink\n key={document.id}\n document={document}\n appBridge={appBridge}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n );\n })}\n </>\n );\n};\n"],"names":["DocumentLinks","appBridge","selectedUrl","onSelectUrl","isLoading","setIsLoading","useState","documents","setDocuments","itemsToExpandInitially","setItemsToExpandInitially","documentArray","useEffect","findLocationOfSelectedUrl","items","_documents","itemsToExpand","document","pages","pagesArray","page","section","jsx","LoadingCircle","Fragment","DocumentLink"],"mappings":";;;;AAcO,MAAMA,IAAgB,CAAC,EAAE,WAAAC,GAAW,aAAAC,GAAa,aAAAC,QAAoD;AACxG,QAAM,CAACC,GAAWC,CAAY,IAAIC,
|
|
1
|
+
{"version":3,"file":"DocumentLinks.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock, Document } from '@frontify/app-bridge';\nimport { LoadingCircle } from '@frontify/fondue';\nimport { ReactElement, useEffect, useState } from 'react';\nimport { InitiallyExpandedItems } from '../../LinkPlugin/FloatingLink/InsertLinkModal/types';\nimport { DocumentLink } from './DocumentLink';\n\ntype DocumentLinksProps = {\n appBridge: AppBridgeBlock;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n};\n\nexport const DocumentLinks = ({ appBridge, selectedUrl, onSelectUrl }: DocumentLinksProps): ReactElement => {\n const [isLoading, setIsLoading] = useState(true);\n const [documents, setDocuments] = useState<Document[]>([]);\n const [itemsToExpandInitially, setItemsToExpandInitially] = useState<InitiallyExpandedItems>({\n documentId: undefined,\n pageId: undefined,\n });\n\n const documentArray = [...documents.values()];\n\n useEffect(() => {\n if (selectedUrl && documentArray.length > 0) {\n findLocationOfSelectedUrl().then((items) => {\n setItemsToExpandInitially(items);\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [documentArray.length]);\n\n useEffect(() => {\n appBridge\n .getAllDocuments()\n .then((_documents) => {\n setDocuments(_documents);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n const findLocationOfSelectedUrl = async () => {\n const itemsToExpand: InitiallyExpandedItems = {\n documentId: undefined,\n pageId: undefined,\n };\n const selectedUrlIsDocument = documentArray.find((document) => document.permanentLink === selectedUrl);\n if (selectedUrlIsDocument) {\n return itemsToExpand;\n }\n for (const document of documentArray) {\n const pages = await appBridge.getDocumentPagesByDocumentId(document.id);\n appBridge.getAllDocuments();\n const pagesArray = [...pages.values()];\n const selectedUrlIsPage = !!pagesArray.find((page) => page.permanentLink === selectedUrl);\n if (selectedUrlIsPage) {\n itemsToExpand.documentId = document.id;\n return itemsToExpand;\n }\n for (const page of pagesArray) {\n const sections = await appBridge.getDocumentSectionsByDocumentPageId(page.id);\n const sectionsArray = [...sections.values()];\n const selectedUrlIsSection = !!sectionsArray.find((section) => section.permanentLink === selectedUrl);\n if (selectedUrlIsSection) {\n itemsToExpand.documentId = document.id;\n itemsToExpand.pageId = page.id;\n return itemsToExpand;\n }\n }\n }\n return itemsToExpand;\n };\n\n return isLoading ? (\n <div className=\"tw-flex tw-justify-center tw-p-4\">\n <LoadingCircle />\n </div>\n ) : (\n <>\n {documentArray.map((document) => {\n return (\n <DocumentLink\n key={document.id}\n document={document}\n appBridge={appBridge}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n />\n );\n })}\n </>\n );\n};\n"],"names":["DocumentLinks","appBridge","selectedUrl","onSelectUrl","isLoading","setIsLoading","useState","documents","setDocuments","itemsToExpandInitially","setItemsToExpandInitially","documentArray","useEffect","findLocationOfSelectedUrl","items","_documents","itemsToExpand","document","pages","pagesArray","page","section","jsx","LoadingCircle","Fragment","DocumentLink"],"mappings":";;;;AAcO,MAAMA,IAAgB,CAAC,EAAE,WAAAC,GAAW,aAAAC,GAAa,aAAAC,QAAoD;AACxG,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAI,GACzC,CAACC,GAAWC,CAAY,IAAIF,EAAqB,CAAE,CAAA,GACnD,CAACG,GAAwBC,CAAyB,IAAIJ,EAAiC;AAAA,IACzF,YAAY;AAAA,IACZ,QAAQ;AAAA,EAAA,CACX,GAEKK,IAAgB,CAAC,GAAGJ,EAAU,OAAQ,CAAA;AAE5C,EAAAK,EAAU,MAAM;AACR,IAAAV,KAAeS,EAAc,SAAS,KACZE,EAAA,EAAE,KAAK,CAACC,MAAU;AACxC,MAAAJ,EAA0BI,CAAK;AAAA,IAAA,CAClC;AAAA,EACL,GAED,CAACH,EAAc,MAAM,CAAC,GAEzBC,EAAU,MAAM;AACZ,IAAAX,EACK,gBAAgB,EAChB,KAAK,CAACc,MAAe;AAClB,MAAAP,EAAaO,CAAU;AAAA,IAAA,CAC1B,EACA,QAAQ,MAAM;AACX,MAAAV,EAAa,EAAK;AAAA,IAAA,CACrB;AAAA,EACT,GAAG,CAAE,CAAA;AAEL,QAAMQ,IAA4B,YAAY;AAC1C,UAAMG,IAAwC;AAAA,MAC1C,YAAY;AAAA,MACZ,QAAQ;AAAA,IAAA;AAGZ,QAD8BL,EAAc,KAAK,CAACM,MAAaA,EAAS,kBAAkBf,CAAW;AAE1F,aAAAc;AAEX,eAAWC,KAAYN,GAAe;AAClC,YAAMO,IAAQ,MAAMjB,EAAU,6BAA6BgB,EAAS,EAAE;AACtE,MAAAhB,EAAU,gBAAgB;AAC1B,YAAMkB,IAAa,CAAC,GAAGD,EAAM,OAAQ,CAAA;AAErC,UAD0B,CAAC,CAACC,EAAW,KAAK,CAACC,MAASA,EAAK,kBAAkBlB,CAAW;AAEpF,eAAAc,EAAc,aAAaC,EAAS,IAC7BD;AAEX,iBAAWI,KAAQD;AAIf,YAD6B,CAAC,CADR,CAAC,IADN,MAAMlB,EAAU,oCAAoCmB,EAAK,EAAE,GACzC,OAAQ,CAAA,EACE,KAAK,CAACC,MAAYA,EAAQ,kBAAkBnB,CAAW;AAEhG,iBAAAc,EAAc,aAAaC,EAAS,IACpCD,EAAc,SAASI,EAAK,IACrBJ;AAAA,IAGnB;AACO,WAAAA;AAAA,EAAA;AAGX,SAAOZ,IACH,gBAAAkB,EAAC,OAAI,EAAA,WAAU,oCACX,UAAA,gBAAAA,EAACC,GAAc,CAAA,CAAA,GACnB,IAEA,gBAAAD,EAAAE,GAAA,EACK,UAAcb,EAAA,IAAI,CAACM,MAEZ,gBAAAK;AAAA,IAACG;AAAA,IAAA;AAAA,MAEG,UAAAR;AAAA,MACA,WAAAhB;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,wBAAAM;AAAA,IAAA;AAAA,IALKQ,EAAS;AAAA,EAAA,CAQzB,EACL,CAAA;AAER;"}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button as
|
|
3
|
-
import { useOverlayTriggerState as
|
|
4
|
-
import {
|
|
5
|
-
import { DocumentLinks as
|
|
6
|
-
const
|
|
7
|
-
const { open: u, isOpen: f, close:
|
|
8
|
-
c(
|
|
9
|
-
},
|
|
10
|
-
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Button as y, IconLink as D, ButtonSize as S, ButtonType as B, ButtonStyle as l, ButtonEmphasis as r, Modal as i } from "@frontify/fondue";
|
|
3
|
+
import { useOverlayTriggerState as L } from "@react-stately/overlays";
|
|
4
|
+
import { useState as C, useEffect as T } from "react";
|
|
5
|
+
import { DocumentLinks as x } from "./DocumentLinks.es.js";
|
|
6
|
+
const I = ({ appBridge: p, url: o, onUrlChange: m }) => {
|
|
7
|
+
const { open: u, isOpen: f, close: s } = L({}), [n, c] = C(o), k = (e) => {
|
|
8
|
+
c(e);
|
|
9
|
+
}, h = (e) => {
|
|
10
|
+
e.key === "Enter" && a();
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, [
|
|
12
|
+
T(() => {
|
|
13
|
+
o && !n && c(o);
|
|
14
|
+
}, [o, n]);
|
|
15
15
|
const a = () => {
|
|
16
|
-
m(
|
|
16
|
+
m(n), s();
|
|
17
17
|
};
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
18
|
+
return /* @__PURE__ */ d("div", { "data-test-id": "internal-link-selector", onKeyDown: h, children: [
|
|
19
|
+
/* @__PURE__ */ t(
|
|
20
|
+
y,
|
|
21
21
|
{
|
|
22
|
-
icon: /* @__PURE__ */
|
|
23
|
-
size:
|
|
24
|
-
type:
|
|
25
|
-
style:
|
|
26
|
-
emphasis:
|
|
22
|
+
icon: /* @__PURE__ */ t(D, {}),
|
|
23
|
+
size: S.Medium,
|
|
24
|
+
type: B.Button,
|
|
25
|
+
style: l.Default,
|
|
26
|
+
emphasis: r.Default,
|
|
27
27
|
onClick: () => u(),
|
|
28
28
|
children: "Internal link"
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
31
|
+
/* @__PURE__ */ d(i, { zIndex: 1001, onClose: () => s(), isOpen: f, isDismissable: !0, children: [
|
|
32
|
+
/* @__PURE__ */ t(i.Header, { title: "Select internal link" }),
|
|
33
|
+
/* @__PURE__ */ t(i.Body, { children: /* @__PURE__ */ t(x, { appBridge: p, selectedUrl: n, onSelectUrl: k }) }),
|
|
34
|
+
/* @__PURE__ */ t(
|
|
35
|
+
i.Footer,
|
|
36
36
|
{
|
|
37
37
|
buttons: [
|
|
38
38
|
{
|
|
39
39
|
children: "Cancel",
|
|
40
|
-
onClick: () =>
|
|
41
|
-
style:
|
|
42
|
-
emphasis:
|
|
40
|
+
onClick: () => s(),
|
|
41
|
+
style: l.Default,
|
|
42
|
+
emphasis: r.Default
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
children: "Choose",
|
|
46
|
-
onClick: (
|
|
47
|
-
|
|
46
|
+
onClick: (e) => {
|
|
47
|
+
e == null || e.preventDefault(), a();
|
|
48
48
|
},
|
|
49
|
-
style:
|
|
50
|
-
emphasis:
|
|
51
|
-
disabled: !
|
|
49
|
+
style: l.Default,
|
|
50
|
+
emphasis: r.Strong,
|
|
51
|
+
disabled: !n
|
|
52
52
|
}
|
|
53
53
|
]
|
|
54
54
|
}
|
|
@@ -57,6 +57,6 @@ const b = ({ appBridge: d, url: n, onUrlChange: m }) => {
|
|
|
57
57
|
] });
|
|
58
58
|
};
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
I as LinkSelector
|
|
61
61
|
};
|
|
62
62
|
//# sourceMappingURL=LinkSelector.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkSelector.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { Button, ButtonEmphasis, ButtonSize, ButtonStyle, ButtonType, IconLink, Modal } from '@frontify/fondue';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport { KeyboardEvent, ReactElement, useEffect, useState } from 'react';\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n appBridge: AppBridgeBlock;\n url: string;\n onUrlChange: (value: string) => void;\n};\n\nexport const LinkSelector = ({ appBridge, url, onUrlChange }: LinkSelectorProps): ReactElement => {\n const { open: openLinkTree, isOpen: isLinkTreeOpen, close: closeLinkTree } = useOverlayTriggerState({});\n const [selectedUrl, setSelectedUrl] = useState<string>(url);\n\n const onSelectUrl = (url: string) => {\n setSelectedUrl(url);\n };\n\n const onPressEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange(selectedUrl);\n closeLinkTree();\n };\n\n return (\n <div data-test-id=\"internal-link-selector\" onKeyDown={onPressEnter}>\n <Button\n icon={<IconLink />}\n size={ButtonSize.Medium}\n type={ButtonType.Button}\n style={ButtonStyle.Default}\n emphasis={ButtonEmphasis.Default}\n onClick={() => openLinkTree()}\n >\n Internal link\n </Button>\n <Modal zIndex={1001} onClose={() => closeLinkTree()} isOpen={isLinkTreeOpen} isDismissable>\n <Modal.Header title=\"Select internal link\" />\n <Modal.Body>\n <DocumentLinks appBridge={appBridge} selectedUrl={selectedUrl} onSelectUrl={onSelectUrl} />\n </Modal.Body>\n <Modal.Footer\n buttons={[\n {\n children: 'Cancel',\n onClick: () => closeLinkTree(),\n style: ButtonStyle.Default,\n emphasis: ButtonEmphasis.Default,\n },\n {\n children: 'Choose',\n onClick: (event) => {\n event?.preventDefault();\n saveLink();\n },\n style: ButtonStyle.Default,\n emphasis: ButtonEmphasis.Strong,\n disabled: !selectedUrl,\n },\n ]}\n />\n </Modal>\n </div>\n );\n};\n"],"names":["LinkSelector","appBridge","url","onUrlChange","openLinkTree","isLinkTreeOpen","closeLinkTree","useOverlayTriggerState","selectedUrl","setSelectedUrl","useState","onSelectUrl","onPressEnter","event","saveLink","useEffect","jsxs","jsx","Button","IconLink","ButtonSize","ButtonType","ButtonStyle","ButtonEmphasis","Modal","DocumentLinks"],"mappings":";;;;;AAcO,MAAMA,IAAe,CAAC,EAAE,WAAAC,GAAW,KAAAC,GAAK,aAAAC,QAAmD;AACxF,QAAA,EAAE,MAAMC,GAAc,QAAQC,GAAgB,OAAOC,EAAc,IAAIC,EAAuB,CAAA,CAAE,GAChG,CAACC,GAAaC,CAAc,IAAIC,
|
|
1
|
+
{"version":3,"file":"LinkSelector.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { Button, ButtonEmphasis, ButtonSize, ButtonStyle, ButtonType, IconLink, Modal } from '@frontify/fondue';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport { KeyboardEvent, ReactElement, useEffect, useState } from 'react';\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n appBridge: AppBridgeBlock;\n url: string;\n onUrlChange: (value: string) => void;\n};\n\nexport const LinkSelector = ({ appBridge, url, onUrlChange }: LinkSelectorProps): ReactElement => {\n const { open: openLinkTree, isOpen: isLinkTreeOpen, close: closeLinkTree } = useOverlayTriggerState({});\n const [selectedUrl, setSelectedUrl] = useState<string>(url);\n\n const onSelectUrl = (url: string) => {\n setSelectedUrl(url);\n };\n\n const onPressEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange(selectedUrl);\n closeLinkTree();\n };\n\n return (\n <div data-test-id=\"internal-link-selector\" onKeyDown={onPressEnter}>\n <Button\n icon={<IconLink />}\n size={ButtonSize.Medium}\n type={ButtonType.Button}\n style={ButtonStyle.Default}\n emphasis={ButtonEmphasis.Default}\n onClick={() => openLinkTree()}\n >\n Internal link\n </Button>\n <Modal zIndex={1001} onClose={() => closeLinkTree()} isOpen={isLinkTreeOpen} isDismissable>\n <Modal.Header title=\"Select internal link\" />\n <Modal.Body>\n <DocumentLinks appBridge={appBridge} selectedUrl={selectedUrl} onSelectUrl={onSelectUrl} />\n </Modal.Body>\n <Modal.Footer\n buttons={[\n {\n children: 'Cancel',\n onClick: () => closeLinkTree(),\n style: ButtonStyle.Default,\n emphasis: ButtonEmphasis.Default,\n },\n {\n children: 'Choose',\n onClick: (event) => {\n event?.preventDefault();\n saveLink();\n },\n style: ButtonStyle.Default,\n emphasis: ButtonEmphasis.Strong,\n disabled: !selectedUrl,\n },\n ]}\n />\n </Modal>\n </div>\n );\n};\n"],"names":["LinkSelector","appBridge","url","onUrlChange","openLinkTree","isLinkTreeOpen","closeLinkTree","useOverlayTriggerState","selectedUrl","setSelectedUrl","useState","onSelectUrl","onPressEnter","event","saveLink","useEffect","jsxs","jsx","Button","IconLink","ButtonSize","ButtonType","ButtonStyle","ButtonEmphasis","Modal","DocumentLinks"],"mappings":";;;;;AAcO,MAAMA,IAAe,CAAC,EAAE,WAAAC,GAAW,KAAAC,GAAK,aAAAC,QAAmD;AACxF,QAAA,EAAE,MAAMC,GAAc,QAAQC,GAAgB,OAAOC,EAAc,IAAIC,EAAuB,CAAA,CAAE,GAChG,CAACC,GAAaC,CAAc,IAAIC,EAAiBR,CAAG,GAEpDS,IAAc,CAACT,MAAgB;AACjC,IAAAO,EAAeP,CAAG;AAAA,EAAA,GAGhBU,IAAe,CAACC,MAA2C;AACzD,IAAAA,EAAM,QAAQ,WACLC;EACb;AAGJ,EAAAC,EAAU,MAAM;AACR,IAAAb,KAAO,CAACM,KACRC,EAAeP,CAAG;AAAA,EACtB,GACD,CAACA,GAAKM,CAAW,CAAC;AAErB,QAAMM,IAAW,MAAM;AACnB,IAAAX,EAAYK,CAAW,GACTF;EAAA;AAGlB,SACK,gBAAAU,EAAA,OAAA,EAAI,gBAAa,0BAAyB,WAAWJ,GAClD,UAAA;AAAA,IAAA,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,wBAAOC,GAAS,EAAA;AAAA,QAChB,MAAMC,EAAW;AAAA,QACjB,MAAMC,EAAW;AAAA,QACjB,OAAOC,EAAY;AAAA,QACnB,UAAUC,EAAe;AAAA,QACzB,SAAS,MAAMnB,EAAa;AAAA,QAC/B,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,IACA,gBAAAY,EAACQ,GAAM,EAAA,QAAQ,MAAM,SAAS,MAAMlB,EAAiB,GAAA,QAAQD,GAAgB,eAAa,IACtF,UAAA;AAAA,MAAA,gBAAAY,EAACO,EAAM,QAAN,EAAa,OAAM,uBAAuB,CAAA;AAAA,MAC3C,gBAAAP,EAACO,EAAM,MAAN,EACG,4BAACC,GAAc,EAAA,WAAAxB,GAAsB,aAAAO,GAA0B,aAAAG,EAAA,CAA0B,EAC7F,CAAA;AAAA,MACA,gBAAAM;AAAA,QAACO,EAAM;AAAA,QAAN;AAAA,UACG,SAAS;AAAA,YACL;AAAA,cACI,UAAU;AAAA,cACV,SAAS,MAAMlB,EAAc;AAAA,cAC7B,OAAOgB,EAAY;AAAA,cACnB,UAAUC,EAAe;AAAA,YAC7B;AAAA,YACA;AAAA,cACI,UAAU;AAAA,cACV,SAAS,CAACV,MAAU;AAChB,gBAAAA,KAAA,QAAAA,EAAO,kBACEC;cACb;AAAA,cACA,OAAOQ,EAAY;AAAA,cACnB,UAAUC,EAAe;AAAA,cACzB,UAAU,CAACf;AAAA,YACf;AAAA,UACJ;AAAA,QAAA;AAAA,MACJ;AAAA,IAAA,GACJ;AAAA,EACJ,EAAA,CAAA;AAER;"}
|