@payloadcms/richtext-lexical 3.57.0-internal.98b3a35 → 3.57.0-internal.d758c66
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/{Field-D5RCNN4A.js → Field-PKJPWZJL.js} +2 -2
- package/dist/exports/client/Field-PKJPWZJL.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/index.js +10 -10
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/align/server/i18n.d.ts.map +1 -1
- package/dist/features/align/server/i18n.js +0 -6
- package/dist/features/align/server/i18n.js.map +1 -1
- package/dist/features/blockquote/server/i18n.d.ts.map +1 -1
- package/dist/features/blockquote/server/i18n.js +0 -3
- package/dist/features/blockquote/server/i18n.js.map +1 -1
- package/dist/features/blocks/server/i18n.d.ts.map +1 -1
- package/dist/features/blocks/server/i18n.js +0 -9
- package/dist/features/blocks/server/i18n.js.map +1 -1
- package/dist/features/heading/server/i18n.d.ts.map +1 -1
- package/dist/features/heading/server/i18n.js +0 -3
- package/dist/features/heading/server/i18n.js.map +1 -1
- package/dist/features/horizontalRule/server/i18n.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/i18n.js +0 -3
- package/dist/features/horizontalRule/server/i18n.js.map +1 -1
- package/dist/features/indent/server/i18n.d.ts.map +1 -1
- package/dist/features/indent/server/i18n.js +0 -4
- package/dist/features/indent/server/i18n.js.map +1 -1
- package/dist/features/link/server/i18n.d.ts.map +1 -1
- package/dist/features/link/server/i18n.js +0 -4
- package/dist/features/link/server/i18n.js.map +1 -1
- package/dist/features/lists/checklist/server/i18n.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/i18n.js +0 -3
- package/dist/features/lists/checklist/server/i18n.js.map +1 -1
- package/dist/features/lists/orderedList/server/i18n.d.ts.map +1 -1
- package/dist/features/lists/orderedList/server/i18n.js +0 -3
- package/dist/features/lists/orderedList/server/i18n.js.map +1 -1
- package/dist/features/lists/unorderedList/server/i18n.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/i18n.js +0 -3
- package/dist/features/lists/unorderedList/server/i18n.js.map +1 -1
- package/dist/features/paragraph/server/i18n.d.ts.map +1 -1
- package/dist/features/paragraph/server/i18n.js +0 -4
- package/dist/features/paragraph/server/i18n.js.map +1 -1
- package/dist/features/relationship/server/i18n.d.ts.map +1 -1
- package/dist/features/relationship/server/i18n.js +0 -3
- package/dist/features/relationship/server/i18n.js.map +1 -1
- package/dist/features/textState/i18n.d.ts.map +1 -1
- package/dist/features/textState/i18n.js +0 -3
- package/dist/features/textState/i18n.js.map +1 -1
- package/dist/features/upload/client/index.d.ts.map +1 -1
- package/dist/features/upload/client/index.js +1 -2
- package/dist/features/upload/client/index.js.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts +7 -2
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js +27 -3
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts +0 -6
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +22 -293
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/i18n.d.ts.map +1 -1
- package/dist/features/upload/server/i18n.js +0 -3
- package/dist/features/upload/server/i18n.js.map +1 -1
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +1 -4
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -0
- package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js +37 -3
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +1 -1
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +0 -6
- package/dist/i18n.js.map +1 -1
- package/package.json +6 -6
- package/dist/exports/client/Field-D5RCNN4A.js.map +0 -7
- package/dist/exports/client/pendingComponent-WFSCE6LJ.js +0 -2
- package/dist/exports/client/pendingComponent-WFSCE6LJ.js.map +0 -7
- package/dist/features/upload/client/nodes/PendingUploadNode.d.ts +0 -17
- package/dist/features/upload/client/nodes/PendingUploadNode.d.ts.map +0 -1
- package/dist/features/upload/client/nodes/PendingUploadNode.js +0 -57
- package/dist/features/upload/client/nodes/PendingUploadNode.js.map +0 -1
- package/dist/features/upload/client/pendingComponent/index.d.ts +0 -7
- package/dist/features/upload/client/pendingComponent/index.d.ts.map +0 -1
- package/dist/features/upload/client/pendingComponent/index.js +0 -14
- package/dist/features/upload/client/pendingComponent/index.js.map +0 -1
- package/dist/features/upload/server/nodes/PendingUploadNode.d.ts +0 -42
- package/dist/features/upload/server/nodes/PendingUploadNode.d.ts.map +0 -1
- package/dist/features/upload/server/nodes/PendingUploadNode.js +0 -93
- package/dist/features/upload/server/nodes/PendingUploadNode.js.map +0 -1
- package/dist/features/upload/server/nodes/conversions.d.ts +0 -9
- package/dist/features/upload/server/nodes/conversions.d.ts.map +0 -1
- package/dist/features/upload/server/nodes/conversions.js +0 -53
- package/dist/features/upload/server/nodes/conversions.js.map +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PendingUploadData } from '../../server/nodes/PendingUploadNode.js';
|
|
2
|
-
import '../component/index.scss';
|
|
3
|
-
export declare const PendingUploadComponent: (props: {
|
|
4
|
-
data: PendingUploadData;
|
|
5
|
-
nodeKey: string;
|
|
6
|
-
}) => React.ReactNode;
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/pendingComponent/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAEhF,OAAO,yBAAyB,CAAA;AAEhC,eAAO,MAAM,sBAAsB,UAAW;IAC5C,IAAI,EAAE,iBAAiB,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;CAChB,KAAG,KAAK,CAAC,SAMT,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
import { ShimmerEffect } from '@payloadcms/ui';
|
|
5
|
-
export const PendingUploadComponent = props => {
|
|
6
|
-
return /*#__PURE__*/_jsx("div", {
|
|
7
|
-
className: 'lexical-upload',
|
|
8
|
-
children: /*#__PURE__*/_jsx(ShimmerEffect, {
|
|
9
|
-
height: '95px',
|
|
10
|
-
width: '203px'
|
|
11
|
-
})
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ShimmerEffect","PendingUploadComponent","props","_jsx","className","height","width"],"sources":["../../../../../src/features/upload/client/pendingComponent/index.tsx"],"sourcesContent":["'use client'\n\nimport { ShimmerEffect } from '@payloadcms/ui'\n\nimport type { PendingUploadData } from '../../server/nodes/PendingUploadNode.js'\n\nimport '../component/index.scss'\n\nexport const PendingUploadComponent = (props: {\n data: PendingUploadData\n nodeKey: string\n}): React.ReactNode => {\n return (\n <div className={'lexical-upload'}>\n <ShimmerEffect height={'95px'} width={'203px'} />\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAEA,SAASA,aAAa,QAAQ;AAM9B,OAAO,MAAMC,sBAAA,GAA0BC,KAAA;EAIrC,oBACEC,IAAA,CAAC;IAAIC,SAAA,EAAW;cACd,aAAAD,IAAA,CAACH,aAAA;MAAcK,MAAA,EAAQ;MAAQC,KAAA,EAAO;;;AAG5C","ignoreList":[]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
|
|
2
|
-
import type { DOMConversionMap, DOMExportOutput, ElementFormatType, LexicalNode, NodeKey, Spread } from 'lexical';
|
|
3
|
-
import type { JSX } from 'react';
|
|
4
|
-
import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
|
|
5
|
-
export type PendingUploadData = {
|
|
6
|
-
/**
|
|
7
|
-
* ID that corresponds to the bulk upload form ID
|
|
8
|
-
*/
|
|
9
|
-
formID: string;
|
|
10
|
-
/**
|
|
11
|
-
* src value of the image dom element
|
|
12
|
-
*/
|
|
13
|
-
src: string;
|
|
14
|
-
};
|
|
15
|
-
export type SerializedPendingUploadNode = {
|
|
16
|
-
children?: never;
|
|
17
|
-
type: 'pendingUpload';
|
|
18
|
-
} & Spread<PendingUploadData, SerializedDecoratorBlockNode>;
|
|
19
|
-
export declare class PendingUploadServerNode extends DecoratorBlockNode {
|
|
20
|
-
__data: PendingUploadData;
|
|
21
|
-
constructor({ data, format, key, }: {
|
|
22
|
-
data: PendingUploadData;
|
|
23
|
-
format?: ElementFormatType;
|
|
24
|
-
key?: NodeKey;
|
|
25
|
-
});
|
|
26
|
-
static clone(node: PendingUploadServerNode): PendingUploadServerNode;
|
|
27
|
-
static getType(): string;
|
|
28
|
-
static importDOM(): DOMConversionMap<HTMLImageElement>;
|
|
29
|
-
static importJSON(serializedNode: SerializedPendingUploadNode): PendingUploadServerNode;
|
|
30
|
-
static isInline(): false;
|
|
31
|
-
decorate(): JSX.Element;
|
|
32
|
-
exportDOM(): DOMExportOutput;
|
|
33
|
-
exportJSON(): SerializedPendingUploadNode;
|
|
34
|
-
getData(): PendingUploadData;
|
|
35
|
-
setData(data: PendingUploadData): void;
|
|
36
|
-
updateDOM(): false;
|
|
37
|
-
}
|
|
38
|
-
export declare function $createPendingUploadServerNode({ data, }: {
|
|
39
|
-
data: PendingUploadData;
|
|
40
|
-
}): PendingUploadServerNode;
|
|
41
|
-
export declare function $isPendingUploadServerNode(node: LexicalNode | null | undefined): node is PendingUploadServerNode;
|
|
42
|
-
//# sourceMappingURL=PendingUploadNode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PendingUploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/server/nodes/PendingUploadNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAMhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,IAAI,EAAE,eAAe,CAAA;CACtB,GAAG,MAAM,CAAC,iBAAiB,EAAE,4BAA4B,CAAC,CAAA;AAE3D,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D,MAAM,EAAE,iBAAiB,CAAA;gBAEb,EACV,IAAI,EACJ,MAAM,EACN,GAAG,GACJ,EAAE;QACD,IAAI,EAAE,iBAAiB,CAAA;QACvB,MAAM,CAAC,EAAE,iBAAiB,CAAA;QAC1B,GAAG,CAAC,EAAE,OAAO,CAAA;KACd;WAKe,KAAK,CAAC,IAAI,EAAE,uBAAuB,GAAG,uBAAuB;WAQ7D,OAAO,IAAI,MAAM;WAIjB,SAAS,IAAI,gBAAgB,CAAC,gBAAgB,CAAC;WAU/C,UAAU,CAAC,cAAc,EAAE,2BAA2B,GAAG,uBAAuB;IAYhG,MAAM,CAAC,QAAQ,IAAI,KAAK;IAIf,QAAQ,IAAI,GAAG,CAAC,OAAO;IAKvB,SAAS,IAAI,eAAe;IAQ5B,UAAU,IAAI,2BAA2B;IASlD,OAAO,IAAI,iBAAiB;IAI5B,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI;IAK7B,SAAS,IAAI,KAAK;CAG5B;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,IAAI,GACL,EAAE;IACD,IAAI,EAAE,iBAAiB,CAAA;CACxB,GAAG,uBAAuB,CAE1B;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,uBAAuB,CAEjC"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
|
|
3
|
-
import { $applyNodeReplacement } from 'lexical';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { $convertPendingUploadElement } from './conversions.js';
|
|
6
|
-
export class PendingUploadServerNode extends DecoratorBlockNode {
|
|
7
|
-
__data;
|
|
8
|
-
constructor({
|
|
9
|
-
data,
|
|
10
|
-
format,
|
|
11
|
-
key
|
|
12
|
-
}) {
|
|
13
|
-
super(format, key);
|
|
14
|
-
this.__data = data;
|
|
15
|
-
}
|
|
16
|
-
static clone(node) {
|
|
17
|
-
return new this({
|
|
18
|
-
data: node.__data,
|
|
19
|
-
format: node.__format,
|
|
20
|
-
key: node.__key
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
static getType() {
|
|
24
|
-
return 'pendingUpload';
|
|
25
|
-
}
|
|
26
|
-
static importDOM() {
|
|
27
|
-
return {
|
|
28
|
-
img: node => ({
|
|
29
|
-
conversion: domNode => $convertPendingUploadElement(domNode, $createPendingUploadServerNode),
|
|
30
|
-
priority: 0
|
|
31
|
-
})
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
static importJSON(serializedNode) {
|
|
35
|
-
const importedData = {
|
|
36
|
-
formID: serializedNode.formID,
|
|
37
|
-
src: serializedNode.src
|
|
38
|
-
};
|
|
39
|
-
const node = $createPendingUploadServerNode({
|
|
40
|
-
data: importedData
|
|
41
|
-
});
|
|
42
|
-
node.setFormat(serializedNode.format);
|
|
43
|
-
return node;
|
|
44
|
-
}
|
|
45
|
-
static isInline() {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
decorate() {
|
|
49
|
-
// @ts-expect-error
|
|
50
|
-
return /*#__PURE__*/_jsx(RawUploadComponent, {
|
|
51
|
-
data: this.__data,
|
|
52
|
-
format: this.__format,
|
|
53
|
-
nodeKey: this.getKey()
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
exportDOM() {
|
|
57
|
-
const element = document.createElement('img');
|
|
58
|
-
element.setAttribute('data-lexical-pending-upload-form-id', String(this.__data?.formID));
|
|
59
|
-
element.setAttribute('src', this.__data?.src || '');
|
|
60
|
-
return {
|
|
61
|
-
element
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
exportJSON() {
|
|
65
|
-
return {
|
|
66
|
-
...super.exportJSON(),
|
|
67
|
-
...this.getData(),
|
|
68
|
-
type: 'pendingUpload',
|
|
69
|
-
version: 1
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
getData() {
|
|
73
|
-
return this.getLatest().__data;
|
|
74
|
-
}
|
|
75
|
-
setData(data) {
|
|
76
|
-
const writable = this.getWritable();
|
|
77
|
-
writable.__data = data;
|
|
78
|
-
}
|
|
79
|
-
updateDOM() {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
export function $createPendingUploadServerNode({
|
|
84
|
-
data
|
|
85
|
-
}) {
|
|
86
|
-
return $applyNodeReplacement(new PendingUploadServerNode({
|
|
87
|
-
data
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
export function $isPendingUploadServerNode(node) {
|
|
91
|
-
return node instanceof PendingUploadServerNode;
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=PendingUploadNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PendingUploadNode.js","names":["DecoratorBlockNode","$applyNodeReplacement","React","$convertPendingUploadElement","PendingUploadServerNode","__data","constructor","data","format","key","clone","node","__format","__key","getType","importDOM","img","conversion","domNode","$createPendingUploadServerNode","priority","importJSON","serializedNode","importedData","formID","src","setFormat","isInline","decorate","_jsx","RawUploadComponent","nodeKey","getKey","exportDOM","element","document","createElement","setAttribute","String","exportJSON","getData","type","version","getLatest","setData","writable","getWritable","updateDOM","$isPendingUploadServerNode"],"sources":["../../../../../src/features/upload/server/nodes/PendingUploadNode.tsx"],"sourcesContent":["import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMExportOutput,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nimport { $convertPendingUploadElement } from './conversions.js'\n\nexport type PendingUploadData = {\n /**\n * ID that corresponds to the bulk upload form ID\n */\n formID: string\n /**\n * src value of the image dom element\n */\n src: string\n}\n\nexport type SerializedPendingUploadNode = {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'pendingUpload'\n} & Spread<PendingUploadData, SerializedDecoratorBlockNode>\n\nexport class PendingUploadServerNode extends DecoratorBlockNode {\n __data: PendingUploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: PendingUploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static override clone(node: PendingUploadServerNode): PendingUploadServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'pendingUpload'\n }\n\n static override importDOM(): DOMConversionMap<HTMLImageElement> {\n return {\n img: (node) => ({\n conversion: (domNode) =>\n $convertPendingUploadElement(domNode, $createPendingUploadServerNode),\n priority: 0,\n }),\n }\n }\n\n static override importJSON(serializedNode: SerializedPendingUploadNode): PendingUploadServerNode {\n const importedData: PendingUploadData = {\n formID: serializedNode.formID,\n src: serializedNode.src,\n }\n\n const node = $createPendingUploadServerNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override decorate(): JSX.Element {\n // @ts-expect-error\n return <RawUploadComponent data={this.__data} format={this.__format} nodeKey={this.getKey()} />\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n element.setAttribute('data-lexical-pending-upload-form-id', String(this.__data?.formID))\n element.setAttribute('src', this.__data?.src || '')\n\n return { element }\n }\n\n override exportJSON(): SerializedPendingUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'pendingUpload',\n version: 1,\n }\n }\n\n getData(): PendingUploadData {\n return this.getLatest().__data\n }\n\n setData(data: PendingUploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n override updateDOM(): false {\n return false\n }\n}\n\nexport function $createPendingUploadServerNode({\n data,\n}: {\n data: PendingUploadData\n}): PendingUploadServerNode {\n return $applyNodeReplacement(new PendingUploadServerNode({ data }))\n}\n\nexport function $isPendingUploadServerNode(\n node: LexicalNode | null | undefined,\n): node is PendingUploadServerNode {\n return node instanceof PendingUploadServerNode\n}\n"],"mappings":";AAWA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,qBAAqB,QAAQ;AACtC,YAAYC,KAAA,MAAW;AAEvB,SAASC,4BAA4B,QAAQ;AAkB7C,OAAO,MAAMC,uBAAA,SAAgCJ,kBAAA;EAC3CK,MAAA;EAEAC,YAAY;IACVC,IAAI;IACJC,MAAM;IACNC;EAAG,CAKJ,EAAE;IACD,KAAK,CAACD,MAAA,EAAQC,GAAA;IACd,I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EACnB;EAESK,WAAA,EAA0C;IACjD,OAAO;MACL,GAAG,KAAK,CAACA,UAAA,EAAY;MACrB,GAAG,IAAI,CAACC,OAAO,EAAE;MACjBC,IAAA,EAAM;MACNC,OAAA,EAAS;IACX;EACF;EAEAF,QAAA,EAA6B;IAC3B,OAAO,IAAI,CAACG,SAAS,GAAGtC,MAAM;EAChC;EAEAuC,QAAQrC,IAAuB,EAAQ;IACrC,MAAMsC,QAAA,GAAW,IAAI,CAACC,WAAW;IACjCD,QAAA,CAASxC,MAAM,GAAGE,IAAA;EACpB;EAESwC,UAAA,EAAmB;IAC1B,OAAO;EACT;AACF;AAEA,OAAO,SAAS5B,+BAA+B;EAC7CZ;AAAI,CAGL;EACC,OAAON,qBAAA,CAAsB,IAAIG,uBAAA,CAAwB;IAAEG;EAAK;AAClE;AAEA,OAAO,SAASyC,2BACdrC,IAAoC;EAEpC,OAAOA,IAAA,YAAgBP,uBAAA;AACzB","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DOMConversionOutput } from 'lexical';
|
|
2
|
-
import type { $createPendingUploadNode } from '../../client/nodes/PendingUploadNode.js';
|
|
3
|
-
import type { $createUploadNode } from '../../client/nodes/UploadNode.js';
|
|
4
|
-
import type { $createPendingUploadServerNode } from './PendingUploadNode.js';
|
|
5
|
-
import type { $createUploadServerNode } from './UploadNode.js';
|
|
6
|
-
export declare function $convertPendingUploadElement(domNode: HTMLImageElement, $createNode: typeof $createPendingUploadNode | typeof $createPendingUploadServerNode): DOMConversionOutput | null;
|
|
7
|
-
export declare function isGoogleDocCheckboxImg(img: HTMLImageElement): boolean;
|
|
8
|
-
export declare function $convertUploadElement(domNode: HTMLImageElement, $createNode: typeof $createUploadNode | typeof $createUploadServerNode): DOMConversionOutput | null;
|
|
9
|
-
//# sourceMappingURL=conversions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversions.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/server/nodes/conversions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAIlD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAA;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAE9D,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,gBAAgB,EACzB,WAAW,EAAE,OAAO,wBAAwB,GAAG,OAAO,8BAA8B,GACnF,mBAAmB,GAAG,IAAI,CAsB5B;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAOrE;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,gBAAgB,EACzB,WAAW,EAAE,OAAO,iBAAiB,GAAG,OAAO,uBAAuB,GACrE,mBAAmB,GAAG,IAAI,CAqB5B"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// This file contains functions used to convert dom elements to upload or pending upload lexical nodes. It requires the actual node
|
|
2
|
-
// creation functions to be passed in to stay compatible with both client and server code.
|
|
3
|
-
import ObjectID from 'bson-objectid';
|
|
4
|
-
export function $convertPendingUploadElement(domNode, $createNode) {
|
|
5
|
-
if (domNode.hasAttribute('data-lexical-pending-upload-form-id')) {
|
|
6
|
-
const formID = domNode.getAttribute('data-lexical-pending-upload-form-id');
|
|
7
|
-
if (formID != null) {
|
|
8
|
-
const node = $createNode({
|
|
9
|
-
data: {
|
|
10
|
-
formID,
|
|
11
|
-
src: domNode.getAttribute('src') || ''
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
return {
|
|
15
|
-
node
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
// Create a new pending upload node with a new form ID
|
|
20
|
-
const node = $createNode({
|
|
21
|
-
data: {
|
|
22
|
-
formID: new ObjectID.default().toHexString(),
|
|
23
|
-
src: domNode.getAttribute('src') || ''
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return {
|
|
27
|
-
node
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export function isGoogleDocCheckboxImg(img) {
|
|
31
|
-
return img.parentElement != null && img.parentElement.tagName === 'LI' && img.previousSibling === null && img.getAttribute('aria-roledescription') === 'checkbox';
|
|
32
|
-
}
|
|
33
|
-
export function $convertUploadElement(domNode, $createNode) {
|
|
34
|
-
if (domNode.hasAttribute('data-lexical-upload-relation-to') && domNode.hasAttribute('data-lexical-upload-id')) {
|
|
35
|
-
const id = domNode.getAttribute('data-lexical-upload-id');
|
|
36
|
-
const relationTo = domNode.getAttribute('data-lexical-upload-relation-to');
|
|
37
|
-
if (id != null && relationTo != null) {
|
|
38
|
-
const node = $createNode({
|
|
39
|
-
data: {
|
|
40
|
-
fields: {},
|
|
41
|
-
relationTo,
|
|
42
|
-
value: id
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
node
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// Auto-upload functionality is handled here by the PendingUploadNode
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=conversions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversions.js","names":["ObjectID","$convertPendingUploadElement","domNode","$createNode","hasAttribute","formID","getAttribute","node","data","src","default","toHexString","isGoogleDocCheckboxImg","img","parentElement","tagName","previousSibling","$convertUploadElement","id","relationTo","fields","value"],"sources":["../../../../../src/features/upload/server/nodes/conversions.ts"],"sourcesContent":["// This file contains functions used to convert dom elements to upload or pending upload lexical nodes. It requires the actual node\n// creation functions to be passed in to stay compatible with both client and server code.\nimport type { DOMConversionOutput } from 'lexical'\n\nimport ObjectID from 'bson-objectid'\n\nimport type { $createPendingUploadNode } from '../../client/nodes/PendingUploadNode.js'\nimport type { $createUploadNode } from '../../client/nodes/UploadNode.js'\nimport type { $createPendingUploadServerNode } from './PendingUploadNode.js'\nimport type { $createUploadServerNode } from './UploadNode.js'\n\nexport function $convertPendingUploadElement(\n domNode: HTMLImageElement,\n $createNode: typeof $createPendingUploadNode | typeof $createPendingUploadServerNode,\n): DOMConversionOutput | null {\n if (domNode.hasAttribute('data-lexical-pending-upload-form-id')) {\n const formID = domNode.getAttribute('data-lexical-pending-upload-form-id')\n\n if (formID != null) {\n const node = $createNode({\n data: {\n formID,\n src: domNode.getAttribute('src') || '',\n },\n })\n return { node }\n }\n }\n // Create a new pending upload node with a new form ID\n const node = $createNode({\n data: {\n formID: new ObjectID.default().toHexString(),\n src: domNode.getAttribute('src') || '',\n },\n })\n return { node }\n}\n\nexport function isGoogleDocCheckboxImg(img: HTMLImageElement): boolean {\n return (\n img.parentElement != null &&\n img.parentElement.tagName === 'LI' &&\n img.previousSibling === null &&\n img.getAttribute('aria-roledescription') === 'checkbox'\n )\n}\n\nexport function $convertUploadElement(\n domNode: HTMLImageElement,\n $createNode: typeof $createUploadNode | typeof $createUploadServerNode,\n): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n // Auto-upload functionality is handled here by the PendingUploadNode\n return null\n}\n"],"mappings":"AAAA;AACA;AAGA,OAAOA,QAAA,MAAc;AAOrB,OAAO,SAASC,6BACdC,OAAyB,EACzBC,WAAoF;EAEpF,IAAID,OAAA,CAAQE,YAAY,CAAC,wCAAwC;IAC/D,MAAMC,MAAA,GAASH,OAAA,CAAQI,YAAY,CAAC;IAEpC,I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