@frontify/fondue 12.0.0-beta.16 → 12.0.0-beta.17

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 (39) hide show
  1. package/dist/components/RichTextEditor/Plugins/CheckboxListPlugin/CheckboxListButton/CheckboxListToolbarButton.es.js +8 -8
  2. package/dist/components/RichTextEditor/Plugins/CheckboxListPlugin/CheckboxListButton/CheckboxListToolbarButton.es.js.map +1 -1
  3. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +4 -2
  4. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
  5. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +32 -27
  6. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -1
  7. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/FloatingLink.es.js +13 -6
  8. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/FloatingLink.es.js.map +1 -1
  9. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/index.d.ts +1 -0
  10. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.d.ts +2 -0
  11. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +38 -0
  12. package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -0
  13. package/dist/index.cjs.js +10 -4
  14. package/dist/index.cjs.js.map +1 -1
  15. package/dist/index.umd.js +10 -4
  16. package/dist/index.umd.js.map +1 -1
  17. package/dist/node_modules/@udecode/plate-core/dist/index.es.es.js +1482 -0
  18. package/dist/node_modules/@udecode/plate-core/dist/index.es.es.js.map +1 -0
  19. package/dist/node_modules/@udecode/plate-floating/dist/index.es.es.js +21 -0
  20. package/dist/node_modules/@udecode/plate-floating/dist/index.es.es.js.map +1 -0
  21. package/dist/node_modules/@udecode/zustood/dist/index.es.es.js +439 -0
  22. package/dist/node_modules/@udecode/zustood/dist/index.es.es.js.map +1 -0
  23. package/dist/node_modules/@udecode/zustood/node_modules/react-tracked/dist/index.modern.es.js +21 -0
  24. package/dist/node_modules/@udecode/zustood/node_modules/react-tracked/dist/index.modern.es.js.map +1 -0
  25. package/dist/node_modules/hotkeys-js/dist/hotkeys.esm.es.js +275 -0
  26. package/dist/node_modules/hotkeys-js/dist/hotkeys.esm.es.js.map +1 -0
  27. package/dist/node_modules/jotai/esm/index.es.js +418 -0
  28. package/dist/node_modules/jotai/esm/index.es.js.map +1 -0
  29. package/dist/node_modules/proxy-compare/dist/index.modern.es.js +74 -0
  30. package/dist/node_modules/proxy-compare/dist/index.modern.es.js.map +1 -0
  31. package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.es.js +7 -0
  32. package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.es.js.map +1 -0
  33. package/dist/node_modules/zustand/esm/index.es.js +62 -0
  34. package/dist/node_modules/zustand/esm/index.es.js.map +1 -0
  35. package/dist/node_modules/zustand/esm/middleware.es.js +219 -0
  36. package/dist/node_modules/zustand/esm/middleware.es.js.map +1 -0
  37. package/dist/node_modules/zustand/esm/vanilla.es.js +26 -0
  38. package/dist/node_modules/zustand/esm/vanilla.es.js.map +1 -0
  39. package/package.json +3 -3
@@ -1,11 +1,11 @@
1
- import { withPlateEventProvider as i, usePlateEditorState as u, useEventPlateId as c, someNode as m, ToolbarButton as d, unwrapList as f, getPreventDefaultHandler as p, toggleNodeType as P } from "@udecode/plate";
2
- import E from "react";
3
- const g = i(({ id: r, type: o, inactiveType: s, active: t, ...l }) => {
4
- const e = u(c(r)), n = t != null ? t : !!(e != null && e.selection) && m(e, { match: { type: o } });
5
- return /* @__PURE__ */ E.createElement(d, {
6
- active: n,
1
+ import { withPlateProvider as i, usePlateEditorState as u, useEventPlateId as c, someNode as m, ToolbarButton as d, unwrapList as f, getPreventDefaultHandler as p, toggleNodeType as P } from "@udecode/plate";
2
+ import T from "react";
3
+ const h = i(({ id: n, type: o, inactiveType: s, active: t, ...l }) => {
4
+ const e = u(c(n)), r = t != null ? t : !!(e != null && e.selection) && m(e, { match: { type: o } });
5
+ return /* @__PURE__ */ T.createElement(d, {
6
+ active: r,
7
7
  onMouseDown: (a) => {
8
- !e || !e.selection || (n || f(e, {}), p(P, e, {
8
+ !e || !e.selection || (r || f(e, {}), p(P, e, {
9
9
  activeType: o,
10
10
  inactiveType: s
11
11
  })(a));
@@ -14,6 +14,6 @@ const g = i(({ id: r, type: o, inactiveType: s, active: t, ...l }) => {
14
14
  });
15
15
  });
16
16
  export {
17
- g as CheckboxListToolbarButton
17
+ h as CheckboxListToolbarButton
18
18
  };
19
19
  //# sourceMappingURL=CheckboxListToolbarButton.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxListToolbarButton.es.js","sources":["../../../../../../src/components/RichTextEditor/Plugins/CheckboxListPlugin/CheckboxListButton/CheckboxListToolbarButton.tsx"],"sourcesContent":["import {\n BlockToolbarButtonProps,\n ToolbarButton,\n getPreventDefaultHandler,\n someNode,\n toggleNodeType,\n unwrapList,\n useEventPlateId,\n usePlateEditorState,\n withPlateEventProvider,\n} from '@udecode/plate';\nimport React from 'react';\n\nexport const CheckboxListToolbarButton = withPlateEventProvider(\n ({ id, type, inactiveType, active, ...props }: BlockToolbarButtonProps) => {\n const editor = usePlateEditorState(useEventPlateId(id));\n\n const isActive = active ?? (!!editor?.selection && someNode(editor, { match: { type } }));\n\n return (\n <ToolbarButton\n active={isActive}\n onMouseDown={(event) => {\n if (!editor || !editor.selection) {\n return;\n }\n\n if (!isActive) {\n unwrapList(editor, {});\n }\n\n getPreventDefaultHandler(toggleNodeType, editor, {\n activeType: type,\n inactiveType,\n })(event);\n }}\n {...props}\n />\n );\n },\n);\n"],"names":[],"mappings":";;AAaa,MAAA,IAA4B,EACrC,CAAC,EAAE,OAAI,SAAM,iBAAc,cAAW,QAAqC;AACvE,QAAM,IAAS,EAAoB,EAAgB,CAAE,CAAC,GAEhD,IAAW,gBAAY,CAAA,CAAC,gBAAQ,cAAa,EAAS,GAAQ,EAAE,OAAO,EAAE,WAAQ;AAEvF,SACK,kBAAA,cAAA,GAAA;AAAA,IACG,QAAQ;AAAA,IACR,aAAa,CAAC,MAAU;AACpB,MAAI,CAAC,KAAU,CAAC,EAAO,aAIlB,MACU,EAAA,GAAQ,CAAA,CAAE,GAGzB,EAAyB,GAAgB,GAAQ;AAAA,QAC7C,YAAY;AAAA,QACZ;AAAA,MAAA,CACH,EAAE,CAAK;AAAA,IACZ;AAAA,IACC,GAAG;AAAA,EAAA,CACR;AAER,CACJ;"}
1
+ {"version":3,"file":"CheckboxListToolbarButton.es.js","sources":["../../../../../../src/components/RichTextEditor/Plugins/CheckboxListPlugin/CheckboxListButton/CheckboxListToolbarButton.tsx"],"sourcesContent":["import {\n BlockToolbarButtonProps,\n ToolbarButton,\n getPreventDefaultHandler,\n someNode,\n toggleNodeType,\n unwrapList,\n useEventPlateId,\n usePlateEditorState,\n withPlateProvider,\n} from '@udecode/plate';\nimport React from 'react';\n\nexport const CheckboxListToolbarButton = withPlateProvider(\n ({ id, type, inactiveType, active, ...props }: BlockToolbarButtonProps) => {\n const editor = usePlateEditorState(useEventPlateId(id));\n\n const isActive = active ?? (!!editor?.selection && someNode(editor, { match: { type } }));\n\n return (\n <ToolbarButton\n active={isActive}\n onMouseDown={(event) => {\n if (!editor || !editor.selection) {\n return;\n }\n\n if (!isActive) {\n unwrapList(editor, {});\n }\n\n getPreventDefaultHandler(toggleNodeType, editor, {\n activeType: type,\n inactiveType,\n })(event);\n }}\n {...props}\n />\n );\n },\n);\n"],"names":[],"mappings":";;AAaa,MAAA,IAA4B,EACrC,CAAC,EAAE,OAAI,SAAM,iBAAc,cAAW,QAAqC;AACvE,QAAM,IAAS,EAAoB,EAAgB,CAAE,CAAC,GAEhD,IAAW,gBAAY,CAAA,CAAC,gBAAQ,cAAa,EAAS,GAAQ,EAAE,OAAO,EAAE,WAAQ;AAEvF,SACK,kBAAA,cAAA,GAAA;AAAA,IACG,QAAQ;AAAA,IACR,aAAa,CAAC,MAAU;AACpB,MAAI,CAAC,KAAU,CAAC,EAAO,aAIlB,MACU,EAAA,GAAQ,CAAA,CAAE,GAGzB,EAAyB,GAAgB,GAAQ;AAAA,QAC7C,YAAY;AAAA,QACZ;AAAA,MAAA,CACH,EAAE,CAAK;AAAA,IACZ;AAAA,IACC,GAAG;AAAA,EAAA,CACR;AAER,CACJ;"}
@@ -3,11 +3,13 @@ import { useFloatingLinkSelectors as i } from "@udecode/plate";
3
3
  import { FloatingLink as n } from "./FloatingLink.es.js";
4
4
  import { EditModal as l } from "./EditLinkModal/EditModal.es.js";
5
5
  import { InsertModal as m } from "./InsertLinkModal/InsertModal.es.js";
6
- const d = () => {
6
+ import "../../../../../node_modules/@udecode/plate-core/dist/index.es.es.js";
7
+ import "slate-react";
8
+ const g = () => {
7
9
  const o = i().isEditing(), e = /* @__PURE__ */ t.createElement(m, null), r = o ? e : /* @__PURE__ */ t.createElement(l, null);
8
10
  return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(n.InsertRoot, null, e), /* @__PURE__ */ t.createElement(n.EditRoot, null, r));
9
11
  };
10
12
  export {
11
- d as CustomFloatingLink
13
+ g as CustomFloatingLink
12
14
  };
13
15
  //# sourceMappingURL=CustomFloatingLink.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomFloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport React from 'react';\nimport { useFloatingLinkSelectors } from '@udecode/plate';\nimport { FloatingLink } from './FloatingLink';\nimport { EditModal } from './EditLinkModal';\nimport { InsertModal } from './InsertLinkModal';\n\nexport const CustomFloatingLink = () => {\n const isEditing = useFloatingLinkSelectors().isEditing();\n\n const input = <InsertModal />;\n const editContent = !isEditing ? <EditModal /> : input;\n\n return (\n <>\n <FloatingLink.InsertRoot>{input}</FloatingLink.InsertRoot>\n\n <FloatingLink.EditRoot>{editContent}</FloatingLink.EditRoot>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AAQO,MAAM,IAAqB,MAAM;AAC9B,QAAA,IAAY,IAA2B,aAEvC,oCAAS,GAAY,IAAA,GACrB,IAAc,AAAC,IAA4B,IAAhB,kBAAA,cAAC,OAAU;AAE5C,SAEQ,kBAAA,cAAA,EAAA,UAAA,MAAA,kBAAA,cAAC,EAAa,YAAb,MAAyB,CAAM,GAEhC,kBAAA,cAAC,EAAa,UAAb,MAAuB,CAAY,CACxC;AAER;"}
1
+ {"version":3,"file":"CustomFloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport React from 'react';\nimport { useFloatingLinkSelectors } from '@udecode/plate';\nimport { FloatingLink } from './FloatingLink';\nimport { EditModal } from './EditLinkModal';\nimport { InsertModal } from './InsertLinkModal';\n\nexport const CustomFloatingLink = () => {\n const isEditing = useFloatingLinkSelectors().isEditing();\n\n const input = <InsertModal />;\n const editContent = !isEditing ? <EditModal /> : input;\n\n return (\n <>\n <FloatingLink.InsertRoot>{input}</FloatingLink.InsertRoot>\n\n <FloatingLink.EditRoot>{editContent}</FloatingLink.EditRoot>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAQO,MAAM,IAAqB,MAAM;AAC9B,QAAA,IAAY,IAA2B,aAEvC,oCAAS,GAAY,IAAA,GACrB,IAAc,AAAC,IAA4B,IAAhB,kBAAA,cAAC,OAAU;AAE5C,SAEQ,kBAAA,cAAA,EAAA,UAAA,MAAA,kBAAA,cAAC,EAAa,YAAb,MAAyB,CAAM,GAEhC,kBAAA,cAAC,EAAa,UAAb,MAAuB,CAAY,CACxC;AAER;"}
@@ -1,43 +1,48 @@
1
- import { useCallback as k, useEffect as y } from "react";
2
- import { useEditorRef as L, usePlateSelectors as h, useFloatingLinkSelectors as s, getAboveNode as R, getPluginType as c, ELEMENT_LINK as l, getRangeBoundingClientRect as C, getStartPoint as F, getEndPoint as N, getDefaultBoundingClientRect as P, useVirtualFloatingLink as S, floatingLinkActions as o, someNode as B, floatingLinkSelectors as b, useComposedRef as x } from "@udecode/plate";
3
- import { getUrlFromEditor as A } from "../../utils/getUrl.es.js";
4
- const w = ({ floatingOptions: d, ...n }) => {
5
- const e = L(), u = h(e.id).keyEditor(), g = s().mode(), a = s().open(), f = k(() => {
6
- const t = R(e, {
7
- match: { type: c(e, l) }
1
+ import { useCallback as y, useEffect as F } from "react";
2
+ import { useEditorRef as h, usePlateSelectors as C, useFloatingLinkSelectors as l, getPluginOptions as R, ELEMENT_LINK as n, getAboveNode as P, getPluginType as d, getRangeBoundingClientRect as b, getStartPoint as N, getEndPoint as O, getDefaultBoundingClientRect as S, useVirtualFloatingLink as B, floatingLinkActions as o, someNode as I, floatingLinkSelectors as g, useHotkeys as v, triggerFloatingLinkEdit as x, useFloatingLinkEnter as A, useFloatingLinkEscape as D, useComposedRef as H } from "@udecode/plate";
3
+ import { getUrlFromEditor as T } from "../../utils/getUrl.es.js";
4
+ const M = ({ floatingOptions: u, ...i }) => {
5
+ const e = h(), c = C().keyEditor(), a = l().mode(), f = l().isOpen(e.id), { triggerFloatingLinkHotkeys: m } = R(e, n), p = y(() => {
6
+ const t = P(e, {
7
+ match: { type: d(e, n) }
8
8
  });
9
9
  if (t) {
10
- const [, r] = t;
11
- return C(e, {
12
- anchor: F(e, r),
13
- focus: N(e, r)
10
+ const [, s] = t;
11
+ return b(e, {
12
+ anchor: N(e, s),
13
+ focus: O(e, s)
14
14
  });
15
15
  }
16
- return P();
17
- }, [e]), m = a && g === "edit", { update: i, style: p, floating: E } = S({
18
- open: m,
19
- getBoundingClientRect: f,
20
- ...d
16
+ return S();
17
+ }, [e]), k = f && a === "edit", { update: r, style: E, floating: L } = B({
18
+ editorId: e.id,
19
+ open: k,
20
+ getBoundingClientRect: p,
21
+ ...u
21
22
  });
22
- return y(() => {
23
- const t = A(e);
24
- if (t && o.url(t), e.selection && B(e, {
25
- match: { type: c(e, l) }
23
+ return F(() => {
24
+ const t = T(e);
25
+ if (t && o.url(t), e.selection && I(e, {
26
+ match: { type: d(e, n) }
26
27
  })) {
27
- o.show("edit"), i();
28
+ o.show("edit", e.id), r();
28
29
  return;
29
30
  }
30
- b.mode() === "edit" && o.hide();
31
- }, [e, u, i]), {
31
+ g.mode() === "edit" && o.hide();
32
+ }, [e, c, r]), v(m, (t) => {
33
+ t.preventDefault(), g.mode() === "edit" && x(e);
34
+ }, {
35
+ enableOnContentEditable: !0
36
+ }, []), A(), D(), {
32
37
  style: {
33
- ...p,
38
+ ...E,
34
39
  zIndex: 1
35
40
  },
36
- ...n,
37
- ref: x(n.ref, E)
41
+ ...i,
42
+ ref: H(i.ref, L)
38
43
  };
39
44
  };
40
45
  export {
41
- w as useFloatingLinkEdit
46
+ M as useFloatingLinkEdit
42
47
  };
43
48
  //# sourceMappingURL=useFloatingLinkEdit.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFloatingLinkEdit.es.js","sources":["../../../../../../../src/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback, useEffect } from 'react';\nimport {\n ELEMENT_LINK,\n FloatingLinkProps,\n HTMLPropsAs,\n floatingLinkActions,\n floatingLinkSelectors,\n getAboveNode,\n getDefaultBoundingClientRect,\n getEndPoint,\n getPluginType,\n getRangeBoundingClientRect,\n getStartPoint,\n someNode,\n useComposedRef,\n useEditorRef,\n useFloatingLinkSelectors,\n usePlateSelectors,\n useVirtualFloatingLink,\n} from '@udecode/plate';\nimport { getUrlFromEditor } from '../../utils';\n\nexport const useFloatingLinkEdit = ({ floatingOptions, ...props }: FloatingLinkProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const keyEditor = usePlateSelectors(editor.id).keyEditor();\n const mode = useFloatingLinkSelectors().mode();\n const open = useFloatingLinkSelectors().open();\n\n const getBoundingClientRect = useCallback(() => {\n const entry = getAboveNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n });\n\n if (entry) {\n const [, path] = entry;\n return getRangeBoundingClientRect(editor, {\n anchor: getStartPoint(editor, path),\n focus: getEndPoint(editor, path),\n });\n }\n\n return getDefaultBoundingClientRect();\n }, [editor]);\n\n const isOpen = open && mode === 'edit';\n\n const { update, style, floating } = useVirtualFloatingLink({\n open: isOpen,\n getBoundingClientRect,\n ...floatingOptions,\n });\n\n useEffect(() => {\n const url = getUrlFromEditor(editor);\n if (url) {\n floatingLinkActions.url(url);\n }\n if (\n editor.selection &&\n someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n })\n ) {\n floatingLinkActions.show('edit');\n\n update();\n return;\n }\n\n if (floatingLinkSelectors.mode() === 'edit') {\n floatingLinkActions.hide();\n }\n }, [editor, keyEditor, update]);\n\n return {\n style: {\n ...style,\n zIndex: 1,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating),\n };\n};\n"],"names":[],"mappings":";;;AAwBO,MAAM,IAAsB,CAAC,EAAE,uBAAoB,QAAmD;AACzG,QAAM,IAAS,KACT,IAAY,EAAkB,EAAO,EAAE,EAAE,UAAU,GACnD,IAAO,IAA2B,QAClC,IAAO,IAA2B,QAElC,IAAwB,EAAY,MAAM;AACtC,UAAA,IAAQ,EAAa,GAAQ;AAAA,MAC/B,OAAO,EAAE,MAAM,EAAc,GAAQ,CAAY,EAAE;AAAA,IAAA,CACtD;AAED,QAAI,GAAO;AACD,YAAA,CAAG,EAAA,KAAQ;AACjB,aAAO,EAA2B,GAAQ;AAAA,QACtC,QAAQ,EAAc,GAAQ,CAAI;AAAA,QAClC,OAAO,EAAY,GAAQ,CAAI;AAAA,MAAA,CAClC;AAAA,IACL;AAEA,WAAO,EAA6B;AAAA,EAAA,GACrC,CAAC,CAAM,CAAC,GAEL,IAAS,KAAQ,MAAS,QAE1B,EAAE,WAAQ,UAAO,gBAAa,EAAuB;AAAA,IACvD,MAAM;AAAA,IACN;AAAA,IACA,GAAG;AAAA,EAAA,CACN;AAED,WAAU,MAAM;AACN,UAAA,IAAM,EAAiB,CAAM;AAK/B,QAJA,KACA,EAAoB,IAAI,CAAG,GAG3B,EAAO,aACP,EAAS,GAAQ;AAAA,MACb,OAAO,EAAE,MAAM,EAAc,GAAQ,CAAY,EAAE;AAAA,IAAA,CACtD,GACH;AACE,QAAoB,KAAK,MAAM,GAExB;AACP;AAAA,IACJ;AAEI,IAAA,EAAsB,KAAK,MAAM,UACjC,EAAoB,KAAK;AAAA,EAE9B,GAAA,CAAC,GAAQ,GAAW,CAAM,CAAC,GAEvB;AAAA,IACH,OAAO;AAAA,MACH,GAAG;AAAA,MACH,QAAQ;AAAA,IACZ;AAAA,IACA,GAAG;AAAA,IACH,KAAK,EAAmC,EAAM,KAAK,CAAQ;AAAA,EAAA;AAEnE;"}
1
+ {"version":3,"file":"useFloatingLinkEdit.es.js","sources":["../../../../../../../src/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useCallback, useEffect } from 'react';\nimport {\n ELEMENT_LINK,\n FloatingLinkProps,\n HTMLPropsAs,\n LinkPlugin,\n floatingLinkActions,\n floatingLinkSelectors,\n getAboveNode,\n getDefaultBoundingClientRect,\n getEndPoint,\n getPluginOptions,\n getPluginType,\n getRangeBoundingClientRect,\n getStartPoint,\n someNode,\n triggerFloatingLinkEdit,\n useComposedRef,\n useEditorRef,\n useFloatingLinkEnter,\n useFloatingLinkEscape,\n useFloatingLinkSelectors,\n useHotkeys,\n usePlateSelectors,\n useVirtualFloatingLink,\n} from '@udecode/plate';\nimport { getUrlFromEditor } from '../../utils';\n\nexport const useFloatingLinkEdit = ({ floatingOptions, ...props }: FloatingLinkProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const keyEditor = usePlateSelectors().keyEditor();\n const mode = useFloatingLinkSelectors().mode();\n const open = useFloatingLinkSelectors().isOpen(editor.id);\n\n const { triggerFloatingLinkHotkeys } = getPluginOptions<LinkPlugin>(editor, ELEMENT_LINK);\n\n const getBoundingClientRect = useCallback(() => {\n const entry = getAboveNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n });\n\n if (entry) {\n const [, path] = entry;\n return getRangeBoundingClientRect(editor, {\n anchor: getStartPoint(editor, path),\n focus: getEndPoint(editor, path),\n });\n }\n\n return getDefaultBoundingClientRect();\n }, [editor]);\n\n const isOpen = open && mode === 'edit';\n\n const { update, style, floating } = useVirtualFloatingLink({\n editorId: editor.id,\n open: isOpen,\n getBoundingClientRect,\n ...floatingOptions,\n });\n\n useEffect(() => {\n const url = getUrlFromEditor(editor);\n if (url) {\n floatingLinkActions.url(url);\n }\n\n if (\n editor.selection &&\n someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n })\n ) {\n floatingLinkActions.show('edit', editor.id);\n update();\n return;\n }\n\n if (floatingLinkSelectors.mode() === 'edit') {\n floatingLinkActions.hide();\n }\n }, [editor, keyEditor, update]);\n\n useHotkeys(\n triggerFloatingLinkHotkeys!,\n (e) => {\n e.preventDefault();\n\n if (floatingLinkSelectors.mode() === 'edit') {\n triggerFloatingLinkEdit(editor);\n }\n },\n {\n enableOnContentEditable: true,\n },\n [],\n );\n\n useFloatingLinkEnter();\n\n useFloatingLinkEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1,\n },\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GAEJ;AAAA,IACI,yBAAyB;AAAA,EAC7B,GACA,CACJ,CAAA,GAEqB,KAEC,KAEf;AAAA,IACH,OAAO;AAAA,MACH,GAAG;AAAA,MACH,QAAQ;AAAA,IACZ;AAAA,IACA,GAAG;AAAA,IACH,KAAK,EAAmC,EAAM,KAAK,CAAQ;AAAA,EAAA;AAEnE;"}
@@ -1,4 +1,4 @@
1
- import { createComponentAs as m, useFloatingLinkInsert as n, createElementAs as p, FloatingLink as r } from "@udecode/plate";
1
+ import { createComponentAs as m, createElementAs as p, FloatingLink as r } from "@udecode/plate";
2
2
  import "react";
3
3
  import "../../../../../foundation/Icon/Generated/IconAdobeCreativeCloud.es.js";
4
4
  import "../../../../../foundation/Icon/Generated/IconAdobeCreativeCloud12.es.js";
@@ -1662,20 +1662,27 @@ import "../../../../../foundation/Icon/Generated/IconWorkflowShapes24.es.js";
1662
1662
  import "../../../../../foundation/Icon/Generated/IconWorkflowShapes32.es.js";
1663
1663
  import "../../../../../foundation/Icon/IconsMap.es.js";
1664
1664
  import "../../../context/RichTextEditorContext.es.js";
1665
- import { useFloatingLinkEdit as e } from "./EditLinkModal/useFloatingLinkEdit.es.js";
1665
+ import { useFloatingLinkEdit as n } from "./EditLinkModal/useFloatingLinkEdit.es.js";
1666
+ import "../../../../Button/Button.es.js";
1667
+ import "../../../../Checkbox/Checkbox.es.js";
1668
+ import "../../../../FormControl/FormControl.es.js";
1669
+ import "@react-aria/focus";
1670
+ import "../../../../../utilities/focusStyle.es.js";
1671
+ import "./InsertLinkModal/useInsertModal.es.js";
1672
+ import { useFloatingLinkInsert as e } from "./InsertLinkModal/useFloatingLinkInsert.es.js";
1666
1673
  const s = m((i) => {
1667
1674
  var o;
1668
- const t = n(i);
1675
+ const t = e(i);
1669
1676
  return ((o = t.style) == null ? void 0 : o.display) === "none" ? null : p("div", t);
1670
1677
  }), l = m((i) => {
1671
1678
  var o;
1672
- const t = e(i);
1679
+ const t = n(i);
1673
1680
  return ((o = t.style) == null ? void 0 : o.display) === "none" ? null : p("div", t);
1674
1681
  });
1675
1682
  r.EditRoot = l;
1676
1683
  r.InsertRoot = s;
1677
- const m$ = r;
1684
+ const u$ = r;
1678
1685
  export {
1679
- m$ as FloatingLink
1686
+ u$ as FloatingLink
1680
1687
  };
1681
1688
  //# sourceMappingURL=FloatingLink.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/FloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n FloatingLinkProps,\n FloatingLink as PlateFloatingLink,\n createComponentAs,\n createElementAs,\n useFloatingLinkInsert,\n} from '@udecode/plate';\nimport { useFloatingLinkEdit } from './EditLinkModal';\n\nconst FloatingLinkInsertRoot = createComponentAs<FloatingLinkProps>((props) => {\n const htmlProps = useFloatingLinkInsert(props);\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nconst FloatingLinkEditRoot = createComponentAs<FloatingLinkProps>((props) => {\n const htmlProps = useFloatingLinkEdit(props);\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nPlateFloatingLink.EditRoot = FloatingLinkEditRoot;\nPlateFloatingLink.InsertRoot = FloatingLinkInsertRoot;\n\nexport const FloatingLink = PlateFloatingLink;\n"],"names":["PlateFloatingLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,IAAyB,EAAqC,CAAC,MAAU;;AACrE,QAAA,IAAY,EAAsB,CAAK;AAEzC,SAAA,QAAU,UAAV,kBAAiB,aAAY,SACtB,OAGJ,EAAgB,OAAO,CAAS;AAC3C,CAAC,GAEK,IAAuB,EAAqC,CAAC,MAAU;;AACnE,QAAA,IAAY,EAAoB,CAAK;AAEvC,SAAA,QAAU,UAAV,kBAAiB,aAAY,SACtB,OAGJ,EAAgB,OAAO,CAAS;AAC3C,CAAC;AAEDA,EAAkB,WAAW;AAC7BA,EAAkB,aAAa;AAExB,MAAM,KAAeA;"}
1
+ {"version":3,"file":"FloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/FloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n FloatingLinkProps,\n FloatingLink as PlateFloatingLink,\n createComponentAs,\n createElementAs,\n} from '@udecode/plate';\nimport { useFloatingLinkEdit } from './EditLinkModal';\nimport { useFloatingLinkInsert } from './InsertLinkModal';\n\nconst FloatingLinkInsertRoot = createComponentAs<FloatingLinkProps>((props) => {\n const htmlProps = useFloatingLinkInsert(props);\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nconst FloatingLinkEditRoot = createComponentAs<FloatingLinkProps>((props) => {\n const htmlProps = useFloatingLinkEdit(props);\n\n if (htmlProps.style?.display === 'none') {\n return null;\n }\n\n return createElementAs('div', htmlProps);\n});\n\nPlateFloatingLink.EditRoot = FloatingLinkEditRoot;\nPlateFloatingLink.InsertRoot = FloatingLinkInsertRoot;\n\nexport const FloatingLink = PlateFloatingLink;\n"],"names":["PlateFloatingLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAuB,EAAqC,CAAC,MAAU;;AACnE,QAAA,IAAY,EAAoB,CAAK;AAEvC,SAAA,QAAU,UAAV,kBAAiB,aAAY,SACtB,OAGJ,EAAgB,OAAO,CAAS;AAC3C,CAAC;AAEDA,EAAkB,WAAW;AAC7BA,EAAkB,aAAa;AAExB,MAAM,KAAeA;"}
@@ -1 +1,2 @@
1
1
  export * from './InsertModal';
2
+ export * from './useFloatingLinkInsert';
@@ -0,0 +1,2 @@
1
+ import { FloatingLinkProps, HTMLPropsAs } from '@udecode/plate';
2
+ export declare const useFloatingLinkInsert: ({ floatingOptions, ...props }: FloatingLinkProps) => HTMLPropsAs<'div'>;
@@ -0,0 +1,38 @@
1
+ import { useEffect as m } from "react";
2
+ import { useEditorRef as p, useFloatingLinkSelectors as r, getPluginOptions as k, ELEMENT_LINK as L, useHotkeys as E, triggerFloatingLinkInsert as F, useOnClickOutside as C, floatingLinkSelectors as I, floatingLinkActions as n, focusEditor as O, useVirtualFloatingLink as y, useFloatingLinkEscape as R, useComposedRef as S } from "@udecode/plate";
3
+ import { getSelectionBoundingClientRect as b } from "../../../../../../node_modules/@udecode/plate-floating/dist/index.es.es.js";
4
+ import { useFocused as h } from "slate-react";
5
+ const N = ({ floatingOptions: l, ...o }) => {
6
+ const e = p(), i = h(), u = r().mode(), t = r().isOpen(e.id), { triggerFloatingLinkHotkeys: d } = k(e, L);
7
+ E(d, (a) => {
8
+ a.preventDefault(), F(e, {
9
+ focused: i
10
+ });
11
+ }, {
12
+ enableOnContentEditable: !0
13
+ }, [i]);
14
+ const c = C(() => {
15
+ I.mode() === "insert" && t && (n.hide(), O(e, e.selection));
16
+ }), { update: s, style: f, floating: g } = y({
17
+ editorId: e.id,
18
+ open: t && u === "insert",
19
+ getBoundingClientRect: b,
20
+ whileElementsMounted: () => {
21
+ },
22
+ ...l
23
+ });
24
+ return m(() => {
25
+ t ? (s(), n.updated(!0)) : n.updated(!1);
26
+ }, [t, s]), R(), {
27
+ style: {
28
+ ...f,
29
+ zIndex: 1
30
+ },
31
+ ...o,
32
+ ref: S(o.ref, g, c)
33
+ };
34
+ };
35
+ export {
36
+ N as useFloatingLinkInsert
37
+ };
38
+ //# sourceMappingURL=useFloatingLinkInsert.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFloatingLinkInsert.es.js","sources":["../../../../../../../src/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport {\n ELEMENT_LINK,\n FloatingLinkProps,\n HTMLPropsAs,\n LinkPlugin,\n floatingLinkActions,\n floatingLinkSelectors,\n focusEditor,\n getPluginOptions,\n triggerFloatingLinkInsert,\n useComposedRef,\n useEditorRef,\n useFloatingLinkEscape,\n useFloatingLinkSelectors,\n useHotkeys,\n useOnClickOutside,\n useVirtualFloatingLink,\n} from '@udecode/plate';\nimport { getSelectionBoundingClientRect } from '@udecode/plate-floating';\nimport { useFocused } from 'slate-react';\n\nexport const useFloatingLinkInsert = ({ floatingOptions, ...props }: FloatingLinkProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const focused = useFocused();\n const mode = useFloatingLinkSelectors().mode();\n const open = useFloatingLinkSelectors().isOpen(editor.id);\n\n const { triggerFloatingLinkHotkeys } = getPluginOptions<LinkPlugin>(editor, ELEMENT_LINK);\n\n useHotkeys(\n triggerFloatingLinkHotkeys!,\n (e) => {\n e.preventDefault();\n\n triggerFloatingLinkInsert(editor, {\n focused,\n });\n },\n {\n enableOnContentEditable: true,\n },\n [focused],\n );\n\n const ref = useOnClickOutside(() => {\n if (floatingLinkSelectors.mode() === 'insert' && open) {\n floatingLinkActions.hide();\n focusEditor(editor, editor.selection!);\n }\n });\n\n const { update, style, floating } = useVirtualFloatingLink({\n editorId: editor.id,\n open: open && mode === 'insert',\n getBoundingClientRect: getSelectionBoundingClientRect,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n whileElementsMounted: () => {},\n ...floatingOptions,\n });\n\n // wait for update before focusing input\n useEffect(() => {\n if (open) {\n update();\n floatingLinkActions.updated(true);\n } else {\n floatingLinkActions.updated(false);\n }\n }, [open, update]);\n\n useFloatingLinkEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating, ref),\n };\n};\n"],"names":[],"mappings":";;;;AAsBO,MAAM,IAAwB,CAAC,EAAE,uBAAoB,QAAmD;AAC3G,QAAM,IAAS,KACT,IAAU,KACV,IAAO,IAA2B,QAClC,IAAO,EAA2B,EAAA,OAAO,EAAO,EAAE,GAElD,EAAE,kCAA+B,EAA6B,GAAQ,CAAY;AAGpF,IAAA,GACA,CAAC,MAAM;AACH,MAAE,eAAe,GAEjB,EAA0B,GAAQ;AAAA,MAC9B;AAAA,IAAA,CACH;AAAA,EAAA,GAEL;AAAA,IACI,yBAAyB;AAAA,EAAA,GAE7B,CAAC,CAAO,CACZ;AAEM,QAAA,IAAM,EAAkB,MAAM;AAChC,IAAI,EAAsB,WAAW,YAAY,KAC7C,GAAoB,KAAK,GACb,EAAA,GAAQ,EAAO,SAAU;AAAA,EACzC,CACH,GAEK,EAAE,WAAQ,UAAO,gBAAa,EAAuB;AAAA,IACvD,UAAU,EAAO;AAAA,IACjB,MAAM,KAAQ,MAAS;AAAA,IACvB,uBAAuB;AAAA,IAEvB,sBAAsB,MAAM;AAAA,IAAC;AAAA,IAC7B,GAAG;AAAA,EAAA,CACN;AAGD,WAAU,MAAM;AACZ,IAAI,IACO,MACP,EAAoB,QAAQ,EAAI,KAEhC,EAAoB,QAAQ,EAAK;AAAA,EACrC,GACD,CAAC,GAAM,CAAM,CAAC,GAEK,KAEf;AAAA,IACH,OAAO;AAAA,MACH,GAAG;AAAA,MACH,QAAQ;AAAA,IACZ;AAAA,IACA,GAAG;AAAA,IACH,KAAK,EAAmC,EAAM,KAAK,GAAU,CAAG;AAAA,EAAA;AAExE;"}