@payloadcms/richtext-lexical 3.29.0-internal.2984e42 → 3.29.0-internal.3471e81
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/exports/client/bundled.css +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/link.js +6 -2
- package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/link.js +6 -2
- package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
- package/dist/features/link/server/index.d.ts.map +1 -1
- package/dist/features/link/server/index.js +6 -2
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,sBAAsB,EAAE,CAAC,IAAI,EAAE;IAC1C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,kBAAkB,CAAA;QAC5B,QAAQ,CAAC,EAAE,cAAc,CAAA;KAC1B,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;CAC/B,KAAK,mBAAmB,CAAC,sBAAsB,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,sBAAsB,EAAE,CAAC,IAAI,EAAE;IAC1C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,kBAAkB,CAAA;QAC5B,QAAQ,CAAC,EAAE,cAAc,CAAA;KAC1B,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;CAC/B,KAAK,mBAAmB,CAAC,sBAAsB,GAAG,kBAAkB,CA2CnE,CAAA"}
|
|
@@ -9,7 +9,9 @@ export const LinkHTMLConverterAsync = ({
|
|
|
9
9
|
const children = (await nodesToHTML({
|
|
10
10
|
nodes: node.children
|
|
11
11
|
})).join('');
|
|
12
|
-
|
|
12
|
+
const rel = node.fields.newTab ? 'noopener noreferrer' : undefined;
|
|
13
|
+
const target = node.fields.newTab ? '_blank' : undefined;
|
|
14
|
+
return `<a${providedStyleTag} href="${node.fields.url}" rel=${rel} target=${target}>
|
|
13
15
|
${children}
|
|
14
16
|
</a>`;
|
|
15
17
|
},
|
|
@@ -22,6 +24,8 @@ export const LinkHTMLConverterAsync = ({
|
|
|
22
24
|
const children = (await nodesToHTML({
|
|
23
25
|
nodes: node.children
|
|
24
26
|
})).join('');
|
|
27
|
+
const rel = node.fields.newTab ? 'noopener noreferrer' : undefined;
|
|
28
|
+
const target = node.fields.newTab ? '_blank' : undefined;
|
|
25
29
|
let href = node.fields.url ?? '';
|
|
26
30
|
if (node.fields.linkType === 'internal') {
|
|
27
31
|
if (internalDocToHref) {
|
|
@@ -35,7 +39,7 @@ export const LinkHTMLConverterAsync = ({
|
|
|
35
39
|
;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
|
-
return `<a${providedStyleTag} href="${href}"
|
|
42
|
+
return `<a${providedStyleTag} href="${href}" rel=${rel} target=${target}>
|
|
39
43
|
${children}
|
|
40
44
|
</a>`;
|
|
41
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","names":["LinkHTMLConverterAsync","internalDocToHref","autolink","node","nodesToHTML","providedStyleTag","children","nodes","join","
|
|
1
|
+
{"version":3,"file":"link.js","names":["LinkHTMLConverterAsync","internalDocToHref","autolink","node","nodesToHTML","providedStyleTag","children","nodes","join","rel","fields","newTab","undefined","target","url","link","populate","href","linkType","linkNode","console","error"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/link.ts"],"sourcesContent":["import type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync, HTMLPopulateFn } from '../types.js'\n\nexport const LinkHTMLConverterAsync: (args: {\n internalDocToHref?: (args: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => Promise<string> | string\n}) => HTMLConvertersAsync<SerializedAutoLinkNode | SerializedLinkNode> = ({\n internalDocToHref,\n}) => ({\n autolink: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined\n const target: string | undefined = node.fields.newTab ? '_blank' : undefined\n\n return `<a${providedStyleTag} href=\"${node.fields.url}\" rel=${rel} target=${target}>\n ${children}\n </a>`\n },\n link: async ({ node, nodesToHTML, populate, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined\n const target: string | undefined = node.fields.newTab ? '_blank' : undefined\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n if (internalDocToHref) {\n href = await internalDocToHref({ linkNode: node, populate })\n } else {\n console.error(\n 'Lexical => HTML converter: Link converter: found internal link, but internalDocToHref is not provided',\n )\n href = '#' // fallback\n }\n }\n\n return `<a${providedStyleTag} href=\"${href}\" rel=${rel} target=${target}>\n ${children}\n </a>`\n },\n})\n"],"mappings":"AAGA,OAAO,MAAMA,sBAAA,GAK4DA,CAAC;EACxEC;AAAiB,CAClB,MAAM;EACLC,QAAA,EAAU,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACtD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAA0BN,IAAA,CAAKO,MAAM,CAACC,MAAM,GAAG,wBAAwBC,SAAA;IAC7E,MAAMC,MAAA,GAA6BV,IAAA,CAAKO,MAAM,CAACC,MAAM,GAAG,WAAWC,SAAA;IAEnE,OAAO,KAAKP,gBAAA,UAA0BF,IAAA,CAAKO,MAAM,CAACI,GAAG,SAASL,GAAA,WAAcI,MAAA;UACtEP,QAAA;WACC;EACT;EACAS,IAAA,EAAM,MAAAA,CAAO;IAAEZ,IAAI;IAAEC,WAAW;IAAEY,QAAQ;IAAEX;EAAgB,CAAE;IAC5D,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAA0BN,IAAA,CAAKO,MAAM,CAACC,MAAM,GAAG,wBAAwBC,SAAA;IAC7E,MAAMC,MAAA,GAA6BV,IAAA,CAAKO,MAAM,CAACC,MAAM,GAAG,WAAWC,SAAA;IAEnE,IAAIK,IAAA,GAAed,IAAA,CAAKO,MAAM,CAACI,GAAG,IAAI;IACtC,IAAIX,IAAA,CAAKO,MAAM,CAACQ,QAAQ,KAAK,YAAY;MACvC,IAAIjB,iBAAA,EAAmB;QACrBgB,IAAA,GAAO,MAAMhB,iBAAA,CAAkB;UAAEkB,QAAA,EAAUhB,IAAA;UAAMa;QAAS;MAC5D,OAAO;QACLI,OAAA,CAAQC,KAAK,CACX;QAEFJ,IAAA,GAAO,IAAI;QAAA;MACb;IACF;IAEA,OAAO,KAAKZ,gBAAA,UAA0BY,IAAA,SAAaR,GAAA,WAAcI,MAAA;UAC3DP,QAAA;WACC;EACT;AACF","ignoreList":[]}
|
|
@@ -30,7 +30,7 @@ export const ListHTMLConverterAsync = {
|
|
|
30
30
|
tabIndex="-1"
|
|
31
31
|
value="${node.value}"
|
|
32
32
|
>
|
|
33
|
-
${hasSubLists ? children : `<input${node.checked
|
|
33
|
+
${hasSubLists ? children : `<input checked="${node.checked}" id="${uuid}" readOnly="true" type="checkbox" />
|
|
34
34
|
<label htmlFor="${uuid}">${children}</label>
|
|
35
35
|
<br />`}
|
|
36
36
|
</li>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","names":["v4","uuidv4","ListHTMLConverterAsync","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const ListHTMLConverterAsync: HTMLConvertersAsync<\n SerializedListItemNode | SerializedListNode\n> = {\n list: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n return `<${node.tag}${providedStyleTag} class=\"list-${node.listType}\">${children}</${node.tag}>`\n },\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${node.value}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked
|
|
1
|
+
{"version":3,"file":"list.js","names":["v4","uuidv4","ListHTMLConverterAsync","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const ListHTMLConverterAsync: HTMLConvertersAsync<\n SerializedListItemNode | SerializedListNode\n> = {\n list: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n return `<${node.tag}${providedStyleTag} class=\"list-${node.listType}\">${children}</${node.tag}>`\n },\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${node.value}\"\n >\n ${\n hasSubLists\n ? children\n : `<input checked=\"${node.checked}\" id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${node.value}\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":"AAAA,SAASA,EAAA,IAAMC,MAAM,QAAQ;AAK7B,OAAO,MAAMC,sBAAA,GAET;EACFC,IAAA,EAAM,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAClD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,OAAO,IAAIL,IAAA,CAAKM,GAAG,GAAGJ,gBAAA,gBAAgCF,IAAA,CAAKO,QAAQ,KAAKJ,QAAA,KAAaH,IAAA,CAAKM,GAAG,GAAG;EAClG;EACAE,QAAA,EAAU,MAAAA,CAAO;IAAER,IAAI;IAAEC,WAAW;IAAEQ,MAAM;IAAEC;EAAiB,CAAE;IAC/D,MAAMC,WAAA,GAAcX,IAAA,CAAKG,QAAQ,CAACS,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMX,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,IAAI,cAAcI,MAAA,IAAUA,MAAA,EAAQF,QAAA,KAAa,SAAS;MACxD,MAAMQ,IAAA,GAAOlB,MAAA;MACb,OAAO;0BACaG,IAAA,CAAKgB,OAAO,GAAG,SAAS;qCACbhB,IAAA,CAAKgB,OAAO,GAAG,gCAAgC,kCAAkCL,WAAA,GAAc,oBAAoB;;yCAE/GD,iBAAA;;mBAEtBV,IAAA,CAAKiB,KAAK;;YAGjBN,WAAA,GACIR,QAAA,GACA,mBAAmBH,IAAA,CAAKgB,OAAO,SAASD,IAAA;8BAC1BA,IAAA,KAASZ,QAAA;mBACpB;cAEL;IACV,OAAO;MACL,OAAO;mBACMQ,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DV,IAAA,CAAKiB,KAAK;WAClBd,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,iBAAiB,EAAE,CAAC,IAAI,EAAE;IACrC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,kBAAkB,CAAA;KAAE,KAAK,MAAM,CAAA;CACvE,KAAK,cAAc,CAAC,sBAAsB,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,iBAAiB,EAAE,CAAC,IAAI,EAAE;IACrC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,kBAAkB,CAAA;KAAE,KAAK,MAAM,CAAA;CACvE,KAAK,cAAc,CAAC,sBAAsB,GAAG,kBAAkB,CAqC9D,CAAA"}
|
|
@@ -9,7 +9,9 @@ export const LinkHTMLConverter = ({
|
|
|
9
9
|
const children = nodesToHTML({
|
|
10
10
|
nodes: node.children
|
|
11
11
|
}).join('');
|
|
12
|
-
|
|
12
|
+
const rel = node.fields.newTab ? 'noopener noreferrer' : undefined;
|
|
13
|
+
const target = node.fields.newTab ? '_blank' : undefined;
|
|
14
|
+
return `<a${providedStyleTag} href="${node.fields.url}" rel=${rel} target=${target}>
|
|
13
15
|
${children}
|
|
14
16
|
</a>`;
|
|
15
17
|
},
|
|
@@ -21,6 +23,8 @@ export const LinkHTMLConverter = ({
|
|
|
21
23
|
const children = nodesToHTML({
|
|
22
24
|
nodes: node.children
|
|
23
25
|
}).join('');
|
|
26
|
+
const rel = node.fields.newTab ? 'noopener noreferrer' : undefined;
|
|
27
|
+
const target = node.fields.newTab ? '_blank' : undefined;
|
|
24
28
|
let href = node.fields.url ?? '';
|
|
25
29
|
if (node.fields.linkType === 'internal') {
|
|
26
30
|
if (internalDocToHref) {
|
|
@@ -33,7 +37,7 @@ export const LinkHTMLConverter = ({
|
|
|
33
37
|
;
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
|
-
return `<a${providedStyleTag} href="${href}"
|
|
40
|
+
return `<a${providedStyleTag} href="${href}" rel=${rel} target=${target}>
|
|
37
41
|
${children}
|
|
38
42
|
</a>`;
|
|
39
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","names":["LinkHTMLConverter","internalDocToHref","autolink","node","nodesToHTML","providedStyleTag","children","nodes","join","
|
|
1
|
+
{"version":3,"file":"link.js","names":["LinkHTMLConverter","internalDocToHref","autolink","node","nodesToHTML","providedStyleTag","children","nodes","join","rel","fields","newTab","undefined","target","url","link","href","linkType","linkNode","console","error"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/link.ts"],"sourcesContent":["import type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nexport const LinkHTMLConverter: (args: {\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string\n}) => HTMLConverters<SerializedAutoLinkNode | SerializedLinkNode> = ({ internalDocToHref }) => ({\n autolink: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined\n const target: string | undefined = node.fields.newTab ? '_blank' : undefined\n\n return `<a${providedStyleTag} href=\"${node.fields.url}\" rel=${rel} target=${target}>\n ${children}\n </a>`\n },\n link: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined\n const target: string | undefined = node.fields.newTab ? '_blank' : undefined\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n if (internalDocToHref) {\n href = internalDocToHref({ linkNode: node })\n } else {\n console.error(\n 'Lexical => HTML converter: Link converter: found internal link, but internalDocToHref is not provided',\n )\n href = '#' // fallback\n }\n }\n\n return `<a${providedStyleTag} href=\"${href}\" rel=${rel} target=${target}>\n ${children}\n </a>`\n },\n})\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAA,GAEuDA,CAAC;EAAEC;AAAiB,CAAE,MAAM;EAC9FC,QAAA,EAAUA,CAAC;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAChD,MAAMC,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,MAAMC,GAAA,GAA0BN,IAAA,CAAKO,MAAM,CAACC,MAAM,GAAG,wBAAwBC,SAAA;IAC7E,MAAMC,MAAA,GAA6BV,IAAA,CAAKO,MAAM,CAACC,MAAM,GAAG,WAAWC,SAAA;IAEnE,OAAO,KAAKP,gBAAA,UAA0BF,IAAA,CAAKO,MAAM,CAACI,GAAG,SAASL,GAAA,WAAcI,MAAA;UACtEP,QAAA;WACC;EACT;EACAS,IAAA,EAAMA,CAAC;IAAEZ,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAC5C,MAAMC,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,MAAMC,GAAA,GAA0BN,IAAA,CAAKO,MAAM,CAACC,MAAM,GAAG,wBAAwBC,SAAA;IAC7E,MAAMC,MAAA,GAA6BV,IAAA,CAAKO,MAAM,CAACC,MAAM,GAAG,WAAWC,SAAA;IAEnE,IAAII,IAAA,GAAeb,IAAA,CAAKO,MAAM,CAACI,GAAG,IAAI;IACtC,IAAIX,IAAA,CAAKO,MAAM,CAACO,QAAQ,KAAK,YAAY;MACvC,IAAIhB,iBAAA,EAAmB;QACrBe,IAAA,GAAOf,iBAAA,CAAkB;UAAEiB,QAAA,EAAUf;QAAK;MAC5C,OAAO;QACLgB,OAAA,CAAQC,KAAK,CACX;QAEFJ,IAAA,GAAO,IAAI;QAAA;MACb;IACF;IAEA,OAAO,KAAKX,gBAAA,UAA0BW,IAAA,SAAaP,GAAA,WAAcI,MAAA;UAC3DP,QAAA;WACC;EACT;AACF","ignoreList":[]}
|
|
@@ -30,7 +30,7 @@ export const ListHTMLConverter = {
|
|
|
30
30
|
tabIndex="-1"
|
|
31
31
|
value="${node.value}"
|
|
32
32
|
>
|
|
33
|
-
${hasSubLists ? children : `<input${node.checked
|
|
33
|
+
${hasSubLists ? children : `<input checked="${node.checked}" id="${uuid}" readOnly="true" type="checkbox" />
|
|
34
34
|
<label htmlFor="${uuid}">${children}</label>
|
|
35
35
|
<br />`}
|
|
36
36
|
</li>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","names":["v4","uuidv4","ListHTMLConverter","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nexport const ListHTMLConverter: HTMLConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n return `<${node.tag}${providedStyleTag} class=\"list-${node.listType}\">${children}</${node.tag}>`\n },\n listitem: ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${node.value}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked
|
|
1
|
+
{"version":3,"file":"list.js","names":["v4","uuidv4","ListHTMLConverter","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nexport const ListHTMLConverter: HTMLConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n return `<${node.tag}${providedStyleTag} class=\"list-${node.listType}\">${children}</${node.tag}>`\n },\n listitem: ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${node.value}\"\n >\n ${\n hasSubLists\n ? children\n : `<input checked=\"${node.checked}\" id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${node.value}\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":"AAAA,SAASA,EAAA,IAAMC,MAAM,QAAQ;AAK7B,OAAO,MAAMC,iBAAA,GAAiF;EAC5FC,IAAA,EAAMA,CAAC;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAC5C,MAAMC,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,OAAO,IAAIL,IAAA,CAAKM,GAAG,GAAGJ,gBAAA,gBAAgCF,IAAA,CAAKO,QAAQ,KAAKJ,QAAA,KAAaH,IAAA,CAAKM,GAAG,GAAG;EAClG;EACAE,QAAA,EAAUA,CAAC;IAAER,IAAI;IAAEC,WAAW;IAAEQ,MAAM;IAAEC;EAAiB,CAAE;IACzD,MAAMC,WAAA,GAAcX,IAAA,CAAKG,QAAQ,CAACS,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMX,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,IAAI,cAAcI,MAAA,IAAUA,MAAA,EAAQF,QAAA,KAAa,SAAS;MACxD,MAAMQ,IAAA,GAAOlB,MAAA;MACb,OAAO;0BACaG,IAAA,CAAKgB,OAAO,GAAG,SAAS;qCACbhB,IAAA,CAAKgB,OAAO,GAAG,gCAAgC,kCAAkCL,WAAA,GAAc,oBAAoB;;yCAE/GD,iBAAA;;mBAEtBV,IAAA,CAAKiB,KAAK;;YAGjBN,WAAA,GACIR,QAAA,GACA,mBAAmBH,IAAA,CAAKgB,OAAO,SAASD,IAAA;8BAC1BA,IAAA,KAASZ,QAAA;mBACpB;cAEL;IACV,OAAO;MACL,OAAO;mBACMQ,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DV,IAAA,CAAKiB,KAAK;WAClBd,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/link/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,KAAK,EACL,kBAAkB,EAElB,eAAe,EAChB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAarD,MAAM,MAAM,6BAA6B,GACrC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;IAGtC,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAA;CACtC,CAAA;AAEL,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,cAA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HAgMtB,CAAA"}
|
|
@@ -95,11 +95,13 @@ export const LinkFeature = createServerFeature({
|
|
|
95
95
|
req,
|
|
96
96
|
showHiddenFields
|
|
97
97
|
});
|
|
98
|
+
const rel = node.fields.newTab ? ' rel="noopener noreferrer"' : '';
|
|
99
|
+
const target = node.fields.newTab ? ' target="_blank"' : '';
|
|
98
100
|
let href = node.fields.url ?? '';
|
|
99
101
|
if (node.fields.linkType === 'internal') {
|
|
100
102
|
href = typeof node.fields.doc?.value !== 'object' ? String(node.fields.doc?.value) : String(node.fields.doc?.value?.id);
|
|
101
103
|
}
|
|
102
|
-
return `<a href="${href}"${
|
|
104
|
+
return `<a href="${href}"${target}${rel}>${childrenText}</a>`;
|
|
103
105
|
},
|
|
104
106
|
nodeTypes: [AutoLinkNode.getType()]
|
|
105
107
|
}
|
|
@@ -135,8 +137,10 @@ export const LinkFeature = createServerFeature({
|
|
|
135
137
|
req,
|
|
136
138
|
showHiddenFields
|
|
137
139
|
});
|
|
140
|
+
const rel = node.fields.newTab ? ' rel="noopener noreferrer"' : '';
|
|
141
|
+
const target = node.fields.newTab ? ' target="_blank"' : '';
|
|
138
142
|
const href = node.fields.linkType === 'custom' ? escapeHTML(node.fields.url) : node.fields.doc?.value;
|
|
139
|
-
return `<a href="${href}"${
|
|
143
|
+
return `<a href="${href}"${target}${rel}>${childrenText}</a>`;
|
|
140
144
|
},
|
|
141
145
|
nodeTypes: [LinkNode.getType()]
|
|
142
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["escapeHTML","sanitizeFields","createServerFeature","convertLexicalNodesToHTML","createNode","LinkMarkdownTransformer","AutoLinkNode","LinkNode","linkPopulationPromiseHOC","i18n","transformExtraFields","linkValidation","LinkFeature","feature","config","_config","isRoot","parentIsLocalized","props","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","maxDepth","sanitizedFields","requireFieldLevelRichTextEditor","sanitizedFieldsWithoutText","filter","field","name","linkTypeField","linkURLField","defaultLinkType","defaultValue","undefined","defaultLinkURL","ClientFeature","clientFeatureProps","disableAutoLinks","generateSchemaMap","Array","isArray","length","schemaMap","Map","set","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","href","url","linkType","doc","value","String","id","newTab","nodeTypes","getType","validations","getSubFields","getSubFieldsData","graphQLPopulationPromises","Boolean","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/link/server/index.ts"],"sourcesContent":["import type {\n CollectionSlug,\n Config,\n Field,\n FieldAffectingData,\n FieldSchemaMap,\n SanitizedConfig,\n} from 'payload'\n\nimport escapeHTML from 'escape-html'\nimport { sanitizeFields } from 'payload'\n\nimport type { NodeWithHooks } from '../../typesServer.js'\nimport type { ClientProps } from '../client/index.js'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/lexicalToHtml_deprecated/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { LinkMarkdownTransformer } from '../markdownTransformer.js'\nimport { AutoLinkNode } from '../nodes/AutoLinkNode.js'\nimport { LinkNode } from '../nodes/LinkNode.js'\nimport { linkPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { transformExtraFields } from './transformExtraFields.js'\nimport { linkValidation } from './validate.js'\n\nexport type ExclusiveLinkCollectionsProps =\n | {\n /**\n * The collections that should be disabled for internal linking. Overrides the `enableRichTextLink` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: CollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled for internal linking. Overrides the `enableRichTextLink` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: CollectionSlug[]\n }\n\nexport type LinkFeatureServerProps = {\n /**\n * Disables the automatic creation of links from URLs pasted into the editor, as well\n * as auto link nodes.\n *\n * If set to 'creationOnly', only the creation of new auto link nodes will be disabled.\n * Existing auto link nodes will still be editable.\n *\n * @default false\n */\n disableAutoLinks?: 'creationOnly' | true\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldAffectingData[]\n }) => (Field | FieldAffectingData)[])\n | Field[]\n /**\n * Sets a maximum population depth for the internal doc default field of link, regardless of the remaining depth when the field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveLinkCollectionsProps\n\nexport const LinkFeature = createServerFeature<\n LinkFeatureServerProps,\n LinkFeatureServerProps,\n ClientProps\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = {}\n }\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n const _transformedFields = transformExtraFields(\n props.fields ? props.fields : null,\n _config,\n props.enabledCollections,\n props.disabledCollections,\n props.maxDepth,\n )\n\n const sanitizedFields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: _transformedFields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n props.fields = sanitizedFields\n\n // the text field is not included in the node data.\n // Thus, for tasks like validation, we do not want to pass it a text field in the schema which will never have data.\n // Otherwise, it will cause a validation error (field is required).\n const sanitizedFieldsWithoutText = sanitizedFields.filter(\n (field) => !('name' in field) || field.name !== 'text',\n )\n\n let linkTypeField: Field | null = null\n let linkURLField: Field | null = null\n\n for (const field of sanitizedFields) {\n if ('name' in field && field.name === 'linkType') {\n linkTypeField = field\n }\n\n if ('name' in field && field.name === 'url') {\n linkURLField = field\n }\n }\n\n const defaultLinkType = linkTypeField\n ? 'defaultValue' in linkTypeField && typeof linkTypeField.defaultValue === 'string'\n ? linkTypeField.defaultValue\n : 'custom'\n : undefined\n\n const defaultLinkURL = linkURLField\n ? 'defaultValue' in linkURLField && typeof linkURLField.defaultValue === 'string'\n ? linkURLField.defaultValue\n : 'https://'\n : undefined\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#LinkFeatureClient',\n clientFeatureProps: {\n defaultLinkType,\n defaultLinkURL,\n disableAutoLinks: props.disableAutoLinks,\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ClientProps,\n generateSchemaMap: () => {\n if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n schemaMap.set('fields', {\n fields: sanitizedFields,\n })\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [LinkMarkdownTransformer],\n nodes: [\n props?.disableAutoLinks === true\n ? null\n : createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n href =\n typeof node.fields.doc?.value !== 'object'\n ? String(node.fields.doc?.value)\n : String(node.fields.doc?.value?.id)\n }\n\n return `<a href=\"${href}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>${childrenText}</a>`\n },\n nodeTypes: [AutoLinkNode.getType()],\n },\n },\n node: AutoLinkNode,\n // Since AutoLinkNodes are just internal links, they need no hooks or graphQL population promises\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n const href: string =\n node.fields.linkType === 'custom'\n ? escapeHTML(node.fields.url)\n : (node.fields.doc?.value as string)\n\n return `<a href=\"${href}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>${childrenText}</a>`\n },\n nodeTypes: [LinkNode.getType()],\n },\n },\n getSubFields: () => {\n return sanitizedFieldsWithoutText\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [linkPopulationPromiseHOC(props)],\n node: LinkNode,\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n ].filter(Boolean) as Array<NodeWithHooks>,\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'link',\n})\n"],"mappings":"AASA,OAAOA,UAAA,MAAgB;AACvB,SAASC,cAAc,QAAQ;AAK/B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,uBAAuB,QAAQ;AACxC,SAASC,YAAY,QAAQ;AAC7B,SAASC,QAAQ,QAAQ;AACzB,SAASC,wBAAwB,QAAQ;AACzC,SAASC,IAAI,QAAQ;AACrB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,cAAc,QAAQ;AAsD/B,OAAO,MAAMC,WAAA,GAAcV,mBAAA,CAIzB;EACAW,OAAA,EAAS,MAAAA,CAAO;IAAEC,MAAA,EAAQC,OAAO;IAAEC,MAAM;IAAEC,iBAAiB;IAAEC;EAAK,CAAE;IACnE,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ,CAAC;IACX;IACA,MAAMC,kBAAA,GAAqBJ,OAAA,CAAQK,WAAW,CAACC,GAAG,CAAEC,CAAA,IAAMA,CAAA,CAAEC,IAAI,KAAK,EAAE;IAEvE,MAAMC,kBAAA,GAA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QACf;QACAuD,yBAAA,EAA2B,CAACxE,wBAAA,CAAyBU,KAAA,EAAO;QAC5DyC,IAAA,EAAMpD,QAAA;QACNsE,WAAA,EAAa,CAAClE,cAAA,CAAeO,KAAA,EAAOa,0BAAA;MACtC,GACD,CAACC,MAAM,CAACiD,OAAA;MACTC,2BAAA,EAA6BhE;IAC/B;EACF;EACAiE,GAAA,EAAK;AACP","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["escapeHTML","sanitizeFields","createServerFeature","convertLexicalNodesToHTML","createNode","LinkMarkdownTransformer","AutoLinkNode","LinkNode","linkPopulationPromiseHOC","i18n","transformExtraFields","linkValidation","LinkFeature","feature","config","_config","isRoot","parentIsLocalized","props","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","maxDepth","sanitizedFields","requireFieldLevelRichTextEditor","sanitizedFieldsWithoutText","filter","field","name","linkTypeField","linkURLField","defaultLinkType","defaultValue","undefined","defaultLinkURL","ClientFeature","clientFeatureProps","disableAutoLinks","generateSchemaMap","Array","isArray","length","schemaMap","Map","set","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","rel","newTab","target","href","url","linkType","doc","value","String","id","nodeTypes","getType","validations","getSubFields","getSubFieldsData","graphQLPopulationPromises","Boolean","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/link/server/index.ts"],"sourcesContent":["import type {\n CollectionSlug,\n Config,\n Field,\n FieldAffectingData,\n FieldSchemaMap,\n SanitizedConfig,\n} from 'payload'\n\nimport escapeHTML from 'escape-html'\nimport { sanitizeFields } from 'payload'\n\nimport type { NodeWithHooks } from '../../typesServer.js'\nimport type { ClientProps } from '../client/index.js'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/lexicalToHtml_deprecated/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { LinkMarkdownTransformer } from '../markdownTransformer.js'\nimport { AutoLinkNode } from '../nodes/AutoLinkNode.js'\nimport { LinkNode } from '../nodes/LinkNode.js'\nimport { linkPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { transformExtraFields } from './transformExtraFields.js'\nimport { linkValidation } from './validate.js'\n\nexport type ExclusiveLinkCollectionsProps =\n | {\n /**\n * The collections that should be disabled for internal linking. Overrides the `enableRichTextLink` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: CollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled for internal linking. Overrides the `enableRichTextLink` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: CollectionSlug[]\n }\n\nexport type LinkFeatureServerProps = {\n /**\n * Disables the automatic creation of links from URLs pasted into the editor, as well\n * as auto link nodes.\n *\n * If set to 'creationOnly', only the creation of new auto link nodes will be disabled.\n * Existing auto link nodes will still be editable.\n *\n * @default false\n */\n disableAutoLinks?: 'creationOnly' | true\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldAffectingData[]\n }) => (Field | FieldAffectingData)[])\n | Field[]\n /**\n * Sets a maximum population depth for the internal doc default field of link, regardless of the remaining depth when the field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveLinkCollectionsProps\n\nexport const LinkFeature = createServerFeature<\n LinkFeatureServerProps,\n LinkFeatureServerProps,\n ClientProps\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = {}\n }\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n const _transformedFields = transformExtraFields(\n props.fields ? props.fields : null,\n _config,\n props.enabledCollections,\n props.disabledCollections,\n props.maxDepth,\n )\n\n const sanitizedFields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: _transformedFields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n props.fields = sanitizedFields\n\n // the text field is not included in the node data.\n // Thus, for tasks like validation, we do not want to pass it a text field in the schema which will never have data.\n // Otherwise, it will cause a validation error (field is required).\n const sanitizedFieldsWithoutText = sanitizedFields.filter(\n (field) => !('name' in field) || field.name !== 'text',\n )\n\n let linkTypeField: Field | null = null\n let linkURLField: Field | null = null\n\n for (const field of sanitizedFields) {\n if ('name' in field && field.name === 'linkType') {\n linkTypeField = field\n }\n\n if ('name' in field && field.name === 'url') {\n linkURLField = field\n }\n }\n\n const defaultLinkType = linkTypeField\n ? 'defaultValue' in linkTypeField && typeof linkTypeField.defaultValue === 'string'\n ? linkTypeField.defaultValue\n : 'custom'\n : undefined\n\n const defaultLinkURL = linkURLField\n ? 'defaultValue' in linkURLField && typeof linkURLField.defaultValue === 'string'\n ? linkURLField.defaultValue\n : 'https://'\n : undefined\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#LinkFeatureClient',\n clientFeatureProps: {\n defaultLinkType,\n defaultLinkURL,\n disableAutoLinks: props.disableAutoLinks,\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ClientProps,\n generateSchemaMap: () => {\n if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n schemaMap.set('fields', {\n fields: sanitizedFields,\n })\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [LinkMarkdownTransformer],\n nodes: [\n props?.disableAutoLinks === true\n ? null\n : createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n const target: string = node.fields.newTab ? ' target=\"_blank\"' : ''\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n href =\n typeof node.fields.doc?.value !== 'object'\n ? String(node.fields.doc?.value)\n : String(node.fields.doc?.value?.id)\n }\n\n return `<a href=\"${href}\"${target}${rel}>${childrenText}</a>`\n },\n nodeTypes: [AutoLinkNode.getType()],\n },\n },\n node: AutoLinkNode,\n // Since AutoLinkNodes are just internal links, they need no hooks or graphQL population promises\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n const target: string = node.fields.newTab ? ' target=\"_blank\"' : ''\n\n const href: string =\n node.fields.linkType === 'custom'\n ? escapeHTML(node.fields.url)\n : (node.fields.doc?.value as string)\n\n return `<a href=\"${href}\"${target}${rel}>${childrenText}</a>`\n },\n nodeTypes: [LinkNode.getType()],\n },\n },\n getSubFields: () => {\n return sanitizedFieldsWithoutText\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [linkPopulationPromiseHOC(props)],\n node: LinkNode,\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n ].filter(Boolean) as Array<NodeWithHooks>,\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'link',\n})\n"],"mappings":"AASA,OAAOA,UA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