@frontify/guideline-blocks-settings 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/components/Attachments/AttachmentItem.es.js +64 -64
  2. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
  3. package/dist/components/Attachments/Attachments.es.js +31 -31
  4. package/dist/components/Attachments/Attachments.es.js.map +1 -1
  5. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +13 -13
  6. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +1 -1
  7. package/dist/components/BlockInjectButton/BlockInjectButton.es.js +18 -18
  8. package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
  9. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +29 -29
  10. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
  11. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +10 -10
  12. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -1
  13. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +10 -10
  14. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -1
  15. package/dist/components/DownloadButton/DownloadButton.es.js +14 -14
  16. package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -1
  17. package/dist/components/Link/LinkInput.es.js +15 -15
  18. package/dist/components/Link/LinkInput.es.js.map +1 -1
  19. package/dist/components/Link/LinkSelector/DocumentLink.es.js +28 -28
  20. package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +1 -1
  21. package/dist/components/Link/LinkSelector/PageLink.es.js +29 -29
  22. package/dist/components/Link/LinkSelector/PageLink.es.js.map +1 -1
  23. package/dist/components/Link/LinkSelector/PageLinks.es.js +9 -9
  24. package/dist/components/Link/LinkSelector/PageLinks.es.js.map +1 -1
  25. package/dist/components/Link/LinkSelector/SectionLink.es.js +10 -10
  26. package/dist/components/Link/LinkSelector/SectionLink.es.js.map +1 -1
  27. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +15 -13
  28. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
  29. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +17 -17
  30. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
  31. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +7 -7
  32. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
  33. package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js +27 -0
  34. package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js.map +1 -0
  35. package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js +30 -0
  36. package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js.map +1 -0
  37. package/dist/index.cjs.js +7 -7
  38. package/dist/index.cjs.js.map +1 -1
  39. package/dist/index.d.ts +12 -0
  40. package/dist/index.es.js +135 -131
  41. package/dist/index.es.js.map +1 -1
  42. package/dist/index.umd.js +6 -6
  43. package/dist/index.umd.js.map +1 -1
  44. package/dist/styles.css +1 -1
  45. package/package.json +13 -13
  46. package/tailwind.config.ts +17 -0
@@ -1,26 +1,26 @@
1
- import { jsxs as i, Fragment as b, jsx as e } from "react/jsx-runtime";
2
- import { IconColorFan as p } from "@frontify/fondue/icons";
3
- import { useState as x, useEffect as m } from "react";
4
- import { PageLinks as h } from "./PageLinks.es.js";
5
- const k = ({
1
+ import { jsxs as a, Fragment as d, jsx as e } from "react/jsx-runtime";
2
+ import { IconColorFan as g } from "@frontify/fondue/icons";
3
+ import { useState as p, useEffect as m } from "react";
4
+ import { PageLinks as b } from "./PageLinks.es.js";
5
+ const v = ({
6
6
  document: t,
7
- selectedUrl: n,
8
- onSelectUrl: s,
7
+ selectedUrl: o,
8
+ onSelectUrl: i,
9
9
  itemsToExpandInitially: r,
10
- getDocumentSectionsByDocumentPageId: c,
11
- getDocumentPagesByDocumentId: d
10
+ getDocumentSectionsByDocumentPageId: h,
11
+ getDocumentPagesByDocumentId: l
12
12
  }) => {
13
- const [o, w] = x(t.id === r.documentId), l = t.permanentLink === n;
13
+ const [n, s] = p(t.id === r.documentId), c = t.permanentLink === o;
14
14
  return m(() => {
15
- t.id === r.documentId && w(!0);
16
- }, [r, t.id]), /* @__PURE__ */ i(b, { children: [
17
- /* @__PURE__ */ i(
15
+ t.id === r.documentId && s(!0);
16
+ }, [r, t.id]), /* @__PURE__ */ a(d, { children: [
17
+ /* @__PURE__ */ a(
18
18
  "button",
19
19
  {
20
20
  type: "button",
21
21
  "data-test-id": "internal-link-selector-document-link",
22
- className: `tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full ${l ? "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
- onClick: () => s(t.permanentLink),
22
+ className: `tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full ${c ? "tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover" : "hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container"}`,
23
+ onClick: () => i(t.permanentLink),
24
24
  children: [
25
25
  /* @__PURE__ */ e(
26
26
  "button",
@@ -29,36 +29,36 @@ const k = ({
29
29
  tabIndex: 0,
30
30
  "data-test-id": "tree-item-toggle",
31
31
  className: "tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",
32
- onClick: () => w(!o),
33
- onKeyDown: (a) => a.key === "Enter" && a.stopPropagation(),
32
+ onClick: () => s(!n),
33
+ onKeyDown: (w) => w.key === "Enter" && w.stopPropagation(),
34
34
  children: /* @__PURE__ */ e(
35
35
  "div",
36
36
  {
37
- className: `tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong ${o ? "tw-rotate-90" : ""}`
37
+ className: `tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong ${n ? "tw-rotate-90" : ""}`
38
38
  }
39
39
  )
40
40
  }
41
41
  ),
42
- /* @__PURE__ */ e(p, { size: 16 }),
43
- /* @__PURE__ */ e("span", { className: "tw-text-s", children: t.title }),
44
- /* @__PURE__ */ e("span", { className: "tw-flex-auto tw-font-sans tw-text-xs tw-text-right", children: "Document" })
42
+ /* @__PURE__ */ e(g, { size: 16 }),
43
+ /* @__PURE__ */ e("span", { className: "tw-text-small", children: t.title }),
44
+ /* @__PURE__ */ e("span", { className: "tw-flex-auto tw-font-sans tw-text-x-small tw-text-right", children: "Document" })
45
45
  ]
46
46
  }
47
47
  ),
48
- o && /* @__PURE__ */ e(
49
- h,
48
+ n && /* @__PURE__ */ e(
49
+ b,
50
50
  {
51
51
  documentId: t.id,
52
- selectedUrl: n,
53
- onSelectUrl: s,
52
+ selectedUrl: o,
53
+ onSelectUrl: i,
54
54
  itemsToExpandInitially: r,
55
- getDocumentSectionsByDocumentPageId: c,
56
- getDocumentPagesByDocumentId: d
55
+ getDocumentSectionsByDocumentPageId: h,
56
+ getDocumentPagesByDocumentId: l
57
57
  }
58
58
  )
59
59
  ] });
60
60
  };
61
61
  export {
62
- k as DocumentLink
62
+ v as DocumentLink
63
63
  };
64
64
  //# sourceMappingURL=DocumentLink.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentLink.es.js","sources":["../../../../src/components/Link/LinkSelector/DocumentLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { IconColorFan } from '@frontify/fondue/icons';\nimport { useEffect, useState } from 'react';\n\nimport { type InitiallyExpandedItems } from '../types';\n\nimport { PageLinks } from './PageLinks';\n\ntype DocumentLinkProps = {\n document: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const DocumentLink = ({\n document,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n getDocumentPagesByDocumentId,\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 // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, document.id]);\n\n return (\n <>\n <button\n type=\"button\"\n data-test-id=\"internal-link-selector-document-link\"\n className={`tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-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 >\n <button\n type=\"button\"\n tabIndex={0}\n data-test-id=\"tree-item-toggle\"\n className=\"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onKeyDown={(event) => event.key === 'Enter' && event.stopPropagation()}\n >\n <div\n className={`tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong ${isExpanded ? 'tw-rotate-90' : ''}`}\n ></div>\n </button>\n <IconColorFan size={16} />\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 documentId={document.id}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n getDocumentPagesByDocumentId={getDocumentPagesByDocumentId}\n />\n )}\n </>\n );\n};\n"],"names":["DocumentLink","document","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","getDocumentPagesByDocumentId","isExpanded","setIsExpanded","useState","isActive","useEffect","jsxs","Fragment","jsx","event","IconColorFan","PageLinks"],"mappings":";;;;AAuBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AAAA,EACA,8BAAAC;AACJ,MAAyB;AACrB,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAASR,EAAS,OAAOG,EAAuB,UAAU,GACxFM,IAAWT,EAAS,kBAAkBC;AAE5C,SAAAS,EAAU,MAAM;AACZ,IAAIV,EAAS,OAAOG,EAAuB,cAEvCI,EAAc,EAAI;AAAA,EAE1B,GAAG,CAACJ,GAAwBH,EAAS,EAAE,CAAC,GAGpC,gBAAAW,EAAAC,GAAA,EACI,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,gBAAa;AAAA,QACb,WAAW,6GACPF,IACM,oKACA,uEACV;AAAA,QACA,SAAS,MAAMP,EAAYF,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,MAAMN,EAAc,CAACD,CAAU;AAAA,cACxC,WAAW,CAACQ,MAAUA,EAAM,QAAQ,WAAWA,EAAM,gBAAA;AAAA,cAErD,UAAA,gBAAAD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW,uKAAuKP,IAAa,iBAAiB,EAAE;AAAA,gBAAA;AAAA,cAAA;AAAA,YACrN;AAAA,UAAA;AAAA,UAEL,gBAAAO,EAACE,GAAA,EAAa,MAAM,GAAA,CAAI;AAAA,UACxB,gBAAAF,EAAC,QAAA,EAAK,WAAU,aAAa,YAAS,OAAM;AAAA,UAC5C,gBAAAA,EAAC,QAAA,EAAK,WAAU,sDAAqD,UAAA,WAAA,CAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAEhFP,KACG,gBAAAO;AAAA,MAACG;AAAA,MAAA;AAAA,QACG,YAAYhB,EAAS;AAAA,QACrB,aAAAC;AAAA,QACA,aAAAC;AAAA,QACA,wBAAAC;AAAA,QACA,qCAAAC;AAAA,QACA,8BAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GAER;AAER;"}
1
+ {"version":3,"file":"DocumentLink.es.js","sources":["../../../../src/components/Link/LinkSelector/DocumentLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { IconColorFan } from '@frontify/fondue/icons';\nimport { useEffect, useState } from 'react';\n\nimport { type InitiallyExpandedItems } from '../types';\n\nimport { PageLinks } from './PageLinks';\n\ntype DocumentLinkProps = {\n document: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const DocumentLink = ({\n document,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n getDocumentPagesByDocumentId,\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 // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, document.id]);\n\n return (\n <>\n <button\n type=\"button\"\n data-test-id=\"internal-link-selector-document-link\"\n className={`tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full ${\n isActive\n ? 'tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover'\n : 'hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container'\n }`}\n onClick={() => onSelectUrl(document.permanentLink)}\n >\n <button\n type=\"button\"\n tabIndex={0}\n data-test-id=\"tree-item-toggle\"\n className=\"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onKeyDown={(event) => event.key === 'Enter' && event.stopPropagation()}\n >\n <div\n className={`tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong ${isExpanded ? 'tw-rotate-90' : ''}`}\n ></div>\n </button>\n <IconColorFan size={16} />\n <span className=\"tw-text-small\">{document.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-x-small tw-text-right\">Document</span>\n </button>\n {isExpanded && (\n <PageLinks\n documentId={document.id}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n getDocumentPagesByDocumentId={getDocumentPagesByDocumentId}\n />\n )}\n </>\n );\n};\n"],"names":["DocumentLink","document","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","getDocumentPagesByDocumentId","isExpanded","setIsExpanded","useState","isActive","useEffect","jsxs","Fragment","jsx","event","IconColorFan","PageLinks"],"mappings":";;;;AAuBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AAAA,EACA,8BAAAC;AACJ,MAAyB;AACrB,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAASR,EAAS,OAAOG,EAAuB,UAAU,GACxFM,IAAWT,EAAS,kBAAkBC;AAE5C,SAAAS,EAAU,MAAM;AACZ,IAAIV,EAAS,OAAOG,EAAuB,cAEvCI,EAAc,EAAI;AAAA,EAE1B,GAAG,CAACJ,GAAwBH,EAAS,EAAE,CAAC,GAGpC,gBAAAW,EAAAC,GAAA,EACI,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,gBAAa;AAAA,QACb,WAAW,6GACPF,IACM,gIACA,gGACV;AAAA,QACA,SAAS,MAAMP,EAAYF,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,MAAMN,EAAc,CAACD,CAAU;AAAA,cACxC,WAAW,CAACQ,MAAUA,EAAM,QAAQ,WAAWA,EAAM,gBAAA;AAAA,cAErD,UAAA,gBAAAD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW,uKAAuKP,IAAa,iBAAiB,EAAE;AAAA,gBAAA;AAAA,cAAA;AAAA,YACrN;AAAA,UAAA;AAAA,UAEL,gBAAAO,EAACE,GAAA,EAAa,MAAM,GAAA,CAAI;AAAA,UACxB,gBAAAF,EAAC,QAAA,EAAK,WAAU,iBAAiB,YAAS,OAAM;AAAA,UAChD,gBAAAA,EAAC,QAAA,EAAK,WAAU,2DAA0D,UAAA,WAAA,CAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAErFP,KACG,gBAAAO;AAAA,MAACG;AAAA,MAAA;AAAA,QACG,YAAYhB,EAAS;AAAA,QACrB,aAAAC;AAAA,QACA,aAAAC;AAAA,QACA,wBAAAC;AAAA,QACA,qCAAAC;AAAA,QACA,8BAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GAER;AAER;"}
@@ -1,44 +1,44 @@
1
- import { jsxs as d, Fragment as u, jsx as r } from "react/jsx-runtime";
2
- import { useState as h, useEffect as m } from "react";
3
- import { filterDocumentSectionsWithUnreadableTitles as v } from "../helpers/filterDocumentSectionsWithUnreadableTitles.es.js";
4
- import { SectionLink as k } from "./SectionLink.es.js";
1
+ import { jsxs as l, Fragment as x, jsx as n } from "react/jsx-runtime";
2
+ import { useState as d, useEffect as m } from "react";
3
+ import { filterDocumentSectionsWithUnreadableTitles as g } from "../helpers/filterDocumentSectionsWithUnreadableTitles.es.js";
4
+ import { SectionLink as v } from "./SectionLink.es.js";
5
5
  const L = ({
6
6
  page: t,
7
- selectedUrl: i,
8
- onSelectUrl: w,
9
- itemsToExpandInitially: n,
10
- getDocumentSectionsByDocumentPageId: c
7
+ selectedUrl: s,
8
+ onSelectUrl: c,
9
+ itemsToExpandInitially: r,
10
+ getDocumentSectionsByDocumentPageId: w
11
11
  }) => {
12
- const [o, a] = h(t.id === n.documentId), [s, b] = h([]), x = t.permanentLink === i;
12
+ const [o, a] = d(t.id === r.documentId), [i, p] = d([]), f = t.permanentLink === s;
13
13
  m(() => {
14
14
  (async () => {
15
- const p = await c(t.id), f = v(p);
16
- b(f);
15
+ const b = await w(t.id), u = g(b);
16
+ p(u);
17
17
  })();
18
- }, [t.id, c]), m(() => {
19
- t.id === n.pageId && a(!0);
20
- }, [n, t.id]);
21
- const l = s.length > 0;
22
- return /* @__PURE__ */ d(u, { children: [
23
- /* @__PURE__ */ r(
18
+ }, [t.id, w]), m(() => {
19
+ t.id === r.pageId && a(!0);
20
+ }, [r, t.id]);
21
+ const h = i.length > 0;
22
+ return /* @__PURE__ */ l(x, { children: [
23
+ /* @__PURE__ */ n(
24
24
  "button",
25
25
  {
26
26
  type: "button",
27
27
  "data-test-id": "internal-link-selector-page-link",
28
28
  className: `
29
29
  tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-flex tw-w-full
30
- ${l ? "tw-pl-7 " : "tw-pl-12 "}
31
- ${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 "}`,
32
- onClick: () => w(t.permanentLink),
33
- children: /* @__PURE__ */ d("div", { className: "tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6", children: [
34
- l && /* @__PURE__ */ r(
30
+ ${h ? "tw-pl-7 " : "tw-pl-12 "}
31
+ ${f ? "tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover " : "hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container "}`,
32
+ onClick: () => c(t.permanentLink),
33
+ children: /* @__PURE__ */ l("div", { className: "tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6", children: [
34
+ h && /* @__PURE__ */ n(
35
35
  "button",
36
36
  {
37
37
  type: "button",
38
38
  className: "tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",
39
39
  onClick: () => a(!o),
40
40
  onKeyDown: (e) => e.key === "Enter" && e.stopPropagation(),
41
- children: /* @__PURE__ */ r(
41
+ children: /* @__PURE__ */ n(
42
42
  "div",
43
43
  {
44
44
  className: `tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong
@@ -47,17 +47,17 @@ const L = ({
47
47
  )
48
48
  }
49
49
  ),
50
- /* @__PURE__ */ r("span", { className: "tw-text-s", children: t.title }),
51
- /* @__PURE__ */ r("span", { className: "tw-flex-auto tw-font-sans tw-text-xs tw-text-right", children: "Page" })
50
+ /* @__PURE__ */ n("span", { className: "tw-text-small", children: t.title }),
51
+ /* @__PURE__ */ n("span", { className: "tw-flex-auto tw-font-sans tw-text-x-small tw-text-right", children: "Page" })
52
52
  ] }, t.id)
53
53
  }
54
54
  ),
55
- o && s.length > 0 && s.map((e) => /* @__PURE__ */ r(
56
- k,
55
+ o && i.length > 0 && i.map((e) => /* @__PURE__ */ n(
56
+ v,
57
57
  {
58
58
  section: e,
59
- selectedUrl: i,
60
- onSelectUrl: w
59
+ selectedUrl: s,
60
+ onSelectUrl: c
61
61
  },
62
62
  e.id
63
63
  ))
@@ -1 +1 @@
1
- {"version":3,"file":"PageLink.es.js","sources":["../../../../src/components/Link/LinkSelector/PageLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentSection } from '@frontify/app-bridge';\nimport { useEffect, useState } from 'react';\n\nimport { filterDocumentSectionsWithUnreadableTitles } from '../helpers/filterDocumentSectionsWithUnreadableTitles';\nimport { type DocumentSectionWithTitle, type InitiallyExpandedItems } from '../types';\n\nimport { SectionLink } from './SectionLink';\n\ntype PageLinkProps = {\n page: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n};\n\nexport const PageLink = ({\n page,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n}: PageLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(page.id === itemsToExpandInitially.documentId);\n const [documentSections, setDocumentSections] = useState<DocumentSectionWithTitle[]>([]);\n const isActive = page.permanentLink === selectedUrl;\n\n useEffect(() => {\n const fetchDocumentSections = async () => {\n const sections = await getDocumentSectionsByDocumentPageId(page.id);\n const sectionsWithReadableTitles = filterDocumentSectionsWithUnreadableTitles(sections);\n setDocumentSections(sectionsWithReadableTitles);\n };\n\n fetchDocumentSections();\n }, [page.id, getDocumentSectionsByDocumentPageId]);\n\n useEffect(() => {\n if (page.id === itemsToExpandInitially.pageId) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, page.id]);\n\n const hasSections = documentSections.length > 0;\n\n return (\n <>\n <button\n type=\"button\"\n data-test-id=\"internal-link-selector-page-link\"\n className={`\n tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-flex tw-w-full \n ${hasSections ? 'tw-pl-7 ' : 'tw-pl-12 '}\n ${\n isActive\n ? 'tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover '\n : 'hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover '\n }`}\n onClick={() => onSelectUrl(page.permanentLink)}\n >\n <div key={page.id} className=\"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6\">\n {hasSections && (\n <button\n type=\"button\"\n className=\"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onKeyDown={(event) => event.key === 'Enter' && event.stopPropagation()}\n >\n <div\n className={`tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong \n ${isExpanded ? 'tw-rotate-90 ' : ''}`}\n />\n </button>\n )}\n <span className=\"tw-text-s\">{page.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-xs tw-text-right\">Page</span>\n </div>\n </button>\n {isExpanded &&\n documentSections.length > 0 &&\n documentSections.map((section) => {\n return (\n <SectionLink\n key={section.id}\n section={section}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n />\n );\n })}\n </>\n );\n};\n"],"names":["PageLink","page","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","isExpanded","setIsExpanded","useState","documentSections","setDocumentSections","isActive","useEffect","sections","sectionsWithReadableTitles","filterDocumentSectionsWithUnreadableTitles","hasSections","jsxs","Fragment","jsx","event","section","SectionLink"],"mappings":";;;;AAsBO,MAAMA,IAAW,CAAC;AAAA,EACrB,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AACJ,MAAqB;AACjB,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAASP,EAAK,OAAOG,EAAuB,UAAU,GACpF,CAACK,GAAkBC,CAAmB,IAAIF,EAAqC,CAAA,CAAE,GACjFG,IAAWV,EAAK,kBAAkBC;AAExC,EAAAU,EAAU,MAAM;AAOZ,KAN8B,YAAY;AACtC,YAAMC,IAAW,MAAMR,EAAoCJ,EAAK,EAAE,GAC5Da,IAA6BC,EAA2CF,CAAQ;AACtF,MAAAH,EAAoBI,CAA0B;AAAA,IAClD,GAEA;AAAA,EACJ,GAAG,CAACb,EAAK,IAAII,CAAmC,CAAC,GAEjDO,EAAU,MAAM;AACZ,IAAIX,EAAK,OAAOG,EAAuB,UAEnCG,EAAc,EAAI;AAAA,EAE1B,GAAG,CAACH,GAAwBH,EAAK,EAAE,CAAC;AAEpC,QAAMe,IAAcP,EAAiB,SAAS;AAE9C,SACI,gBAAAQ,EAAAC,GAAA,EACI,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,gBAAa;AAAA,QACb,WAAW;AAAA;AAAA,sBAELH,IAAc,aAAa,WAAW;AAAA,sBAEpCL,IACM,qKACA,wEACV;AAAA,QACJ,SAAS,MAAMR,EAAYF,EAAK,aAAa;AAAA,QAE7C,UAAA,gBAAAgB,EAAC,OAAA,EAAkB,WAAU,yDACxB,UAAA;AAAA,UAAAD,KACG,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS,MAAMZ,EAAc,CAACD,CAAU;AAAA,cACxC,WAAW,CAACc,MAAUA,EAAM,QAAQ,WAAWA,EAAM,gBAAA;AAAA,cAErD,UAAA,gBAAAD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW;AAAA,kCACTb,IAAa,kBAAkB,EAAE;AAAA,gBAAA;AAAA,cAAA;AAAA,YACvC;AAAA,UAAA;AAAA,UAGR,gBAAAa,EAAC,QAAA,EAAK,WAAU,aAAa,YAAK,OAAM;AAAA,UACxC,gBAAAA,EAAC,QAAA,EAAK,WAAU,sDAAqD,UAAA,OAAA,CAAI;AAAA,QAAA,EAAA,GAfnElB,EAAK,EAgBf;AAAA,MAAA;AAAA,IAAA;AAAA,IAEHK,KACGG,EAAiB,SAAS,KAC1BA,EAAiB,IAAI,CAACY,MAEd,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QAEG,SAAAD;AAAA,QACA,aAAAnB;AAAA,QACA,aAAAC;AAAA,MAAA;AAAA,MAHKkB,EAAQ;AAAA,IAAA,CAMxB;AAAA,EAAA,GACT;AAER;"}
1
+ {"version":3,"file":"PageLink.es.js","sources":["../../../../src/components/Link/LinkSelector/PageLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentSection } from '@frontify/app-bridge';\nimport { useEffect, useState } from 'react';\n\nimport { filterDocumentSectionsWithUnreadableTitles } from '../helpers/filterDocumentSectionsWithUnreadableTitles';\nimport { type DocumentSectionWithTitle, type InitiallyExpandedItems } from '../types';\n\nimport { SectionLink } from './SectionLink';\n\ntype PageLinkProps = {\n page: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n};\n\nexport const PageLink = ({\n page,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n}: PageLinkProps) => {\n const [isExpanded, setIsExpanded] = useState(page.id === itemsToExpandInitially.documentId);\n const [documentSections, setDocumentSections] = useState<DocumentSectionWithTitle[]>([]);\n const isActive = page.permanentLink === selectedUrl;\n\n useEffect(() => {\n const fetchDocumentSections = async () => {\n const sections = await getDocumentSectionsByDocumentPageId(page.id);\n const sectionsWithReadableTitles = filterDocumentSectionsWithUnreadableTitles(sections);\n setDocumentSections(sectionsWithReadableTitles);\n };\n\n fetchDocumentSections();\n }, [page.id, getDocumentSectionsByDocumentPageId]);\n\n useEffect(() => {\n if (page.id === itemsToExpandInitially.pageId) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsExpanded(true);\n }\n }, [itemsToExpandInitially, page.id]);\n\n const hasSections = documentSections.length > 0;\n\n return (\n <>\n <button\n type=\"button\"\n data-test-id=\"internal-link-selector-page-link\"\n className={`\n tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-flex tw-w-full \n ${hasSections ? 'tw-pl-7 ' : 'tw-pl-12 '}\n ${\n isActive\n ? 'tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover '\n : 'hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container '\n }`}\n onClick={() => onSelectUrl(page.permanentLink)}\n >\n <div key={page.id} className=\"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6\">\n {hasSections && (\n <button\n type=\"button\"\n className=\"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer\"\n onClick={() => setIsExpanded(!isExpanded)}\n onKeyDown={(event) => event.key === 'Enter' && event.stopPropagation()}\n >\n <div\n className={`tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong \n ${isExpanded ? 'tw-rotate-90 ' : ''}`}\n />\n </button>\n )}\n <span className=\"tw-text-small\">{page.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-x-small tw-text-right\">Page</span>\n </div>\n </button>\n {isExpanded &&\n documentSections.length > 0 &&\n documentSections.map((section) => {\n return (\n <SectionLink\n key={section.id}\n section={section}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n />\n );\n })}\n </>\n );\n};\n"],"names":["PageLink","page","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","isExpanded","setIsExpanded","useState","documentSections","setDocumentSections","isActive","useEffect","sections","sectionsWithReadableTitles","filterDocumentSectionsWithUnreadableTitles","hasSections","jsxs","Fragment","jsx","event","section","SectionLink"],"mappings":";;;;AAsBO,MAAMA,IAAW,CAAC;AAAA,EACrB,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AACJ,MAAqB;AACjB,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAASP,EAAK,OAAOG,EAAuB,UAAU,GACpF,CAACK,GAAkBC,CAAmB,IAAIF,EAAqC,CAAA,CAAE,GACjFG,IAAWV,EAAK,kBAAkBC;AAExC,EAAAU,EAAU,MAAM;AAOZ,KAN8B,YAAY;AACtC,YAAMC,IAAW,MAAMR,EAAoCJ,EAAK,EAAE,GAC5Da,IAA6BC,EAA2CF,CAAQ;AACtF,MAAAH,EAAoBI,CAA0B;AAAA,IAClD,GAEA;AAAA,EACJ,GAAG,CAACb,EAAK,IAAII,CAAmC,CAAC,GAEjDO,EAAU,MAAM;AACZ,IAAIX,EAAK,OAAOG,EAAuB,UAEnCG,EAAc,EAAI;AAAA,EAE1B,GAAG,CAACH,GAAwBH,EAAK,EAAE,CAAC;AAEpC,QAAMe,IAAcP,EAAiB,SAAS;AAE9C,SACI,gBAAAQ,EAAAC,GAAA,EACI,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,gBAAa;AAAA,QACb,WAAW;AAAA;AAAA,sBAELH,IAAc,aAAa,WAAW;AAAA,sBAEpCL,IACM,iIACA,iGACV;AAAA,QACJ,SAAS,MAAMR,EAAYF,EAAK,aAAa;AAAA,QAE7C,UAAA,gBAAAgB,EAAC,OAAA,EAAkB,WAAU,yDACxB,UAAA;AAAA,UAAAD,KACG,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS,MAAMZ,EAAc,CAACD,CAAU;AAAA,cACxC,WAAW,CAACc,MAAUA,EAAM,QAAQ,WAAWA,EAAM,gBAAA;AAAA,cAErD,UAAA,gBAAAD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW;AAAA,kCACTb,IAAa,kBAAkB,EAAE;AAAA,gBAAA;AAAA,cAAA;AAAA,YACvC;AAAA,UAAA;AAAA,UAGR,gBAAAa,EAAC,QAAA,EAAK,WAAU,iBAAiB,YAAK,OAAM;AAAA,UAC5C,gBAAAA,EAAC,QAAA,EAAK,WAAU,2DAA0D,UAAA,OAAA,CAAI;AAAA,QAAA,EAAA,GAfxElB,EAAK,EAgBf;AAAA,MAAA;AAAA,IAAA;AAAA,IAEHK,KACGG,EAAiB,SAAS,KAC1BA,EAAiB,IAAI,CAACY,MAEd,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QAEG,SAAAD;AAAA,QACA,aAAAnB;AAAA,QACA,aAAAC;AAAA,MAAA;AAAA,MAHKkB,EAAQ;AAAA,IAAA,CAMxB;AAAA,EAAA,GACT;AAER;"}
@@ -8,19 +8,19 @@ const j = ({
8
8
  onSelectUrl: g,
9
9
  itemsToExpandInitially: l,
10
10
  getDocumentSectionsByDocumentPageId: m,
11
- getDocumentPagesByDocumentId: f
11
+ getDocumentPagesByDocumentId: d
12
12
  }) => {
13
- const [d, p] = n([]), [s, h] = n(!0), a = [...d.values()], u = !s && a.length > 0;
13
+ const [f, p] = n([]), [s, y] = n(!0), a = [...f.values()], h = !s && a.length > 0;
14
14
  return L(() => {
15
- f(i).then((e) => {
16
- const w = e.filter((t) => !!t.category).sort(
15
+ d(i).then((e) => {
16
+ const u = e.filter((t) => !!t.category).sort(
17
17
  (t, r) => t.category.sort === r.category.sort ? t.sort - r.sort : t.category.sort - r.category.sort
18
- ), y = e.filter((t) => !t.category).sort((t, r) => t.sort - r.sort);
19
- p([...w, ...y]);
18
+ ), w = e.filter((t) => !t.category).sort((t, r) => t.sort - r.sort);
19
+ p([...u, ...w]);
20
20
  }).finally(() => {
21
- h(!1);
21
+ y(!1);
22
22
  });
23
- }, []), s ? /* @__PURE__ */ o(P, {}) : u ? /* @__PURE__ */ o(x, { children: a.map((e) => /* @__PURE__ */ o(
23
+ }, []), s ? /* @__PURE__ */ o(P, {}) : h ? /* @__PURE__ */ o(x, { children: a.map((e) => /* @__PURE__ */ o(
24
24
  k,
25
25
  {
26
26
  page: e,
@@ -30,7 +30,7 @@ const j = ({
30
30
  getDocumentSectionsByDocumentPageId: m
31
31
  },
32
32
  e.id
33
- )) }) : /* @__PURE__ */ o("div", { className: "tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak", children: "This document does not contain any pages." });
33
+ )) }) : /* @__PURE__ */ o("div", { className: "tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-small tw-text-secondary", children: "This document does not contain any pages." });
34
34
  };
35
35
  export {
36
36
  j as PageLinks
@@ -1 +1 @@
1
- {"version":3,"file":"PageLinks.es.js","sources":["../../../../src/components/Link/LinkSelector/PageLinks.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { type ReactElement, useEffect, useState } from 'react';\n\nimport { type InitiallyExpandedItems } from '../types';\n\nimport { LoadingIndicator } from './LoadingIndicator';\nimport { PageLink } from './PageLink';\n\ntype PageLinksProps = {\n documentId: number;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const PageLinks = ({\n documentId,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n getDocumentPagesByDocumentId,\n}: PageLinksProps): ReactElement => {\n const [pages, setPages] = useState<DocumentPage[]>([]);\n const [isLoading, setIsLoading] = useState(true);\n const pagesArray = [...pages.values()];\n const hasPages = !isLoading && pagesArray.length > 0;\n\n useEffect(() => {\n getDocumentPagesByDocumentId(documentId)\n .then((_pages) => {\n const pagesWithCategories = _pages\n .filter((page) => !!page.category)\n .sort((a, b) =>\n a.category.sort === b.category.sort ? a.sort - b.sort : a.category.sort - b.category.sort,\n );\n const pagesWithoutCategories = _pages.filter((page) => !page.category).sort((a, b) => a.sort - b.sort);\n setPages([...pagesWithCategories, ...pagesWithoutCategories]);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n if (isLoading) {\n return <LoadingIndicator />;\n }\n\n return hasPages ? (\n <>\n {pagesArray.map((page) => {\n return (\n <PageLink\n key={page.id}\n page={page}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n />\n );\n })}\n </>\n ) : (\n <div className=\"tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak\">\n This document does not contain any pages.\n </div>\n );\n};\n"],"names":["PageLinks","documentId","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","getDocumentPagesByDocumentId","pages","setPages","useState","isLoading","setIsLoading","pagesArray","hasPages","useEffect","_pages","pagesWithCategories","page","a","b","pagesWithoutCategories","LoadingIndicator","jsx","Fragment","PageLink"],"mappings":";;;;AAmBO,MAAMA,IAAY,CAAC;AAAA,EACtB,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AAAA,EACA,8BAAAC;AACJ,MAAoC;AAChC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAyB,CAAA,CAAE,GAC/C,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAI,GACzCG,IAAa,CAAC,GAAGL,EAAM,QAAQ,GAC/BM,IAAW,CAACH,KAAaE,EAAW,SAAS;AAkBnD,SAhBAE,EAAU,MAAM;AACZ,IAAAR,EAA6BL,CAAU,EAClC,KAAK,CAACc,MAAW;AACd,YAAMC,IAAsBD,EACvB,OAAO,CAACE,MAAS,CAAC,CAACA,EAAK,QAAQ,EAChC;AAAA,QAAK,CAACC,GAAGC,MACND,EAAE,SAAS,SAASC,EAAE,SAAS,OAAOD,EAAE,OAAOC,EAAE,OAAOD,EAAE,SAAS,OAAOC,EAAE,SAAS;AAAA,MAAA,GAEvFC,IAAyBL,EAAO,OAAO,CAACE,MAAS,CAACA,EAAK,QAAQ,EAAE,KAAK,CAACC,GAAGC,MAAMD,EAAE,OAAOC,EAAE,IAAI;AACrG,MAAAX,EAAS,CAAC,GAAGQ,GAAqB,GAAGI,CAAsB,CAAC;AAAA,IAChE,CAAC,EACA,QAAQ,MAAM;AACX,MAAAT,EAAa,EAAK;AAAA,IACtB,CAAC;AAAA,EACT,GAAG,CAAA,CAAE,GAEDD,sBACQW,GAAA,EAAiB,IAGtBR,IACH,gBAAAS,EAAAC,GAAA,EACK,UAAAX,EAAW,IAAI,CAACK,MAET,gBAAAK;AAAA,IAACE;AAAA,IAAA;AAAA,MAEG,MAAAP;AAAA,MACA,aAAAf;AAAA,MACA,aAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,qCAAAC;AAAA,IAAA;AAAA,IALKY,EAAK;AAAA,EAAA,CAQrB,EAAA,CACL,sBAEC,OAAA,EAAI,WAAU,8FAA6F,UAAA,6CAE5G;AAER;"}
1
+ {"version":3,"file":"PageLinks.es.js","sources":["../../../../src/components/Link/LinkSelector/PageLinks.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { type ReactElement, useEffect, useState } from 'react';\n\nimport { type InitiallyExpandedItems } from '../types';\n\nimport { LoadingIndicator } from './LoadingIndicator';\nimport { PageLink } from './PageLink';\n\ntype PageLinksProps = {\n documentId: number;\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n itemsToExpandInitially: InitiallyExpandedItems;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const PageLinks = ({\n documentId,\n selectedUrl,\n onSelectUrl,\n itemsToExpandInitially,\n getDocumentSectionsByDocumentPageId,\n getDocumentPagesByDocumentId,\n}: PageLinksProps): ReactElement => {\n const [pages, setPages] = useState<DocumentPage[]>([]);\n const [isLoading, setIsLoading] = useState(true);\n const pagesArray = [...pages.values()];\n const hasPages = !isLoading && pagesArray.length > 0;\n\n useEffect(() => {\n getDocumentPagesByDocumentId(documentId)\n .then((_pages) => {\n const pagesWithCategories = _pages\n .filter((page) => !!page.category)\n .sort((a, b) =>\n a.category.sort === b.category.sort ? a.sort - b.sort : a.category.sort - b.category.sort,\n );\n const pagesWithoutCategories = _pages.filter((page) => !page.category).sort((a, b) => a.sort - b.sort);\n setPages([...pagesWithCategories, ...pagesWithoutCategories]);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n if (isLoading) {\n return <LoadingIndicator />;\n }\n\n return hasPages ? (\n <>\n {pagesArray.map((page) => {\n return (\n <PageLink\n key={page.id}\n page={page}\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n itemsToExpandInitially={itemsToExpandInitially}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n />\n );\n })}\n </>\n ) : (\n <div className=\"tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-small tw-text-secondary\">\n This document does not contain any pages.\n </div>\n );\n};\n"],"names":["PageLinks","documentId","selectedUrl","onSelectUrl","itemsToExpandInitially","getDocumentSectionsByDocumentPageId","getDocumentPagesByDocumentId","pages","setPages","useState","isLoading","setIsLoading","pagesArray","hasPages","useEffect","_pages","pagesWithCategories","page","a","b","pagesWithoutCategories","LoadingIndicator","jsx","Fragment","PageLink"],"mappings":";;;;AAmBO,MAAMA,IAAY,CAAC;AAAA,EACtB,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qCAAAC;AAAA,EACA,8BAAAC;AACJ,MAAoC;AAChC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAyB,CAAA,CAAE,GAC/C,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAI,GACzCG,IAAa,CAAC,GAAGL,EAAM,QAAQ,GAC/BM,IAAW,CAACH,KAAaE,EAAW,SAAS;AAkBnD,SAhBAE,EAAU,MAAM;AACZ,IAAAR,EAA6BL,CAAU,EAClC,KAAK,CAACc,MAAW;AACd,YAAMC,IAAsBD,EACvB,OAAO,CAACE,MAAS,CAAC,CAACA,EAAK,QAAQ,EAChC;AAAA,QAAK,CAACC,GAAGC,MACND,EAAE,SAAS,SAASC,EAAE,SAAS,OAAOD,EAAE,OAAOC,EAAE,OAAOD,EAAE,SAAS,OAAOC,EAAE,SAAS;AAAA,MAAA,GAEvFC,IAAyBL,EAAO,OAAO,CAACE,MAAS,CAACA,EAAK,QAAQ,EAAE,KAAK,CAACC,GAAGC,MAAMD,EAAE,OAAOC,EAAE,IAAI;AACrG,MAAAX,EAAS,CAAC,GAAGQ,GAAqB,GAAGI,CAAsB,CAAC;AAAA,IAChE,CAAC,EACA,QAAQ,MAAM;AACX,MAAAT,EAAa,EAAK;AAAA,IACtB,CAAC;AAAA,EACT,GAAG,CAAA,CAAE,GAEDD,sBACQW,GAAA,EAAiB,IAGtBR,IACH,gBAAAS,EAAAC,GAAA,EACK,UAAAX,EAAW,IAAI,CAACK,MAET,gBAAAK;AAAA,IAACE;AAAA,IAAA;AAAA,MAEG,MAAAP;AAAA,MACA,aAAAf;AAAA,MACA,aAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,qCAAAC;AAAA,IAAA;AAAA,IALKY,EAAK;AAAA,EAAA,CAQrB,EAAA,CACL,sBAEC,OAAA,EAAI,WAAU,kGAAiG,UAAA,6CAEhH;AAER;"}
@@ -1,7 +1,7 @@
1
- import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
- import { IconDocumentText as i } from "@frontify/fondue/icons";
3
- const c = ({ section: e, selectedUrl: r, onSelectUrl: o }) => {
4
- const n = e.permanentLink === r;
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ import { IconDocumentText as h } from "@frontify/fondue/icons";
3
+ const s = ({ section: e, selectedUrl: i, onSelectUrl: o }) => {
4
+ const n = e.permanentLink === i;
5
5
  return /* @__PURE__ */ t(
6
6
  "button",
7
7
  {
@@ -10,17 +10,17 @@ const c = ({ section: e, selectedUrl: r, onSelectUrl: o }) => {
10
10
  "data-is-active": n,
11
11
  className: `
12
12
  tw-py-2 tw-pr-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full
13
- ${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" : "hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"}`,
13
+ ${n ? "tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover" : "hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container"}`,
14
14
  onClick: () => o(e.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__ */ t(i, { size: 16 }),
17
- /* @__PURE__ */ t("span", { className: "tw-text-s", children: e.title }),
18
- /* @__PURE__ */ t("span", { className: "tw-flex-auto tw-font-sans tw-text-xs tw-text-right", children: "Section" })
15
+ children: /* @__PURE__ */ r("div", { className: "tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6", children: [
16
+ /* @__PURE__ */ t(h, { size: 16 }),
17
+ /* @__PURE__ */ t("span", { className: "tw-text-small", children: e.title }),
18
+ /* @__PURE__ */ t("span", { className: "tw-flex-auto tw-font-sans tw-text-x-small tw-text-right", children: "Section" })
19
19
  ] })
20
20
  }
21
21
  );
22
22
  };
23
23
  export {
24
- c as SectionLink
24
+ s as SectionLink
25
25
  };
26
26
  //# sourceMappingURL=SectionLink.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionLink.es.js","sources":["../../../../src/components/Link/LinkSelector/SectionLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDocumentText } from '@frontify/fondue/icons';\n\ntype SectionLinkProps = {\n section: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n};\n\nexport const SectionLink = ({ section, selectedUrl, onSelectUrl }: SectionLinkProps) => {\n const isActive = section.permanentLink === selectedUrl;\n\n return (\n <button\n data-test-id=\"internal-link-selector-section-link\"\n type=\"button\"\n data-is-active={isActive}\n className={`\n tw-py-2 tw-pr-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full \n ${\n isActive\n ? 'tw-bg-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 >\n <div className=\"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6\">\n <IconDocumentText size={16} />\n <span className=\"tw-text-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","jsxs","IconDocumentText"],"mappings":";;AAcO,MAAMA,IAAc,CAAC,EAAE,SAAAC,GAAS,aAAAC,GAAa,aAAAC,QAAoC;AACpF,QAAMC,IAAWH,EAAQ,kBAAkBC;AAE3C,SACI,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,gBAAa;AAAA,MACb,MAAK;AAAA,MACL,kBAAgBD;AAAA,MAChB,WAAW;AAAA;AAAA,kBAGHA,IACM,oKACA,uEACV;AAAA,MACJ,SAAS,MAAMD,EAAYF,EAAQ,aAAa;AAAA,MAEhD,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAU,yDACX,UAAA;AAAA,QAAA,gBAAAD,EAACE,GAAA,EAAiB,MAAM,GAAA,CAAI;AAAA,QAC5B,gBAAAF,EAAC,QAAA,EAAK,WAAU,aAAa,YAAQ,OAAM;AAAA,QAC3C,gBAAAA,EAAC,QAAA,EAAK,WAAU,sDAAqD,UAAA,UAAA,CAAO;AAAA,MAAA,EAAA,CAChF;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
1
+ {"version":3,"file":"SectionLink.es.js","sources":["../../../../src/components/Link/LinkSelector/SectionLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDocumentText } from '@frontify/fondue/icons';\n\ntype SectionLinkProps = {\n section: {\n id: number;\n title: string;\n permanentLink: string;\n };\n selectedUrl: string;\n onSelectUrl: (url: string) => void;\n};\n\nexport const SectionLink = ({ section, selectedUrl, onSelectUrl }: SectionLinkProps) => {\n const isActive = section.permanentLink === selectedUrl;\n\n return (\n <button\n data-test-id=\"internal-link-selector-section-link\"\n type=\"button\"\n data-is-active={isActive}\n className={`\n tw-py-2 tw-pr-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full \n ${\n isActive\n ? 'tw-bg-highlight tw-text-highlight-on-highlight hover:tw-bg-highlight-hover:hover hover:tw-text-highlight-on-highlight:hover'\n : 'hover:tw-bg-container-secondary-hover hover:tw-text-container-secondary-on-secondary-container'\n }`}\n onClick={() => onSelectUrl(section.permanentLink)}\n >\n <div className=\"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6\">\n <IconDocumentText size={16} />\n <span className=\"tw-text-small\">{section.title}</span>\n <span className=\"tw-flex-auto tw-font-sans tw-text-x-small tw-text-right\">Section</span>\n </div>\n </button>\n );\n};\n"],"names":["SectionLink","section","selectedUrl","onSelectUrl","isActive","jsx","jsxs","IconDocumentText"],"mappings":";;AAcO,MAAMA,IAAc,CAAC,EAAE,SAAAC,GAAS,aAAAC,GAAa,aAAAC,QAAoC;AACpF,QAAMC,IAAWH,EAAQ,kBAAkBC;AAE3C,SACI,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,gBAAa;AAAA,MACb,MAAK;AAAA,MACL,kBAAgBD;AAAA,MAChB,WAAW;AAAA;AAAA,kBAGHA,IACM,gIACA,gGACV;AAAA,MACJ,SAAS,MAAMD,EAAYF,EAAQ,aAAa;AAAA,MAEhD,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAU,yDACX,UAAA;AAAA,QAAA,gBAAAD,EAACE,GAAA,EAAiB,MAAM,GAAA,CAAI;AAAA,QAC5B,gBAAAF,EAAC,QAAA,EAAK,WAAU,iBAAiB,YAAQ,OAAM;AAAA,QAC/C,gBAAAA,EAAC,QAAA,EAAK,WAAU,2DAA0D,UAAA,UAAA,CAAO;AAAA,MAAA,EAAA,CACrF;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
@@ -1,11 +1,13 @@
1
- import { PluginComposer as i, SoftBreakPlugin as t, TextStylePlugin as l, BoldPlugin as g, ItalicPlugin as u, UnderlinePlugin as o, StrikethroughPlugin as r, CodePlugin as P, AlignLeftPlugin as w, AlignCenterPlugin as s, AlignRightPlugin as m, AlignJustifyPlugin as a, UnorderedListPlugin as d, CheckboxListPlugin as f, OrderedListPlugin as y, ResetFormattingPlugin as h, AutoformatPlugin as p } from "@frontify/fondue/rte";
2
- import { TextStylePluginsWithoutImage as T, TextStylesWithoutImage as n } from "../plugins/TextStylePlugins/helpers.es.js";
3
- import { LinkPlugin as x } from "../plugins/LinkPlugin/index.es.js";
4
- import { ButtonPlugin as L } from "../plugins/ButtonPlugin/createButtonPlugin.es.js";
5
- const v = (e) => new i().setPlugin(
1
+ import { PluginComposer as i, SoftBreakPlugin as t, TextStylePlugin as l, BoldPlugin as g, ItalicPlugin as u, UnderlinePlugin as o, StrikethroughPlugin as r, CodePlugin as P, AlignLeftPlugin as w, AlignCenterPlugin as s, AlignRightPlugin as m, AlignJustifyPlugin as f, CheckboxListPlugin as a, ResetFormattingPlugin as d, AutoformatPlugin as p } from "@frontify/fondue/rte";
2
+ import { TextStylePluginsWithoutImage as y, TextStylesWithoutImage as n } from "../plugins/TextStylePlugins/helpers.es.js";
3
+ import { LinkPlugin as h } from "../plugins/LinkPlugin/index.es.js";
4
+ import { ButtonPlugin as T } from "../plugins/ButtonPlugin/createButtonPlugin.es.js";
5
+ import { UnorderedListPlugin as x } from "../plugins/UnorderedListPlugin/index.es.js";
6
+ import { OrderedListPlugin as L } from "../plugins/OrderedListPlugin/index.es.js";
7
+ const I = (e) => new i().setPlugin(
6
8
  new t(),
7
9
  new l({
8
- textStyles: T
10
+ textStyles: y
9
11
  })
10
12
  ).setPlugin(
11
13
  [
@@ -13,23 +15,23 @@ const v = (e) => new i().setPlugin(
13
15
  new u(),
14
16
  new o(),
15
17
  new r(),
16
- new x({ appBridge: e }),
17
- new L({ appBridge: e }),
18
+ new h({ appBridge: e }),
19
+ new T({ appBridge: e }),
18
20
  new P()
19
21
  ],
20
22
  [
21
23
  new w({ validTypes: n }),
22
24
  new s({ validTypes: n }),
23
25
  new m({ validTypes: n }),
24
- new a({ validTypes: n }),
26
+ new f({ validTypes: n }),
27
+ new x(),
28
+ new a(),
29
+ new L(),
25
30
  new d(),
26
- new f(),
27
- new y(),
28
- new h(),
29
31
  new p()
30
32
  ]
31
33
  );
32
34
  export {
33
- v as getDefaultPluginsWithLinkChooser
35
+ I as getDefaultPluginsWithLinkChooser
34
36
  };
35
37
  //# sourceMappingURL=defaultPluginsWithLinkChooser.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultPluginsWithLinkChooser.es.js","sources":["../../../../src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n AutoformatPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n OrderedListPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n UnorderedListPlugin,\n} from '@frontify/fondue/rte';\n\nimport { ButtonPlugin, LinkPlugin, TextStylePluginsWithoutImage, TextStylesWithoutImage } from '../plugins';\n\nexport const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {\n return new PluginComposer()\n .setPlugin(\n new SoftBreakPlugin(),\n new TextStylePlugin({\n textStyles: TextStylePluginsWithoutImage,\n }),\n )\n .setPlugin(\n [\n new BoldPlugin(),\n new ItalicPlugin(),\n new UnderlinePlugin(),\n new StrikethroughPlugin(),\n new LinkPlugin({ appBridge }),\n new ButtonPlugin({ appBridge }),\n new CodePlugin(),\n ],\n [\n new AlignLeftPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignCenterPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignRightPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignJustifyPlugin({ validTypes: TextStylesWithoutImage }),\n new UnorderedListPlugin(),\n new CheckboxListPlugin(),\n new OrderedListPlugin(),\n new ResetFormattingPlugin(),\n new AutoformatPlugin(),\n ],\n );\n};\n"],"names":["getDefaultPluginsWithLinkChooser","appBridge","PluginComposer","SoftBreakPlugin","TextStylePlugin","TextStylePluginsWithoutImage","BoldPlugin","ItalicPlugin","UnderlinePlugin","StrikethroughPlugin","LinkPlugin","ButtonPlugin","CodePlugin","AlignLeftPlugin","TextStylesWithoutImage","AlignCenterPlugin","AlignRightPlugin","AlignJustifyPlugin","UnorderedListPlugin","CheckboxListPlugin","OrderedListPlugin","ResetFormattingPlugin","AutoformatPlugin"],"mappings":";;;;AAyBO,MAAMA,IAAmC,CAACC,MACtC,IAAIC,IACN;AAAA,EACG,IAAIC,EAAA;AAAA,EACJ,IAAIC,EAAgB;AAAA,IAChB,YAAYC;AAAA,EAAA,CACf;AAAA,EAEJ;AAAA,EACG;AAAA,IACI,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAW,EAAE,WAAAT,GAAW;AAAA,IAC5B,IAAIU,EAAa,EAAE,WAAAV,GAAW;AAAA,IAC9B,IAAIW,EAAA;AAAA,EAAW;AAAA,EAEnB;AAAA,IACI,IAAIC,EAAgB,EAAE,YAAYC,GAAwB;AAAA,IAC1D,IAAIC,EAAkB,EAAE,YAAYD,GAAwB;AAAA,IAC5D,IAAIE,EAAiB,EAAE,YAAYF,GAAwB;AAAA,IAC3D,IAAIG,EAAmB,EAAE,YAAYH,GAAwB;AAAA,IAC7D,IAAII,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,EAAiB;AACzB;"}
1
+ {"version":3,"file":"defaultPluginsWithLinkChooser.es.js","sources":["../../../../src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n AutoformatPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n} from '@frontify/fondue/rte';\n\nimport {\n ButtonPlugin,\n LinkPlugin,\n OrderedListPlugin,\n TextStylePluginsWithoutImage,\n TextStylesWithoutImage,\n UnorderedListPlugin,\n} from '../plugins';\n\nexport const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {\n return new PluginComposer()\n .setPlugin(\n new SoftBreakPlugin(),\n new TextStylePlugin({\n textStyles: TextStylePluginsWithoutImage,\n }),\n )\n .setPlugin(\n [\n new BoldPlugin(),\n new ItalicPlugin(),\n new UnderlinePlugin(),\n new StrikethroughPlugin(),\n new LinkPlugin({ appBridge }),\n new ButtonPlugin({ appBridge }),\n new CodePlugin(),\n ],\n [\n new AlignLeftPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignCenterPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignRightPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignJustifyPlugin({ validTypes: TextStylesWithoutImage }),\n new UnorderedListPlugin(),\n new CheckboxListPlugin(),\n new OrderedListPlugin(),\n new ResetFormattingPlugin(),\n new AutoformatPlugin(),\n ],\n );\n};\n"],"names":["getDefaultPluginsWithLinkChooser","appBridge","PluginComposer","SoftBreakPlugin","TextStylePlugin","TextStylePluginsWithoutImage","BoldPlugin","ItalicPlugin","UnderlinePlugin","StrikethroughPlugin","LinkPlugin","ButtonPlugin","CodePlugin","AlignLeftPlugin","TextStylesWithoutImage","AlignCenterPlugin","AlignRightPlugin","AlignJustifyPlugin","UnorderedListPlugin","CheckboxListPlugin","OrderedListPlugin","ResetFormattingPlugin","AutoformatPlugin"],"mappings":";;;;;;AA8BO,MAAMA,IAAmC,CAACC,MACtC,IAAIC,IACN;AAAA,EACG,IAAIC,EAAA;AAAA,EACJ,IAAIC,EAAgB;AAAA,IAChB,YAAYC;AAAA,EAAA,CACf;AAAA,EAEJ;AAAA,EACG;AAAA,IACI,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAW,EAAE,WAAAT,GAAW;AAAA,IAC5B,IAAIU,EAAa,EAAE,WAAAV,GAAW;AAAA,IAC9B,IAAIW,EAAA;AAAA,EAAW;AAAA,EAEnB;AAAA,IACI,IAAIC,EAAgB,EAAE,YAAYC,GAAwB;AAAA,IAC1D,IAAIC,EAAkB,EAAE,YAAYD,GAAwB;AAAA,IAC5D,IAAIE,EAAiB,EAAE,YAAYF,GAAwB;AAAA,IAC3D,IAAIG,EAAmB,EAAE,YAAYH,GAAwB;AAAA,IAC7D,IAAII,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,IACJ,IAAIC,EAAA;AAAA,EAAiB;AACzB;"}
@@ -1,14 +1,14 @@
1
- import { jsx as t, jsxs as e } from "react/jsx-runtime";
2
- import { IconPen as n, IconTrashBin as i } from "@frontify/fondue/icons";
3
- import { useEditorRef as a, FloatingModalWrapper as l, focusEditor as s } from "@frontify/fondue/rte";
4
- import { LINK_PLUGIN as d } from "../../../../LinkPlugin/id.es.js";
5
- import { BlockStyles as c } from "../../../../styles.es.js";
1
+ import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
+ import { IconPen as i, IconTrashBin as n } from "@frontify/fondue/icons";
3
+ import { useEditorRef as a, FloatingModalWrapper as d, focusEditor as l } from "@frontify/fondue/rte";
4
+ import { LINK_PLUGIN as s } from "../../../../LinkPlugin/id.es.js";
5
+ import { BlockStyles as m } from "../../../../styles.es.js";
6
6
  import { floatingButtonSelectors as r } from "../floatingButtonStore.es.js";
7
- import { triggerFloatingButtonEdit as p } from "../../../utils/triggerFloatingButtonEdit.es.js";
8
- import { unwrapButton as u } from "../../../transforms/unwrapButton.es.js";
7
+ import { triggerFloatingButtonEdit as u } from "../../../utils/triggerFloatingButtonEdit.es.js";
8
+ import { unwrapButton as c } from "../../../transforms/unwrapButton.es.js";
9
9
  const N = () => {
10
- const o = a();
11
- return /* @__PURE__ */ t(l, { padding: "16px", minWidth: "400px", "data-test-id": "floating-button-edit", children: /* @__PURE__ */ e("span", { "data-test-id": "preview-button-flyout", className: "tw-flex tw-justify-between tw-items-center tw-gap-2", children: [
10
+ const e = a();
11
+ return /* @__PURE__ */ t(d, { padding: "16px", minWidth: "400px", "data-test-id": "floating-button-edit", children: /* @__PURE__ */ o("span", { "data-test-id": "preview-button-flyout", className: "tw-flex tw-justify-between tw-items-center tw-gap-2", children: [
12
12
  /* @__PURE__ */ t(
13
13
  "a",
14
14
  {
@@ -16,34 +16,34 @@ const N = () => {
16
16
  href: r.url(),
17
17
  target: "_blank",
18
18
  rel: "noopener noreferrer",
19
- style: c[d],
19
+ style: m[s],
20
20
  className: "tw-break-all",
21
21
  children: r.url()
22
22
  }
23
23
  ),
24
- /* @__PURE__ */ e("span", { className: "tw-flex tw-gap-2", children: [
24
+ /* @__PURE__ */ o("span", { className: "tw-flex tw-gap-2", children: [
25
25
  /* @__PURE__ */ t(
26
26
  "button",
27
27
  {
28
28
  onClick: () => {
29
- p(o);
29
+ u(e);
30
30
  },
31
31
  tabIndex: 0,
32
32
  "data-test-id": "edit-button-button",
33
- className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
34
- children: /* @__PURE__ */ t(n, { size: 16 })
33
+ className: "tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1",
34
+ children: /* @__PURE__ */ t(i, { size: 16 })
35
35
  }
36
36
  ),
37
37
  /* @__PURE__ */ t(
38
38
  "button",
39
39
  {
40
40
  onClick: () => {
41
- u(o), s(o, o.selection ?? void 0);
41
+ c(e), l(e, e.selection ?? void 0);
42
42
  },
43
43
  tabIndex: 0,
44
44
  "data-test-id": "remove-button-button",
45
- className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
46
- children: /* @__PURE__ */ t(i, { size: 16 })
45
+ className: "tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1",
46
+ children: /* @__PURE__ */ t(n, { size: 16 })
47
47
  }
48
48
  )
49
49
  ] })
@@ -1 +1 @@
1
- {"version":3,"file":"EditModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen, IconTrashBin } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper, focusEditor, useEditorRef } from '@frontify/fondue/rte';\n\nimport { LINK_PLUGIN } from '../../../../LinkPlugin/id';\nimport { BlockStyles } from '../../../../styles';\nimport { unwrapButton } from '../../../transforms';\nimport { triggerFloatingButtonEdit } from '../../../utils';\nimport { floatingButtonSelectors } from '../floatingButtonStore';\n\nexport const EditModal = () => {\n const editor = useEditorRef();\n return (\n <FloatingModalWrapper padding=\"16px\" minWidth=\"400px\" data-test-id=\"floating-button-edit\">\n <span data-test-id=\"preview-button-flyout\" className=\"tw-flex tw-justify-between tw-items-center tw-gap-2\">\n <a\n data-test-id=\"floating-button-edit-url\"\n href={floatingButtonSelectors.url()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={BlockStyles[LINK_PLUGIN]}\n className=\"tw-break-all\"\n >\n {floatingButtonSelectors.url()}\n </a>\n <span className=\"tw-flex tw-gap-2\">\n <button\n onClick={() => {\n triggerFloatingButtonEdit(editor);\n }}\n tabIndex={0}\n data-test-id=\"edit-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <IconPen size={16} />\n </button>\n\n <button\n onClick={() => {\n unwrapButton(editor);\n focusEditor(editor, editor.selection ?? undefined);\n }}\n tabIndex={0}\n data-test-id=\"remove-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <IconTrashBin size={16} />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"names":["EditModal","editor","useEditorRef","jsx","FloatingModalWrapper","jsxs","floatingButtonSelectors","BlockStyles","LINK_PLUGIN","triggerFloatingButtonEdit","IconPen","unwrapButton","focusEditor","IconTrashBin"],"mappings":";;;;;;;;AAWO,MAAMA,IAAY,MAAM;AAC3B,QAAMC,IAASC,EAAA;AACf,SACI,gBAAAC,EAACC,GAAA,EAAqB,SAAQ,QAAO,UAAS,SAAQ,gBAAa,wBAC/D,UAAA,gBAAAC,EAAC,QAAA,EAAK,gBAAa,yBAAwB,WAAU,uDACjD,UAAA;AAAA,IAAA,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,gBAAa;AAAA,QACb,MAAMG,EAAwB,IAAA;AAAA,QAC9B,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,OAAOC,EAAYC,CAAW;AAAA,QAC9B,WAAU;AAAA,QAET,YAAwB,IAAA;AAAA,MAAI;AAAA,IAAA;AAAA,IAEjC,gBAAAH,EAAC,QAAA,EAAK,WAAU,oBACZ,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,SAAS,MAAM;AACX,YAAAM,EAA0BR,CAAM;AAAA,UACpC;AAAA,UACA,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UAEV,UAAA,gBAAAE,EAACO,GAAA,EAAQ,MAAM,GAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAGvB,gBAAAP;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,SAAS,MAAM;AACX,YAAAQ,EAAaV,CAAM,GACnBW,EAAYX,GAAQA,EAAO,aAAa,MAAS;AAAA,UACrD;AAAA,UACA,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UAEV,UAAA,gBAAAE,EAACU,GAAA,EAAa,MAAM,GAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5B,EAAA,CACJ;AAAA,EAAA,EAAA,CACJ,EAAA,CACJ;AAER;"}
1
+ {"version":3,"file":"EditModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen, IconTrashBin } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper, focusEditor, useEditorRef } from '@frontify/fondue/rte';\n\nimport { LINK_PLUGIN } from '../../../../LinkPlugin/id';\nimport { BlockStyles } from '../../../../styles';\nimport { unwrapButton } from '../../../transforms';\nimport { triggerFloatingButtonEdit } from '../../../utils';\nimport { floatingButtonSelectors } from '../floatingButtonStore';\n\nexport const EditModal = () => {\n const editor = useEditorRef();\n return (\n <FloatingModalWrapper padding=\"16px\" minWidth=\"400px\" data-test-id=\"floating-button-edit\">\n <span data-test-id=\"preview-button-flyout\" className=\"tw-flex tw-justify-between tw-items-center tw-gap-2\">\n <a\n data-test-id=\"floating-button-edit-url\"\n href={floatingButtonSelectors.url()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={BlockStyles[LINK_PLUGIN]}\n className=\"tw-break-all\"\n >\n {floatingButtonSelectors.url()}\n </a>\n <span className=\"tw-flex tw-gap-2\">\n <button\n onClick={() => {\n triggerFloatingButtonEdit(editor);\n }}\n tabIndex={0}\n data-test-id=\"edit-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n >\n <IconPen size={16} />\n </button>\n\n <button\n onClick={() => {\n unwrapButton(editor);\n focusEditor(editor, editor.selection ?? undefined);\n }}\n tabIndex={0}\n data-test-id=\"remove-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n >\n <IconTrashBin size={16} />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"names":["EditModal","editor","useEditorRef","jsx","FloatingModalWrapper","jsxs","floatingButtonSelectors","BlockStyles","LINK_PLUGIN","triggerFloatingButtonEdit","IconPen","unwrapButton","focusEditor","IconTrashBin"],"mappings":";;;;;;;;AAWO,MAAMA,IAAY,MAAM;AAC3B,QAAMC,IAASC,EAAA;AACf,SACI,gBAAAC,EAACC,GAAA,EAAqB,SAAQ,QAAO,UAAS,SAAQ,gBAAa,wBAC/D,UAAA,gBAAAC,EAAC,QAAA,EAAK,gBAAa,yBAAwB,WAAU,uDACjD,UAAA;AAAA,IAAA,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,gBAAa;AAAA,QACb,MAAMG,EAAwB,IAAA;AAAA,QAC9B,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,OAAOC,EAAYC,CAAW;AAAA,QAC9B,WAAU;AAAA,QAET,YAAwB,IAAA;AAAA,MAAI;AAAA,IAAA;AAAA,IAEjC,gBAAAH,EAAC,QAAA,EAAK,WAAU,oBACZ,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,SAAS,MAAM;AACX,YAAAM,EAA0BR,CAAM;AAAA,UACpC;AAAA,UACA,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UAEV,UAAA,gBAAAE,EAACO,GAAA,EAAQ,MAAM,GAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAGvB,gBAAAP;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,SAAS,MAAM;AACX,YAAAQ,EAAaV,CAAM,GACnBW,EAAYX,GAAQA,EAAO,aAAa,MAAS;AAAA,UACrD;AAAA,UACA,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UAEV,UAAA,gBAAAE,EAACU,GAAA,EAAa,MAAM,GAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5B,EAAA,CACJ;AAAA,EAAA,EAAA,CACJ,EAAA,CACJ;AAER;"}
@@ -1,11 +1,11 @@
1
1
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
2
  import { IconPen as o, IconTrashBin as l } from "@frontify/fondue/icons";
3
3
  import { useLinkOpenButtonState as s, FloatingModalWrapper as d } from "@frontify/fondue/rte";
4
- import { BlockStyles as c } from "../../../styles.es.js";
5
- import { LINK_PLUGIN as p } from "../../id.es.js";
6
- import { getUrlFromLinkOrLegacyLink as m } from "../../../../../Link/utils/getUrl.es.js";
4
+ import { BlockStyles as m } from "../../../styles.es.js";
5
+ import { LINK_PLUGIN as c } from "../../id.es.js";
6
+ import { getUrlFromLinkOrLegacyLink as p } from "../../../../../Link/utils/getUrl.es.js";
7
7
  const h = ({ editButtonProps: i, unlinkButtonProps: a }) => {
8
- const { element: e } = s(), r = e ? m(e) : "";
8
+ const { element: e } = s(), r = e ? p(e) : "";
9
9
  return /* @__PURE__ */ t(d, { "data-test-id": "floating-link-edit", padding: "16px", minWidth: "400px", children: /* @__PURE__ */ n("span", { "data-test-id": "preview-link-flyout", className: "tw-flex tw-justify-between tw-items-center tw-gap-2", children: [
10
10
  /* @__PURE__ */ t(
11
11
  "a",
@@ -14,7 +14,7 @@ const h = ({ editButtonProps: i, unlinkButtonProps: a }) => {
14
14
  href: r,
15
15
  target: "_blank",
16
16
  rel: "noopener noreferrer",
17
- style: c[p],
17
+ style: m[c],
18
18
  className: "tw-break-all",
19
19
  children: r
20
20
  }
@@ -25,7 +25,7 @@ const h = ({ editButtonProps: i, unlinkButtonProps: a }) => {
25
25
  {
26
26
  tabIndex: 0,
27
27
  "data-test-id": "edit-link-button",
28
- className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
28
+ className: "tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1",
29
29
  ...i,
30
30
  children: /* @__PURE__ */ t(o, { size: 16 })
31
31
  }
@@ -35,7 +35,7 @@ const h = ({ editButtonProps: i, unlinkButtonProps: a }) => {
35
35
  {
36
36
  tabIndex: 0,
37
37
  "data-test-id": "remove-link-button",
38
- className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
38
+ className: "tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1",
39
39
  ...a,
40
40
  children: /* @__PURE__ */ t(l, { size: 16 })
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EditModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen, IconTrashBin } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper, useLinkOpenButtonState } from '@frontify/fondue/rte';\nimport { type MouseEvent } from 'react';\n\nimport { getUrlFromLinkOrLegacyLink } from '../../../../../Link';\nimport { BlockStyles } from '../../../styles';\nimport { LINK_PLUGIN } from '../../id';\n\ntype EditModalProps = {\n editButtonProps: {\n onClick: () => void;\n };\n unlinkButtonProps: {\n onMouseDown: (e: MouseEvent<HTMLButtonElement>) => void;\n onClick: () => void;\n };\n};\n\nexport const EditModal = ({ editButtonProps, unlinkButtonProps }: EditModalProps) => {\n const { element } = useLinkOpenButtonState();\n const url = element ? getUrlFromLinkOrLegacyLink(element) : '';\n\n return (\n <FloatingModalWrapper data-test-id=\"floating-link-edit\" padding=\"16px\" minWidth=\"400px\">\n <span data-test-id=\"preview-link-flyout\" className=\"tw-flex tw-justify-between tw-items-center tw-gap-2\">\n <a\n data-test-id=\"floating-link-edit-url\"\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={BlockStyles[LINK_PLUGIN]}\n className=\"tw-break-all\"\n >\n {url}\n </a>\n <span className=\"tw-flex tw-gap-2\">\n <button\n tabIndex={0}\n data-test-id=\"edit-link-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n {...editButtonProps}\n >\n <IconPen size={16} />\n </button>\n\n <button\n tabIndex={0}\n data-test-id=\"remove-link-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n {...unlinkButtonProps}\n >\n <IconTrashBin size={16} />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"names":["EditModal","editButtonProps","unlinkButtonProps","element","useLinkOpenButtonState","url","getUrlFromLinkOrLegacyLink","jsx","FloatingModalWrapper","jsxs","BlockStyles","LINK_PLUGIN","IconPen","IconTrashBin"],"mappings":";;;;;;AAoBO,MAAMA,IAAY,CAAC,EAAE,iBAAAC,GAAiB,mBAAAC,QAAwC;AACjF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAMF,IAAUG,EAA2BH,CAAO,IAAI;AAE5D,SACI,gBAAAI,EAACC,GAAA,EAAqB,gBAAa,sBAAqB,SAAQ,QAAO,UAAS,SAC5E,UAAA,gBAAAC,EAAC,QAAA,EAAK,gBAAa,uBAAsB,WAAU,uDAC/C,UAAA;AAAA,IAAA,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,gBAAa;AAAA,QACb,MAAMF;AAAA,QACN,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,OAAOK,EAAYC,CAAW;AAAA,QAC9B,WAAU;AAAA,QAET,UAAAN;AAAA,MAAA;AAAA,IAAA;AAAA,IAEL,gBAAAI,EAAC,QAAA,EAAK,WAAU,oBACZ,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UACT,GAAGN;AAAA,UAEJ,UAAA,gBAAAM,EAACK,GAAA,EAAQ,MAAM,GAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAGvB,gBAAAL;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UACT,GAAGL;AAAA,UAEJ,UAAA,gBAAAK,EAACM,GAAA,EAAa,MAAM,GAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5B,EAAA,CACJ;AAAA,EAAA,EAAA,CACJ,EAAA,CACJ;AAER;"}
1
+ {"version":3,"file":"EditModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen, IconTrashBin } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper, useLinkOpenButtonState } from '@frontify/fondue/rte';\nimport { type MouseEvent } from 'react';\n\nimport { getUrlFromLinkOrLegacyLink } from '../../../../../Link';\nimport { BlockStyles } from '../../../styles';\nimport { LINK_PLUGIN } from '../../id';\n\ntype EditModalProps = {\n editButtonProps: {\n onClick: () => void;\n };\n unlinkButtonProps: {\n onMouseDown: (e: MouseEvent<HTMLButtonElement>) => void;\n onClick: () => void;\n };\n};\n\nexport const EditModal = ({ editButtonProps, unlinkButtonProps }: EditModalProps) => {\n const { element } = useLinkOpenButtonState();\n const url = element ? getUrlFromLinkOrLegacyLink(element) : '';\n\n return (\n <FloatingModalWrapper data-test-id=\"floating-link-edit\" padding=\"16px\" minWidth=\"400px\">\n <span data-test-id=\"preview-link-flyout\" className=\"tw-flex tw-justify-between tw-items-center tw-gap-2\">\n <a\n data-test-id=\"floating-link-edit-url\"\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={BlockStyles[LINK_PLUGIN]}\n className=\"tw-break-all\"\n >\n {url}\n </a>\n <span className=\"tw-flex tw-gap-2\">\n <button\n tabIndex={0}\n data-test-id=\"edit-link-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n {...editButtonProps}\n >\n <IconPen size={16} />\n </button>\n\n <button\n tabIndex={0}\n data-test-id=\"remove-link-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n {...unlinkButtonProps}\n >\n <IconTrashBin size={16} />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"names":["EditModal","editButtonProps","unlinkButtonProps","element","useLinkOpenButtonState","url","getUrlFromLinkOrLegacyLink","jsx","FloatingModalWrapper","jsxs","BlockStyles","LINK_PLUGIN","IconPen","IconTrashBin"],"mappings":";;;;;;AAoBO,MAAMA,IAAY,CAAC,EAAE,iBAAAC,GAAiB,mBAAAC,QAAwC;AACjF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAMF,IAAUG,EAA2BH,CAAO,IAAI;AAE5D,SACI,gBAAAI,EAACC,GAAA,EAAqB,gBAAa,sBAAqB,SAAQ,QAAO,UAAS,SAC5E,UAAA,gBAAAC,EAAC,QAAA,EAAK,gBAAa,uBAAsB,WAAU,uDAC/C,UAAA;AAAA,IAAA,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,gBAAa;AAAA,QACb,MAAMF;AAAA,QACN,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,OAAOK,EAAYC,CAAW;AAAA,QAC9B,WAAU;AAAA,QAET,UAAAN;AAAA,MAAA;AAAA,IAAA;AAAA,IAEL,gBAAAI,EAAC,QAAA,EAAK,WAAU,oBACZ,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UACT,GAAGN;AAAA,UAEJ,UAAA,gBAAAM,EAACK,GAAA,EAAQ,MAAM,GAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAGvB,gBAAAL;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UACT,GAAGL;AAAA,UAEJ,UAAA,gBAAAK,EAACM,GAAA,EAAa,MAAM,GAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5B,EAAA,CACJ;AAAA,EAAA,EAAA,CACJ,EAAA,CACJ;AAER;"}