@frontify/guideline-blocks-settings 1.0.5 → 1.0.6
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/Link/LinkSelector/LinkSelector.es.js +26 -26
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +1 -1
- package/dist/index.cjs.js +15 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.umd.js +15 -15
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as c, useEffect as
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useEffect as g } from "react";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { DocumentLinks as x } from "./DocumentLinks.es.js";
|
|
5
|
-
import { Dialog as
|
|
5
|
+
import { Dialog as t } from "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components9.es.js";
|
|
6
6
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components3.es.js";
|
|
7
7
|
import "../../../node_modules/.pnpm/@frontify_fondue-icons@0.17.1_react@18.3.1/node_modules/@frontify/fondue-icons/dist/fondue-icons4.es.js";
|
|
8
8
|
import "../../../node_modules/.pnpm/@frontify_fondue-icons@0.17.1_react@18.3.1/node_modules/@frontify/fondue-icons/dist/fondue-icons5.es.js";
|
|
@@ -365,7 +365,7 @@ import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify
|
|
|
365
365
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components16.es.js";
|
|
366
366
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components17.es.js";
|
|
367
367
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components18.es.js";
|
|
368
|
-
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components19.es.js";
|
|
368
|
+
import { ScrollArea as O } from "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components19.es.js";
|
|
369
369
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components20.es.js";
|
|
370
370
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components21.es.js";
|
|
371
371
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components22.es.js";
|
|
@@ -378,7 +378,7 @@ import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify
|
|
|
378
378
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components29.es.js";
|
|
379
379
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components31.es.js";
|
|
380
380
|
import "../../../node_modules/.pnpm/@frontify_fondue-components@19.6.0_@frontify_fondue-icons@0.17.1_react@18.3.1__@frontif_6b598a27f85dfd99e6188fe1d9949a4c/node_modules/@frontify/fondue-components/dist/fondue-components32.es.js";
|
|
381
|
-
const
|
|
381
|
+
const Ee = ({
|
|
382
382
|
url: m,
|
|
383
383
|
onUrlChange: e,
|
|
384
384
|
buttonSize: n = "medium",
|
|
@@ -386,16 +386,16 @@ const Ie = ({
|
|
|
386
386
|
getDocumentPagesByDocumentId: h,
|
|
387
387
|
getDocumentSectionsByDocumentPageId: u
|
|
388
388
|
}) => {
|
|
389
|
-
const [k, s] = c(!1), [
|
|
390
|
-
d(
|
|
391
|
-
}, y = (
|
|
392
|
-
|
|
389
|
+
const [k, s] = c(!1), [i, d] = c(m), D = (r) => {
|
|
390
|
+
d(r);
|
|
391
|
+
}, y = (r) => {
|
|
392
|
+
r.key === "Enter" && (r.preventDefault(), a());
|
|
393
393
|
};
|
|
394
|
-
|
|
395
|
-
m && !
|
|
396
|
-
}, [m,
|
|
394
|
+
g(() => {
|
|
395
|
+
m && !i && d(m);
|
|
396
|
+
}, [m, i]);
|
|
397
397
|
const a = () => {
|
|
398
|
-
e == null || e(
|
|
398
|
+
e == null || e(i), s(!1);
|
|
399
399
|
}, P = {
|
|
400
400
|
onOpenAutoFocus: () => {
|
|
401
401
|
},
|
|
@@ -405,32 +405,32 @@ const Ie = ({
|
|
|
405
405
|
};
|
|
406
406
|
return (
|
|
407
407
|
// eslint-disable-next-line jsx-a11y-x/no-static-element-interactions
|
|
408
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ o(
|
|
409
409
|
"div",
|
|
410
410
|
{
|
|
411
|
-
onPointerDown: (
|
|
411
|
+
onPointerDown: (r) => r.preventDefault(),
|
|
412
412
|
"data-test-id": "internal-link-selector",
|
|
413
413
|
onKeyDown: y,
|
|
414
|
-
children: /* @__PURE__ */ p(
|
|
415
|
-
/* @__PURE__ */ t
|
|
416
|
-
/* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ p(t.Root, { modal: !0, open: k, onOpenChange: s, children: [
|
|
415
|
+
/* @__PURE__ */ o(t.Trigger, { asChild: !0, children: /* @__PURE__ */ p(l, { size: n, emphasis: "default", children: [
|
|
416
|
+
/* @__PURE__ */ o(L, { size: "20" }),
|
|
417
417
|
"Internal link"
|
|
418
418
|
] }) }),
|
|
419
|
-
/* @__PURE__ */ p(
|
|
420
|
-
/* @__PURE__ */ t
|
|
421
|
-
/* @__PURE__ */ t
|
|
419
|
+
/* @__PURE__ */ p(t.Content, { ...P, children: [
|
|
420
|
+
/* @__PURE__ */ o(t.Header, { children: /* @__PURE__ */ o(t.Title, { children: "Select internal link" }) }),
|
|
421
|
+
/* @__PURE__ */ o(t.Body, { padding: "none", children: /* @__PURE__ */ o(O, { padding: "compact", children: /* @__PURE__ */ o(
|
|
422
422
|
x,
|
|
423
423
|
{
|
|
424
|
-
selectedUrl:
|
|
424
|
+
selectedUrl: i,
|
|
425
425
|
onSelectUrl: D,
|
|
426
426
|
getAllDocuments: f,
|
|
427
427
|
getDocumentPagesByDocumentId: h,
|
|
428
428
|
getDocumentSectionsByDocumentPageId: u
|
|
429
429
|
}
|
|
430
430
|
) }) }),
|
|
431
|
-
/* @__PURE__ */ p(
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ p(t.Footer, { children: [
|
|
432
|
+
/* @__PURE__ */ o(l, { size: n, emphasis: "default", onPress: () => s(!1), children: "Cancel" }),
|
|
433
|
+
/* @__PURE__ */ o(l, { size: n, disabled: !i, emphasis: "strong", onPress: () => a(), children: "Choose" })
|
|
434
434
|
] })
|
|
435
435
|
] })
|
|
436
436
|
] })
|
|
@@ -439,6 +439,6 @@ const Ie = ({
|
|
|
439
439
|
);
|
|
440
440
|
};
|
|
441
441
|
export {
|
|
442
|
-
|
|
442
|
+
Ee as LinkSelector
|
|
443
443
|
};
|
|
444
444
|
//# sourceMappingURL=LinkSelector.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkSelector.es.js","sources":["../../../../src/components/Link/LinkSelector/LinkSelector.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Document, type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { Button, Dialog } from '@frontify/fondue/components';\nimport { IconLink } from '@frontify/fondue/icons';\nimport { type KeyboardEvent, type ReactElement, useEffect, useState } from 'react';\n\nimport './LinkSelector.css';\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n url: string;\n onUrlChange?: (value: string) => void;\n buttonSize?: 'small' | 'medium' | 'large';\n getAllDocuments: () => Promise<Document[]>;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const LinkSelector = ({\n url,\n onUrlChange,\n buttonSize = 'medium',\n getAllDocuments,\n getDocumentPagesByDocumentId,\n getDocumentSectionsByDocumentPageId,\n}: LinkSelectorProps): ReactElement => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [selectedUrl, setSelectedUrl] = useState<string>(url);\n\n const onSelectUrl = (url: string) => {\n setSelectedUrl(url);\n };\n\n const onPressEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange?.(selectedUrl);\n setIsModalOpen(false);\n };\n\n const dialogProps = {\n onOpenAutoFocus: () => {},\n showUnderlay: true,\n 'data-is-underlay': true,\n minWidth: '800px',\n };\n\n return (\n // eslint-disable-next-line jsx-a11y-x/no-static-element-interactions\n <div\n onPointerDown={(event) => event.preventDefault()}\n data-test-id=\"internal-link-selector\"\n onKeyDown={onPressEnter}\n >\n <Dialog.Root modal open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Dialog.Trigger asChild>\n <Button size={buttonSize} emphasis=\"default\">\n <IconLink size=\"20\" />\n Internal link\n </Button>\n </Dialog.Trigger>\n <Dialog.Content {...dialogProps}>\n <Dialog.Header>\n <Dialog.Title>Select internal link</Dialog.Title>\n </Dialog.Header>\n <Dialog.Body>\n <
|
|
1
|
+
{"version":3,"file":"LinkSelector.es.js","sources":["../../../../src/components/Link/LinkSelector/LinkSelector.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Document, type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { Button, Dialog, ScrollArea } from '@frontify/fondue/components';\nimport { IconLink } from '@frontify/fondue/icons';\nimport { type KeyboardEvent, type ReactElement, useEffect, useState } from 'react';\n\nimport './LinkSelector.css';\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n url: string;\n onUrlChange?: (value: string) => void;\n buttonSize?: 'small' | 'medium' | 'large';\n getAllDocuments: () => Promise<Document[]>;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const LinkSelector = ({\n url,\n onUrlChange,\n buttonSize = 'medium',\n getAllDocuments,\n getDocumentPagesByDocumentId,\n getDocumentSectionsByDocumentPageId,\n}: LinkSelectorProps): ReactElement => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [selectedUrl, setSelectedUrl] = useState<string>(url);\n\n const onSelectUrl = (url: string) => {\n setSelectedUrl(url);\n };\n\n const onPressEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange?.(selectedUrl);\n setIsModalOpen(false);\n };\n\n const dialogProps = {\n onOpenAutoFocus: () => {},\n showUnderlay: true,\n 'data-is-underlay': true,\n minWidth: '800px',\n };\n\n return (\n // eslint-disable-next-line jsx-a11y-x/no-static-element-interactions\n <div\n onPointerDown={(event) => event.preventDefault()}\n data-test-id=\"internal-link-selector\"\n onKeyDown={onPressEnter}\n >\n <Dialog.Root modal open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Dialog.Trigger asChild>\n <Button size={buttonSize} emphasis=\"default\">\n <IconLink size=\"20\" />\n Internal link\n </Button>\n </Dialog.Trigger>\n <Dialog.Content {...dialogProps}>\n <Dialog.Header>\n <Dialog.Title>Select internal link</Dialog.Title>\n </Dialog.Header>\n <Dialog.Body padding=\"none\">\n <ScrollArea padding=\"compact\">\n <DocumentLinks\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n getAllDocuments={getAllDocuments}\n getDocumentPagesByDocumentId={getDocumentPagesByDocumentId}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n />\n </ScrollArea>\n </Dialog.Body>\n <Dialog.Footer>\n <Button size={buttonSize} emphasis=\"default\" onPress={() => setIsModalOpen(false)}>\n Cancel\n </Button>\n <Button size={buttonSize} disabled={!selectedUrl} emphasis=\"strong\" onPress={() => saveLink()}>\n Choose\n </Button>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog.Root>\n </div>\n );\n};\n"],"names":["LinkSelector","url","onUrlChange","buttonSize","getAllDocuments","getDocumentPagesByDocumentId","getDocumentSectionsByDocumentPageId","isModalOpen","setIsModalOpen","useState","selectedUrl","setSelectedUrl","onSelectUrl","onPressEnter","event","saveLink","useEffect","dialogProps","jsx","jsxs","Dialog","Button","IconLink","ScrollArea","DocumentLinks"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAMA,KAAe,CAAC;AAAA,EACzB,KAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,iBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,qCAAAC;AACJ,MAAuC;AACnC,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAaC,CAAc,IAAIF,EAAiBR,CAAG,GAEpDW,IAAc,CAACX,MAAgB;AACjC,IAAAU,EAAeV,CAAG;AAAA,EACtB,GAEMY,IAAe,CAACC,MAA2C;AAC7D,IAAIA,EAAM,QAAQ,YACdA,EAAM,eAAA,GACNC,EAAA;AAAA,EAER;AAEA,EAAAC,EAAU,MAAM;AACZ,IAAIf,KAAO,CAACS,KACRC,EAAeV,CAAG;AAAA,EAE1B,GAAG,CAACA,GAAKS,CAAW,CAAC;AAErB,QAAMK,IAAW,MAAM;AACnB,IAAAb,KAAA,QAAAA,EAA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