payload-richtext-tiptap 0.0.31 → 0.0.32

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 (136) hide show
  1. package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.d.ts +1 -1
  2. package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.d.ts.map +1 -1
  3. package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.js +3 -4
  4. package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.js.map +1 -1
  5. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.d.ts.map +1 -1
  6. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.js +2 -3
  7. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.js.map +1 -1
  8. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.d.ts +1 -1
  9. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.d.ts.map +1 -1
  10. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.js +5 -6
  11. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.js.map +1 -1
  12. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.d.ts.map +1 -1
  13. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.js +1 -2
  14. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.js.map +1 -1
  15. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.d.ts.map +1 -1
  16. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.js +6 -7
  17. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.js.map +1 -1
  18. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.d.ts.map +1 -1
  19. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.js +1 -2
  20. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.js.map +1 -1
  21. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.d.ts.map +1 -1
  22. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.js +3 -4
  23. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.js.map +1 -1
  24. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.d.ts.map +1 -1
  25. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.js +3 -4
  26. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.js.map +1 -1
  27. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.d.ts.map +1 -1
  28. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.js +1 -2
  29. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.js.map +1 -1
  30. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.d.ts.map +1 -1
  31. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.js +2 -3
  32. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.js.map +1 -1
  33. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.d.ts.map +1 -1
  34. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.js +1 -2
  35. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.js.map +1 -1
  36. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.d.ts.map +1 -1
  37. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js +62 -55
  38. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js.map +1 -1
  39. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.d.ts.map +1 -1
  40. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js +3 -4
  41. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js.map +1 -1
  42. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.d.ts.map +1 -1
  43. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.js +3 -4
  44. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.js.map +1 -1
  45. package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.d.ts.map +1 -1
  46. package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js +2 -3
  47. package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js.map +1 -1
  48. package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.d.ts.map +1 -1
  49. package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.js +4 -5
  50. package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.js.map +1 -1
  51. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.d.ts.map +1 -1
  52. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js +3 -4
  53. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js.map +1 -1
  54. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.d.ts.map +1 -1
  55. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.js +2 -3
  56. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.js.map +1 -1
  57. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.d.ts.map +1 -1
  58. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.js +2 -3
  59. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.js.map +1 -1
  60. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.d.ts.map +1 -1
  61. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js +1 -2
  62. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js.map +1 -1
  63. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.d.ts.map +1 -1
  64. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.js +6 -7
  65. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.js.map +1 -1
  66. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.d.ts.map +1 -1
  67. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js +7 -8
  68. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js.map +1 -1
  69. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.d.ts.map +1 -1
  70. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js +10 -11
  71. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js.map +1 -1
  72. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.d.ts.map +1 -1
  73. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.js +3 -4
  74. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.js.map +1 -1
  75. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.d.ts.map +1 -1
  76. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js +4 -5
  77. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js.map +1 -1
  78. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.d.ts.map +1 -1
  79. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js +4 -5
  80. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js.map +1 -1
  81. package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.d.ts.map +1 -1
  82. package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.js +3 -4
  83. package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.js.map +1 -1
  84. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.d.ts.map +1 -1
  85. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js +6 -7
  86. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js.map +1 -1
  87. package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.d.ts.map +1 -1
  88. package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.js +2 -3
  89. package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.js.map +1 -1
  90. package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.d.ts.map +1 -1
  91. package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.js +6 -7
  92. package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.js.map +1 -1
  93. package/dist/src/fields/TiptapEditor/features/ui/Button/Button.d.ts.map +1 -1
  94. package/dist/src/fields/TiptapEditor/features/ui/Button/Button.js +1 -2
  95. package/dist/src/fields/TiptapEditor/features/ui/Button/Button.js.map +1 -1
  96. package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.d.ts.map +1 -1
  97. package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.js +2 -3
  98. package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.js.map +1 -1
  99. package/dist/src/fields/TiptapEditor/features/ui/Icon.d.ts.map +1 -1
  100. package/dist/src/fields/TiptapEditor/features/ui/Icon.js +1 -2
  101. package/dist/src/fields/TiptapEditor/features/ui/Icon.js.map +1 -1
  102. package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.d.ts.map +1 -1
  103. package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.js +4 -5
  104. package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.js.map +1 -1
  105. package/dist/src/fields/TiptapEditor/features/ui/Panel/index.d.ts.map +1 -1
  106. package/dist/src/fields/TiptapEditor/features/ui/Panel/index.js +6 -7
  107. package/dist/src/fields/TiptapEditor/features/ui/Panel/index.js.map +1 -1
  108. package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.d.ts.map +1 -1
  109. package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.js +7 -9
  110. package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.js.map +1 -1
  111. package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.d.ts.map +1 -1
  112. package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.js +1 -2
  113. package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.js.map +1 -1
  114. package/dist/src/fields/TiptapEditor/features/ui/Surface.d.ts.map +1 -1
  115. package/dist/src/fields/TiptapEditor/features/ui/Surface.js +1 -2
  116. package/dist/src/fields/TiptapEditor/features/ui/Surface.js.map +1 -1
  117. package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.d.ts.map +1 -1
  118. package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.js +1 -2
  119. package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.js.map +1 -1
  120. package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.d.ts.map +1 -1
  121. package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.js +2 -5
  122. package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.js.map +1 -1
  123. package/dist/src/fields/TiptapEditor/features/ui/Toolbar.d.ts.map +1 -1
  124. package/dist/src/fields/TiptapEditor/features/ui/Toolbar.js +3 -5
  125. package/dist/src/fields/TiptapEditor/features/ui/Toolbar.js.map +1 -1
  126. package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.d.ts.map +1 -1
  127. package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.js +7 -8
  128. package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.js.map +1 -1
  129. package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.d.ts.map +1 -1
  130. package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.js +4 -5
  131. package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.js.map +1 -1
  132. package/dist/src/fields/TiptapEditor/features/ui/scroll-area.d.ts.map +1 -1
  133. package/dist/src/fields/TiptapEditor/features/ui/scroll-area.js +4 -5
  134. package/dist/src/fields/TiptapEditor/features/ui/scroll-area.js.map +1 -1
  135. package/dist/tsconfig.tsbuildinfo +1 -1
  136. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  declare const Design: () => React.JSX.Element;
3
3
  export default Design;
4
4
  //# sourceMappingURL=Design.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Design.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,MAAM,yBAgBX,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Design.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,QAAA,MAAM,MAAM,yBASX,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1,11 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import React from "react";
3
- import { twj } from "tw-to-css";
2
+ import React from 'react';
4
3
  const Design = ()=>{
5
4
  return /*#__PURE__*/ _jsx("blockquote", {
6
- style: twj("p-4 my-4 border-s-4 border-gray-300 bg-gray-50 w-full"),
5
+ className: "p-4 my-4 border-s-4 border-gray-300 bg-gray-50 w-full",
7
6
  children: /*#__PURE__*/ _jsx("p", {
8
- style: twj("text-xl italic font-medium leading-relaxed text-gray-900 w-full"),
7
+ className: "text-xl italic font-medium leading-relaxed text-gray-900 w-full",
9
8
  children: '"Flowbite is just awesome. It contains tons of predesigned components and pages starting from login screen to complex dashboard. Perfect choice for your next SaaS application."'
10
9
  })
11
10
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.tsx"],"sourcesContent":["import React from \"react\";\nimport { twj } from \"tw-to-css\";\n\nconst Design = () => {\n return (\n <blockquote\n style={twj(\"p-4 my-4 border-s-4 border-gray-300 bg-gray-50 w-full\")}\n >\n <p\n style={twj(\n \"text-xl italic font-medium leading-relaxed text-gray-900 w-full\"\n )}\n >\n \"Flowbite is just awesome. It contains tons of predesigned components\n and pages starting from login screen to complex dashboard. Perfect\n choice for your next SaaS application.\"\n </p>\n </blockquote>\n );\n};\n\nexport default Design;\n"],"names":["React","twj","Design","blockquote","style","p"],"rangeMappings":";;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,GAAG,QAAQ,YAAY;AAEhC,MAAMC,SAAS;IACb,qBACE,KAACC;QACCC,OAAOH,IAAI;kBAEX,cAAA,KAACI;YACCD,OAAOH,IACL;sBAEH;;;AAOP;AAEA,eAAeC,OAAO"}
1
+ {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.tsx"],"sourcesContent":["import React from 'react'\n\nconst Design = () => {\n return (\n <blockquote className=\"p-4 my-4 border-s-4 border-gray-300 bg-gray-50 w-full\">\n <p className=\"text-xl italic font-medium leading-relaxed text-gray-900 w-full\">\n \"Flowbite is just awesome. It contains tons of predesigned components and pages starting\n from login screen to complex dashboard. Perfect choice for your next SaaS application.\"\n </p>\n </blockquote>\n )\n}\n\nexport default Design\n"],"names":["React","Design","blockquote","className","p"],"rangeMappings":";;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAO;AAEzB,MAAMC,SAAS;IACb,qBACE,KAACC;QAAWC,WAAU;kBACpB,cAAA,KAACC;YAAED,WAAU;sBAAkE;;;AAMrF;AAEA,eAAeF,OAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageBlockView.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAmB,MAAM,eAAe,CAAC;AACxD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,IAAI,EAAE,IAAI,GAAG;QACX,KAAK,EAAE;YACL,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;KACH,CAAC;IACF,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,cAAc,UAAW,mBAAmB,sBAwBxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ImageBlockView.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAmB,MAAM,eAAe,CAAC;AACxD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,IAAI,EAAE,IAAI,GAAG;QACX,KAAK,EAAE;YACL,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;KACH,CAAC;IACF,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,cAAc,UAAW,mBAAmB,sBAwBxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { NodeViewWrapper } from "@tiptap/react";
3
3
  import React, { useCallback, useRef } from "react";
4
4
  import { cn } from "../../../lib/utils/index.js";
5
- import { twj } from "tw-to-css";
6
5
  export const ImageBlockView = (props)=>{
7
6
  const { editor, getPos, node } = props;
8
7
  const imageWrapperRef = useRef(null);
@@ -16,15 +15,15 @@ export const ImageBlockView = (props)=>{
16
15
  ]);
17
16
  return /*#__PURE__*/ _jsx(NodeViewWrapper, {
18
17
  children: /*#__PURE__*/ _jsx("div", {
18
+ className: wrapperClassName,
19
19
  style: {
20
- ...twj(wrapperClassName),
21
20
  width: node.attrs.width
22
21
  },
23
22
  children: /*#__PURE__*/ _jsx("div", {
24
23
  contentEditable: false,
25
24
  ref: imageWrapperRef,
26
25
  children: /*#__PURE__*/ _jsx("img", {
27
- style: twj("block"),
26
+ className: "block",
28
27
  src: src,
29
28
  alt: "",
30
29
  onClick: onClick
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.tsx"],"sourcesContent":["import { Node } from \"@tiptap/pm/model\";\nimport { Editor, NodeViewWrapper } from \"@tiptap/react\";\nimport React, { useCallback, useRef } from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport { twj } from \"tw-to-css\";\n\ninterface ImageBlockViewProps {\n editor: Editor;\n getPos: () => number;\n node: Node & {\n attrs: {\n src: string;\n };\n };\n updateAttributes: (attrs: Record<string, string>) => void;\n}\n\nexport const ImageBlockView = (props: ImageBlockViewProps) => {\n const { editor, getPos, node } = props;\n const imageWrapperRef = useRef<HTMLDivElement>(null);\n const { src } = node.attrs;\n\n const wrapperClassName = cn(\n node.attrs.align === \"left\" ? \"ml-0\" : \"ml-auto\",\n node.attrs.align === \"right\" ? \"mr-0\" : \"mr-auto\",\n node.attrs.align === \"center\" && \"mx-auto\"\n );\n\n const onClick = useCallback(() => {\n editor.commands.setNodeSelection(getPos());\n }, [getPos, editor.commands]);\n\n return (\n <NodeViewWrapper>\n <div style={{ ...twj(wrapperClassName), width: node.attrs.width }}>\n <div contentEditable={false} ref={imageWrapperRef}>\n <img style={twj(\"block\")} src={src} alt=\"\" onClick={onClick} />\n </div>\n </div>\n </NodeViewWrapper>\n );\n};\n\nexport default ImageBlockView;\n"],"names":["NodeViewWrapper","React","useCallback","useRef","cn","twj","ImageBlockView","props","editor","getPos","node","imageWrapperRef","src","attrs","wrapperClassName","align","onClick","commands","setNodeSelection","div","style","width","contentEditable","ref","img","alt"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AACA,SAAiBA,eAAe,QAAQ,gBAAgB;AACxD,OAAOC,SAASC,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AACnD,SAASC,EAAE,QAAQ,8BAA8B;AACjD,SAASC,GAAG,QAAQ,YAAY;AAahC,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGH;IACjC,MAAMI,kBAAkBR,OAAuB;IAC/C,MAAM,EAAES,GAAG,EAAE,GAAGF,KAAKG,KAAK;IAE1B,MAAMC,mBAAmBV,GACvBM,KAAKG,KAAK,CAACE,KAAK,KAAK,SAAS,SAAS,WACvCL,KAAKG,KAAK,CAACE,KAAK,KAAK,UAAU,SAAS,WACxCL,KAAKG,KAAK,CAACE,KAAK,KAAK,YAAY;IAGnC,MAAMC,UAAUd,YAAY;QAC1BM,OAAOS,QAAQ,CAACC,gBAAgB,CAACT;IACnC,GAAG;QAACA;QAAQD,OAAOS,QAAQ;KAAC;IAE5B,qBACE,KAACjB;kBACC,cAAA,KAACmB;YAAIC,OAAO;gBAAE,GAAGf,IAAIS,iBAAiB;gBAAEO,OAAOX,KAAKG,KAAK,CAACQ,KAAK;YAAC;sBAC9D,cAAA,KAACF;gBAAIG,iBAAiB;gBAAOC,KAAKZ;0BAChC,cAAA,KAACa;oBAAIJ,OAAOf,IAAI;oBAAUO,KAAKA;oBAAKa,KAAI;oBAAGT,SAASA;;;;;AAK9D,EAAE;AAEF,eAAeV,eAAe"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.tsx"],"sourcesContent":["import { Node } from \"@tiptap/pm/model\";\nimport { Editor, NodeViewWrapper } from \"@tiptap/react\";\nimport React, { useCallback, useRef } from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\n\ninterface ImageBlockViewProps {\n editor: Editor;\n getPos: () => number;\n node: Node & {\n attrs: {\n src: string;\n };\n };\n updateAttributes: (attrs: Record<string, string>) => void;\n}\n\nexport const ImageBlockView = (props: ImageBlockViewProps) => {\n const { editor, getPos, node } = props;\n const imageWrapperRef = useRef<HTMLDivElement>(null);\n const { src } = node.attrs;\n\n const wrapperClassName = cn(\n node.attrs.align === \"left\" ? \"ml-0\" : \"ml-auto\",\n node.attrs.align === \"right\" ? \"mr-0\" : \"mr-auto\",\n node.attrs.align === \"center\" && \"mx-auto\"\n );\n\n const onClick = useCallback(() => {\n editor.commands.setNodeSelection(getPos());\n }, [getPos, editor.commands]);\n\n return (\n <NodeViewWrapper>\n <div className={wrapperClassName} style={{ width: node.attrs.width }}>\n <div contentEditable={false} ref={imageWrapperRef}>\n <img className=\"block\" src={src} alt=\"\" onClick={onClick} />\n </div>\n </div>\n </NodeViewWrapper>\n );\n};\n\nexport default ImageBlockView;\n"],"names":["NodeViewWrapper","React","useCallback","useRef","cn","ImageBlockView","props","editor","getPos","node","imageWrapperRef","src","attrs","wrapperClassName","align","onClick","commands","setNodeSelection","div","className","style","width","contentEditable","ref","img","alt"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AACA,SAAiBA,eAAe,QAAQ,gBAAgB;AACxD,OAAOC,SAASC,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AACnD,SAASC,EAAE,QAAQ,8BAA8B;AAajD,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGH;IACjC,MAAMI,kBAAkBP,OAAuB;IAC/C,MAAM,EAAEQ,GAAG,EAAE,GAAGF,KAAKG,KAAK;IAE1B,MAAMC,mBAAmBT,GACvBK,KAAKG,KAAK,CAACE,KAAK,KAAK,SAAS,SAAS,WACvCL,KAAKG,KAAK,CAACE,KAAK,KAAK,UAAU,SAAS,WACxCL,KAAKG,KAAK,CAACE,KAAK,KAAK,YAAY;IAGnC,MAAMC,UAAUb,YAAY;QAC1BK,OAAOS,QAAQ,CAACC,gBAAgB,CAACT;IACnC,GAAG;QAACA;QAAQD,OAAOS,QAAQ;KAAC;IAE5B,qBACE,KAAChB;kBACC,cAAA,KAACkB;YAAIC,WAAWN;YAAkBO,OAAO;gBAAEC,OAAOZ,KAAKG,KAAK,CAACS,KAAK;YAAC;sBACjE,cAAA,KAACH;gBAAII,iBAAiB;gBAAOC,KAAKb;0BAChC,cAAA,KAACc;oBAAIL,WAAU;oBAAQR,KAAKA;oBAAKc,KAAI;oBAAGV,SAASA;;;;;AAK3D,EAAE;AAEF,eAAeV,eAAe"}
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export type ImageBlockWidthProps = {
3
3
  onChange: (value: number) => void;
4
4
  value: number;
@@ -1 +1 @@
1
- {"version":3,"file":"ImageBlockWidth.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAGtE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,eAAe,kDACJ,oBAAoB,uBAiC3C,CAAC"}
1
+ {"version":3,"file":"ImageBlockWidth.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAA;AAErE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,eAAe,kDAA8B,oBAAoB,uBA4B5E,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { memo, useCallback, useEffect, useState } from "react";
3
- import { twj } from "tw-to-css";
2
+ import React, { memo, useCallback, useEffect, useState } from 'react';
4
3
  export const ImageBlockWidth = /*#__PURE__*/ memo(({ onChange, value })=>{
5
4
  const [currentValue, setCurrentValue] = useState(value);
6
5
  useEffect(()=>{
@@ -14,10 +13,10 @@ export const ImageBlockWidth = /*#__PURE__*/ memo(({ onChange, value })=>{
14
13
  onChange
15
14
  ]);
16
15
  return /*#__PURE__*/ _jsxs("div", {
17
- style: twj("flex items-center gap-2"),
16
+ className: "flex items-center gap-2",
18
17
  children: [
19
18
  /*#__PURE__*/ _jsx("input", {
20
- style: twj("h-2 bg-neutral-200 border-0 rounded appearance-none fill-neutral-300"),
19
+ className: "h-2 bg-neutral-200 border-0 rounded appearance-none fill-neutral-300",
21
20
  type: "range",
22
21
  min: "25",
23
22
  max: "100",
@@ -26,7 +25,7 @@ export const ImageBlockWidth = /*#__PURE__*/ memo(({ onChange, value })=>{
26
25
  value: currentValue
27
26
  }),
28
27
  /*#__PURE__*/ _jsxs("span", {
29
- style: twj("text-xs font-semibold text-neutral-500 select-none"),
28
+ className: "text-xs font-semibold text-neutral-500 select-none",
30
29
  children: [
31
30
  value,
32
31
  "%"
@@ -35,6 +34,6 @@ export const ImageBlockWidth = /*#__PURE__*/ memo(({ onChange, value })=>{
35
34
  ]
36
35
  });
37
36
  });
38
- ImageBlockWidth.displayName = "ImageBlockWidth";
37
+ ImageBlockWidth.displayName = 'ImageBlockWidth';
39
38
 
40
39
  //# sourceMappingURL=ImageBlockWidth.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.tsx"],"sourcesContent":["import React, { memo, useCallback, useEffect, useState } from \"react\";\nimport { twj } from \"tw-to-css\";\n\nexport type ImageBlockWidthProps = {\n onChange: (value: number) => void;\n value: number;\n};\n\nexport const ImageBlockWidth = memo(\n ({ onChange, value }: ImageBlockWidthProps) => {\n const [currentValue, setCurrentValue] = useState(value);\n\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(parseInt(e.target.value));\n },\n [onChange]\n );\n\n return (\n <div style={twj(\"flex items-center gap-2\")}>\n <input\n style={twj(\n \"h-2 bg-neutral-200 border-0 rounded appearance-none fill-neutral-300\"\n )}\n type=\"range\"\n min=\"25\"\n max=\"100\"\n step=\"25\"\n onChange={handleChange}\n value={currentValue}\n />\n <span style={twj(\"text-xs font-semibold text-neutral-500 select-none\")}>\n {value}%\n </span>\n </div>\n );\n }\n);\n\nImageBlockWidth.displayName = \"ImageBlockWidth\";\n"],"names":["React","memo","useCallback","useEffect","useState","twj","ImageBlockWidth","onChange","value","currentValue","setCurrentValue","handleChange","e","parseInt","target","div","style","input","type","min","max","step","span","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AACtE,SAASC,GAAG,QAAQ,YAAY;AAOhC,OAAO,MAAMC,gCAAkBL,KAC7B,CAAC,EAAEM,QAAQ,EAAEC,KAAK,EAAwB;IACxC,MAAM,CAACC,cAAcC,gBAAgB,GAAGN,SAASI;IAEjDL,UAAU;QACRO,gBAAgBF;IAClB,GAAG;QAACA;KAAM;IAEV,MAAMG,eAAeT,YACnB,CAACU;QACCL,SAASM,SAASD,EAAEE,MAAM,CAACN,KAAK;IAClC,GACA;QAACD;KAAS;IAGZ,qBACE,MAACQ;QAAIC,OAAOX,IAAI;;0BACd,KAACY;gBACCD,OAAOX,IACL;gBAEFa,MAAK;gBACLC,KAAI;gBACJC,KAAI;gBACJC,MAAK;gBACLd,UAAUI;gBACVH,OAAOC;;0BAET,MAACa;gBAAKN,OAAOX,IAAI;;oBACdG;oBAAM;;;;;AAIf,GACA;AAEFF,gBAAgBiB,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.tsx"],"sourcesContent":["import React, { memo, useCallback, useEffect, useState } from 'react'\n\nexport type ImageBlockWidthProps = {\n onChange: (value: number) => void\n value: number\n}\n\nexport const ImageBlockWidth = memo(({ onChange, value }: ImageBlockWidthProps) => {\n const [currentValue, setCurrentValue] = useState(value)\n\n useEffect(() => {\n setCurrentValue(value)\n }, [value])\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(parseInt(e.target.value))\n },\n [onChange],\n )\n\n return (\n <div className=\"flex items-center gap-2\">\n <input\n className=\"h-2 bg-neutral-200 border-0 rounded appearance-none fill-neutral-300\"\n type=\"range\"\n min=\"25\"\n max=\"100\"\n step=\"25\"\n onChange={handleChange}\n value={currentValue}\n />\n <span className=\"text-xs font-semibold text-neutral-500 select-none\">{value}%</span>\n </div>\n )\n})\n\nImageBlockWidth.displayName = 'ImageBlockWidth'\n"],"names":["React","memo","useCallback","useEffect","useState","ImageBlockWidth","onChange","value","currentValue","setCurrentValue","handleChange","e","parseInt","target","div","className","input","type","min","max","step","span","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAOrE,OAAO,MAAMC,gCAAkBJ,KAAK,CAAC,EAAEK,QAAQ,EAAEC,KAAK,EAAwB;IAC5E,MAAM,CAACC,cAAcC,gBAAgB,GAAGL,SAASG;IAEjDJ,UAAU;QACRM,gBAAgBF;IAClB,GAAG;QAACA;KAAM;IAEV,MAAMG,eAAeR,YACnB,CAACS;QACCL,SAASM,SAASD,EAAEE,MAAM,CAACN,KAAK;IAClC,GACA;QAACD;KAAS;IAGZ,qBACE,MAACQ;QAAIC,WAAU;;0BACb,KAACC;gBACCD,WAAU;gBACVE,MAAK;gBACLC,KAAI;gBACJC,KAAI;gBACJC,MAAK;gBACLd,UAAUI;gBACVH,OAAOC;;0BAET,MAACa;gBAAKN,WAAU;;oBAAsDR;oBAAM;;;;;AAGlF,GAAE;AAEFF,gBAAgBiB,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageUpload.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAmB,MAAM,eAAe,CAAC;AAIxD,eAAO,MAAM,WAAW,wBAGrB;IACD,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,gCAuCA,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ImageUpload.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAmB,MAAM,eAAe,CAAC;AAGxD,eAAO,MAAM,WAAW,wBAGrB;IACD,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,gCAuCA,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Upload } from "@payloadcms/ui/fields/Upload";
3
3
  import { NodeViewWrapper } from "@tiptap/react";
4
4
  import { useCallback } from "react";
5
- import { twj } from "tw-to-css";
6
5
  export const ImageUpload = ({ getPos, editor })=>{
7
6
  const onUpload = useCallback((url)=>{
8
7
  if (url) {
@@ -19,7 +18,7 @@ export const ImageUpload = ({ getPos, editor })=>{
19
18
  ]);
20
19
  return /*#__PURE__*/ _jsx(NodeViewWrapper, {
21
20
  children: /*#__PURE__*/ _jsx("div", {
22
- style: twj("p-0 m-0"),
21
+ className: "p-0 m-0",
23
22
  "data-drag-handle": true,
24
23
  children: /*#__PURE__*/ _jsx(Upload, {})
25
24
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.tsx"],"sourcesContent":["import { Upload } from \"@payloadcms/ui/fields/Upload\";\nimport { Editor, NodeViewWrapper } from \"@tiptap/react\";\nimport { useCallback } from \"react\";\nimport { twj } from \"tw-to-css\";\n\nexport const ImageUpload = ({\n getPos,\n editor,\n}: {\n getPos: () => number;\n editor: Editor;\n}) => {\n const onUpload = useCallback(\n (url: string) => {\n if (url) {\n editor\n .chain()\n .setImageBlock({ src: url })\n .deleteRange({ from: getPos(), to: getPos() })\n .focus()\n .run();\n }\n },\n [getPos, editor]\n );\n\n return (\n <NodeViewWrapper>\n <div style={twj(\"p-0 m-0\")} data-drag-handle>\n {/* <RenderFields\n fieldMap={[\n {\n name: 'thumbnail',\n type: 'upload',\n\n },\n ]}\n path=\"media\"\n readOnly={false}\n schemaPath=\"\"\n // fieldTypes={fieldTypes}\n // fields={sidebarFields}\n // permissions={permissions.fields}\n // readOnly={!hasSavePermission}\n /> */}\n {/* <ImageUploader onUpload={onUpload} /> */}\n <Upload />\n </div>\n </NodeViewWrapper>\n );\n};\n\nexport default ImageUpload;\n"],"names":["Upload","NodeViewWrapper","useCallback","twj","ImageUpload","getPos","editor","onUpload","url","chain","setImageBlock","src","deleteRange","from","to","focus","run","div","style","data-drag-handle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,MAAM,QAAQ,+BAA+B;AACtD,SAAiBC,eAAe,QAAQ,gBAAgB;AACxD,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,GAAG,QAAQ,YAAY;AAEhC,OAAO,MAAMC,cAAc,CAAC,EAC1BC,MAAM,EACNC,MAAM,EAIP;IACC,MAAMC,WAAWL,YACf,CAACM;QACC,IAAIA,KAAK;YACPF,OACGG,KAAK,GACLC,aAAa,CAAC;gBAAEC,KAAKH;YAAI,GACzBI,WAAW,CAAC;gBAAEC,MAAMR;gBAAUS,IAAIT;YAAS,GAC3CU,KAAK,GACLC,GAAG;QACR;IACF,GACA;QAACX;QAAQC;KAAO;IAGlB,qBACE,KAACL;kBACC,cAAA,KAACgB;YAAIC,OAAOf,IAAI;YAAYgB,kBAAgB;sBAkB1C,cAAA,KAACnB;;;AAIT,EAAE;AAEF,eAAeI,YAAY"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.tsx"],"sourcesContent":["import { Upload } from \"@payloadcms/ui/fields/Upload\";\nimport { Editor, NodeViewWrapper } from \"@tiptap/react\";\nimport { useCallback } from \"react\";\n\nexport const ImageUpload = ({\n getPos,\n editor,\n}: {\n getPos: () => number;\n editor: Editor;\n}) => {\n const onUpload = useCallback(\n (url: string) => {\n if (url) {\n editor\n .chain()\n .setImageBlock({ src: url })\n .deleteRange({ from: getPos(), to: getPos() })\n .focus()\n .run();\n }\n },\n [getPos, editor]\n );\n\n return (\n <NodeViewWrapper>\n <div className=\"p-0 m-0\" data-drag-handle>\n {/* <RenderFields\n fieldMap={[\n {\n name: 'thumbnail',\n type: 'upload',\n\n },\n ]}\n path=\"media\"\n readOnly={false}\n schemaPath=\"\"\n // fieldTypes={fieldTypes}\n // fields={sidebarFields}\n // permissions={permissions.fields}\n // readOnly={!hasSavePermission}\n /> */}\n {/* <ImageUploader onUpload={onUpload} /> */}\n <Upload />\n </div>\n </NodeViewWrapper>\n );\n};\n\nexport default ImageUpload;\n"],"names":["Upload","NodeViewWrapper","useCallback","ImageUpload","getPos","editor","onUpload","url","chain","setImageBlock","src","deleteRange","from","to","focus","run","div","className","data-drag-handle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,MAAM,QAAQ,+BAA+B;AACtD,SAAiBC,eAAe,QAAQ,gBAAgB;AACxD,SAASC,WAAW,QAAQ,QAAQ;AAEpC,OAAO,MAAMC,cAAc,CAAC,EAC1BC,MAAM,EACNC,MAAM,EAIP;IACC,MAAMC,WAAWJ,YACf,CAACK;QACC,IAAIA,KAAK;YACPF,OACGG,KAAK,GACLC,aAAa,CAAC;gBAAEC,KAAKH;YAAI,GACzBI,WAAW,CAAC;gBAAEC,MAAMR;gBAAUS,IAAIT;YAAS,GAC3CU,KAAK,GACLC,GAAG;QACR;IACF,GACA;QAACX;QAAQC;KAAO;IAGlB,qBACE,KAACJ;kBACC,cAAA,KAACe;YAAIC,WAAU;YAAUC,kBAAgB;sBAkBvC,cAAA,KAAClB;;;AAIT,EAAE;AAEF,eAAeG,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageUploader.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,kBAEvB;IACD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,gCAwEA,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ImageUploader.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,kBAEvB;IACD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,gCAgEA,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -6,7 +6,6 @@ import { Icon } from "../../../features/ui/Icon.js";
6
6
  import { Spinner } from "../../../features/ui/Spinner/Spinner.js";
7
7
  import { cn } from "../../../lib/utils/index.js";
8
8
  import { useDropZone, useFileUpload, useUploader } from "./hooks.js";
9
- import { twj } from "tw-to-css";
10
9
  export const ImageUploader = ({ onUpload })=>{
11
10
  const { loading, uploadFile } = useUploader({
12
11
  onUpload
@@ -20,16 +19,16 @@ export const ImageUploader = ({ onUpload })=>{
20
19
  ]);
21
20
  if (loading) {
22
21
  return /*#__PURE__*/ _jsx("div", {
23
- style: twj("flex items-center justify-center p-8 rounded-lg min-h-[10rem] bg-opacity-80"),
22
+ className: "flex items-center justify-center p-8 rounded-lg min-h-[10rem] bg-opacity-80",
24
23
  children: /*#__PURE__*/ _jsx(Spinner, {
25
- style: twj("text-neutral-500"),
24
+ className: "text-neutral-500",
26
25
  size: 1.5
27
26
  })
28
27
  });
29
28
  }
30
29
  const wrapperClass = cn("flex flex-col items-center justify-center px-8 py-10 rounded-lg bg-opacity-80", draggedInside && "bg-neutral-100");
31
30
  return /*#__PURE__*/ _jsxs("div", {
32
- style: twj(wrapperClass),
31
+ className: wrapperClass,
33
32
  onDrop: onDrop,
34
33
  onDragOver: onDragEnter,
35
34
  onDragLeave: onDragLeave,
@@ -40,10 +39,10 @@ export const ImageUploader = ({ onUpload })=>{
40
39
  className: "w-12 h-12 mb-4 text-black dark:text-white opacity-20"
41
40
  }),
42
41
  /*#__PURE__*/ _jsxs("div", {
43
- style: twj("flex flex-col items-center justify-center gap-2"),
42
+ className: "flex flex-col items-center justify-center gap-2",
44
43
  children: [
45
44
  /*#__PURE__*/ _jsx("div", {
46
- style: twj("text-sm font-medium text-center text-neutral-400 dark:text-neutral-500"),
45
+ className: "text-sm font-medium text-center text-neutral-400 dark:text-neutral-500",
47
46
  children: draggedInside ? "Drop image here" : "Drag and drop or"
48
47
  }),
49
48
  /*#__PURE__*/ _jsx("div", {
@@ -64,7 +63,7 @@ export const ImageUploader = ({ onUpload })=>{
64
63
  ]
65
64
  }),
66
65
  /*#__PURE__*/ _jsx("input", {
67
- style: twj("w-0 h-0 overflow-hidden opacity-0"),
66
+ className: "w-0 h-0 overflow-hidden opacity-0",
68
67
  ref: ref,
69
68
  type: "file",
70
69
  accept: ".jpg,.jpeg,.png,.webp,.gif",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.tsx"],"sourcesContent":["import { Image, Upload } from \"lucide-react\";\nimport { ChangeEvent, useCallback } from \"react\";\nimport { Button } from \"../../../features/ui/Button/Button.js\";\nimport { Icon } from \"../../../features/ui/Icon.js\";\nimport { Spinner } from \"../../../features/ui/Spinner/Spinner.js\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport { useDropZone, useFileUpload, useUploader } from \"./hooks.js\";\nimport { twj } from \"tw-to-css\";\nexport const ImageUploader = ({\n onUpload,\n}: {\n onUpload: (url: string) => void;\n}) => {\n const { loading, uploadFile } = useUploader({ onUpload });\n const { handleUploadClick, ref } = useFileUpload();\n const { draggedInside, onDrop, onDragEnter, onDragLeave } = useDropZone({\n uploader: uploadFile,\n });\n\n const onFileChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) =>\n e.target.files ? uploadFile() : null,\n [uploadFile]\n );\n\n if (loading) {\n return (\n <div\n style={twj(\n \"flex items-center justify-center p-8 rounded-lg min-h-[10rem] bg-opacity-80\"\n )}\n >\n <Spinner style={twj(\"text-neutral-500\")} size={1.5} />\n </div>\n );\n }\n\n const wrapperClass = cn(\n \"flex flex-col items-center justify-center px-8 py-10 rounded-lg bg-opacity-80\",\n draggedInside && \"bg-neutral-100\"\n );\n\n return (\n <div\n style={twj(wrapperClass)}\n onDrop={onDrop}\n onDragOver={onDragEnter}\n onDragLeave={onDragLeave}\n contentEditable={false}\n >\n <Icon\n icon={Image}\n className=\"w-12 h-12 mb-4 text-black dark:text-white opacity-20\"\n />\n <div style={twj(\"flex flex-col items-center justify-center gap-2\")}>\n <div\n style={twj(\n \"text-sm font-medium text-center text-neutral-400 dark:text-neutral-500\"\n )}\n >\n {draggedInside ? \"Drop image here\" : \"Drag and drop or\"}\n </div>\n <div>\n <Button\n type=\"button\"\n disabled={draggedInside}\n onClick={handleUploadClick}\n variant=\"primary\"\n buttonSize=\"small\"\n >\n <Icon icon={Upload} />\n Upload an image\n </Button>\n </div>\n </div>\n <input\n style={twj(\"w-0 h-0 overflow-hidden opacity-0\")}\n ref={ref}\n type=\"file\"\n accept=\".jpg,.jpeg,.png,.webp,.gif\"\n onChange={onFileChange}\n />\n </div>\n );\n};\n\nexport default ImageUploader;\n"],"names":["Image","Upload","useCallback","Button","Icon","Spinner","cn","useDropZone","useFileUpload","useUploader","twj","ImageUploader","onUpload","loading","uploadFile","handleUploadClick","ref","draggedInside","onDrop","onDragEnter","onDragLeave","uploader","onFileChange","e","target","files","div","style","size","wrapperClass","onDragOver","contentEditable","icon","className","type","disabled","onClick","variant","buttonSize","input","accept","onChange"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mapp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,MAAM/B;;gCAAU;;;;;;0BAK5B,KAACsC;gBACCZ,OAAOjB,IAAI;gBACXM,KAAKA;gBACLkB,MAAK;gBACLM,QAAO;gBACPC,UAAUnB;;;;AAIlB,EAAE;AAEF,eAAeX,cAAc"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.tsx"],"sourcesContent":["import { Image, Upload } from \"lucide-react\";\nimport { ChangeEvent, useCallback } from \"react\";\nimport { Button } from \"../../../features/ui/Button/Button.js\";\nimport { Icon } from \"../../../features/ui/Icon.js\";\nimport { Spinner } from \"../../../features/ui/Spinner/Spinner.js\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport { useDropZone, useFileUpload, useUploader } from \"./hooks.js\";\nexport const ImageUploader = ({\n onUpload,\n}: {\n onUpload: (url: string) => void;\n}) => {\n const { loading, uploadFile } = useUploader({ onUpload });\n const { handleUploadClick, ref } = useFileUpload();\n const { draggedInside, onDrop, onDragEnter, onDragLeave } = useDropZone({\n uploader: uploadFile,\n });\n\n const onFileChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) =>\n e.target.files ? uploadFile() : null,\n [uploadFile]\n );\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-8 rounded-lg min-h-[10rem] bg-opacity-80\">\n <Spinner className=\"text-neutral-500\" size={1.5} />\n </div>\n );\n }\n\n const wrapperClass = cn(\n \"flex flex-col items-center justify-center px-8 py-10 rounded-lg bg-opacity-80\",\n draggedInside && \"bg-neutral-100\"\n );\n\n return (\n <div\n className={wrapperClass}\n onDrop={onDrop}\n onDragOver={onDragEnter}\n onDragLeave={onDragLeave}\n contentEditable={false}\n >\n <Icon\n icon={Image}\n className=\"w-12 h-12 mb-4 text-black dark:text-white opacity-20\"\n />\n <div className=\"flex flex-col items-center justify-center gap-2\">\n <div className=\"text-sm font-medium text-center text-neutral-400 dark:text-neutral-500\">\n {draggedInside ? \"Drop image here\" : \"Drag and drop or\"}\n </div>\n <div>\n <Button\n type=\"button\"\n disabled={draggedInside}\n onClick={handleUploadClick}\n variant=\"primary\"\n buttonSize=\"small\"\n >\n <Icon icon={Upload} />\n Upload an image\n </Button>\n </div>\n </div>\n <input\n className=\"w-0 h-0 overflow-hidden opacity-0\"\n ref={ref}\n type=\"file\"\n accept=\".jpg,.jpeg,.png,.webp,.gif\"\n onChange={onFileChange}\n />\n </div>\n );\n};\n\nexport default ImageUploader;\n"],"names":["Image","Upload","useCallback","Button","Icon","Spinner","cn","useDropZone","useFileUpload","useUploader","ImageUploader","onUpload","loading","uploadFile","handleUploadClick","ref","draggedInside","onDrop","onDragEnter","onDragLeave","uploader","onFileChange","e","target","files","div","className","size","wrapperClass","onDragOver","contentEditable","icon","type","disabled","onClick","variant","buttonSize","input","accept","onChange"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,KAAK,EAAEC,MAAM,QAAQ,eAAe;AAC7C,SAAsBC,WAAW,QAAQ,QAAQ;AACjD,SAASC,MAAM,QAAQ,wCAAwC;AAC/D,SAASC,IAAI,QAAQ,+BAA+B;AACpD,SAASC,OAAO,QAAQ,0CAA0C;AAClE,SAASC,EAAE,QAAQ,8BAA8B;AACjD,SAASC,WAAW,EAAEC,aAAa,EAAEC,WAAW,QAAQ,aAAa;AACrE,OAAO,MAAMC,gBAAgB,CAAC,EAC5BC,QAAQ,EAGT;IACC,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGJ,YAAY;QAAEE;IAAS;IACvD,MAAM,EAAEG,iBAAiB,EAAEC,GAAG,EAAE,GAAGP;IACnC,MAAM,EAAEQ,aAAa,EAAEC,MAAM,EAAEC,WAAW,EAAEC,WAAW,EAAE,GAAGZ,YAAY;QACtEa,UAAUP;IACZ;IAEA,MAAMQ,eAAenB,YACnB,CAACoB,IACCA,EAAEC,MAAM,CAACC,KAAK,GAAGX,eAAe,MAClC;QAACA;KAAW;IAGd,IAAID,SAAS;QACX,qBACE,KAACa;YAAIC,WAAU;sBACb,cAAA,KAACrB;gBAAQqB,WAAU;gBAAmBC,MAAM;;;IAGlD;IAEA,MAAMC,eAAetB,GACnB,iFACAU,iBAAiB;IAGnB,qBACE,MAACS;QACCC,WAAWE;QACXX,QAAQA;QACRY,YAAYX;QACZC,aAAaA;QACbW,iBAAiB;;0BAEjB,KAAC1B;gBACC2B,MAAM/B;gBACN0B,WAAU;;0BAEZ,MAACD;gBAAIC,WAAU;;kCACb,KAACD;wBAAIC,WAAU;kCACZV,gBAAgB,oBAAoB;;kCAEvC,KAACS;kCACC,cAAA,MAACtB;4BACC6B,MAAK;4BACLC,UAAUjB;4BACVkB,SAASpB;4BACTqB,SAAQ;4BACRC,YAAW;;8CAEX,KAAChC;oCAAK2B,MAAM9B;;gCAAU;;;;;;0BAK5B,KAACoC;gBACCX,WAAU;gBACVX,KAAKA;gBACLiB,MAAK;gBACLM,QAAO;gBACPC,UAAUlB;;;;AAIlB,EAAE;AAEF,eAAeX,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"InsideLink.client.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,0CAG7B;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,EAAE,CAAC,EAChB,EAAE,EACF,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,GACJ,EAAE;QACD,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,KAAK,IAAI,CAAC;CACZ,gCA6GA,CAAC"}
1
+ {"version":3,"file":"InsideLink.client.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,0CAG7B;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,EAAE,CAAC,EAChB,EAAE,EACF,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,GACJ,EAAE;QACD,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,KAAK,IAAI,CAAC;CACZ,gCA6GA,CAAC"}
@@ -4,7 +4,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  // import { PayloadAsyncSelect } from '@/components/PayloadAsyncSelect'
5
5
  import { Button } from "@payloadcms/ui/elements/Button";
6
6
  import { useCallback, useState } from "react";
7
- import { twj } from "tw-to-css";
8
7
  const limit = 10;
9
8
  export const ContentRelationship = ({ setRelationship, cancelSelection })=>{
10
9
  const [optionType, setOptionType] = useState("articles");
@@ -38,7 +37,7 @@ export const ContentRelationship = ({ setRelationship, cancelSelection })=>{
38
37
  }
39
38
  }, []);
40
39
  return /*#__PURE__*/ _jsx("div", {
41
- style: twj("w-full min-w-[300px] "),
40
+ className: "w-full min-w-[300px] ",
42
41
  children: /*#__PURE__*/ _jsx("div", {
43
42
  children: /*#__PURE__*/ _jsx(Button, {
44
43
  onClick: ()=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.tsx"],"sourcesContent":["\"use client\";\n\n// import { CustomRelationShipComponent } from '@/components/CustomRelationshipComponent'\n// import { PayloadAsyncSelect } from '@/components/PayloadAsyncSelect'\nimport { Button } from \"@payloadcms/ui/elements/Button\";\nimport { useCallback, useState } from \"react\";\nimport { twj } from \"tw-to-css\";\n\nconst limit = 10;\nexport const ContentRelationship = ({\n setRelationship,\n cancelSelection,\n}: {\n type?: string;\n relationId?: string;\n cancelSelection: () => void;\n setRelationship: ({\n id,\n type,\n thumbnail,\n title,\n url,\n }: {\n id: string;\n type: string;\n thumbnail: string;\n title: string;\n url: string;\n }) => void;\n}) => {\n const [optionType, setOptionType] = useState(\"articles\");\n const [relationOption, setRelationOption] = useState<any>(null);\n const opts = [\n {\n label: \"Article\",\n value: \"articles\",\n },\n {\n label: \"Video\",\n value: \"video\",\n },\n {\n label: \"Audio\",\n value: \"audios\",\n },\n // {\n // label: 'Media',\n // value: 'media',\n // },\n ];\n\n const fetchContentTypes = useCallback(\n async (search: any, loadedOptions: any, { page }: any) => {\n try {\n // Perform your API call with the endpoint and inputValue\n\n return {\n options: opts,\n hasMore: opts?.length === limit,\n additional: {\n page: page + 1,\n },\n };\n } catch (error) {\n // console.error('Error fetching data:', error)\n }\n },\n []\n );\n return (\n <div style={twj(\"w-full min-w-[300px] \")}>\n {/* <PayloadAsyncSelect\n fetchData={fetchContentTypes as any}\n handleChange={(val: string) => {\n setOptionType(val);\n }}\n defaultValue={opts?.find((option) => {\n return option.value === optionType;\n })}\n cacheOptions={null}\n /> */}\n\n {/* <CustomRelationShipComponent\n label={`${\n opts?.find((option) => {\n return option.value === optionType\n })?.label\n } Content`}\n collection={optionType}\n key={optionType}\n value={relationOption?.id ?? null}\n handleChange={(val: any) => {\n setRelationOption(val)\n }}\n handleInitialLoad={(val: any) => {\n setRelationOption(val)\n }}\n /> */}\n\n <div>\n <Button\n onClick={() => {\n let url = \"\";\n const topic = relationOption?.topics?.[0]?.slug ?? \"\";\n switch (optionType) {\n case \"articles\":\n url = `/${topic}/${relationOption?.slug}`;\n break;\n case \"video\":\n url = `/video/${relationOption?.slug}`;\n\n break;\n case \"audios\":\n url = `/audio/${relationOption?.slug}`;\n break;\n }\n setRelationship({\n id: relationOption?.id,\n type: optionType,\n thumbnail: relationOption?.thumbnail?.url,\n title: relationOption?.title,\n url: url,\n });\n }}\n >\n Save\n </Button>\n\n {/* <Button\n onClick={() => {\n cancelSelection()\n }}\n >\n Cancel\n </Button> */}\n </div>\n </div>\n );\n};\n"],"names":["Button","useCallback","useState","twj","limit","ContentRelationship","setRelationship","cancelSelection","optionType","setOptionType","relationOption","setRelationOption","opts","label","value","fetchContentTypes","search","loadedOptions","page","options","hasMore","length","additional","error","div","style","onClick","url","topic","topics","slug","id","type","thumbnail","title"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAEA,yFAAyF;AACzF,uEAAuE;AACvE,SAASA,MAAM,QAAQ,iCAAiC;AACxD,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAC9C,SAASC,GAAG,QAAQ,YAAY;AAEhC,MAAMC,QAAQ;AACd,OAAO,MAAMC,sBAAsB,CAAC,EAClCC,eAAe,EACfC,eAAe,EAkBhB;IACC,MAAM,CAACC,YAAYC,cAAc,GAAGP,SAAS;IAC7C,MAAM,CAACQ,gBAAgBC,kBAAkB,GAAGT,SAAc;IAC1D,MAAMU,OAAO;QACX;YACEC,OAAO;YACPC,OAAO;QACT;QACA;YACED,OAAO;YACPC,OAAO;QACT;QACA;YACED,OAAO;YACPC,OAAO;QACT;KAKD;IAED,MAAMC,oBAAoBd,YACxB,OAAOe,QAAaC,eAAoB,EAAEC,IAAI,EAAO;QACnD,IAAI;YACF,yDAAyD;YAEzD,OAAO;gBACLC,SAASP;gBACTQ,SAASR,MAAMS,WAAWjB;gBAC1BkB,YAAY;oBACVJ,MAAMA,OAAO;gBACf;YACF;QACF,EAAE,OAAOK,OAAO;QACd,+CAA+C;QACjD;IACF,GACA,EAAE;IAEJ,qBACE,KAACC;QAAIC,OAAOtB,IAAI;kBA6Bd,cAAA,KAACqB;sBACC,cAAA,KAACxB;gBACC0B,SAAS;oBACP,IAAIC,MAAM;oBACV,MAAMC,QAAQlB,gBAAgBmB,QAAQ,CAAC,EAAE,EAAEC,QAAQ;oBACnD,OAAQtB;wBACN,KAAK;4BACHmB,MAAM,CAAC,CAAC,EAAEC,MAAM,CAAC,EAAElB,gBAAgBoB,KAAK,CAAC;4BACzC;wBACF,KAAK;4BACHH,MAAM,CAAC,OAAO,EAAEjB,gBAAgBoB,KAAK,CAAC;4BAEtC;wBACF,KAAK;4BACHH,MAAM,CAAC,OAAO,EAAEjB,gBAAgBoB,KAAK,CAAC;4BACtC;oBACJ;oBACAxB,gBAAgB;wBACdyB,IAAIrB,gBAAgBqB;wBACpBC,MAAMxB;wBACNyB,WAAWvB,gBAAgBuB,WAAWN;wBACtCO,OAAOxB,gBAAgBwB;wBACvBP,KAAKA;oBACP;gBACF;0BACD;;;;AAcT,EAAE"}
1
+ {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.tsx"],"sourcesContent":["\"use client\";\n\n// import { CustomRelationShipComponent } from '@/components/CustomRelationshipComponent'\n// import { PayloadAsyncSelect } from '@/components/PayloadAsyncSelect'\nimport { Button } from \"@payloadcms/ui/elements/Button\";\nimport { useCallback, useState } from \"react\";\n\nconst limit = 10;\nexport const ContentRelationship = ({\n setRelationship,\n cancelSelection,\n}: {\n type?: string;\n relationId?: string;\n cancelSelection: () => void;\n setRelationship: ({\n id,\n type,\n thumbnail,\n title,\n url,\n }: {\n id: string;\n type: string;\n thumbnail: string;\n title: string;\n url: string;\n }) => void;\n}) => {\n const [optionType, setOptionType] = useState(\"articles\");\n const [relationOption, setRelationOption] = useState<any>(null);\n const opts = [\n {\n label: \"Article\",\n value: \"articles\",\n },\n {\n label: \"Video\",\n value: \"video\",\n },\n {\n label: \"Audio\",\n value: \"audios\",\n },\n // {\n // label: 'Media',\n // value: 'media',\n // },\n ];\n\n const fetchContentTypes = useCallback(\n async (search: any, loadedOptions: any, { page }: any) => {\n try {\n // Perform your API call with the endpoint and inputValue\n\n return {\n options: opts,\n hasMore: opts?.length === limit,\n additional: {\n page: page + 1,\n },\n };\n } catch (error) {\n // console.error('Error fetching data:', error)\n }\n },\n []\n );\n return (\n <div className=\"w-full min-w-[300px] \">\n {/* <PayloadAsyncSelect\n fetchData={fetchContentTypes as any}\n handleChange={(val: string) => {\n setOptionType(val);\n }}\n defaultValue={opts?.find((option) => {\n return option.value === optionType;\n })}\n cacheOptions={null}\n /> */}\n\n {/* <CustomRelationShipComponent\n label={`${\n opts?.find((option) => {\n return option.value === optionType\n })?.label\n } Content`}\n collection={optionType}\n key={optionType}\n value={relationOption?.id ?? null}\n handleChange={(val: any) => {\n setRelationOption(val)\n }}\n handleInitialLoad={(val: any) => {\n setRelationOption(val)\n }}\n /> */}\n\n <div>\n <Button\n onClick={() => {\n let url = \"\";\n const topic = relationOption?.topics?.[0]?.slug ?? \"\";\n switch (optionType) {\n case \"articles\":\n url = `/${topic}/${relationOption?.slug}`;\n break;\n case \"video\":\n url = `/video/${relationOption?.slug}`;\n\n break;\n case \"audios\":\n url = `/audio/${relationOption?.slug}`;\n break;\n }\n setRelationship({\n id: relationOption?.id,\n type: optionType,\n thumbnail: relationOption?.thumbnail?.url,\n title: relationOption?.title,\n url: url,\n });\n }}\n >\n Save\n </Button>\n\n {/* <Button\n onClick={() => {\n cancelSelection()\n }}\n >\n Cancel\n </Button> */}\n </div>\n </div>\n );\n};\n"],"names":["Button","useCallback","useState","limit","ContentRelationship","setRelationship","cancelSelection","optionType","setOptionType","relationOption","setRelationOption","opts","label","value","fetchContentTypes","search","loadedOptions","page","options","hasMore","length","additional","error","div","className","onClick","url","topic","topics","slug","id","type","thumbnail","title"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAEA,yFAAyF;AACzF,uEAAuE;AACvE,SAASA,MAAM,QAAQ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T,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommandButton.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,kHAsBzB,CAAC"}
1
+ {"version":3,"file":"CommandButton.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,kHAsBzB,CAAC"}
@@ -2,23 +2,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Icon } from "../../features/ui/Icon.js";
4
4
  import { cn } from "../../lib/utils/index.js";
5
- import { twj } from "tw-to-css";
6
5
  export const CommandButton = /*#__PURE__*/ forwardRef(({ active, icon, onClick, title }, ref)=>{
7
6
  const wrapperClass = cn("flex text-neutral-500 items-center text-xs font-semibold justify-start p-1.5 gap-2 rounded", !active && "bg-transparent hover:bg-neutral-50 hover:text-black", active && "bg-neutral-100 text-black hover:bg-neutral-100");
8
7
  return /*#__PURE__*/ _jsxs("button", {
9
8
  type: "button",
10
9
  ref: ref,
11
10
  onClick: onClick,
12
- style: twj(wrapperClass),
11
+ className: wrapperClass,
13
12
  children: [
14
13
  /*#__PURE__*/ _jsx(Icon, {
15
14
  icon: icon,
16
15
  className: "w-3 h-3"
17
16
  }),
18
17
  /*#__PURE__*/ _jsx("div", {
19
- style: twj("flex flex-col items-start justify-start"),
18
+ className: "flex flex-col items-start justify-start",
20
19
  children: /*#__PURE__*/ _jsx("div", {
21
- style: twj("text-sm font-medium"),
20
+ className: "text-sm font-medium",
22
21
  children: title
23
22
  })
24
23
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.tsx"],"sourcesContent":["import { LucideIcon } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport { Icon } from \"../../features/ui/Icon.js\";\nimport { cn } from \"../../lib/utils/index.js\";\nimport { twj } from \"tw-to-css\";\n\nexport type CommandButtonProps = {\n active?: boolean;\n description: string;\n icon: LucideIcon;\n onClick: () => void;\n title: string;\n};\n\nexport const CommandButton = forwardRef<HTMLButtonElement, CommandButtonProps>(\n ({ active, icon, onClick, title }, ref) => {\n const wrapperClass = cn(\n \"flex text-neutral-500 items-center text-xs font-semibold justify-start p-1.5 gap-2 rounded\",\n !active && \"bg-transparent hover:bg-neutral-50 hover:text-black\",\n active && \"bg-neutral-100 text-black hover:bg-neutral-100\"\n );\n\n return (\n <button\n type=\"button\"\n ref={ref}\n onClick={onClick}\n style={twj(wrapperClass)}\n >\n <Icon icon={icon} className=\"w-3 h-3\" />\n <div style={twj(\"flex flex-col items-start justify-start\")}>\n <div style={twj(\"text-sm font-medium\")}>{title}</div>\n </div>\n </button>\n );\n }\n);\n\nCommandButton.displayName = \"CommandButton\";\n"],"names":["forwardRef","Icon","cn","twj","CommandButton","active","icon","onClick","title","ref","wrapperClass","button","type","style","className","div","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AACA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SAASC,EAAE,QAAQ,2BAA2B;AAC9C,SAASC,GAAG,QAAQ,YAAY;AAUhC,OAAO,MAAMC,8BAAgBJ,WAC3B,CAAC,EAAEK,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAK,EAAE,EAAEC;IACjC,MAAMC,eAAeR,GACnB,8FACA,CAACG,UAAU,uDACXA,UAAU;IAGZ,qBACE,MAACM;QACCC,MAAK;QACLH,KAAKA;QACLF,SAASA;QACTM,OAAOV,IAAIO;;0BAEX,KAACT;gBAAKK,MAAMA;gBAAMQ,WAAU;;0BAC5B,KAACC;gBAAIF,OAAOV,IAAI;0BACd,cAAA,KAACY;oBAAIF,OAAOV,IAAI;8BAAyBK;;;;;AAIjD,GACA;AAEFJ,cAAcY,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.tsx"],"sourcesContent":["import { LucideIcon } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport { Icon } from \"../../features/ui/Icon.js\";\nimport { cn } from \"../../lib/utils/index.js\";\n\nexport type CommandButtonProps = {\n active?: boolean;\n description: string;\n icon: LucideIcon;\n onClick: () => void;\n title: string;\n};\n\nexport const CommandButton = forwardRef<HTMLButtonElement, CommandButtonProps>(\n ({ active, icon, onClick, title }, ref) => {\n const wrapperClass = cn(\n \"flex text-neutral-500 items-center text-xs font-semibold justify-start p-1.5 gap-2 rounded\",\n !active && \"bg-transparent hover:bg-neutral-50 hover:text-black\",\n active && \"bg-neutral-100 text-black hover:bg-neutral-100\"\n );\n\n return (\n <button\n type=\"button\"\n ref={ref}\n onClick={onClick}\n className={wrapperClass}\n >\n <Icon icon={icon} className=\"w-3 h-3\" />\n <div className=\"flex flex-col items-start justify-start\">\n <div className=\"text-sm font-medium\">{title}</div>\n </div>\n </button>\n );\n }\n);\n\nCommandButton.displayName = \"CommandButton\";\n"],"names":["forwardRef","Icon","cn","CommandButton","active","icon","onClick","title","ref","wrapperClass","button","type","className","div","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AACA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SAASC,EAAE,QAAQ,2BAA2B;AAU9C,OAAO,MAAMC,8BAAgBH,WAC3B,CAAC,EAAEI,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAK,EAAE,EAAEC;IACjC,MAAMC,eAAeP,GACnB,8FACA,CAACE,UAAU,uDACXA,UAAU;IAGZ,qBACE,MAACM;QACCC,MAAK;QACLH,KAAKA;QACLF,SAASA;QACTM,WAAWH;;0BAEX,KAACR;gBAAKI,MAAMA;gBAAMO,WAAU;;0BAC5B,KAACC;gBAAID,WAAU;0BACb,cAAA,KAACC;oBAAID,WAAU;8BAAuBL;;;;;AAI9C,GACA;AAEFJ,cAAcW,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/MenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAW,aAAa,EAAE,MAAM,YAAY,CAAC;AAKpD,eAAO,MAAM,QAAQ,+EAqJnB,CAAC;AAIH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/MenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAW,aAAa,EAAE,MAAM,YAAY,CAAC;AAIpD,eAAO,MAAM,QAAQ,+EAiJnB,CAAC;AAIH,eAAe,QAAQ,CAAC"}
@@ -3,7 +3,6 @@ import React, { useCallback, useEffect, useRef, useState } from "react";
3
3
  import { DropdownButton } from "../../features/ui/Dropdown/Dropdown.js";
4
4
  import { Surface } from "../../features/ui/Surface.js";
5
5
  import { Icon } from "../../features/ui/Icon.js";
6
- import { twj } from "tw-to-css";
7
6
  export const MenuList = /*#__PURE__*/ React.forwardRef((props, ref)=>{
8
7
  const scrollContainer = useRef(null);
9
8
  const activeItem = useRef(null);
@@ -93,13 +92,13 @@ export const MenuList = /*#__PURE__*/ React.forwardRef((props, ref)=>{
93
92
  }
94
93
  return /*#__PURE__*/ _jsx(Surface, {
95
94
  ref: scrollContainer,
96
- style: twj("text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-2"),
95
+ className: "text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-2",
97
96
  children: /*#__PURE__*/ _jsx("div", {
98
- style: twj("grid grid-cols-1 gap-0.5"),
97
+ className: "grid grid-cols-1 gap-0.5",
99
98
  children: props.items.map((group, groupIndex)=>/*#__PURE__*/ _jsxs(React.Fragment, {
100
99
  children: [
101
100
  /*#__PURE__*/ _jsx("div", {
102
- style: twj("text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-4 font-semibold tracking-wider select-none uppercase first:mt-0.5"),
101
+ className: "text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-4 font-semibold tracking-wider select-none uppercase first:mt-0.5",
103
102
  children: group.title
104
103
  }, `${group.title}`),
105
104
  group.commands.map((command, commandIndex)=>/*#__PURE__*/ _jsxs(DropdownButton, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/MenuList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { DropdownButton } from \"../../features/ui/Dropdown/Dropdown.js\";\nimport { Surface } from \"../../features/ui/Surface.js\";\nimport { Command, MenuListProps } from \"./types.js\";\n\nimport { Icon } from \"../../features/ui/Icon.js\";\nimport { twj } from \"tw-to-css\";\n\nexport const MenuList = React.forwardRef((props: MenuListProps, ref) => {\n const scrollContainer = useRef<HTMLDivElement>(null);\n const activeItem = useRef<HTMLButtonElement>(null);\n const [selectedGroupIndex, setSelectedGroupIndex] = useState(0);\n const [selectedCommandIndex, setSelectedCommandIndex] = useState(0);\n\n // Anytime the groups change, i.e. the user types to narrow it down, we want to\n // reset the current selection to the first menu item\n useEffect(() => {\n setSelectedGroupIndex(0);\n setSelectedCommandIndex(0);\n }, [props.items]);\n\n const selectItem = useCallback(\n (groupIndex: number, commandIndex: number) => {\n const command = props.items[groupIndex].commands[commandIndex];\n props.command(command);\n },\n [props]\n );\n\n React.useImperativeHandle(ref, () => ({\n onKeyDown: ({ event }: { event: React.KeyboardEvent }) => {\n if (event.key === \"ArrowDown\") {\n if (!props.items.length) {\n return false;\n }\n\n const commands = props.items[selectedGroupIndex].commands;\n\n let newCommandIndex = selectedCommandIndex + 1;\n let newGroupIndex = selectedGroupIndex;\n\n if (commands.length - 1 < newCommandIndex) {\n newCommandIndex = 0;\n newGroupIndex = selectedGroupIndex + 1;\n }\n\n if (props.items.length - 1 < newGroupIndex) {\n newGroupIndex = 0;\n }\n\n setSelectedCommandIndex(newCommandIndex);\n setSelectedGroupIndex(newGroupIndex);\n\n return true;\n }\n\n if (event.key === \"ArrowUp\") {\n if (!props.items.length) {\n return false;\n }\n\n let newCommandIndex = selectedCommandIndex - 1;\n let newGroupIndex = selectedGroupIndex;\n\n if (newCommandIndex < 0) {\n newGroupIndex = selectedGroupIndex - 1;\n newCommandIndex =\n props.items[newGroupIndex]?.commands.length - 1 || 0;\n }\n\n if (newGroupIndex < 0) {\n newGroupIndex = props.items.length - 1;\n newCommandIndex = props.items[newGroupIndex].commands.length - 1;\n }\n\n setSelectedCommandIndex(newCommandIndex);\n setSelectedGroupIndex(newGroupIndex);\n\n return true;\n }\n\n if (event.key === \"Enter\") {\n if (\n !props.items.length ||\n selectedGroupIndex === -1 ||\n selectedCommandIndex === -1\n ) {\n return false;\n }\n\n selectItem(selectedGroupIndex, selectedCommandIndex);\n\n return true;\n }\n\n return false;\n },\n }));\n\n useEffect(() => {\n if (activeItem.current && scrollContainer.current) {\n const offsetTop = activeItem.current.offsetTop;\n const offsetHeight = activeItem.current.offsetHeight;\n\n scrollContainer.current.scrollTop = offsetTop - offsetHeight;\n }\n }, [selectedCommandIndex, selectedGroupIndex]);\n\n const createCommandClickHandler = useCallback(\n (groupIndex: number, commandIndex: number) => {\n return () => {\n selectItem(groupIndex, commandIndex);\n };\n },\n [selectItem]\n );\n\n if (!props.items.length) {\n return null;\n }\n\n return (\n <Surface\n ref={scrollContainer}\n style={twj(\n \"text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-2\"\n )}\n >\n <div style={twj(\"grid grid-cols-1 gap-0.5\")}>\n {props.items.map((group, groupIndex: number) => (\n <React.Fragment key={`${group.title}-wrapper`}>\n <div\n style={twj(\n \"text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-4 font-semibold tracking-wider select-none uppercase first:mt-0.5\"\n )}\n key={`${group.title}`}\n >\n {group.title}\n </div>\n {group.commands.map((command: Command, commandIndex: number) => (\n <DropdownButton\n key={`${command.label}`}\n isActive={\n selectedGroupIndex === groupIndex &&\n selectedCommandIndex === commandIndex\n }\n onClick={createCommandClickHandler(groupIndex, commandIndex)}\n >\n <Icon icon={command.icon} className=\"mr-1\" />\n {command.label}\n </DropdownButton>\n ))}\n </React.Fragment>\n ))}\n </div>\n </Surface>\n );\n});\n\nMenuList.displayName = \"MenuList\";\n\nexport default MenuList;\n"],"names":["React","useCallback","useEffect","useRef","useState","DropdownButton","Surface","Icon","twj","MenuList","forwardRef","props","ref","scrollContainer","activeItem","selectedGroupIndex","setSelectedGroupIndex","selectedCommandIndex","setSelectedCommandIndex","items","selectItem","groupIndex","commandIndex","command","commands","useImperativeHandle","onKeyDown","event","key","length","newCommandIndex","newGroupIndex","current","offsetTop","offsetHeight","scrollTop","createCommandClickHandler","style","div","map","group","Fragment","title","isActive","onClick","icon","className","label","displayName"],"rangeMappings":";;;;;;;;;;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4BAA4BnC,YAChC,CAACoB,YAAoBC;QACnB,OAAO;YACLF,WAAWC,YAAYC;QACzB;IACF,GACA;QAACF;KAAW;IAGd,IAAI,CAACT,MAAMQ,KAAK,CAACU,MAAM,EAAE;QACvB,OAAO;IACT;IAEA,qBACE,KAACvB;QACCM,KAAKC;QACLwB,OAAO7B,IACL;kBAGF,cAAA,KAAC8B;YAAID,OAAO7B,IAAI;sBACbG,MAAMQ,KAAK,CAACoB,GAAG,CAAC,CAACC,OAAOnB,2BACvB,MAACrB,MAAMyC,QAAQ;;sCACb,KAACH;4BACCD,OAAO7B,IACL;sCAIDgC,MAAME,KAAK;2BAFP,CAAC,EAAEF,MAAME,KAAK,CAAC,CAAC;wBAItBF,MAAMhB,QAAQ,CAACe,GAAG,CAAC,CAAChB,SAAkBD,6BACrC,MAACjB;gCAECsC,UACE5B,uBAAuBM,cACvBJ,yBAAyBK;gCAE3BsB,SAASR,0BAA0Bf,YAAYC;;kDAE/C,KAACf;wCAAKsC,MAAMtB,QAAQsB,IAAI;wCAAEC,WAAU;;oCACnCvB,QAAQwB,KAAK;;+BART,CAAC,EAAExB,QAAQwB,KAAK,CAAC,CAAC;;mBAXR,CAAC,EAAEP,MAAME,KAAK,CAAC,QAAQ,CAAC;;;AA2BvD,GAAG;AAEHjC,SAASuC,WAAW,GAAG;AAEvB,eAAevC,SAAS"}
1
+ {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/MenuList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { DropdownButton } from \"../../features/ui/Dropdown/Dropdown.js\";\nimport { Surface } from \"../../features/ui/Surface.js\";\nimport { Command, MenuListProps } from \"./types.js\";\n\nimport { Icon } from \"../../features/ui/Icon.js\";\n\nexport const MenuList = React.forwardRef((props: MenuListProps, ref) => {\n const scrollContainer = useRef<HTMLDivElement>(null);\n const activeItem = useRef<HTMLButtonElement>(null);\n const [selectedGroupIndex, setSelectedGroupIndex] = useState(0);\n const [selectedCommandIndex, setSelectedCommandIndex] = useState(0);\n\n // Anytime the groups change, i.e. the user types to narrow it down, we want to\n // reset the current selection to the first menu item\n useEffect(() => {\n setSelectedGroupIndex(0);\n setSelectedCommandIndex(0);\n }, [props.items]);\n\n const selectItem = useCallback(\n (groupIndex: number, commandIndex: number) => {\n const command = props.items[groupIndex].commands[commandIndex];\n props.command(command);\n },\n [props]\n );\n\n React.useImperativeHandle(ref, () => ({\n onKeyDown: ({ event }: { event: React.KeyboardEvent }) => {\n if (event.key === \"ArrowDown\") {\n if (!props.items.length) {\n return false;\n }\n\n const commands = props.items[selectedGroupIndex].commands;\n\n let newCommandIndex = selectedCommandIndex + 1;\n let newGroupIndex = selectedGroupIndex;\n\n if (commands.length - 1 < newCommandIndex) {\n newCommandIndex = 0;\n newGroupIndex = selectedGroupIndex + 1;\n }\n\n if (props.items.length - 1 < newGroupIndex) {\n newGroupIndex = 0;\n }\n\n setSelectedCommandIndex(newCommandIndex);\n setSelectedGroupIndex(newGroupIndex);\n\n return true;\n }\n\n if (event.key === \"ArrowUp\") {\n if (!props.items.length) {\n return false;\n }\n\n let newCommandIndex = selectedCommandIndex - 1;\n let newGroupIndex = selectedGroupIndex;\n\n if (newCommandIndex < 0) {\n newGroupIndex = selectedGroupIndex - 1;\n newCommandIndex =\n props.items[newGroupIndex]?.commands.length - 1 || 0;\n }\n\n if (newGroupIndex < 0) {\n newGroupIndex = props.items.length - 1;\n newCommandIndex = props.items[newGroupIndex].commands.length - 1;\n }\n\n setSelectedCommandIndex(newCommandIndex);\n setSelectedGroupIndex(newGroupIndex);\n\n return true;\n }\n\n if (event.key === \"Enter\") {\n if (\n !props.items.length ||\n selectedGroupIndex === -1 ||\n selectedCommandIndex === -1\n ) {\n return false;\n }\n\n selectItem(selectedGroupIndex, selectedCommandIndex);\n\n return true;\n }\n\n return false;\n },\n }));\n\n useEffect(() => {\n if (activeItem.current && scrollContainer.current) {\n const offsetTop = activeItem.current.offsetTop;\n const offsetHeight = activeItem.current.offsetHeight;\n\n scrollContainer.current.scrollTop = offsetTop - offsetHeight;\n }\n }, [selectedCommandIndex, selectedGroupIndex]);\n\n const createCommandClickHandler = useCallback(\n (groupIndex: number, commandIndex: number) => {\n return () => {\n selectItem(groupIndex, commandIndex);\n };\n },\n [selectItem]\n );\n\n if (!props.items.length) {\n return null;\n }\n\n return (\n <Surface\n ref={scrollContainer}\n className=\"text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-2\"\n >\n <div className=\"grid grid-cols-1 gap-0.5\">\n {props.items.map((group, groupIndex: number) => (\n <React.Fragment key={`${group.title}-wrapper`}>\n <div\n className=\"text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-4 font-semibold tracking-wider select-none uppercase first:mt-0.5\"\n key={`${group.title}`}\n >\n {group.title}\n </div>\n {group.commands.map((command: Command, commandIndex: number) => (\n <DropdownButton\n key={`${command.label}`}\n isActive={\n selectedGroupIndex === groupIndex &&\n selectedCommandIndex === commandIndex\n }\n onClick={createCommandClickHandler(groupIndex, commandIndex)}\n >\n <Icon icon={command.icon} className=\"mr-1\" />\n {command.label}\n </DropdownButton>\n ))}\n </React.Fragment>\n ))}\n </div>\n </Surface>\n );\n});\n\nMenuList.displayName = \"MenuList\";\n\nexport default MenuList;\n"],"names":["React","useCallback","useEffect","useRef","useState","DropdownButton","Surface","Icon","MenuList","forwardRef","props","ref","scrollContainer","activeItem","selectedGroupIndex","setSelectedGroupIndex","selectedCommandIndex","setSelectedCommandIndex","items","selectItem","groupIndex","commandIndex","command","commands","useImperativeHandle","onKeyDown","event","key","length","newCommandIndex","newGroupIndex","current","offsetTop","offsetHeight","scrollTop","createCommandClickHandler","className","div","map","group","Fragment","title","isActive","onClick","icon","label","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IACT;IAEA,qBACE,KAACtB;QACCK,KAAKC;QACLwB,WAAU;kBAEV,cAAA,KAACC;YAAID,WAAU;sBACZ1B,MAAMQ,KAAK,CAACoB,GAAG,CAAC,CAACC,OAAOnB,2BACvB,MAACpB,MAAMwC,QAAQ;;sCACb,KAACH;4BACCD,WAAU;sCAGTG,MAAME,KAAK;2BAFP,CAAC,EAAEF,MAAME,KAAK,CAAC,CAAC;wBAItBF,MAAMhB,QAAQ,CAACe,GAAG,CAAC,CAAChB,SAAkBD,6BACrC,MAAChB;gCAECqC,UACE5B,uBAAuBM,cACvBJ,yBAAyBK;gCAE3BsB,SAASR,0BAA0Bf,YAAYC;;kDAE/C,KAACd;wCAAKqC,MAAMtB,QAAQsB,IAAI;wCAAER,WAAU;;oCACnCd,QAAQuB,KAAK;;+BART,CAAC,EAAEvB,QAAQuB,KAAK,CAAC,CAAC;;mBATR,CAAC,EAAEN,MAAME,KAAK,CAAC,QAAQ,CAAC;;;AAyBvD,GAAG;AAEHjC,SAASsC,WAAW,GAAG;AAEvB,eAAetC,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"InstagramEmbed.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.tsx"],"names":[],"mappings":"gCAKuB;IAAE,IAAI,EAAE;QAAE,KAAK,EAAE;YAAE,GAAG,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE;AAA5D,wBAeE"}
1
+ {"version":3,"file":"InstagramEmbed.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.tsx"],"names":[],"mappings":"gCAIuB;IAAE,IAAI,EAAE;QAAE,KAAK,EAAE;YAAE,GAAG,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE;AAA5D,wBAeE"}
@@ -2,14 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Instagram } from "lucide-react";
3
3
  import { InstagramEmbed } from "react-social-media-embed";
4
4
  import SocialMediaEmbed from "../SocialMediaEmbed.js";
5
- import { twj } from "tw-to-css";
6
5
  export default ((props)=>{
7
6
  return /*#__PURE__*/ _jsx(SocialMediaEmbed, {
8
7
  props: props,
9
8
  Icon: Instagram,
10
9
  text: "Embed a post from Instagram",
11
10
  children: /*#__PURE__*/ _jsx(InstagramEmbed, {
12
- style: twj("max-w-[328px]"),
11
+ className: "max-w-[328px]",
13
12
  url: props?.node?.attrs?.url ?? "",
14
13
  width: 328,
15
14
  captioned: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.tsx"],"sourcesContent":["import { Instagram } from \"lucide-react\";\nimport { InstagramEmbed } from \"react-social-media-embed\";\nimport SocialMediaEmbed from \"../SocialMediaEmbed.js\";\nimport { twj } from \"tw-to-css\";\n\nexport default (props: { node: { attrs: { url?: string } } }) => {\n return (\n <SocialMediaEmbed\n props={props}\n Icon={Instagram}\n text={\"Embed a post from Instagram\"}\n >\n <InstagramEmbed\n style={twj(\"max-w-[328px]\")}\n url={props?.node?.attrs?.url ?? \"\"}\n width={328}\n captioned\n />\n </SocialMediaEmbed>\n );\n};\n"],"names":["Instagram","InstagramEmbed","SocialMediaEmbed","twj","props","Icon","text","style","url","node","attrs","width","captioned"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,SAAS,QAAQ,eAAe;AACzC,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,OAAOC,sBAAsB,yBAAyB;AACtD,SAASC,GAAG,QAAQ,YAAY;AAEhC,eAAe,CAAA,CAACC;IACd,qBACE,KAACF;QACCE,OAAOA;QACPC,MAAML;QACNM,MAAM;kBAEN,cAAA,KAACL;YACCM,OAAOJ,IAAI;YACXK,KAAKJ,OAAOK,MAAMC,OAAOF,OAAO;YAChCG,OAAO;YACPC,SAAS;;;AAIjB,CAAA,EAAE"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.tsx"],"sourcesContent":["import { Instagram } from \"lucide-react\";\nimport { InstagramEmbed } from \"react-social-media-embed\";\nimport SocialMediaEmbed from \"../SocialMediaEmbed.js\";\n\nexport default (props: { node: { attrs: { url?: string } } }) => {\n return (\n <SocialMediaEmbed\n props={props}\n Icon={Instagram}\n text={\"Embed a post from Instagram\"}\n >\n <InstagramEmbed\n className=\"max-w-[328px]\"\n url={props?.node?.attrs?.url ?? \"\"}\n width={328}\n captioned\n />\n </SocialMediaEmbed>\n );\n};\n"],"names":["Instagram","InstagramEmbed","SocialMediaEmbed","props","Icon","text","className","url","node","attrs","width","captioned"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,SAAS,QAAQ,eAAe;AACzC,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,OAAOC,sBAAsB,yBAAyB;AAEtD,eAAe,CAAA,CAACC;IACd,qBACE,KAACD;QACCC,OAAOA;QACPC,MAAMJ;QACNK,MAAM;kBAEN,cAAA,KAACJ;YACCK,WAAU;YACVC,KAAKJ,OAAOK,MAAMC,OAAOF,OAAO;YAChCG,OAAO;YACPC,SAAS;;;AAIjB,CAAA,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"SocialMediaEmbed.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.tsx"],"names":[],"mappings":"0DAGiD,GAAG;AAApD,wBA6CE"}
1
+ {"version":3,"file":"SocialMediaEmbed.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.tsx"],"names":[],"mappings":"0DAEiD,GAAG;AAApD,wBA2CE"}
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { NodeViewContent, NodeViewWrapper } from "@tiptap/react";
3
- import { twj } from "tw-to-css";
4
3
  export default (({ props, children, Icon, text })=>{
5
4
  return /*#__PURE__*/ _jsx(NodeViewWrapper, {
6
5
  className: "react-component",
@@ -17,7 +16,7 @@ export default (({ props, children, Icon, text })=>{
17
16
  width: "100%"
18
17
  },
19
18
  children: !props?.node?.attrs?.url ?? "" ? /*#__PURE__*/ _jsxs("div", {
20
- style: twj("w-full bg-zinc-100 py-8 px-6 flex items-center justify-center gap-2 socialMediaCard"),
19
+ className: "w-full bg-zinc-100 py-8 px-6 flex items-center justify-center gap-2 socialMediaCard",
21
20
  draggable: "true",
22
21
  "data-drag-handle": "",
23
22
  contentEditable: "false",
@@ -26,8 +25,8 @@ export default (({ props, children, Icon, text })=>{
26
25
  size: 24
27
26
  }),
28
27
  /*#__PURE__*/ _jsx("p", {
28
+ className: "w-full flex items-center justify-start mt-0",
29
29
  style: {
30
- ...twj("w-full flex items-center justify-start mt-0"),
31
30
  marginTop: 0
32
31
  },
33
32
  children: text
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.tsx"],"sourcesContent":["import { NodeViewContent, NodeViewWrapper } from \"@tiptap/react\";\nimport { twj } from \"tw-to-css\";\n\nexport default ({ props, children, Icon, text }: any) => {\n return (\n <NodeViewWrapper\n className=\"react-component\"\n onClick={() => {\n props.editor.commands.setNodeSelection(props.getPos());\n }}\n >\n <NodeViewContent contentEditable=\"false\" className=\"socialMediaContainer\">\n {props?.node.type.spec.draggable ? (\n <div draggable=\"true\" data-drag-handle=\"\" style={{ width: \"100%\" }}>\n {!props?.node?.attrs?.url ?? \"\" ? (\n <div\n style={twj(\n \"w-full bg-zinc-100 py-8 px-6 flex items-center justify-center gap-2 socialMediaCard\"\n )}\n draggable=\"true\"\n data-drag-handle=\"\"\n contentEditable=\"false\"\n >\n <Icon size={24} />\n <p\n style={{\n ...twj(\"w-full flex items-center justify-start mt-0\"),\n marginTop: 0,\n }}\n >\n {text}\n </p>\n </div>\n ) : (\n <div\n style={{ display: \"flex\", justifyContent: \"center\" }}\n draggable=\"true\"\n data-drag-handle=\"\"\n contentEditable=\"false\"\n >\n {children}\n </div>\n )}\n </div>\n ) : null}\n </NodeViewContent>\n </NodeViewWrapper>\n );\n};\n"],"names":["NodeViewContent","NodeViewWrapper","twj","props","children","Icon","text","className","onClick","editor","commands","setNodeSelection","getPos","contentEditable","node","type","spec","draggable","div","data-drag-handle","style","width","attrs","url","size","p","marginTop","display","justifyContent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,eAAe,EAAEC,eAAe,QAAQ,gBAAgB;AACjE,SAASC,GAAG,QAAQ,YAAY;AAEhC,eAAe,CAAA,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAO;IAClD,qBACE,KAACL;QACCM,WAAU;QACVC,SAAS;YACPL,MAAMM,MAAM,CAACC,QAAQ,CAACC,gBAAgB,CAACR,MAAMS,MAAM;QACrD;kBAEA,cAAA,KAACZ;YAAgBa,iBAAgB;YAAQN,WAAU;sBAChDJ,OAAOW,KAAKC,KAAKC,KAAKC,0BACrB,KAACC;gBAAID,WAAU;gBAAOE,oBAAiB;gBAAGC,OAAO;oBAAEC,OAAO;gBAAO;0BAC9D,CAAClB,OAAOW,MAAMQ,OAAOC,OAAO,mBAC3B,MAACL;oBACCE,OAAOlB,IACL;oBAEFe,WAAU;oBACVE,oBAAiB;oBACjBN,iBAAgB;;sCAEhB,KAACR;4BAAKmB,MAAM;;sCACZ,KAACC;4BACCL,OAAO;gCACL,GAAGlB,IAAI,8CAA8C;gCACrDwB,WAAW;4BACb;sCAECpB;;;mCAIL,KAACY;oBACCE,OAAO;wBAAEO,SAAS;wBAAQC,gBAAgB;oBAAS;oBACnDX,WAAU;oBACVE,oBAAiB;oBACjBN,iBAAgB;8BAEfT;;iBAIL;;;AAIZ,CAAA,EAAE"}
1
+ {"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.tsx"],"sourcesContent":["import { NodeViewContent, NodeViewWrapper } from \"@tiptap/react\";\n\nexport default ({ props, children, Icon, text }: any) => {\n return (\n <NodeViewWrapper\n className=\"react-component\"\n onClick={() => {\n props.editor.commands.setNodeSelection(props.getPos());\n }}\n >\n <NodeViewContent contentEditable=\"false\" className=\"socialMediaContainer\">\n {props?.node.type.spec.draggable ? (\n <div draggable=\"true\" data-drag-handle=\"\" style={{ width: \"100%\" }}>\n {!props?.node?.attrs?.url ?? \"\" ? (\n <div\n className=\"w-full bg-zinc-100 py-8 px-6 flex items-center justify-center gap-2 socialMediaCard\"\n draggable=\"true\"\n data-drag-handle=\"\"\n contentEditable=\"false\"\n >\n <Icon size={24} />\n <p\n className=\"w-full flex items-center justify-start mt-0\"\n style={{\n marginTop: 0,\n }}\n >\n {text}\n </p>\n </div>\n ) : (\n <div\n style={{ display: \"flex\", justifyContent: \"center\" }}\n draggable=\"true\"\n data-drag-handle=\"\"\n contentEditable=\"false\"\n >\n {children}\n </div>\n )}\n </div>\n ) : null}\n </NodeViewContent>\n </NodeViewWrapper>\n );\n};\n"],"names":["NodeViewContent","NodeViewWrapper","props","children","Icon","text","className","onClick","editor","commands","setNodeSelection","getPos","contentEditable","node","type","spec","draggable","div","data-drag-handle","style","width","attrs","url","size","p","marginTop","display","justifyContent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,eAAe,EAAEC,eAAe,QAAQ,gBAAgB;AAEjE,eAAe,CAAA,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAO;IAClD,qBACE,KAACJ;QACCK,WAAU;QACVC,SAAS;YACPL,MAAMM,MAAM,CAACC,QAAQ,CAACC,gBAAgB,CAACR,MAAMS,MAAM;QACrD;kBAEA,cAAA,KAACX;YAAgBY,iBAAgB;YAAQN,WAAU;sBAChDJ,OAAOW,KAAKC,KAAKC,KAAKC,0BACrB,KAACC;gBAAID,WAAU;gBAAOE,oBAAiB;gBAAGC,OAAO;oBAAEC,OAAO;gBAAO;0BAC9D,CAAClB,OAAOW,MAAMQ,OAAOC,OAAO,mBAC3B,MAACL;oBACCX,WAAU;oBACVU,WAAU;oBACVE,oBAAiB;oBACjBN,iBAAgB;;sCAEhB,KAACR;4BAAKmB,MAAM;;sCACZ,KAACC;4BACClB,WAAU;4BACVa,OAAO;gCACLM,WAAW;4BACb;sCAECpB;;;mCAIL,KAACY;oBACCE,OAAO;wBAAEO,SAAS;wBAAQC,gBAAgB;oBAAS;oBACnDX,WAAU;oBACVE,oBAAiB;oBACjBN,iBAAgB;8BAEfT;;iBAIL;;;AAIZ,CAAA,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableOfContentsNode.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAyB,MAAM,cAAc,CAAC;AAiB3D,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,mBAAmB,EAAE;YACnB,qBAAqB,EAAE,MAAM,UAAU,CAAC;SACzC,CAAC;KACH;CACF;AAED,eAAO,MAAM,mBAAmB,gBAmC9B,CAAC"}
1
+ {"version":3,"file":"TableOfContentsNode.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAyB,MAAM,cAAc,CAAC;AAgB3D,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,mBAAmB,EAAE;YACnB,qBAAqB,EAAE,MAAM,UAAU,CAAC;SACzC,CAAC;KACH;CACF;AAED,eAAO,MAAM,mBAAmB,gBAmC9B,CAAC"}
@@ -3,12 +3,11 @@ import React from "react";
3
3
  import { Node } from "@tiptap/core";
4
4
  import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
5
5
  import { TableOfContents } from "../../features/TableOfContents/index.js";
6
- import { twj } from "tw-to-css";
7
6
  const TableOfNodeContent = (props)=>{
8
7
  const { editor } = props;
9
8
  return /*#__PURE__*/ _jsx(NodeViewWrapper, {
10
9
  children: /*#__PURE__*/ _jsx("div", {
11
- style: twj("p-2 -m-2 rounded-lg"),
10
+ className: "p-2 -m-2 rounded-lg",
12
11
  contentEditable: false,
13
12
  children: /*#__PURE__*/ _jsx(TableOfContents, {
14
13
  editor: editor