@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.
- package/dist/components/DownloadButton/DownloadButton.es.js +14 -20
- package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/SerializedText.es.js +13 -10
- package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,34 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { FOCUS_STYLE as
|
|
3
|
-
import { useFocusRing as
|
|
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
|
|
6
|
-
const
|
|
7
|
-
const { isFocused:
|
|
8
|
-
return /* @__PURE__ */
|
|
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
|
-
...
|
|
15
|
-
className:
|
|
13
|
+
"aria-label": n ?? "Download",
|
|
14
|
+
...s,
|
|
15
|
+
className: u(["tw-outline-none tw-rounded", r && a]),
|
|
16
16
|
onClick: e,
|
|
17
|
-
onPointerDown: (
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
2
|
-
import { serializeRawToHtmlAsync as
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
5
|
-
const [t,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, [e,
|
|
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
|
-
)
|
|
18
|
+
);
|
|
16
19
|
};
|
|
17
20
|
export {
|
|
18
|
-
|
|
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
|
|
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;"}
|