@frontify/guideline-blocks-settings 0.34.2 → 0.34.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +37 -44
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +8 -8
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +29 -29
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
|
@@ -1,48 +1,41 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useEditorRef as n,
|
|
3
|
-
import { floatingButtonSelectors as
|
|
4
|
-
import { triggerFloatingButtonEdit as
|
|
5
|
-
import { unwrapButton as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */ t(
|
|
9
|
-
"
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
children: /* @__PURE__ */ t(a, {})
|
|
38
|
-
}
|
|
39
|
-
)
|
|
40
|
-
] })
|
|
41
|
-
] })
|
|
42
|
-
}
|
|
43
|
-
);
|
|
1
|
+
import { jsx as t, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { useEditorRef as n, FloatingModalWrapper as r, IconPen16 as i, focusEditor as a, IconTrashBin16 as s } from "@frontify/fondue";
|
|
3
|
+
import { floatingButtonSelectors as d } from "../floatingButtonStore.es.js";
|
|
4
|
+
import { triggerFloatingButtonEdit as l } from "../../../utils/triggerFloatingButtonEdit.es.js";
|
|
5
|
+
import { unwrapButton as c } from "../../../transforms/unwrapButton.es.js";
|
|
6
|
+
const f = () => {
|
|
7
|
+
const o = n();
|
|
8
|
+
return /* @__PURE__ */ t(r, { 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", children: [
|
|
9
|
+
/* @__PURE__ */ t("span", { className: "tw-pointer-events-none", children: d.url() }),
|
|
10
|
+
/* @__PURE__ */ e("span", { className: "tw-flex tw-gap-2", children: [
|
|
11
|
+
/* @__PURE__ */ t(
|
|
12
|
+
"button",
|
|
13
|
+
{
|
|
14
|
+
onClick: () => {
|
|
15
|
+
l(o);
|
|
16
|
+
},
|
|
17
|
+
tabIndex: 0,
|
|
18
|
+
"data-test-id": "edit-button-button",
|
|
19
|
+
className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
|
|
20
|
+
children: /* @__PURE__ */ t(i, {})
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ t(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
onClick: () => {
|
|
27
|
+
c(o), a(o, o.selection ?? void 0);
|
|
28
|
+
},
|
|
29
|
+
tabIndex: 0,
|
|
30
|
+
"data-test-id": "remove-button-button",
|
|
31
|
+
className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
|
|
32
|
+
children: /* @__PURE__ */ t(s, {})
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
] })
|
|
36
|
+
] }) });
|
|
44
37
|
};
|
|
45
38
|
export {
|
|
46
|
-
|
|
39
|
+
f as EditModal
|
|
47
40
|
};
|
|
48
41
|
//# sourceMappingURL=EditModal.es.js.map
|
|
@@ -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 { IconPen16, IconTrashBin16, focusEditor, useEditorRef } from '@frontify/fondue';\n\nimport { floatingButtonSelectors } from '../floatingButtonStore';\nimport { unwrapButton } from '../../../transforms';\nimport { triggerFloatingButtonEdit } from '../../../utils';\n\nexport const EditModal = () => {\n const editor = useEditorRef();\n return (\n <
|
|
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 { FloatingModalWrapper, IconPen16, IconTrashBin16, focusEditor, useEditorRef } from '@frontify/fondue';\n\nimport { floatingButtonSelectors } from '../floatingButtonStore';\nimport { unwrapButton } from '../../../transforms';\nimport { triggerFloatingButtonEdit } from '../../../utils';\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\">\n <span className=\"tw-pointer-events-none\">{floatingButtonSelectors.url()}</span>\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 <IconPen16 />\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 <IconTrashBin16 />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"names":["EditModal","editor","useEditorRef","jsx","FloatingModalWrapper","jsxs","floatingButtonSelectors","triggerFloatingButtonEdit","IconPen16","unwrapButton","focusEditor","IconTrashBin16"],"mappings":";;;;;AAQO,MAAMA,IAAY,MAAM;AAC3B,QAAMC,IAASC;AACf,SACK,gBAAAC,EAAAC,GAAA,EAAqB,SAAQ,QAAO,UAAS,SAAQ,gBAAa,wBAC/D,UAAC,gBAAAC,EAAA,QAAA,EAAK,gBAAa,yBAAwB,WAAU,8CACjD,UAAA;AAAA,IAAA,gBAAAF,EAAC,QAAK,EAAA,WAAU,0BAA0B,UAAAG,EAAwB,OAAM;AAAA,IACxE,gBAAAD,EAAC,QAAK,EAAA,WAAU,oBACZ,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,SAAS,MAAM;AACX,YAAAI,EAA0BN,CAAM;AAAA,UACpC;AAAA,UACA,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UAEV,4BAACO,GAAU,EAAA;AAAA,QAAA;AAAA,MACf;AAAA,MAEA,gBAAAL;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,SAAS,MAAM;AACX,YAAAM,EAAaR,CAAM,GACPS,EAAAT,GAAQA,EAAO,aAAa,MAAS;AAAA,UACrD;AAAA,UACA,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UAEV,4BAACU,GAAe,EAAA;AAAA,QAAA;AAAA,MACpB;AAAA,IAAA,GACJ;AAAA,EAAA,EACJ,CAAA,EACJ,CAAA;AAER;"}
|
package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { useLinkOpenButtonState as o,
|
|
3
|
-
import { getUrlFromLinkOrLegacyLink as
|
|
4
|
-
const
|
|
5
|
-
const { element: e } = o(), a = e ?
|
|
6
|
-
return /* @__PURE__ */ t(
|
|
2
|
+
import { useLinkOpenButtonState as o, FloatingModalWrapper as s, IconPen16 as d, IconTrashBin16 as l } from "@frontify/fondue";
|
|
3
|
+
import { getUrlFromLinkOrLegacyLink as c } from "../../../../../Link/utils/getUrl.es.js";
|
|
4
|
+
const u = ({ editButtonProps: i, unlinkButtonProps: r }) => {
|
|
5
|
+
const { element: e } = o(), a = e ? c(e) : "";
|
|
6
|
+
return /* @__PURE__ */ t(s, { "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", children: [
|
|
7
7
|
/* @__PURE__ */ t("span", { className: "tw-pointer-events-none", children: a }),
|
|
8
8
|
/* @__PURE__ */ n("span", { className: "tw-flex tw-gap-2", children: [
|
|
9
9
|
/* @__PURE__ */ t(
|
|
@@ -13,7 +13,7 @@ const p = ({ editButtonProps: i, unlinkButtonProps: r }) => {
|
|
|
13
13
|
"data-test-id": "edit-link-button",
|
|
14
14
|
className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
|
|
15
15
|
...i,
|
|
16
|
-
children: /* @__PURE__ */ t(
|
|
16
|
+
children: /* @__PURE__ */ t(d, {})
|
|
17
17
|
}
|
|
18
18
|
),
|
|
19
19
|
/* @__PURE__ */ t(
|
|
@@ -23,13 +23,13 @@ const p = ({ editButtonProps: i, unlinkButtonProps: r }) => {
|
|
|
23
23
|
"data-test-id": "remove-link-button",
|
|
24
24
|
className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
|
|
25
25
|
...r,
|
|
26
|
-
children: /* @__PURE__ */ t(
|
|
26
|
+
children: /* @__PURE__ */ t(l, {})
|
|
27
27
|
}
|
|
28
28
|
)
|
|
29
29
|
] })
|
|
30
30
|
] }) });
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
u as EditModal
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=EditModal.es.js.map
|
|
@@ -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 { MouseEvent } from 'react';\nimport { IconPen16, IconTrashBin16, useLinkOpenButtonState } from '@frontify/fondue';\nimport { getUrlFromLinkOrLegacyLink } from '../../../../../Link';\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 <
|
|
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 { MouseEvent } from 'react';\nimport { FloatingModalWrapper, IconPen16, IconTrashBin16, useLinkOpenButtonState } from '@frontify/fondue';\nimport { getUrlFromLinkOrLegacyLink } from '../../../../../Link';\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\">\n <span className=\"tw-pointer-events-none\">{url}</span>\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 <IconPen16 />\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 <IconTrashBin16 />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"names":["EditModal","editButtonProps","unlinkButtonProps","element","useLinkOpenButtonState","url","getUrlFromLinkOrLegacyLink","jsx","FloatingModalWrapper","jsxs","IconPen16","IconTrashBin16"],"mappings":";;;AAgBO,MAAMA,IAAY,CAAC,EAAE,iBAAAC,GAAiB,mBAAAC,QAAwC;AAC3E,QAAA,EAAE,SAAAC,MAAYC,KACdC,IAAMF,IAAUG,EAA2BH,CAAO,IAAI;AAE5D,SACK,gBAAAI,EAAAC,GAAA,EAAqB,gBAAa,sBAAqB,SAAQ,QAAO,UAAS,SAC5E,UAAC,gBAAAC,EAAA,QAAA,EAAK,gBAAa,uBAAsB,WAAU,8CAC/C,UAAA;AAAA,IAAC,gBAAAF,EAAA,QAAA,EAAK,WAAU,0BAA0B,UAAIF,GAAA;AAAA,IAC9C,gBAAAI,EAAC,QAAK,EAAA,WAAU,oBACZ,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UACT,GAAGN;AAAA,UAEJ,4BAACS,GAAU,EAAA;AAAA,QAAA;AAAA,MACf;AAAA,MAEA,gBAAAH;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UAAU;AAAA,UACV,gBAAa;AAAA,UACb,WAAU;AAAA,UACT,GAAGL;AAAA,UAEJ,4BAACS,GAAe,EAAA;AAAA,QAAA;AAAA,MACpB;AAAA,IAAA,GACJ;AAAA,EAAA,EACJ,CAAA,EACJ,CAAA;AAER;"}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { FormControl as
|
|
3
|
-
import { LinkInput as
|
|
4
|
-
const
|
|
5
|
-
state:
|
|
6
|
-
onTextChange:
|
|
7
|
-
onUrlChange:
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { FloatingModalWrapper as x, FormControl as w, TextInput as k, Button as t, ButtonSize as r, ButtonStyle as b, ButtonEmphasis as f, IconCheckMark20 as T } from "@frontify/fondue";
|
|
3
|
+
import { LinkInput as C } from "../../../../../Link/LinkInput.es.js";
|
|
4
|
+
const B = ({
|
|
5
|
+
state: i,
|
|
6
|
+
onTextChange: d,
|
|
7
|
+
onUrlChange: o,
|
|
8
8
|
onToggleTab: a,
|
|
9
9
|
onCancel: c,
|
|
10
|
-
onSave:
|
|
11
|
-
isValidUrlOrEmpty:
|
|
10
|
+
onSave: m,
|
|
11
|
+
isValidUrlOrEmpty: l,
|
|
12
12
|
hasValues: u,
|
|
13
|
-
testId:
|
|
14
|
-
appBridge:
|
|
13
|
+
testId: h,
|
|
14
|
+
appBridge: p,
|
|
15
15
|
children: s
|
|
16
|
-
}) => /* @__PURE__ */
|
|
16
|
+
}) => /* @__PURE__ */ n(x, { "data-test-id": h, padding: "28px", minWidth: "400px", children: [
|
|
17
17
|
/* @__PURE__ */ e(
|
|
18
|
-
|
|
18
|
+
w,
|
|
19
19
|
{
|
|
20
20
|
label: {
|
|
21
21
|
children: "Text",
|
|
22
22
|
htmlFor: "linkText",
|
|
23
23
|
required: !0
|
|
24
24
|
},
|
|
25
|
-
children: /* @__PURE__ */ e(
|
|
25
|
+
children: /* @__PURE__ */ e(k, { id: "linkText", value: i.text, placeholder: "Link Text", onChange: d })
|
|
26
26
|
}
|
|
27
27
|
),
|
|
28
28
|
s,
|
|
29
29
|
/* @__PURE__ */ e("div", { className: "tw-mt-5", children: /* @__PURE__ */ e(
|
|
30
|
-
|
|
30
|
+
C,
|
|
31
31
|
{
|
|
32
|
-
url:
|
|
33
|
-
newTab:
|
|
34
|
-
onUrlChange:
|
|
32
|
+
url: i.url,
|
|
33
|
+
newTab: i.newTab,
|
|
34
|
+
onUrlChange: o,
|
|
35
35
|
onToggleTab: a,
|
|
36
|
-
isValidUrlOrEmpty:
|
|
37
|
-
appBridge:
|
|
36
|
+
isValidUrlOrEmpty: l,
|
|
37
|
+
appBridge: p
|
|
38
38
|
}
|
|
39
39
|
) }),
|
|
40
|
-
/* @__PURE__ */ e("div", { className: "tw-mt-3", children: /* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ e("div", { className: "tw-mt-3", children: /* @__PURE__ */ n("div", { className: "tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10", children: [
|
|
41
41
|
/* @__PURE__ */ e(
|
|
42
|
-
|
|
42
|
+
t,
|
|
43
43
|
{
|
|
44
44
|
onClick: c,
|
|
45
45
|
size: r.Medium,
|
|
46
|
-
style:
|
|
47
|
-
emphasis:
|
|
46
|
+
style: b.Default,
|
|
47
|
+
emphasis: f.Default,
|
|
48
48
|
children: "Cancel"
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
51
|
/* @__PURE__ */ e(
|
|
52
|
-
|
|
52
|
+
t,
|
|
53
53
|
{
|
|
54
|
-
onClick:
|
|
54
|
+
onClick: m,
|
|
55
55
|
size: r.Medium,
|
|
56
|
-
icon: /* @__PURE__ */ e(
|
|
57
|
-
disabled: !i
|
|
56
|
+
icon: /* @__PURE__ */ e(T, {}),
|
|
57
|
+
disabled: !l(i == null ? void 0 : i.url) || !u,
|
|
58
58
|
children: "Save"
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
] }) })
|
|
62
62
|
] });
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
B as InsertModal
|
|
65
65
|
};
|
|
66
66
|
//# sourceMappingURL=InsertModal.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsertModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MouseEvent, ReactElement, ReactNode } from 'react';\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n Button,\n ButtonEmphasis,\n ButtonSize,\n ButtonStyle,\n FormControl,\n IconCheckMark20,\n TextInput,\n} from '@frontify/fondue';\nimport { InsertModalStateProps } from './types';\nimport { LinkInput } from '../../../../../Link';\n\ntype Props = {\n state: InsertModalStateProps;\n onTextChange: (value: string) => void;\n onUrlChange: (value: string) => void;\n onToggleTab: (checked: boolean) => void;\n onCancel: () => void;\n onSave: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent> | KeyboardEvent | undefined) => void;\n hasValues: boolean;\n isValidUrlOrEmpty: (url: string) => boolean;\n testId?: string;\n children?: ReactNode;\n appBridge: AppBridgeBlock;\n};\n\nexport const InsertModal = ({\n state,\n onTextChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n isValidUrlOrEmpty,\n hasValues,\n testId,\n appBridge,\n children,\n}: Props): ReactElement => (\n <
|
|
1
|
+
{"version":3,"file":"InsertModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MouseEvent, ReactElement, ReactNode } from 'react';\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n Button,\n ButtonEmphasis,\n ButtonSize,\n ButtonStyle,\n FloatingModalWrapper,\n FormControl,\n IconCheckMark20,\n TextInput,\n} from '@frontify/fondue';\nimport { InsertModalStateProps } from './types';\nimport { LinkInput } from '../../../../../Link';\n\ntype Props = {\n state: InsertModalStateProps;\n onTextChange: (value: string) => void;\n onUrlChange: (value: string) => void;\n onToggleTab: (checked: boolean) => void;\n onCancel: () => void;\n onSave: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent> | KeyboardEvent | undefined) => void;\n hasValues: boolean;\n isValidUrlOrEmpty: (url: string) => boolean;\n testId?: string;\n children?: ReactNode;\n appBridge: AppBridgeBlock;\n};\n\nexport const InsertModal = ({\n state,\n onTextChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n isValidUrlOrEmpty,\n hasValues,\n testId,\n appBridge,\n children,\n}: Props): ReactElement => (\n <FloatingModalWrapper data-test-id={testId} padding=\"28px\" minWidth=\"400px\">\n <FormControl\n label={{\n children: 'Text',\n htmlFor: 'linkText',\n required: true,\n }}\n >\n <TextInput id=\"linkText\" value={state.text} placeholder=\"Link Text\" onChange={onTextChange} />\n </FormControl>\n\n {children}\n\n <div className=\"tw-mt-5\">\n <LinkInput\n url={state.url}\n newTab={state.newTab}\n onUrlChange={onUrlChange}\n onToggleTab={onToggleTab}\n isValidUrlOrEmpty={isValidUrlOrEmpty}\n appBridge={appBridge}\n />\n </div>\n <div className=\"tw-mt-3\">\n <div className={'tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10'}>\n <Button\n onClick={onCancel}\n size={ButtonSize.Medium}\n style={ButtonStyle.Default}\n emphasis={ButtonEmphasis.Default}\n >\n Cancel\n </Button>\n <Button\n onClick={onSave}\n size={ButtonSize.Medium}\n icon={<IconCheckMark20 />}\n disabled={!isValidUrlOrEmpty(state?.url) || !hasValues}\n >\n Save\n </Button>\n </div>\n </div>\n </FloatingModalWrapper>\n);\n"],"names":["InsertModal","state","onTextChange","onUrlChange","onToggleTab","onCancel","onSave","isValidUrlOrEmpty","hasValues","testId","appBridge","children","FloatingModalWrapper","jsx","FormControl","TextInput","LinkInput","jsxs","Button","ButtonSize","ButtonStyle","ButtonEmphasis","IconCheckMark20"],"mappings":";;;AA+BO,MAAMA,IAAc,CAAC;AAAA,EACxB,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACJ,wBACKC,GAAqB,EAAA,gBAAcH,GAAQ,SAAQ,QAAO,UAAS,SAChE,UAAA;AAAA,EAAA,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,OAAO;AAAA,QACH,UAAU;AAAA,QACV,SAAS;AAAA,QACT,UAAU;AAAA,MACd;AAAA,MAEA,UAAA,gBAAAD,EAACE,GAAU,EAAA,IAAG,YAAW,OAAOd,EAAM,MAAM,aAAY,aAAY,UAAUC,EAAc,CAAA;AAAA,IAAA;AAAA,EAChG;AAAA,EAECS;AAAA,EAED,gBAAAE,EAAC,OAAI,EAAA,WAAU,WACX,UAAA,gBAAAA;AAAA,IAACG;AAAA,IAAA;AAAA,MACG,KAAKf,EAAM;AAAA,MACX,QAAQA,EAAM;AAAA,MACd,aAAAE;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAG;AAAA,MACA,WAAAG;AAAA,IAAA;AAAA,EAAA,GAER;AAAA,oBACC,OAAI,EAAA,WAAU,WACX,UAAC,gBAAAO,EAAA,OAAA,EAAI,WAAW,8EACZ,UAAA;AAAA,IAAA,gBAAAJ;AAAA,MAACK;AAAA,MAAA;AAAA,QACG,SAASb;AAAA,QACT,MAAMc,EAAW;AAAA,QACjB,OAAOC,EAAY;AAAA,QACnB,UAAUC,EAAe;AAAA,QAC5B,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,IACA,gBAAAR;AAAA,MAACK;AAAA,MAAA;AAAA,QACG,SAASZ;AAAA,QACT,MAAMa,EAAW;AAAA,QACjB,wBAAOG,GAAgB,EAAA;AAAA,QACvB,UAAU,CAACf,EAAkBN,KAAA,gBAAAA,EAAO,GAAG,KAAK,CAACO;AAAA,QAChD,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,EAAA,EAAA,CACJ,EACJ,CAAA;AAAA,EACJ,CAAA;"}
|