@frontify/guideline-blocks-settings 0.37.7 → 0.38.1

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.
@@ -1,34 +1,28 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { FOCUS_STYLE as l, IconArrowCircleDown16 as a } from "@frontify/fondue";
3
- import { useFocusRing as w } from "@react-aria/focus";
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import { FOCUS_STYLE as a, IconArrowCircleDown16 as w } from "@frontify/fondue";
3
+ import { useFocusRing as d } from "@react-aria/focus";
4
4
  import { Tooltip as o } from "../../node_modules/.pnpm/@frontify_fondue-components@16.0.4_@frontify_fondue-icons@0.15.2_react@18.3.1__@frontify_fond_op7623tx44xrzjacx6eyu4zgva/node_modules/@frontify/fondue-components/dist/fondue-components29.es.js";
5
- import { joinClassNames as d } from "../../utilities/react/joinClassNames.es.js";
6
- const f = ({ onDownload: e }) => {
7
- const { isFocused: n, focusProps: r } = w();
8
- return /* @__PURE__ */ i(o.Root, { enterDelay: 500, children: [
5
+ import { joinClassNames as u } from "../../utilities/react/joinClassNames.es.js";
6
+ const x = ({ onDownload: e, ariaLabel: n }) => {
7
+ const { isFocused: r, focusProps: s } = d();
8
+ return /* @__PURE__ */ l(o.Root, { enterDelay: 500, children: [
9
9
  /* @__PURE__ */ t(o.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
10
10
  "button",
11
11
  {
12
12
  tabIndex: 0,
13
- "aria-label": "Download",
14
- ...r,
15
- className: d(["tw-outline-none tw-rounded", n && l]),
13
+ "aria-label": n ?? "Download",
14
+ ...s,
15
+ className: u(["tw-outline-none tw-rounded", r && a]),
16
16
  onClick: e,
17
- onPointerDown: (s) => s.preventDefault(),
18
- children: /* @__PURE__ */ t(
19
- "span",
20
- {
21
- "data-test-id": "download-button",
22
- className: "tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line",
23
- children: /* @__PURE__ */ t(a, {})
24
- }
25
- )
17
+ onPointerDown: (i) => i.preventDefault(),
18
+ "data-test-id": "download-button",
19
+ children: /* @__PURE__ */ t("span", { className: "tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line", children: /* @__PURE__ */ t(w, {}) })
26
20
  }
27
21
  ) }),
28
22
  /* @__PURE__ */ t(o.Content, { side: "top", children: "Download" })
29
23
  ] });
30
24
  };
31
25
  export {
32
- f as DownloadButton
26
+ x as DownloadButton
33
27
  };
34
28
  //# sourceMappingURL=DownloadButton.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadButton.es.js","sources":["../../../src/components/DownloadButton/DownloadButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FOCUS_STYLE, IconArrowCircleDown16 } from '@frontify/fondue';\nimport { Tooltip } from '@frontify/fondue/components';\nimport { useFocusRing } from '@react-aria/focus';\n\nimport { joinClassNames } from '../../utilities';\n\nimport { type DownloadButtonProps } from './types';\n\nexport const DownloadButton = ({ onDownload }: DownloadButtonProps) => {\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <Tooltip.Root enterDelay={500}>\n <Tooltip.Trigger asChild>\n <button\n tabIndex={0}\n aria-label=\"Download\"\n {...focusProps}\n className={joinClassNames(['tw-outline-none tw-rounded', isFocused && FOCUS_STYLE])}\n onClick={onDownload}\n onPointerDown={(e) => e.preventDefault()}\n >\n <span\n data-test-id=\"download-button\"\n className=\"tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line\"\n >\n <IconArrowCircleDown16 />\n </span>\n </button>\n </Tooltip.Trigger>\n <Tooltip.Content side=\"top\">Download</Tooltip.Content>\n </Tooltip.Root>\n );\n};\n"],"names":["DownloadButton","onDownload","isFocused","focusProps","useFocusRing","jsxs","Tooltip","jsx","joinClassNames","FOCUS_STYLE","e","IconArrowCircleDown16"],"mappings":";;;;;AAUO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,QAAsC;AACnE,QAAM,EAAE,WAAAC,GAAW,YAAAC,EAAW,IAAIC,EAAa;AAE/C,SACK,gBAAAC,EAAAC,EAAQ,MAAR,EAAa,YAAY,KACtB,UAAA;AAAA,IAAA,gBAAAC,EAACD,EAAQ,SAAR,EAAgB,SAAO,IACpB,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,UAAU;AAAA,QACV,cAAW;AAAA,QACV,GAAGJ;AAAA,QACJ,WAAWK,EAAe,CAAC,8BAA8BN,KAAaO,CAAW,CAAC;AAAA,QAClF,SAASR;AAAA,QACT,eAAe,CAACS,MAAMA,EAAE,eAAe;AAAA,QAEvC,UAAA,gBAAAH;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,gBAAa;AAAA,YACb,WAAU;AAAA,YAEV,4BAACI,GAAsB,EAAA;AAAA,UAAA;AAAA,QAC3B;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,sBACCL,EAAQ,SAAR,EAAgB,MAAK,OAAM,UAAQ,YAAA;AAAA,EACxC,EAAA,CAAA;AAER;"}
1
+ {"version":3,"file":"DownloadButton.es.js","sources":["../../../src/components/DownloadButton/DownloadButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FOCUS_STYLE, IconArrowCircleDown16 } from '@frontify/fondue';\nimport { Tooltip } from '@frontify/fondue/components';\nimport { useFocusRing } from '@react-aria/focus';\n\nimport { joinClassNames } from '../../utilities';\n\nimport { type DownloadButtonProps } from './types';\n\nexport const DownloadButton = ({ onDownload, ariaLabel }: DownloadButtonProps) => {\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <Tooltip.Root enterDelay={500}>\n <Tooltip.Trigger asChild>\n <button\n tabIndex={0}\n aria-label={ariaLabel ?? 'Download'}\n {...focusProps}\n className={joinClassNames(['tw-outline-none tw-rounded', isFocused && FOCUS_STYLE])}\n onClick={onDownload}\n onPointerDown={(e) => e.preventDefault()}\n data-test-id=\"download-button\"\n >\n <span className=\"tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line\">\n <IconArrowCircleDown16 />\n </span>\n </button>\n </Tooltip.Trigger>\n <Tooltip.Content side=\"top\">Download</Tooltip.Content>\n </Tooltip.Root>\n );\n};\n"],"names":["DownloadButton","onDownload","ariaLabel","isFocused","focusProps","useFocusRing","jsxs","Tooltip","jsx","joinClassNames","FOCUS_STYLE","e","IconArrowCircleDown16"],"mappings":";;;;;AAUO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,GAAY,WAAAC,QAAqC;AAC9E,QAAM,EAAE,WAAAC,GAAW,YAAAC,EAAW,IAAIC,EAAa;AAE/C,SACK,gBAAAC,EAAAC,EAAQ,MAAR,EAAa,YAAY,KACtB,UAAA;AAAA,IAAA,gBAAAC,EAACD,EAAQ,SAAR,EAAgB,SAAO,IACpB,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,UAAU;AAAA,QACV,cAAYN,KAAa;AAAA,QACxB,GAAGE;AAAA,QACJ,WAAWK,EAAe,CAAC,8BAA8BN,KAAaO,CAAW,CAAC;AAAA,QAClF,SAAST;AAAA,QACT,eAAe,CAACU,MAAMA,EAAE,eAAe;AAAA,QACvC,gBAAa;AAAA,QAEb,4BAAC,QAAK,EAAA,WAAU,0SACZ,UAAA,gBAAAH,EAACI,IAAsB,CAAA,GAC3B;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,sBACCL,EAAQ,SAAR,EAAgB,MAAK,OAAM,UAAQ,YAAA;AAAA,EACxC,EAAA,CAAA;AAER;"}
@@ -1,20 +1,23 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { serializeRawToHtmlAsync as s } from "@frontify/fondue";
3
- import { useState as w, useEffect as o } from "react";
4
- const c = ({ value: e = "", gap: l, customClass: r, show: i = !0, plugins: a }) => {
5
- const [t, m] = w(null);
6
- return o(() => {
7
- (async () => m(await s(e, a, void 0, l, r)))();
8
- }, [e, l, a, r]), !i || t === "<br />" ? null : t !== null ? /* @__PURE__ */ n(
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { serializeRawToHtmlAsync as i } from "@frontify/fondue";
3
+ import { useState as u, useCallback as d, useEffect as f } from "react";
4
+ const H = ({ value: e = "", gap: r, customClass: l, show: a = !0, plugins: n }) => {
5
+ const [t, s] = u(null), o = d(async () => {
6
+ const c = await i(e, n, void 0, r, l);
7
+ s(c);
8
+ }, [e, r, n, l]);
9
+ return f(() => {
10
+ o().catch(console.error);
11
+ }, [o]), !a || t === "<br />" || t === null ? null : /* @__PURE__ */ m(
9
12
  "div",
10
13
  {
11
14
  className: "tw-w-full tw-whitespace-pre-wrap",
12
15
  "data-test-id": "rte-content-html",
13
16
  dangerouslySetInnerHTML: { __html: t }
14
17
  }
15
- ) : /* @__PURE__ */ n("div", { className: "tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full" });
18
+ );
16
19
  };
17
20
  export {
18
- c as SerializedText
21
+ H as SerializedText
19
22
  };
20
23
  //# sourceMappingURL=SerializedText.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SerializedText.es.js","sources":["../../../src/components/RichTextEditor/SerializedText.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { serializeRawToHtmlAsync } from '@frontify/fondue';\nimport { useEffect, useState } from 'react';\n\nimport { type SerializedTextProps } from './types';\n\nexport const SerializedText = ({ value = '', gap, customClass, show = true, plugins }: SerializedTextProps) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n (async () => {\n setHtml(await serializeRawToHtmlAsync(value, plugins, undefined, gap, customClass));\n })();\n }, [value, gap, plugins, customClass]);\n\n if (!show || html === '<br />') {\n return null;\n }\n\n return html !== null ? (\n <div\n className=\"tw-w-full tw-whitespace-pre-wrap\"\n data-test-id=\"rte-content-html\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n ) : (\n <div className=\"tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full\" />\n );\n};\n"],"names":["SerializedText","value","gap","customClass","show","plugins","html","setHtml","useState","useEffect","serializeRawToHtmlAsync","jsx"],"mappings":";;;AAOa,MAAAA,IAAiB,CAAC,EAAE,OAAAC,IAAQ,IAAI,KAAAC,GAAK,aAAAC,GAAa,MAAAC,IAAO,IAAM,SAAAC,QAAmC;AAC3G,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAwB,IAAI;AAQhD,SANJC,EAAU,MAAM;AACZ,KAAC,YACGF,EAAQ,MAAMG,EAAwBT,GAAOI,GAAS,QAAWH,GAAKC,CAAW,CAAC;AAAA,KAEvF,CAACF,GAAOC,GAAKG,GAASF,CAAW,CAAC,GAEjC,CAACC,KAAQE,MAAS,WACX,OAGJA,MAAS,OACZ,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,gBAAa;AAAA,MACb,yBAAyB,EAAE,QAAQL,EAAK;AAAA,IAAA;AAAA,EAG5C,IAAA,gBAAAK,EAAC,OAAI,EAAA,WAAU,oFAAoF,CAAA;AAE3G;"}
1
+ {"version":3,"file":"SerializedText.es.js","sources":["../../../src/components/RichTextEditor/SerializedText.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { serializeRawToHtmlAsync } from '@frontify/fondue';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { type SerializedTextProps } from './types';\n\nexport const SerializedText = ({ value = '', gap, customClass, show = true, plugins }: SerializedTextProps) => {\n const [html, setHtml] = useState<string | null>(null);\n\n const updateHtml = useCallback(async () => {\n const htmlContent = await serializeRawToHtmlAsync(value, plugins, undefined, gap, customClass);\n setHtml(htmlContent);\n }, [value, gap, plugins, customClass]);\n\n useEffect(() => {\n updateHtml().catch(console.error);\n }, [updateHtml]);\n\n if (!show || html === '<br />' || html === null) {\n return null;\n }\n\n return (\n <div\n className=\"tw-w-full tw-whitespace-pre-wrap\"\n data-test-id=\"rte-content-html\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n );\n};\n"],"names":["SerializedText","value","gap","customClass","show","plugins","html","setHtml","useState","updateHtml","useCallback","htmlContent","serializeRawToHtmlAsync","useEffect","jsx"],"mappings":";;;AAOa,MAAAA,IAAiB,CAAC,EAAE,OAAAC,IAAQ,IAAI,KAAAC,GAAK,aAAAC,GAAa,MAAAC,IAAO,IAAM,SAAAC,QAAmC;AAC3G,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAwB,IAAI,GAE9CC,IAAaC,EAAY,YAAY;AACvC,UAAMC,IAAc,MAAMC,EAAwBX,GAAOI,GAAS,QAAWH,GAAKC,CAAW;AAC7F,IAAAI,EAAQI,CAAW;AAAA,KACpB,CAACV,GAAOC,GAAKG,GAASF,CAAW,CAAC;AAMrC,SAJAU,EAAU,MAAM;AACD,IAAAJ,IAAE,MAAM,QAAQ,KAAK;AAAA,EAAA,GACjC,CAACA,CAAU,CAAC,GAEX,CAACL,KAAQE,MAAS,YAAYA,MAAS,OAChC,OAIP,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,gBAAa;AAAA,MACb,yBAAyB,EAAE,QAAQR,EAAK;AAAA,IAAA;AAAA,EAAA;AAGpD;"}