payload-richtext-tiptap 0.0.110 → 0.0.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.js +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentSidebarRenderer.js +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentSidebarRenderer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedContentInlineRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.tsx"],"names":[],"mappings":"AAcA,wBAAgB,0BAA0B,CAAC,EAAE,IAAI,EAAE;;CAAA,+
|
|
1
|
+
{"version":3,"file":"EmbedContentInlineRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.tsx"],"names":[],"mappings":"AAcA,wBAAgB,0BAA0B,CAAC,EAAE,IAAI,EAAE;;CAAA,+BAwBlD"}
|
|
@@ -17,7 +17,7 @@ export function EmbedContentInlineRenderer({ body }) {
|
|
|
17
17
|
}, []);
|
|
18
18
|
if (!mounted) return null;
|
|
19
19
|
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
20
|
-
children: body.content.filter((content)=>content?.attrs?.["data-id"]).
|
|
20
|
+
children: body.content.filter((content)=>content?.attrs?.["data-id"]).map((content)=>{
|
|
21
21
|
return /*#__PURE__*/ _jsx(CustomPortal, {
|
|
22
22
|
container: document?.querySelector(`[data-id='${content.attrs["data-id"]}']`),
|
|
23
23
|
content: content
|
package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.tsx"],"sourcesContent":["\"use client\";\n\nimport { Portal } from \"@radix-ui/react-portal\";\nimport { ComponentProps, memo, useEffect, useState } from \"react\";\n\nimport { renderEmbedContent } from \"./RenderEmbedClientSide.js\";\n\nconst CustomPortal = memo(\n ({ content, ...props }: ComponentProps<typeof Portal>) => {\n useEffect(() => {}, []);\n return <Portal {...props}>{renderEmbedContent(content)}</Portal>;\n }\n);\n\nexport function EmbedContentInlineRenderer({ body }) {\n const [mounted, setMounted] = useState(false);\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) return null;\n return (\n <>\n {body.content\n .filter((content) => content?.attrs?.[\"data-id\"])\n .
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentInlineRenderer.tsx"],"sourcesContent":["\"use client\";\n\nimport { Portal } from \"@radix-ui/react-portal\";\nimport { ComponentProps, memo, useEffect, useState } from \"react\";\n\nimport { renderEmbedContent } from \"./RenderEmbedClientSide.js\";\n\nconst CustomPortal = memo(\n ({ content, ...props }: ComponentProps<typeof Portal>) => {\n useEffect(() => {}, []);\n return <Portal {...props}>{renderEmbedContent(content)}</Portal>;\n }\n);\n\nexport function EmbedContentInlineRenderer({ body }) {\n const [mounted, setMounted] = useState(false);\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) return null;\n return (\n <>\n {body.content\n .filter((content) => content?.attrs?.[\"data-id\"])\n .map((content) => {\n return (\n <CustomPortal\n key={`embed-content-inline-${content.attrs[\"data-id\"]}-${content.attrs.key}`}\n container={document?.querySelector(\n `[data-id='${content.attrs[\"data-id\"]}']`\n )}\n content={content}\n />\n );\n })}\n </>\n );\n}\n"],"names":["Portal","memo","useEffect","useState","renderEmbedContent","CustomPortal","content","props","EmbedContentInlineRenderer","body","mounted","setMounted","filter","attrs","map","container","document","querySelector","key"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAAyBC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAElE,SAASC,kBAAkB,QAAQ,6BAA6B;AAEhE,MAAMC,6BAAeJ,KACnB,CAAC,EAAEK,OAAO,EAAE,GAAGC,OAAsC;IACnDL,UAAU,KAAO,GAAG,EAAE;IACtB,qBAAO,KAACF;QAAQ,GAAGO,KAAK;kBAAGH,mBAAmBE;;AAChD;AAGF,OAAO,SAASE,2BAA2B,EAAEC,IAAI,EAAE;IACjD,MAAM,CAACC,SAASC,WAAW,GAAGR,SAAS;IACvCD,UAAU;QACRS,WAAW;IACb,GAAG,EAAE;IAEL,IAAI,CAACD,SAAS,OAAO;IACrB,qBACE;kBACGD,KAAKH,OAAO,CACVM,MAAM,CAAC,CAACN,UAAYA,SAASO,OAAO,CAAC,UAAU,EAC/CC,GAAG,CAAC,CAACR;YACJ,qBACE,KAACD;gBAECU,WAAWC,UAAUC,cACnB,CAAC,UAAU,EAAEX,QAAQO,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;gBAE3CP,SAASA;eAJJ,CAAC,qBAAqB,EAAEA,QAAQO,KAAK,CAAC,UAAU,CAAC,CAAC,EAAEP,QAAQO,KAAK,CAACK,GAAG,EAAE;QAOlF;;AAGR"}
|
|
@@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
4
4
|
import { renderEmbedContent } from "./RenderEmbedClientSide.js";
|
|
5
5
|
const HEIGHT = 320;
|
|
6
6
|
function getContainerElement(containerId) {
|
|
7
|
-
if (typeof window === "undefined"
|
|
7
|
+
if (typeof window === "undefined" || !containerId) return null;
|
|
8
8
|
return document.getElementById(containerId);
|
|
9
9
|
}
|
|
10
10
|
export function EmbedContentSidebarRenderer({ body, containerId }) {
|
package/dist/src/fields/TiptapEditor/extensions/serverside/EmbedContentSidebarRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentSidebarRenderer.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { renderEmbedContent } from \"./RenderEmbedClientSide.js\";\nconst HEIGHT = 320;\n\nfunction getContainerElement(containerId) {\n if (typeof window === \"undefined\"
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/EmbedContentSidebarRenderer.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { renderEmbedContent } from \"./RenderEmbedClientSide.js\";\nconst HEIGHT = 320;\n\nfunction getContainerElement(containerId) {\n if (typeof window === \"undefined\" || !containerId) return null;\n return document.getElementById(containerId);\n}\n\nexport function EmbedContentSidebarRenderer({ body, containerId }) {\n const [mounted, setMounted] = useState(false);\n useEffect(() => {\n setTimeout(() => {\n setMounted(true);\n }, 200);\n }, []);\n const containerEl = useRef(getContainerElement(containerId));\n if (!mounted || typeof window === \"undefined\") return null;\n if (!containerEl.current) {\n containerEl.current = getContainerElement(containerId);\n }\n let lastRenderedPixel =\n containerEl.current?.getBoundingClientRect()?.top + window.scrollY ||\n window.innerHeight;\n\n return (\n <>\n {body.content\n .filter((content) => content?.attrs?.[\"data-id\"])\n .filter((content) => content?.attrs?.side)\n .map((content) => {\n const el = document?.querySelector(\n `[data-id='${content.attrs[\"data-id\"]}']`\n );\n const relativeTopPosition = el.getBoundingClientRect().top;\n const topPosition = relativeTopPosition + window.scrollY;\n\n const tempBottomPixel = lastRenderedPixel;\n\n const marginTop = Math.max(\n 8,\n topPosition - tempBottomPixel - HEIGHT / 2\n );\n lastRenderedPixel = topPosition + HEIGHT;\n console.log(\n topPosition,\n tempBottomPixel,\n marginTop,\n window.innerHeight\n );\n return (\n <div\n key={`embed-content-sidebar-${content.attrs[\"data-id\"]}-${content.attrs.key}`}\n className=\"w-full\"\n style={{ marginTop }}\n >\n {renderEmbedContent(content)}\n </div>\n );\n })}\n </>\n );\n}\n"],"names":["useEffect","useRef","useState","renderEmbedContent","HEIGHT","getContainerElement","containerId","window","document","getElementById","EmbedContentSidebarRenderer","body","mounted","setMounted","setTimeout","containerEl","current","lastRenderedPixel","getBoundingClientRect","top","scrollY","innerHeight","content","filter","attrs","side","map","el","querySelector","relativeTopPosition","topPosition","tempBottomPixel","marginTop","Math","max","console","log","div","className","style","key"],"mappings":"AAAA;;AAEA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AACpD,SAASC,kBAAkB,QAAQ,6BAA6B;AAChE,MAAMC,SAAS;AAEf,SAASC,oBAAoBC,WAAW;IACtC,IAAI,OAAOC,WAAW,eAAe,CAACD,aAAa,OAAO;IAC1D,OAAOE,SAASC,cAAc,CAACH;AACjC;AAEA,OAAO,SAASI,4BAA4B,EAAEC,IAAI,EAAEL,WAAW,EAAE;IAC/D,MAAM,CAACM,SAASC,WAAW,GAAGX,SAAS;IACvCF,UAAU;QACRc,WAAW;YACTD,WAAW;QACb,GAAG;IACL,GAAG,EAAE;IACL,MAAME,cAAcd,OAAOI,oBAAoBC;IAC/C,IAAI,CAACM,WAAW,OAAOL,WAAW,aAAa,OAAO;IACtD,IAAI,CAACQ,YAAYC,OAAO,EAAE;QACxBD,YAAYC,OAAO,GAAGX,oBAAoBC;IAC5C;IACA,IAAIW,oBACFF,YAAYC,OAAO,EAAEE,yBAAyBC,MAAMZ,OAAOa,OAAO,IAClEb,OAAOc,WAAW;IAEpB,qBACE;kBACGV,KAAKW,OAAO,CACVC,MAAM,CAAC,CAACD,UAAYA,SAASE,OAAO,CAAC,UAAU,EAC/CD,MAAM,CAAC,CAACD,UAAYA,SAASE,OAAOC,MACpCC,GAAG,CAAC,CAACJ;YACJ,MAAMK,KAAKnB,UAAUoB,cACnB,CAAC,UAAU,EAAEN,QAAQE,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YAE3C,MAAMK,sBAAsBF,GAAGT,qBAAqB,GAAGC,GAAG;YAC1D,MAAMW,cAAcD,sBAAsBtB,OAAOa,OAAO;YAExD,MAAMW,kBAAkBd;YAExB,MAAMe,YAAYC,KAAKC,GAAG,CACxB,GACAJ,cAAcC,kBAAkB3B,SAAS;YAE3Ca,oBAAoBa,cAAc1B;YAClC+B,QAAQC,GAAG,CACTN,aACAC,iBACAC,WACAzB,OAAOc,WAAW;YAEpB,qBACE,KAACgB;gBAECC,WAAU;gBACVC,OAAO;oBAAEP;gBAAU;0BAElB7B,mBAAmBmB;eAJf,CAAC,sBAAsB,EAAEA,QAAQE,KAAK,CAAC,UAAU,CAAC,CAAC,EAAEF,QAAQE,KAAK,CAACgB,GAAG,EAAE;QAOnF;;AAGR"}
|