@bikdotai/bik-component-library 0.0.809-beta.5 → 0.0.809-beta.6
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/cjs/components/list-item/themes.js +1 -1
- package/dist/cjs/components/list-item/themes.js.map +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js.map +1 -1
- package/dist/cjs/components/variable-picker-v3/SubHeaderItems.js +1 -1
- package/dist/cjs/components/variable-picker-v3/SubHeaderItems.js.map +1 -1
- package/dist/cjs/components/variable-picker-v3/context.js +1 -1
- package/dist/cjs/components/variable-picker-v3/context.js.map +1 -1
- package/dist/cjs/editor/extensions/buildExtensions.js +1 -1
- package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/cjs/editor/extensions/plainClipboard/PasteNormalizationExtension.js +2 -0
- package/dist/cjs/editor/extensions/plainClipboard/PasteNormalizationExtension.js.map +1 -0
- package/dist/cjs/editor/extensions/plainClipboard/pasteUtils.js +1 -1
- package/dist/cjs/editor/extensions/plainClipboard/pasteUtils.js.map +1 -1
- package/dist/cjs/src/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/src/components/variable-picker-v3/context.d.ts +0 -4
- package/dist/cjs/src/editor/extensions/plainClipboard/PasteNormalizationExtension.d.ts +10 -0
- package/dist/cjs/src/editor/extensions/plainClipboard/pasteUtils.d.ts +24 -8
- package/dist/esm/components/list-item/themes.js +1 -1
- package/dist/esm/components/list-item/themes.js.map +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js.map +1 -1
- package/dist/esm/components/variable-picker-v3/SubHeaderItems.js +1 -1
- package/dist/esm/components/variable-picker-v3/SubHeaderItems.js.map +1 -1
- package/dist/esm/components/variable-picker-v3/context.js +1 -1
- package/dist/esm/components/variable-picker-v3/context.js.map +1 -1
- package/dist/esm/editor/extensions/buildExtensions.js +1 -1
- package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/esm/editor/extensions/plainClipboard/PasteNormalizationExtension.js +2 -0
- package/dist/esm/editor/extensions/plainClipboard/PasteNormalizationExtension.js.map +1 -0
- package/dist/esm/editor/extensions/plainClipboard/pasteUtils.js +1 -1
- package/dist/esm/editor/extensions/plainClipboard/pasteUtils.js.map +1 -1
- package/dist/esm/src/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/src/components/variable-picker-v3/context.d.ts +0 -4
- package/dist/esm/src/editor/extensions/plainClipboard/PasteNormalizationExtension.d.ts +10 -0
- package/dist/esm/src/editor/extensions/plainClipboard/pasteUtils.d.ts +24 -8
- package/package.json +1 -1
- package/dist/cjs/editor/extensions/plainClipboard/ClipboardNormalizationExtension.js +0 -2
- package/dist/cjs/editor/extensions/plainClipboard/ClipboardNormalizationExtension.js.map +0 -1
- package/dist/cjs/editor/extensions/plainClipboard/PlainClipboardExtension.js +0 -2
- package/dist/cjs/editor/extensions/plainClipboard/PlainClipboardExtension.js.map +0 -1
- package/dist/cjs/src/editor/extensions/plainClipboard/ClipboardNormalizationExtension.d.ts +0 -7
- package/dist/cjs/src/editor/extensions/plainClipboard/PlainClipboardExtension.d.ts +0 -2
- package/dist/cjs/src/icons/Actions/Common actions/SendAirplane2.d.ts +0 -7
- package/dist/cjs/src/icons/BIK AI specific/AiAgent.d.ts +0 -7
- package/dist/cjs/src/icons/Informational/Communication/AtSymbol.d.ts +0 -7
- package/dist/cjs/src/icons/Informational/Communication/Hangup.d.ts +0 -7
- package/dist/cjs/src/icons/Informational/Communication/IncomingCall.d.ts +0 -7
- package/dist/cjs/src/icons/Informational/Communication/OutgoingCall.d.ts +0 -7
- package/dist/cjs/src/icons/Informational/Communication/PhoneCall.d.ts +0 -7
- package/dist/cjs/src/icons/Informational/Communication/Transcript.d.ts +0 -7
- package/dist/cjs/src/icons/Informational/Files and folders/BookOpen.d.ts +0 -7
- package/dist/cjs/src/icons/Informational/Identity/AiVoiceAgent.d.ts +0 -7
- package/dist/cjs/src/icons/Social/Channels/Subdued/FbCommentTicket.d.ts +0 -6
- package/dist/cjs/src/icons/Social/Channels/Subdued/FbTicket.d.ts +0 -6
- package/dist/cjs/src/icons/Social/Channels/Subdued/IgCommentTicket.d.ts +0 -6
- package/dist/cjs/src/icons/Social/Channels/Subdued/IgTicket.d.ts +0 -6
- package/dist/cjs/src/icons/Social/Channels/Subdued/MailTicket.d.ts +0 -6
- package/dist/cjs/src/icons/Social/Channels/Subdued/PhoneTicket.d.ts +0 -6
- package/dist/cjs/src/icons/Social/Channels/Subdued/TaskTicket.d.ts +0 -6
- package/dist/cjs/src/icons/Social/Channels/Subdued/WhatsappTicket.d.ts +0 -6
- package/dist/cjs/src/icons/Social/Channels/Subdued/index.d.ts +0 -8
- package/dist/esm/editor/extensions/plainClipboard/ClipboardNormalizationExtension.js +0 -2
- package/dist/esm/editor/extensions/plainClipboard/ClipboardNormalizationExtension.js.map +0 -1
- package/dist/esm/editor/extensions/plainClipboard/PlainClipboardExtension.js +0 -2
- package/dist/esm/editor/extensions/plainClipboard/PlainClipboardExtension.js.map +0 -1
- package/dist/esm/src/editor/extensions/plainClipboard/ClipboardNormalizationExtension.d.ts +0 -7
- package/dist/esm/src/editor/extensions/plainClipboard/PlainClipboardExtension.d.ts +0 -2
- package/dist/esm/src/icons/Actions/Common actions/SendAirplane2.d.ts +0 -7
- package/dist/esm/src/icons/BIK AI specific/AiAgent.d.ts +0 -7
- package/dist/esm/src/icons/Informational/Communication/AtSymbol.d.ts +0 -7
- package/dist/esm/src/icons/Informational/Communication/Hangup.d.ts +0 -7
- package/dist/esm/src/icons/Informational/Communication/IncomingCall.d.ts +0 -7
- package/dist/esm/src/icons/Informational/Communication/OutgoingCall.d.ts +0 -7
- package/dist/esm/src/icons/Informational/Communication/PhoneCall.d.ts +0 -7
- package/dist/esm/src/icons/Informational/Communication/Transcript.d.ts +0 -7
- package/dist/esm/src/icons/Informational/Files and folders/BookOpen.d.ts +0 -7
- package/dist/esm/src/icons/Informational/Identity/AiVoiceAgent.d.ts +0 -7
- package/dist/esm/src/icons/Social/Channels/Subdued/FbCommentTicket.d.ts +0 -6
- package/dist/esm/src/icons/Social/Channels/Subdued/FbTicket.d.ts +0 -6
- package/dist/esm/src/icons/Social/Channels/Subdued/IgCommentTicket.d.ts +0 -6
- package/dist/esm/src/icons/Social/Channels/Subdued/IgTicket.d.ts +0 -6
- package/dist/esm/src/icons/Social/Channels/Subdued/MailTicket.d.ts +0 -6
- package/dist/esm/src/icons/Social/Channels/Subdued/PhoneTicket.d.ts +0 -6
- package/dist/esm/src/icons/Social/Channels/Subdued/TaskTicket.d.ts +0 -6
- package/dist/esm/src/icons/Social/Channels/Subdued/WhatsappTicket.d.ts +0 -6
- package/dist/esm/src/icons/Social/Channels/Subdued/index.d.ts +0 -8
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Extension as t}from"../../../node_modules/@tiptap/core/dist/index.js";import{Slice as e}from"@tiptap/pm/model";import{Plugin as r}from"@tiptap/pm/state";import{parseClipboardText as o,cleanBlockBrs as n,stripTrailingBrs as s,normalizeHardBreaks as a,stripRichMarks as p}from"./pasteUtils.js";const i=t.create({name:"pasteNormalization",addOptions:()=>({preserveMarks:!1}),addProseMirrorPlugins(){const t=this.options.preserveMarks;return[new r({props:{clipboardTextParser:(t,e,r,n)=>o(t,n.state.schema),transformPastedHTML(t){if(t.includes("data-pm-slice"))return t;const e=document.createElement("div");return e.innerHTML=t,n(e),s(e),e.innerHTML},transformPasted(r){let o=a(r.content);return t||(o=p(o)),new e(o,r.openStart,r.openEnd)}}})]}});export{i as PasteNormalizationExtension};
|
|
2
|
+
//# sourceMappingURL=PasteNormalizationExtension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasteNormalizationExtension.js","sources":["../../../../../src/editor/extensions/plainClipboard/PasteNormalizationExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { Slice } from '@tiptap/pm/model';\nimport { Plugin } from '@tiptap/pm/state';\nimport {\n\tcleanBlockBrs,\n\tnormalizeHardBreaks,\n\tparseClipboardText,\n\tstripRichMarks,\n\tstripTrailingBrs,\n} from './pasteUtils';\n\n/**\n * Unified paste normalizer for all editor channels.\n *\n * Uses ProseMirror's recommended hooks instead of overriding handlePaste:\n * - clipboardTextParser: plain text → Slice (preserves blank lines)\n * - transformPastedHTML: HTML → HTML (cleans Google Docs / Word artifacts)\n * - transformPasted: Slice → Slice (normalizes hardBreaks, strips marks)\n */\nexport const PasteNormalizationExtension = Extension.create({\n\tname: 'pasteNormalization',\n\taddOptions() {\n\t\treturn {\n\t\t\tpreserveMarks: false,\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\tconst preserveMarks = this.options.preserveMarks;\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tprops: {\n\t\t\t\t\tclipboardTextParser(text, _$context, _plain, view) {\n\t\t\t\t\t\treturn parseClipboardText(text, view.state.schema);\n\t\t\t\t\t},\n\n\t\t\t\t\ttransformPastedHTML(html) {\n\t\t\t\t\t\tif (html.includes('data-pm-slice')) return html;\n\t\t\t\t\t\tconst container = document.createElement('div');\n\t\t\t\t\t\tcontainer.innerHTML = html;\n\t\t\t\t\t\tcleanBlockBrs(container);\n\t\t\t\t\t\tstripTrailingBrs(container);\n\t\t\t\t\t\treturn container.innerHTML;\n\t\t\t\t\t},\n\n\t\t\t\t\ttransformPasted(slice) {\n\t\t\t\t\t\tlet content = normalizeHardBreaks(slice.content);\n\t\t\t\t\t\tif (!preserveMarks) {\n\t\t\t\t\t\t\tcontent = stripRichMarks(content);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn new Slice(content, slice.openStart, slice.openEnd);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["PasteNormalizationExtension","Extension","create","name","addOptions","preserveMarks","addProseMirrorPlugins","this","options","Plugin","props","clipboardTextParser","text","_$context","_plain","view","parseClipboardText","state","schema","transformPastedHTML","html","includes","container","document","createElement","innerHTML","cleanBlockBrs","stripTrailingBrs","transformPasted","slice","content","normalizeHardBreaks","stripRichMarks","Slice","openStart","openEnd"],"mappings":"iTAmBaA,EAA8BC,EAAUC,OAAO,CAC3DC,KAAM,qBACNC,WAAUA,KACF,CACNC,eAAe,IAGjBC,wBACC,MAAMD,EAAgBE,KAAKC,QAAQH,cACnC,MAAO,CACN,IAAII,EAAO,CACVC,MAAO,CACNC,oBAAmBA,CAACC,EAAMC,EAAWC,EAAQC,IACrCC,EAAmBJ,EAAMG,EAAKE,MAAMC,QAG5CC,oBAAoBC,GACnB,GAAIA,EAAKC,SAAS,iBAAkB,OAAOD,EAC3C,MAAME,EAAYC,SAASC,cAAc,OAIzC,OAHAF,EAAUG,UAAYL,EACtBM,EAAcJ,GACdK,EAAiBL,GACVA,EAAUG,SACjB,EAEDG,gBAAgBC,GACf,IAAIC,EAAUC,EAAoBF,EAAMC,SAIxC,OAHKzB,IACJyB,EAAUE,EAAeF,IAEnB,IAAIG,EAAMH,EAASD,EAAMK,UAAWL,EAAMM,QAClD,KAIJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as e}from"@tiptap/pm/model";const
|
|
1
|
+
import{Fragment as e,Slice as t}from"@tiptap/pm/model";const n=new Set(["P","LI","H1","H2","H3","H4","H5","H6","TD","TH","PRE"]),r=new Set(["bold","italic","strike","underline","code"]);function o(e){const t=Array.from(e.querySelectorAll("br"));for(const r of t){let t=!1,o=r.parentElement;for(;o&&o!==e;){if(n.has(o.tagName)){t=!0;break}o=o.parentElement}t||r.parentElement.replaceChild(document.createElement("p"),r)}}function a(e){for(const t of["p","div"])for(const n of Array.from(e.querySelectorAll(t))){const e=n.lastElementChild;"BR"===(null==e?void 0:e.tagName)&&n.childNodes.length>1&&e.remove()}}function l(t){const n=[];return t.forEach((t=>{var r,o;if("paragraph"===t.type.name){if(1===t.childCount&&"hardBreak"===(null===(r=t.firstChild)||void 0===r?void 0:r.type.name))return void n.push(t.type.create(t.attrs));if(t.childCount>1&&"hardBreak"===(null===(o=t.lastChild)||void 0===o?void 0:o.type.name)){const r=[];return t.content.forEach(((e,n,o)=>{o<t.childCount-1&&r.push(e)})),void n.push(t.copy(e.from(r)))}}t.isBlock&&!t.isLeaf?n.push(t.copy(l(t.content))):n.push(t)})),e.from(n)}function c(t){const n=[];return t.forEach((e=>{if(e.isText){const t=e.marks.filter((e=>r.has(e.type.name)));n.push(t.length===e.marks.length?e:e.mark(t))}else n.push(e.copy(c(e.content)))})),e.from(n)}function i(n,r){const o=n.split("\n").map((e=>r.node("paragraph",null,e?[r.text(e)]:[])));return new t(e.fromArray(o),1,1)}export{n as TEXTBLOCK_TAGS,o as cleanBlockBrs,l as normalizeHardBreaks,i as parseClipboardText,c as stripRichMarks,a as stripTrailingBrs};
|
|
2
2
|
//# sourceMappingURL=pasteUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pasteUtils.js","sources":["../../../../../src/editor/extensions/plainClipboard/pasteUtils.ts"],"sourcesContent":["import { Fragment, Node as PMNode } from '@tiptap/pm/model';\n\nexport const TEXTBLOCK_TAGS = new Set([\n\t'P',\n\t'LI',\n\t'H1',\n\t'H2',\n\t'H3',\n\t'H4',\n\t'H5',\n\t'H6',\n\t'TD',\n\t'TH',\n\t'PRE',\n]);\n\nexport const BLOCK_SELECTOR =\n\t'p,div,h1,h2,h3,h4,h5,h6,ul,ol,li,blockquote,table,pre';\n\nconst BASIC_MARKS = new Set(['bold', 'italic', 'strike', 'underline', 'code']);\n\n/**\n * Replace `<br>` elements that sit at block level (not inside a textblock\n * like `<p>`, `<li>`, etc.) with empty `<p></p>` elements. Google Docs\n * puts standalone `<br>` tags between paragraphs to represent blank lines.\n
|
|
1
|
+
{"version":3,"file":"pasteUtils.js","sources":["../../../../../src/editor/extensions/plainClipboard/pasteUtils.ts"],"sourcesContent":["import { Fragment, Node as PMNode, Schema, Slice } from '@tiptap/pm/model';\n\nexport const TEXTBLOCK_TAGS = new Set([\n\t'P',\n\t'LI',\n\t'H1',\n\t'H2',\n\t'H3',\n\t'H4',\n\t'H5',\n\t'H6',\n\t'TD',\n\t'TH',\n\t'PRE',\n]);\n\nexport const BLOCK_SELECTOR =\n\t'p,div,h1,h2,h3,h4,h5,h6,ul,ol,li,blockquote,table,pre';\n\nconst BASIC_MARKS = new Set(['bold', 'italic', 'strike', 'underline', 'code']);\n\n/**\n * Replace `<br>` elements that sit at block level (not inside a textblock\n * like `<p>`, `<li>`, etc.) with empty `<p></p>` elements. Google Docs\n * puts standalone `<br>` tags between paragraphs to represent blank lines.\n */\nexport function cleanBlockBrs(container: HTMLElement): void {\n\tconst brs = Array.from(container.querySelectorAll('br'));\n\tfor (const br of brs) {\n\t\tlet insideTextblock = false;\n\t\tlet el = br.parentElement;\n\t\twhile (el && el !== container) {\n\t\t\tif (TEXTBLOCK_TAGS.has(el.tagName)) {\n\t\t\t\tinsideTextblock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tel = el.parentElement;\n\t\t}\n\t\tif (!insideTextblock) {\n\t\t\tbr.parentElement!.replaceChild(document.createElement('p'), br);\n\t\t}\n\t}\n}\n\n/**\n * Strip trailing `<br>` from content paragraphs in the DOM.\n * Google Docs adds a `<br>` at the end of non-empty paragraphs as a cursor\n * placeholder. Without this, ProseMirror creates a trailing hardBreak that\n * adds a visual blank line at the bottom of the paragraph.\n */\nexport function stripTrailingBrs(container: HTMLElement): void {\n\tfor (const tag of ['p', 'div']) {\n\t\tfor (const el of Array.from(container.querySelectorAll(tag))) {\n\t\t\tconst last = el.lastElementChild;\n\t\t\tif (last?.tagName === 'BR' && el.childNodes.length > 1) {\n\t\t\t\tlast.remove();\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Convert paragraphs containing only a hardBreak into truly empty paragraphs.\n * Google Docs represents blank lines as `<p><br></p>` — ProseMirror parses\n * the `<br>` as a hardBreak node, which renders double-height. Converting to\n * an empty paragraph (childCount 0) gives a single-height blank line.\n *\n * Does NOT collapse consecutive empties — that would destroy user intent.\n */\nexport function normalizeHardBreaks(fragment: Fragment): Fragment {\n\tconst nodes: PMNode[] = [];\n\tfragment.forEach((node) => {\n\t\tif (node.type.name === 'paragraph') {\n\t\t\tif (node.childCount === 1 && node.firstChild?.type.name === 'hardBreak') {\n\t\t\t\tnodes.push(node.type.create(node.attrs));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (node.childCount > 1 && node.lastChild?.type.name === 'hardBreak') {\n\t\t\t\tconst children: PMNode[] = [];\n\t\t\t\tnode.content.forEach((child, _offset, index) => {\n\t\t\t\t\tif (index < node.childCount - 1) children.push(child);\n\t\t\t\t});\n\t\t\t\tnodes.push(node.copy(Fragment.from(children)));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (node.isBlock && !node.isLeaf) {\n\t\t\tnodes.push(node.copy(normalizeHardBreaks(node.content)));\n\t\t} else {\n\t\t\tnodes.push(node);\n\t\t}\n\t});\n\treturn Fragment.from(nodes);\n}\n\n/**\n * Strip \"rich\" marks (link, textStyle, highlight, etc.) while keeping\n * basic marks (bold, italic, strike, underline, code) that messaging\n * channels can represent.\n */\nexport function stripRichMarks(fragment: Fragment): Fragment {\n\tconst nodes: PMNode[] = [];\n\tfragment.forEach((node) => {\n\t\tif (node.isText) {\n\t\t\tconst kept = node.marks.filter((m) => BASIC_MARKS.has(m.type.name));\n\t\t\tnodes.push(kept.length === node.marks.length ? node : node.mark(kept));\n\t\t} else {\n\t\t\tnodes.push(node.copy(stripRichMarks(node.content)));\n\t\t}\n\t});\n\treturn Fragment.from(nodes);\n}\n\n/**\n * Parse plain clipboard text into a ProseMirror Slice, preserving blank\n * lines as empty paragraphs. This replaces ProseMirror's default text\n * parser which uses `\\n+` and loses all blank lines.\n */\nexport function parseClipboardText(text: string, schema: Schema): Slice {\n\tconst paragraphs = text\n\t\t.split('\\n')\n\t\t.map((line) =>\n\t\t\tschema.node('paragraph', null, line ? [schema.text(line)] : []),\n\t\t);\n\treturn new Slice(Fragment.fromArray(paragraphs), 1, 1);\n}\n"],"names":["TEXTBLOCK_TAGS","Set","BASIC_MARKS","cleanBlockBrs","container","brs","Array","from","querySelectorAll","br","insideTextblock","el","parentElement","has","tagName","replaceChild","document","createElement","stripTrailingBrs","tag","last","lastElementChild","childNodes","length","remove","normalizeHardBreaks","fragment","nodes","forEach","node","type","name","childCount","_a","firstChild","push","create","attrs","_b","lastChild","children","content","child","_offset","index","copy","Fragment","isBlock","isLeaf","stripRichMarks","isText","kept","marks","filter","m","mark","parseClipboardText","text","schema","paragraphs","split","map","line","Slice","fromArray"],"mappings":"uDAEaA,MAAAA,EAAiB,IAAIC,IAAI,CACrC,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,QAMKC,EAAc,IAAID,IAAI,CAAC,OAAQ,SAAU,SAAU,YAAa,SAOhE,SAAUE,EAAcC,GAC7B,MAAMC,EAAMC,MAAMC,KAAKH,EAAUI,iBAAiB,OAClD,IAAK,MAAMC,KAAMJ,EAAK,CACrB,IAAIK,GAAkB,EAClBC,EAAKF,EAAGG,cACZ,KAAOD,GAAMA,IAAOP,GAAW,CAC9B,GAAIJ,EAAea,IAAIF,EAAGG,SAAU,CACnCJ,GAAkB,EAClB,KACA,CACDC,EAAKA,EAAGC,aACR,CACIF,GACJD,EAAGG,cAAeG,aAAaC,SAASC,cAAc,KAAMR,EAE7D,CACF,CAQM,SAAUS,EAAiBd,GAChC,IAAK,MAAMe,IAAO,CAAC,IAAK,OACvB,IAAK,MAAMR,KAAML,MAAMC,KAAKH,EAAUI,iBAAiBW,IAAO,CAC7D,MAAMC,EAAOT,EAAGU,iBACM,QAAlBD,aAAA,EAAAA,EAAMN,UAAoBH,EAAGW,WAAWC,OAAS,GACpDH,EAAKI,QAEN,CAEH,CAUM,SAAUC,EAAoBC,GACnC,MAAMC,EAAkB,GAsBxB,OArBAD,EAASE,SAASC,YACjB,GAAuB,cAAnBA,EAAKC,KAAKC,KAAsB,CACnC,GAAwB,IAApBF,EAAKG,YAAmD,eAAd,QAAjBC,EAAAJ,EAAKK,kBAAY,IAAAD,OAAA,EAAAA,EAAAH,KAAKC,MAElD,YADAJ,EAAMQ,KAAKN,EAAKC,KAAKM,OAAOP,EAAKQ,QAGlC,GAAIR,EAAKG,WAAa,GAAmC,eAAd,QAAhBM,EAAAT,EAAKU,iBAAW,IAAAD,OAAA,EAAAA,EAAAR,KAAKC,MAAsB,CACrE,MAAMS,EAAqB,GAK3B,OAJAX,EAAKY,QAAQb,SAAQ,CAACc,EAAOC,EAASC,KACjCA,EAAQf,EAAKG,WAAa,GAAGQ,EAASL,KAAKO,EAAM,SAEtDf,EAAMQ,KAAKN,EAAKgB,KAAKC,EAASvC,KAAKiC,IAEnC,CACD,CACGX,EAAKkB,UAAYlB,EAAKmB,OACzBrB,EAAMQ,KAAKN,EAAKgB,KAAKpB,EAAoBI,EAAKY,WAE9Cd,EAAMQ,KAAKN,EACX,IAEKiB,EAASvC,KAAKoB,EACtB,CAOM,SAAUsB,EAAevB,GAC9B,MAAMC,EAAkB,GASxB,OARAD,EAASE,SAASC,IACjB,GAAIA,EAAKqB,OAAQ,CAChB,MAAMC,EAAOtB,EAAKuB,MAAMC,QAAQC,GAAMpD,EAAYW,IAAIyC,EAAExB,KAAKC,QAC7DJ,EAAMQ,KAAKgB,EAAK5B,SAAWM,EAAKuB,MAAM7B,OAASM,EAAOA,EAAK0B,KAAKJ,GAChE,MACAxB,EAAMQ,KAAKN,EAAKgB,KAAKI,EAAepB,EAAKY,UACzC,IAEKK,EAASvC,KAAKoB,EACtB,CAOgB,SAAA6B,EAAmBC,EAAcC,GAChD,MAAMC,EAAaF,EACjBG,MAAM,MACNC,KAAKC,GACLJ,EAAO7B,KAAK,YAAa,KAAMiC,EAAO,CAACJ,EAAOD,KAAKK,IAAS,MAE9D,OAAO,IAAIC,EAAMjB,EAASkB,UAAUL,GAAa,EAAG,EACrD"}
|
|
@@ -8,8 +8,6 @@ export declare const VariablePickerContext: React.Context<{
|
|
|
8
8
|
setVariables: React.Dispatch<React.SetStateAction<any[]>>;
|
|
9
9
|
showRecommended: boolean;
|
|
10
10
|
setShowRecommended: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
|
-
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
12
|
-
scrollPositionStack: React.MutableRefObject<number[]>;
|
|
13
11
|
}>;
|
|
14
12
|
export declare const useVariablePickerContext: () => {
|
|
15
13
|
searchText: string;
|
|
@@ -20,6 +18,4 @@ export declare const useVariablePickerContext: () => {
|
|
|
20
18
|
setVariables: React.Dispatch<React.SetStateAction<any[]>>;
|
|
21
19
|
showRecommended: boolean;
|
|
22
20
|
setShowRecommended: React.Dispatch<React.SetStateAction<boolean>>;
|
|
23
|
-
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
24
|
-
scrollPositionStack: React.MutableRefObject<number[]>;
|
|
25
21
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* Unified paste normalizer for all editor channels.
|
|
4
|
+
*
|
|
5
|
+
* Uses ProseMirror's recommended hooks instead of overriding handlePaste:
|
|
6
|
+
* - clipboardTextParser: plain text → Slice (preserves blank lines)
|
|
7
|
+
* - transformPastedHTML: HTML → HTML (cleans Google Docs / Word artifacts)
|
|
8
|
+
* - transformPasted: Slice → Slice (normalizes hardBreaks, strips marks)
|
|
9
|
+
*/
|
|
10
|
+
export declare const PasteNormalizationExtension: Extension<any, any>;
|
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
import { Fragment } from '@tiptap/pm/model';
|
|
1
|
+
import { Fragment, Schema, Slice } from '@tiptap/pm/model';
|
|
2
2
|
export declare const TEXTBLOCK_TAGS: Set<string>;
|
|
3
3
|
export declare const BLOCK_SELECTOR = "p,div,h1,h2,h3,h4,h5,h6,ul,ol,li,blockquote,table,pre";
|
|
4
4
|
/**
|
|
5
5
|
* Replace `<br>` elements that sit at block level (not inside a textblock
|
|
6
6
|
* like `<p>`, `<li>`, etc.) with empty `<p></p>` elements. Google Docs
|
|
7
7
|
* puts standalone `<br>` tags between paragraphs to represent blank lines.
|
|
8
|
-
* Without this, ProseMirror parses them as top-level hardBreak nodes.
|
|
9
8
|
*/
|
|
10
9
|
export declare function cleanBlockBrs(container: HTMLElement): void;
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Strip trailing `<br>` from content paragraphs in the DOM.
|
|
12
|
+
* Google Docs adds a `<br>` at the end of non-empty paragraphs as a cursor
|
|
13
|
+
* placeholder. Without this, ProseMirror creates a trailing hardBreak that
|
|
14
|
+
* adds a visual blank line at the bottom of the paragraph.
|
|
14
15
|
*/
|
|
15
|
-
export declare function
|
|
16
|
+
export declare function stripTrailingBrs(container: HTMLElement): void;
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Convert paragraphs containing only a hardBreak into truly empty paragraphs.
|
|
19
|
+
* Google Docs represents blank lines as `<p><br></p>` — ProseMirror parses
|
|
20
|
+
* the `<br>` as a hardBreak node, which renders double-height. Converting to
|
|
21
|
+
* an empty paragraph (childCount 0) gives a single-height blank line.
|
|
22
|
+
*
|
|
23
|
+
* Does NOT collapse consecutive empties — that would destroy user intent.
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeHardBreaks(fragment: Fragment): Fragment;
|
|
26
|
+
/**
|
|
27
|
+
* Strip "rich" marks (link, textStyle, highlight, etc.) while keeping
|
|
28
|
+
* basic marks (bold, italic, strike, underline, code) that messaging
|
|
29
|
+
* channels can represent.
|
|
20
30
|
*/
|
|
21
31
|
export declare function stripRichMarks(fragment: Fragment): Fragment;
|
|
32
|
+
/**
|
|
33
|
+
* Parse plain clipboard text into a ProseMirror Slice, preserving blank
|
|
34
|
+
* lines as empty paragraphs. This replaces ProseMirror's default text
|
|
35
|
+
* parser which uses `\n+` and loses all blank lines.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseClipboardText(text: string, schema: Schema): Slice;
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/@tiptap/core/dist/index.js"),t=require("@tiptap/pm/model"),r=require("@tiptap/pm/state"),i=require("./pasteUtils.js");const a=e.Extension.create({name:"clipboardNormalization",addProseMirrorPlugins:()=>[new r.Plugin({props:{handlePaste(e,r){var a,n,o;if(null===(n=null===(a=r.clipboardData)||void 0===a?void 0:a.files)||void 0===n?void 0:n.length)return!1;const l=null===(o=r.clipboardData)||void 0===o?void 0:o.getData("text/html");if(!l)return!1;if(l.includes("data-pm-slice"))return!1;const s=document.createElement("div");if(s.innerHTML=l,!s.querySelector(i.BLOCK_SELECTOR))return!1;i.cleanBlockBrs(s);const c=e.state.schema,d=t.DOMParser.fromSchema(c).parseSlice(s),p=i.normalizeBlanks(d.content),u=new t.Slice(p,d.openStart,d.openEnd);return e.dispatch(e.state.tr.replaceSelection(u)),!0}}})]});exports.ClipboardNormalizationExtension=a;
|
|
2
|
-
//# sourceMappingURL=ClipboardNormalizationExtension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClipboardNormalizationExtension.js","sources":["../../../../../src/editor/extensions/plainClipboard/ClipboardNormalizationExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { DOMParser as ProseMirrorDOMParser, Slice } from '@tiptap/pm/model';\nimport { Plugin } from '@tiptap/pm/state';\nimport { BLOCK_SELECTOR, cleanBlockBrs, normalizeBlanks } from './pasteUtils';\n\n/**\n * Lightweight paste normalizer for rich-paste editors (email).\n * Fixes Google Docs' standalone `<br>` between paragraphs and collapses\n * consecutive empty paragraphs — but keeps ALL formatting marks intact.\n */\nexport const ClipboardNormalizationExtension = Extension.create({\n\tname: 'clipboardNormalization',\n\taddProseMirrorPlugins() {\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tprops: {\n\t\t\t\t\thandlePaste(_view, event) {\n\t\t\t\t\t\tif (event.clipboardData?.files?.length) return false;\n\t\t\t\t\t\tconst html = event.clipboardData?.getData('text/html');\n\t\t\t\t\t\tif (!html) return false;\n\t\t\t\t\t\tif (html.includes('data-pm-slice')) return false;\n\n\t\t\t\t\t\tconst container = document.createElement('div');\n\t\t\t\t\t\tcontainer.innerHTML = html;\n\t\t\t\t\t\tif (!container.querySelector(BLOCK_SELECTOR)) return false;\n\n\t\t\t\t\t\tcleanBlockBrs(container);\n\t\t\t\t\t\tconst schema = _view.state.schema;\n\t\t\t\t\t\tconst parsed =\n\t\t\t\t\t\t\tProseMirrorDOMParser.fromSchema(schema).parseSlice(container);\n\t\t\t\t\t\tconst cleaned = normalizeBlanks(parsed.content);\n\t\t\t\t\t\tconst slice = new Slice(cleaned, parsed.openStart, parsed.openEnd);\n\t\t\t\t\t\t_view.dispatch(_view.state.tr.replaceSelection(slice));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["ClipboardNormalizationExtension","Extension","create","name","addProseMirrorPlugins","Plugin","props","handlePaste","_view","event","_b","clipboardData","_a","files","length","html","_c","getData","includes","container","document","createElement","innerHTML","querySelector","BLOCK_SELECTOR","cleanBlockBrs","schema","state","parsed","ProseMirrorDOMParser","fromSchema","parseSlice","cleaned","normalizeBlanks","content","slice","Slice","openStart","openEnd","dispatch","tr","replaceSelection"],"mappings":"qOAUaA,EAAkCC,EAASA,UAACC,OAAO,CAC/DC,KAAM,yBACNC,sBAAqBA,IACb,CACN,IAAIC,EAAAA,OAAO,CACVC,MAAO,CACNC,YAAYC,EAAOC,aAClB,WAAIC,EAAqB,UAArBD,EAAME,qBAAe,IAAAC,OAAA,EAAAA,EAAAC,4BAAOC,OAAQ,OAAO,EAC/C,MAAMC,EAA0B,QAAnBC,EAAAP,EAAME,qBAAa,IAAAK,OAAA,EAAAA,EAAEC,QAAQ,aAC1C,IAAKF,EAAM,OAAO,EAClB,GAAIA,EAAKG,SAAS,iBAAkB,OAAO,EAE3C,MAAMC,EAAYC,SAASC,cAAc,OAEzC,GADAF,EAAUG,UAAYP,GACjBI,EAAUI,cAAcC,EAAAA,gBAAiB,OAAO,EAErDC,EAAaA,cAACN,GACd,MAAMO,EAASlB,EAAMmB,MAAMD,OACrBE,EACLC,EAAAA,UAAqBC,WAAWJ,GAAQK,WAAWZ,GAC9Ca,EAAUC,EAAAA,gBAAgBL,EAAOM,SACjCC,EAAQ,IAAIC,EAAAA,MAAMJ,EAASJ,EAAOS,UAAWT,EAAOU,SAE1D,OADA9B,EAAM+B,SAAS/B,EAAMmB,MAAMa,GAAGC,iBAAiBN,KACxC,CACR"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/@tiptap/core/dist/index.js"),t=require("@tiptap/pm/model"),r=require("@tiptap/pm/state"),a=require("./pasteUtils.js");const i=e.Extension.create({name:"plainClipboard",addProseMirrorPlugins:()=>[new r.Plugin({props:{handlePaste(e,r){var i,n,l,o;if(null===(n=null===(i=r.clipboardData)||void 0===i?void 0:i.files)||void 0===n?void 0:n.length)return!1;const s=null===(l=r.clipboardData)||void 0===l?void 0:l.getData("text/html"),p=null===(o=r.clipboardData)||void 0===o?void 0:o.getData("text/plain");if(!p)return!1;if(null==s?void 0:s.includes("data-pm-slice"))return!1;const c=e.state.schema;if(s){const r=document.createElement("div");r.innerHTML=s;if(r.querySelector(a.BLOCK_SELECTOR)){a.cleanBlockBrs(r);const i=t.DOMParser.fromSchema(c).parseSlice(r),n=a.normalizeBlanks(a.stripRichMarks(i.content)),l=new t.Slice(n,i.openStart,i.openEnd);return e.dispatch(e.state.tr.replaceSelection(l)),!0}}const d=p.split("\n").map((e=>c.node("paragraph",null,e?[c.text(e)]:[]))),u=new t.Slice(t.Fragment.fromArray(d),1,1);return e.dispatch(e.state.tr.replaceSelection(u)),!0}}})]});exports.PlainClipboardExtension=i;
|
|
2
|
-
//# sourceMappingURL=PlainClipboardExtension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlainClipboardExtension.js","sources":["../../../../../src/editor/extensions/plainClipboard/PlainClipboardExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport {\n\tFragment,\n\tDOMParser as ProseMirrorDOMParser,\n\tSlice,\n} from '@tiptap/pm/model';\nimport { Plugin } from '@tiptap/pm/state';\nimport {\n\tBLOCK_SELECTOR,\n\tcleanBlockBrs,\n\tnormalizeBlanks,\n\tstripRichMarks,\n} from './pasteUtils';\n\nexport const PlainClipboardExtension = Extension.create({\n\tname: 'plainClipboard',\n\taddProseMirrorPlugins() {\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tprops: {\n\t\t\t\t\thandlePaste(_view, event) {\n\t\t\t\t\t\tif (event.clipboardData?.files?.length) return false;\n\t\t\t\t\t\tconst html = event.clipboardData?.getData('text/html');\n\t\t\t\t\t\tconst text = event.clipboardData?.getData('text/plain');\n\t\t\t\t\t\tif (!text) return false;\n\n\t\t\t\t\t\tif (html?.includes('data-pm-slice')) return false;\n\n\t\t\t\t\t\tconst schema = _view.state.schema;\n\n\t\t\t\t\t\tif (html) {\n\t\t\t\t\t\t\tconst container = document.createElement('div');\n\t\t\t\t\t\t\tcontainer.innerHTML = html;\n\t\t\t\t\t\t\tconst hasBlocks = container.querySelector(BLOCK_SELECTOR);\n\t\t\t\t\t\t\tif (hasBlocks) {\n\t\t\t\t\t\t\t\tcleanBlockBrs(container);\n\t\t\t\t\t\t\t\tconst parsed =\n\t\t\t\t\t\t\t\t\tProseMirrorDOMParser.fromSchema(schema).parseSlice(container);\n\t\t\t\t\t\t\t\tconst cleaned = normalizeBlanks(stripRichMarks(parsed.content));\n\t\t\t\t\t\t\t\tconst slice = new Slice(\n\t\t\t\t\t\t\t\t\tcleaned,\n\t\t\t\t\t\t\t\t\tparsed.openStart,\n\t\t\t\t\t\t\t\t\tparsed.openEnd,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t_view.dispatch(_view.state.tr.replaceSelection(slice));\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst paragraphs = text\n\t\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t\t.map((line) =>\n\t\t\t\t\t\t\t\tschema.node('paragraph', null, line ? [schema.text(line)] : []),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tconst slice = new Slice(Fragment.fromArray(paragraphs), 1, 1);\n\t\t\t\t\t\t_view.dispatch(_view.state.tr.replaceSelection(slice));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["PlainClipboardExtension","Extension","create","name","addProseMirrorPlugins","Plugin","props","handlePaste","_view","event","_b","clipboardData","_a","files","length","html","_c","getData","text","_d","includes","schema","state","container","document","createElement","innerHTML","querySelector","BLOCK_SELECTOR","cleanBlockBrs","parsed","ProseMirrorDOMParser","fromSchema","parseSlice","cleaned","normalizeBlanks","stripRichMarks","content","slice","Slice","openStart","openEnd","dispatch","tr","replaceSelection","paragraphs","split","map","line","node","Fragment","fromArray"],"mappings":"qOAcaA,EAA0BC,EAASA,UAACC,OAAO,CACvDC,KAAM,iBACNC,sBAAqBA,IACb,CACN,IAAIC,EAAAA,OAAO,CACVC,MAAO,CACNC,YAAYC,EAAOC,eAClB,WAAIC,EAAqB,UAArBD,EAAME,qBAAe,IAAAC,OAAA,EAAAA,EAAAC,4BAAOC,OAAQ,OAAO,EAC/C,MAAMC,EAA0B,QAAnBC,EAAAP,EAAME,qBAAa,IAAAK,OAAA,EAAAA,EAAEC,QAAQ,aACpCC,EAA0B,QAAnBC,EAAAV,EAAME,qBAAa,IAAAQ,OAAA,EAAAA,EAAEF,QAAQ,cAC1C,IAAKC,EAAM,OAAO,EAElB,GAAIH,aAAI,EAAJA,EAAMK,SAAS,iBAAkB,OAAO,EAE5C,MAAMC,EAASb,EAAMc,MAAMD,OAE3B,GAAIN,EAAM,CACT,MAAMQ,EAAYC,SAASC,cAAc,OACzCF,EAAUG,UAAYX,EAEtB,GADkBQ,EAAUI,cAAcC,EAAcA,gBACzC,CACdC,EAAaA,cAACN,GACd,MAAMO,EACLC,EAAAA,UAAqBC,WAAWX,GAAQY,WAAWV,GAC9CW,EAAUC,EAAAA,gBAAgBC,EAAAA,eAAeN,EAAOO,UAChDC,EAAQ,IAAIC,EAAAA,MACjBL,EACAJ,EAAOU,UACPV,EAAOW,SAGR,OADAjC,EAAMkC,SAASlC,EAAMc,MAAMqB,GAAGC,iBAAiBN,KACxC,CACP,CACD,CAED,MAAMO,EAAa3B,EACjB4B,MAAM,MACNC,KAAKC,GACL3B,EAAO4B,KAAK,YAAa,KAAMD,EAAO,CAAC3B,EAAOH,KAAK8B,IAAS,MAExDV,EAAQ,IAAIC,EAAAA,MAAMW,EAAQA,SAACC,UAAUN,GAAa,EAAG,GAE3D,OADArC,EAAMkC,SAASlC,EAAMc,MAAMqB,GAAGC,iBAAiBN,KACxC,CACR"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
/**
|
|
3
|
-
* Lightweight paste normalizer for rich-paste editors (email).
|
|
4
|
-
* Fixes Google Docs' standalone `<br>` between paragraphs and collapses
|
|
5
|
-
* consecutive empty paragraphs — but keeps ALL formatting marks intact.
|
|
6
|
-
*/
|
|
7
|
-
export declare const ClipboardNormalizationExtension: Extension<any, any>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgSendAirplane2: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgSendAirplane2;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgAiAgent: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgAiAgent;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgAtSymbol: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgAtSymbol;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgHangup: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgHangup;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgIncomingCall: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgIncomingCall;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgOutgoingCall: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgOutgoingCall;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgPhoneCall: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgPhoneCall;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgTranscript: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgTranscript;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgBookOpen: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgBookOpen;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgAiVoiceAgent: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgAiVoiceAgent;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default as FbCommentTicket } from './FbCommentTicket';
|
|
2
|
-
export { default as FbTicket } from './FbTicket';
|
|
3
|
-
export { default as IgCommentTicket } from './IgCommentTicket';
|
|
4
|
-
export { default as IgTicket } from './IgTicket';
|
|
5
|
-
export { default as MailTicket } from './MailTicket';
|
|
6
|
-
export { default as PhoneTicket } from './PhoneTicket';
|
|
7
|
-
export { default as TaskTicket } from './TaskTicket';
|
|
8
|
-
export { default as WhatsappTicket } from './WhatsappTicket';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Extension as t}from"../../../node_modules/@tiptap/core/dist/index.js";import{DOMParser as e,Slice as r}from"@tiptap/pm/model";import{Plugin as o}from"@tiptap/pm/state";import{BLOCK_SELECTOR as i,cleanBlockBrs as a,normalizeBlanks as n}from"./pasteUtils.js";const l=t.create({name:"clipboardNormalization",addProseMirrorPlugins:()=>[new o({props:{handlePaste(t,o){var l,p,d;if(null===(p=null===(l=o.clipboardData)||void 0===l?void 0:l.files)||void 0===p?void 0:p.length)return!1;const s=null===(d=o.clipboardData)||void 0===d?void 0:d.getData("text/html");if(!s)return!1;if(s.includes("data-pm-slice"))return!1;const c=document.createElement("div");if(c.innerHTML=s,!c.querySelector(i))return!1;a(c);const m=t.state.schema,u=e.fromSchema(m).parseSlice(c),f=n(u.content),v=new r(f,u.openStart,u.openEnd);return t.dispatch(t.state.tr.replaceSelection(v)),!0}}})]});export{l as ClipboardNormalizationExtension};
|
|
2
|
-
//# sourceMappingURL=ClipboardNormalizationExtension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClipboardNormalizationExtension.js","sources":["../../../../../src/editor/extensions/plainClipboard/ClipboardNormalizationExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { DOMParser as ProseMirrorDOMParser, Slice } from '@tiptap/pm/model';\nimport { Plugin } from '@tiptap/pm/state';\nimport { BLOCK_SELECTOR, cleanBlockBrs, normalizeBlanks } from './pasteUtils';\n\n/**\n * Lightweight paste normalizer for rich-paste editors (email).\n * Fixes Google Docs' standalone `<br>` between paragraphs and collapses\n * consecutive empty paragraphs — but keeps ALL formatting marks intact.\n */\nexport const ClipboardNormalizationExtension = Extension.create({\n\tname: 'clipboardNormalization',\n\taddProseMirrorPlugins() {\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tprops: {\n\t\t\t\t\thandlePaste(_view, event) {\n\t\t\t\t\t\tif (event.clipboardData?.files?.length) return false;\n\t\t\t\t\t\tconst html = event.clipboardData?.getData('text/html');\n\t\t\t\t\t\tif (!html) return false;\n\t\t\t\t\t\tif (html.includes('data-pm-slice')) return false;\n\n\t\t\t\t\t\tconst container = document.createElement('div');\n\t\t\t\t\t\tcontainer.innerHTML = html;\n\t\t\t\t\t\tif (!container.querySelector(BLOCK_SELECTOR)) return false;\n\n\t\t\t\t\t\tcleanBlockBrs(container);\n\t\t\t\t\t\tconst schema = _view.state.schema;\n\t\t\t\t\t\tconst parsed =\n\t\t\t\t\t\t\tProseMirrorDOMParser.fromSchema(schema).parseSlice(container);\n\t\t\t\t\t\tconst cleaned = normalizeBlanks(parsed.content);\n\t\t\t\t\t\tconst slice = new Slice(cleaned, parsed.openStart, parsed.openEnd);\n\t\t\t\t\t\t_view.dispatch(_view.state.tr.replaceSelection(slice));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["ClipboardNormalizationExtension","Extension","create","name","addProseMirrorPlugins","Plugin","props","handlePaste","_view","event","_b","clipboardData","_a","files","length","html","_c","getData","includes","container","document","createElement","innerHTML","querySelector","BLOCK_SELECTOR","cleanBlockBrs","schema","state","parsed","ProseMirrorDOMParser","fromSchema","parseSlice","cleaned","normalizeBlanks","content","slice","Slice","openStart","openEnd","dispatch","tr","replaceSelection"],"mappings":"8QAUaA,EAAkCC,EAAUC,OAAO,CAC/DC,KAAM,yBACNC,sBAAqBA,IACb,CACN,IAAIC,EAAO,CACVC,MAAO,CACNC,YAAYC,EAAOC,aAClB,WAAIC,EAAqB,UAArBD,EAAME,qBAAe,IAAAC,OAAA,EAAAA,EAAAC,4BAAOC,OAAQ,OAAO,EAC/C,MAAMC,EAA0B,QAAnBC,EAAAP,EAAME,qBAAa,IAAAK,OAAA,EAAAA,EAAEC,QAAQ,aAC1C,IAAKF,EAAM,OAAO,EAClB,GAAIA,EAAKG,SAAS,iBAAkB,OAAO,EAE3C,MAAMC,EAAYC,SAASC,cAAc,OAEzC,GADAF,EAAUG,UAAYP,GACjBI,EAAUI,cAAcC,GAAiB,OAAO,EAErDC,EAAcN,GACd,MAAMO,EAASlB,EAAMmB,MAAMD,OACrBE,EACLC,EAAqBC,WAAWJ,GAAQK,WAAWZ,GAC9Ca,EAAUC,EAAgBL,EAAOM,SACjCC,EAAQ,IAAIC,EAAMJ,EAASJ,EAAOS,UAAWT,EAAOU,SAE1D,OADA9B,EAAM+B,SAAS/B,EAAMmB,MAAMa,GAAGC,iBAAiBN,KACxC,CACR"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Extension as t}from"../../../node_modules/@tiptap/core/dist/index.js";import{DOMParser as e,Slice as r,Fragment as a}from"@tiptap/pm/model";import{Plugin as o}from"@tiptap/pm/state";import{BLOCK_SELECTOR as i,cleanBlockBrs as n,normalizeBlanks as l,stripRichMarks as p}from"./pasteUtils.js";const d=t.create({name:"plainClipboard",addProseMirrorPlugins:()=>[new o({props:{handlePaste(t,o){var d,s,c,m;if(null===(s=null===(d=o.clipboardData)||void 0===d?void 0:d.files)||void 0===s?void 0:s.length)return!1;const u=null===(c=o.clipboardData)||void 0===c?void 0:c.getData("text/html"),f=null===(m=o.clipboardData)||void 0===m?void 0:m.getData("text/plain");if(!f)return!1;if(null==u?void 0:u.includes("data-pm-slice"))return!1;const v=t.state.schema;if(u){const a=document.createElement("div");a.innerHTML=u;if(a.querySelector(i)){n(a);const o=e.fromSchema(v).parseSlice(a),i=l(p(o.content)),d=new r(i,o.openStart,o.openEnd);return t.dispatch(t.state.tr.replaceSelection(d)),!0}}const h=f.split("\n").map((t=>v.node("paragraph",null,t?[v.text(t)]:[]))),S=new r(a.fromArray(h),1,1);return t.dispatch(t.state.tr.replaceSelection(S)),!0}}})]});export{d as PlainClipboardExtension};
|
|
2
|
-
//# sourceMappingURL=PlainClipboardExtension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlainClipboardExtension.js","sources":["../../../../../src/editor/extensions/plainClipboard/PlainClipboardExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport {\n\tFragment,\n\tDOMParser as ProseMirrorDOMParser,\n\tSlice,\n} from '@tiptap/pm/model';\nimport { Plugin } from '@tiptap/pm/state';\nimport {\n\tBLOCK_SELECTOR,\n\tcleanBlockBrs,\n\tnormalizeBlanks,\n\tstripRichMarks,\n} from './pasteUtils';\n\nexport const PlainClipboardExtension = Extension.create({\n\tname: 'plainClipboard',\n\taddProseMirrorPlugins() {\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tprops: {\n\t\t\t\t\thandlePaste(_view, event) {\n\t\t\t\t\t\tif (event.clipboardData?.files?.length) return false;\n\t\t\t\t\t\tconst html = event.clipboardData?.getData('text/html');\n\t\t\t\t\t\tconst text = event.clipboardData?.getData('text/plain');\n\t\t\t\t\t\tif (!text) return false;\n\n\t\t\t\t\t\tif (html?.includes('data-pm-slice')) return false;\n\n\t\t\t\t\t\tconst schema = _view.state.schema;\n\n\t\t\t\t\t\tif (html) {\n\t\t\t\t\t\t\tconst container = document.createElement('div');\n\t\t\t\t\t\t\tcontainer.innerHTML = html;\n\t\t\t\t\t\t\tconst hasBlocks = container.querySelector(BLOCK_SELECTOR);\n\t\t\t\t\t\t\tif (hasBlocks) {\n\t\t\t\t\t\t\t\tcleanBlockBrs(container);\n\t\t\t\t\t\t\t\tconst parsed =\n\t\t\t\t\t\t\t\t\tProseMirrorDOMParser.fromSchema(schema).parseSlice(container);\n\t\t\t\t\t\t\t\tconst cleaned = normalizeBlanks(stripRichMarks(parsed.content));\n\t\t\t\t\t\t\t\tconst slice = new Slice(\n\t\t\t\t\t\t\t\t\tcleaned,\n\t\t\t\t\t\t\t\t\tparsed.openStart,\n\t\t\t\t\t\t\t\t\tparsed.openEnd,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t_view.dispatch(_view.state.tr.replaceSelection(slice));\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst paragraphs = text\n\t\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t\t.map((line) =>\n\t\t\t\t\t\t\t\tschema.node('paragraph', null, line ? [schema.text(line)] : []),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tconst slice = new Slice(Fragment.fromArray(paragraphs), 1, 1);\n\t\t\t\t\t\t_view.dispatch(_view.state.tr.replaceSelection(slice));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["PlainClipboardExtension","Extension","create","name","addProseMirrorPlugins","Plugin","props","handlePaste","_view","event","_b","clipboardData","_a","files","length","html","_c","getData","text","_d","includes","schema","state","container","document","createElement","innerHTML","querySelector","BLOCK_SELECTOR","cleanBlockBrs","parsed","ProseMirrorDOMParser","fromSchema","parseSlice","cleaned","normalizeBlanks","stripRichMarks","content","slice","Slice","openStart","openEnd","dispatch","tr","replaceSelection","paragraphs","split","map","line","node","Fragment","fromArray"],"mappings":"gTAcaA,EAA0BC,EAAUC,OAAO,CACvDC,KAAM,iBACNC,sBAAqBA,IACb,CACN,IAAIC,EAAO,CACVC,MAAO,CACNC,YAAYC,EAAOC,eAClB,WAAIC,EAAqB,UAArBD,EAAME,qBAAe,IAAAC,OAAA,EAAAA,EAAAC,4BAAOC,OAAQ,OAAO,EAC/C,MAAMC,EAA0B,QAAnBC,EAAAP,EAAME,qBAAa,IAAAK,OAAA,EAAAA,EAAEC,QAAQ,aACpCC,EAA0B,QAAnBC,EAAAV,EAAME,qBAAa,IAAAQ,OAAA,EAAAA,EAAEF,QAAQ,cAC1C,IAAKC,EAAM,OAAO,EAElB,GAAIH,aAAI,EAAJA,EAAMK,SAAS,iBAAkB,OAAO,EAE5C,MAAMC,EAASb,EAAMc,MAAMD,OAE3B,GAAIN,EAAM,CACT,MAAMQ,EAAYC,SAASC,cAAc,OACzCF,EAAUG,UAAYX,EAEtB,GADkBQ,EAAUI,cAAcC,GAC3B,CACdC,EAAcN,GACd,MAAMO,EACLC,EAAqBC,WAAWX,GAAQY,WAAWV,GAC9CW,EAAUC,EAAgBC,EAAeN,EAAOO,UAChDC,EAAQ,IAAIC,EACjBL,EACAJ,EAAOU,UACPV,EAAOW,SAGR,OADAjC,EAAMkC,SAASlC,EAAMc,MAAMqB,GAAGC,iBAAiBN,KACxC,CACP,CACD,CAED,MAAMO,EAAa3B,EACjB4B,MAAM,MACNC,KAAKC,GACL3B,EAAO4B,KAAK,YAAa,KAAMD,EAAO,CAAC3B,EAAOH,KAAK8B,IAAS,MAExDV,EAAQ,IAAIC,EAAMW,EAASC,UAAUN,GAAa,EAAG,GAE3D,OADArC,EAAMkC,SAASlC,EAAMc,MAAMqB,GAAGC,iBAAiBN,KACxC,CACR"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
/**
|
|
3
|
-
* Lightweight paste normalizer for rich-paste editors (email).
|
|
4
|
-
* Fixes Google Docs' standalone `<br>` between paragraphs and collapses
|
|
5
|
-
* consecutive empty paragraphs — but keeps ALL formatting marks intact.
|
|
6
|
-
*/
|
|
7
|
-
export declare const ClipboardNormalizationExtension: Extension<any, any>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgSendAirplane2: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgSendAirplane2;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgAiAgent: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgAiAgent;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgAtSymbol: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgAtSymbol;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgHangup: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgHangup;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgIncomingCall: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgIncomingCall;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgOutgoingCall: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgOutgoingCall;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgPhoneCall: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgPhoneCall;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgTranscript: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgTranscript;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgBookOpen: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgBookOpen;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
|
-
interface Props extends SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgAiVoiceAgent: ({ size, color, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgAiVoiceAgent;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default as FbCommentTicket } from './FbCommentTicket';
|
|
2
|
-
export { default as FbTicket } from './FbTicket';
|
|
3
|
-
export { default as IgCommentTicket } from './IgCommentTicket';
|
|
4
|
-
export { default as IgTicket } from './IgTicket';
|
|
5
|
-
export { default as MailTicket } from './MailTicket';
|
|
6
|
-
export { default as PhoneTicket } from './PhoneTicket';
|
|
7
|
-
export { default as TaskTicket } from './TaskTicket';
|
|
8
|
-
export { default as WhatsappTicket } from './WhatsappTicket';
|