@wazobiatech/wazui 0.0.16 → 0.0.17
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/{PictureBlot-DsqHXQHd.js → PictureBlot-B7Ope1o8.js} +2 -2
- package/dist/{PictureBlot-DsqHXQHd.js.map → PictureBlot-B7Ope1o8.js.map} +1 -1
- package/dist/{PictureBlot-DVJ33YF8.cjs → PictureBlot-DK2nWljS.cjs} +2 -2
- package/dist/{PictureBlot-DVJ33YF8.cjs.map → PictureBlot-DK2nWljS.cjs.map} +1 -1
- package/dist/components/wazui/PagesContentComponent/PagesContentComponent.d.ts.map +1 -1
- package/dist/{index-BYi-7ndi.js → index-CP3vOLLn.js} +5 -6
- package/dist/index-CP3vOLLn.js.map +4 -0
- package/dist/{index-BNm71m46.cjs → index-CWFJOyHy.cjs} +5 -5
- package/dist/index-CWFJOyHy.cjs.map +4 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{quill-Cjc-Xw3_.cjs → quill-CfsOhlVA.cjs} +2 -2
- package/dist/{quill-Cjc-Xw3_.cjs.map → quill-CfsOhlVA.cjs.map} +1 -1
- package/dist/{quill-95fxWbma.js → quill-D5usMbvq.js} +2 -2
- package/dist/{quill-95fxWbma.js.map → quill-D5usMbvq.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BNm71m46.cjs.map +0 -4
- package/dist/index-BYi-7ndi.js.map +0 -4
|
@@ -5,7 +5,7 @@ var y = (d, a, s) => b(d, typeof a != "symbol" ? a + "" : a, s);
|
|
|
5
5
|
const h = async () => {
|
|
6
6
|
if (typeof window > "u") return null;
|
|
7
7
|
try {
|
|
8
|
-
const a = (await import("./quill-
|
|
8
|
+
const a = (await import("./quill-D5usMbvq.js")).default.import("blots/block/embed");
|
|
9
9
|
class s extends a {
|
|
10
10
|
static create(r) {
|
|
11
11
|
const p = document.createElement("div");
|
|
@@ -99,4 +99,4 @@ const h = async () => {
|
|
|
99
99
|
export {
|
|
100
100
|
h as default
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=PictureBlot-
|
|
102
|
+
//# sourceMappingURL=PictureBlot-B7Ope1o8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PictureBlot-DsqHXQHd.js","sources":["../src/components/wazui/WazUiWysiwygInput/blots/PictureBlot.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { PictureBlotReturnValue, PictureBlotValue, QuillBlockEmbedStatic } from './types';\n\nconst createPictureBlot = async () => {\n if (typeof window === 'undefined') return null;\n\n try {\n const Quill = (await import('quill')).default;\n const BlockEmbed = Quill.import('blots/block/embed') as QuillBlockEmbedStatic;\n\n class PictureBlot extends (BlockEmbed as any) {\n static blotName = 'picture';\n static tagName = 'div';\n static className = 'ql-picture-container';\n\n static create(value: PictureBlotValue): HTMLElement {\n const container = document.createElement('div');\n container.className = 'ql-picture-container';\n container.style.margin = '1em 0';\n\n const pictureElement = document.createElement('picture');\n\n // Create source elements\n value.sources.forEach(source => {\n const sourceElement = document.createElement('source');\n sourceElement.setAttribute('media', source.media);\n sourceElement.setAttribute('srcset', source.srcset);\n sourceElement.setAttribute('type', source.type);\n pictureElement.appendChild(sourceElement);\n });\n\n // Create fallback img element\n const imgElement = document.createElement('img');\n imgElement.setAttribute('src', value.fallbackSrc);\n imgElement.setAttribute('alt', value.alt);\n imgElement.setAttribute('loading', 'lazy');\n imgElement.style.maxWidth = '100%';\n imgElement.style.height = 'auto';\n pictureElement.appendChild(imgElement);\n\n // Create caption element\n const captionWrapper = document.createElement('div');\n captionWrapper.className = 'ql-picture-caption-wrapper';\n captionWrapper.style.position = 'relative';\n\n const captionElement = document.createElement('div');\n captionElement.className = 'ql-picture-caption';\n captionElement.innerHTML = value.caption || 'Click to edit caption...';\n captionElement.style.fontStyle = 'italic';\n captionElement.style.color = value.caption ? '#666' : '#999';\n captionElement.style.fontSize = '14px';\n captionElement.style.marginTop = '8px';\n captionElement.style.textAlign = 'center';\n captionElement.style.minHeight = '1.2em';\n captionElement.style.outline = 'none';\n captionElement.style.padding = '4px';\n captionElement.style.borderRadius = '4px';\n captionElement.style.cursor = 'text';\n captionElement.style.border = '1px solid transparent';\n\n // Make it NOT contenteditable initially to prevent interference\n captionElement.contentEditable = 'false';\n\n // Store original caption value\n captionElement.setAttribute('data-original-caption', value.caption || '');\n\n // Flag to track editing state\n let isEditingCaption = false;\n\n // Enhanced click handler with better focus management\n captionElement.addEventListener('click', e => {\n e.stopPropagation();\n e.preventDefault();\n\n if (isEditingCaption) return; // Already editing\n\n isEditingCaption = true;\n\n // Mark the caption as being edited (for Quill to ignore)\n captionElement.setAttribute('data-editing', 'true');\n\n // Enter edit mode\n captionElement.contentEditable = 'true';\n\n // Handle placeholder\n if (captionElement.innerHTML === 'Click to edit caption...') {\n captionElement.innerHTML = '';\n captionElement.style.color = '#666';\n }\n\n captionElement.style.border = '1px solid #ddd';\n\n // Focus with a slight delay to ensure DOM is ready\n setTimeout(() => {\n captionElement.focus();\n\n // Set cursor position at the end\n const range = document.createRange();\n const selection = window.getSelection();\n\n if (captionElement.childNodes.length > 0) {\n const lastNode = captionElement.childNodes[captionElement.childNodes.length - 1];\n if (lastNode && lastNode.nodeType === Node.TEXT_NODE) {\n range.setStart(lastNode, lastNode.textContent?.length || 0);\n } else if (lastNode) {\n range.setStartAfter(lastNode);\n }\n } else {\n range.setStart(captionElement, 0);\n }\n\n range.collapse(true);\n selection?.removeAllRanges();\n selection?.addRange(range);\n }, 0);\n });\n\n // Enhanced blur handler\n captionElement.addEventListener('blur', () => {\n // Small delay to prevent immediate re-blur from Quill interference\n setTimeout(() => {\n if (isEditingCaption) {\n isEditingCaption = false;\n captionElement.removeAttribute('data-editing');\n\n // Exit edit mode\n captionElement.contentEditable = 'false';\n const text = captionElement.innerHTML.trim();\n if (!text || text === '<br>') {\n captionElement.innerHTML = 'Click to edit caption...';\n captionElement.style.color = '#999';\n }\n captionElement.style.border = '1px solid transparent';\n }\n }, 10);\n });\n\n // Improved keydown handler\n captionElement.addEventListener('keydown', e => {\n if (!isEditingCaption) return;\n\n // Handle Enter and Escape to exit edit mode\n if (e.key === 'Enter' || e.key === 'Escape') {\n e.stopPropagation();\n e.preventDefault();\n captionElement.blur();\n return;\n }\n\n // Handle backspace when caption is empty - delete the entire image\n if (e.key === 'Backspace') {\n const text = captionElement.innerHTML.trim();\n if (!text || text === '<br>' || text === 'Click to edit caption...') {\n e.stopPropagation();\n e.preventDefault();\n\n // Delete the entire image container\n const imageContainer = captionElement.closest('.ql-picture-container');\n if (imageContainer && imageContainer.parentNode) {\n imageContainer.parentNode.removeChild(imageContainer);\n\n // Try to focus back to the editor\n setTimeout(() => {\n const quillEditor = document.querySelector('.ql-editor');\n if (quillEditor) {\n (quillEditor as HTMLElement).focus();\n }\n }, 10);\n }\n return;\n }\n }\n\n // Stop all other events from reaching Quill during caption editing\n e.stopPropagation();\n });\n\n // Stop input events from reaching Quill during editing\n captionElement.addEventListener('input', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n // Prevent mouse events from reaching Quill during editing\n captionElement.addEventListener('mousedown', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n captionElement.addEventListener('mouseup', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n // Add paste event handler to prevent bubbling to main editor\n captionElement.addEventListener('paste', e => {\n if (isEditingCaption) {\n e.stopPropagation(); // Prevent bubbling to Quill's paste handler\n // Let the default paste behavior handle the text insertion into caption\n }\n });\n\n // Prevent mouse events from bubbling to Quill - REMOVE THESE\n // captionElement.addEventListener('mousedown', (e) => {\n // e.stopPropagation();\n // });\n\n // captionElement.addEventListener('click', (e) => {\n // e.stopPropagation();\n // captionElement.focus();\n // });\n\n captionWrapper.appendChild(captionElement);\n container.appendChild(pictureElement);\n container.appendChild(captionWrapper);\n\n // Make the container non-editable for Quill\n container.contentEditable = 'false';\n\n return container;\n }\n\n static value(node: HTMLElement): PictureBlotReturnValue {\n const sources = Array.from(node.querySelectorAll('source')).map(source => ({\n media: source.getAttribute('media') || '',\n srcset: source.getAttribute('srcset') || '',\n type: source.getAttribute('type') || '',\n }));\n\n const img = node.querySelector('img');\n const captionElement = node.querySelector('.ql-picture-caption');\n let caption = '';\n\n if (captionElement) {\n const text = captionElement.innerHTML.trim();\n if (text && text !== 'Click to edit caption...') {\n caption = text;\n }\n }\n\n return {\n sources,\n fallbackSrc: img?.getAttribute('src') || '',\n alt: img?.getAttribute('alt') || '',\n caption,\n };\n }\n }\n\n return PictureBlot;\n } catch (error) {\n console.error('Failed to create PictureBlot:', error);\n return null;\n }\n};\n\nexport default createPictureBlot;\n"],"names":["createPictureBlot","BlockEmbed","PictureBlot","value","container","pictureElement","source","sourceElement","imgElement","captionWrapper","captionElement","isEditingCaption","range","selection","lastNode","_a","text","imageContainer","quillEditor","node","sources","img","caption","__publicField","error"],"mappings":";;;;AAIA,MAAMA,IAAoB,YAAY;AACpC,MAAI,OAAO,SAAW,IAAa,QAAO;AAE1C,MAAI;AAEF,UAAMC,KADS,MAAM,OAAO,qBAAO,GAAG,QACb,OAAO,mBAAmB;AAAA,IAEnD,MAAMC,UAAqBD,EAAmB;AAAA,MAK5C,OAAO,OAAOE,GAAsC;AAClD,cAAMC,IAAY,SAAS,cAAc,KAAK;AAC9C,QAAAA,EAAU,YAAY,wBACtBA,EAAU,MAAM,SAAS;AAEzB,cAAMC,IAAiB,SAAS,cAAc,SAAS;AAGvD,QAAAF,EAAM,QAAQ,QAAQ,CAAAG,MAAU;AAC9B,gBAAMC,IAAgB,SAAS,cAAc,QAAQ;AACrD,UAAAA,EAAc,aAAa,SAASD,EAAO,KAAK,GAChDC,EAAc,aAAa,UAAUD,EAAO,MAAM,GAClDC,EAAc,aAAa,QAAQD,EAAO,IAAI,GAC9CD,EAAe,YAAYE,CAAa;AAAA,QAC1C,CAAC;AAGD,cAAMC,IAAa,SAAS,cAAc,KAAK;AAC/C,QAAA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IAAA;AA9OA,WAAAC,EADIrB,GACG,YAAW,YAClBqB,EAFIrB,GAEG,WAAU,QACjBqB,EAHIrB,GAGG,aAAY,yBA+OdA;AAAA,EACT,SAASsB,GAAO;AACd,mBAAQ,MAAM,iCAAiCA,CAAK,GAC7C;AAAA,EACT;AACF;"}
|
|
1
|
+
{"version":3,"file":"PictureBlot-B7Ope1o8.js","sources":["../src/components/wazui/WazUiWysiwygInput/blots/PictureBlot.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { PictureBlotReturnValue, PictureBlotValue, QuillBlockEmbedStatic } from './types';\n\nconst createPictureBlot = async () => {\n if (typeof window === 'undefined') return null;\n\n try {\n const Quill = (await import('quill')).default;\n const BlockEmbed = Quill.import('blots/block/embed') as QuillBlockEmbedStatic;\n\n class PictureBlot extends (BlockEmbed as any) {\n static blotName = 'picture';\n static tagName = 'div';\n static className = 'ql-picture-container';\n\n static create(value: PictureBlotValue): HTMLElement {\n const container = document.createElement('div');\n container.className = 'ql-picture-container';\n container.style.margin = '1em 0';\n\n const pictureElement = document.createElement('picture');\n\n // Create source elements\n value.sources.forEach(source => {\n const sourceElement = document.createElement('source');\n sourceElement.setAttribute('media', source.media);\n sourceElement.setAttribute('srcset', source.srcset);\n sourceElement.setAttribute('type', source.type);\n pictureElement.appendChild(sourceElement);\n });\n\n // Create fallback img element\n const imgElement = document.createElement('img');\n imgElement.setAttribute('src', value.fallbackSrc);\n imgElement.setAttribute('alt', value.alt);\n imgElement.setAttribute('loading', 'lazy');\n imgElement.style.maxWidth = '100%';\n imgElement.style.height = 'auto';\n pictureElement.appendChild(imgElement);\n\n // Create caption element\n const captionWrapper = document.createElement('div');\n captionWrapper.className = 'ql-picture-caption-wrapper';\n captionWrapper.style.position = 'relative';\n\n const captionElement = document.createElement('div');\n captionElement.className = 'ql-picture-caption';\n captionElement.innerHTML = value.caption || 'Click to edit caption...';\n captionElement.style.fontStyle = 'italic';\n captionElement.style.color = value.caption ? '#666' : '#999';\n captionElement.style.fontSize = '14px';\n captionElement.style.marginTop = '8px';\n captionElement.style.textAlign = 'center';\n captionElement.style.minHeight = '1.2em';\n captionElement.style.outline = 'none';\n captionElement.style.padding = '4px';\n captionElement.style.borderRadius = '4px';\n captionElement.style.cursor = 'text';\n captionElement.style.border = '1px solid transparent';\n\n // Make it NOT contenteditable initially to prevent interference\n captionElement.contentEditable = 'false';\n\n // Store original caption value\n captionElement.setAttribute('data-original-caption', value.caption || '');\n\n // Flag to track editing state\n let isEditingCaption = false;\n\n // Enhanced click handler with better focus management\n captionElement.addEventListener('click', e => {\n e.stopPropagation();\n e.preventDefault();\n\n if (isEditingCaption) return; // Already editing\n\n isEditingCaption = true;\n\n // Mark the caption as being edited (for Quill to ignore)\n captionElement.setAttribute('data-editing', 'true');\n\n // Enter edit mode\n captionElement.contentEditable = 'true';\n\n // Handle placeholder\n if (captionElement.innerHTML === 'Click to edit caption...') {\n captionElement.innerHTML = '';\n captionElement.style.color = '#666';\n }\n\n captionElement.style.border = '1px solid #ddd';\n\n // Focus with a slight delay to ensure DOM is ready\n setTimeout(() => {\n captionElement.focus();\n\n // Set cursor position at the end\n const range = document.createRange();\n const selection = window.getSelection();\n\n if (captionElement.childNodes.length > 0) {\n const lastNode = captionElement.childNodes[captionElement.childNodes.length - 1];\n if (lastNode && lastNode.nodeType === Node.TEXT_NODE) {\n range.setStart(lastNode, lastNode.textContent?.length || 0);\n } else if (lastNode) {\n range.setStartAfter(lastNode);\n }\n } else {\n range.setStart(captionElement, 0);\n }\n\n range.collapse(true);\n selection?.removeAllRanges();\n selection?.addRange(range);\n }, 0);\n });\n\n // Enhanced blur handler\n captionElement.addEventListener('blur', () => {\n // Small delay to prevent immediate re-blur from Quill interference\n setTimeout(() => {\n if (isEditingCaption) {\n isEditingCaption = false;\n captionElement.removeAttribute('data-editing');\n\n // Exit edit mode\n captionElement.contentEditable = 'false';\n const text = captionElement.innerHTML.trim();\n if (!text || text === '<br>') {\n captionElement.innerHTML = 'Click to edit caption...';\n captionElement.style.color = '#999';\n }\n captionElement.style.border = '1px solid transparent';\n }\n }, 10);\n });\n\n // Improved keydown handler\n captionElement.addEventListener('keydown', e => {\n if (!isEditingCaption) return;\n\n // Handle Enter and Escape to exit edit mode\n if (e.key === 'Enter' || e.key === 'Escape') {\n e.stopPropagation();\n e.preventDefault();\n captionElement.blur();\n return;\n }\n\n // Handle backspace when caption is empty - delete the entire image\n if (e.key === 'Backspace') {\n const text = captionElement.innerHTML.trim();\n if (!text || text === '<br>' || text === 'Click to edit caption...') {\n e.stopPropagation();\n e.preventDefault();\n\n // Delete the entire image container\n const imageContainer = captionElement.closest('.ql-picture-container');\n if (imageContainer && imageContainer.parentNode) {\n imageContainer.parentNode.removeChild(imageContainer);\n\n // Try to focus back to the editor\n setTimeout(() => {\n const quillEditor = document.querySelector('.ql-editor');\n if (quillEditor) {\n (quillEditor as HTMLElement).focus();\n }\n }, 10);\n }\n return;\n }\n }\n\n // Stop all other events from reaching Quill during caption editing\n e.stopPropagation();\n });\n\n // Stop input events from reaching Quill during editing\n captionElement.addEventListener('input', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n // Prevent mouse events from reaching Quill during editing\n captionElement.addEventListener('mousedown', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n captionElement.addEventListener('mouseup', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n // Add paste event handler to prevent bubbling to main editor\n captionElement.addEventListener('paste', e => {\n if (isEditingCaption) {\n e.stopPropagation(); // Prevent bubbling to Quill's paste handler\n // Let the default paste behavior handle the text insertion into caption\n }\n });\n\n // Prevent mouse events from bubbling to Quill - REMOVE THESE\n // captionElement.addEventListener('mousedown', (e) => {\n // e.stopPropagation();\n // });\n\n // captionElement.addEventListener('click', (e) => {\n // e.stopPropagation();\n // captionElement.focus();\n // });\n\n captionWrapper.appendChild(captionElement);\n container.appendChild(pictureElement);\n container.appendChild(captionWrapper);\n\n // Make the container non-editable for Quill\n container.contentEditable = 'false';\n\n return container;\n }\n\n static value(node: HTMLElement): PictureBlotReturnValue {\n const sources = Array.from(node.querySelectorAll('source')).map(source => ({\n media: source.getAttribute('media') || '',\n srcset: source.getAttribute('srcset') || '',\n type: source.getAttribute('type') || '',\n }));\n\n const img = node.querySelector('img');\n const captionElement = node.querySelector('.ql-picture-caption');\n let caption = '';\n\n if (captionElement) {\n const text = captionElement.innerHTML.trim();\n if (text && text !== 'Click to edit caption...') {\n caption = text;\n }\n }\n\n return {\n sources,\n fallbackSrc: img?.getAttribute('src') || '',\n alt: img?.getAttribute('alt') || '',\n caption,\n };\n }\n }\n\n return PictureBlot;\n } catch (error) {\n console.error('Failed to create PictureBlot:', error);\n return null;\n }\n};\n\nexport default createPictureBlot;\n"],"names":["createPictureBlot","BlockEmbed","PictureBlot","value","container","pictureElement","source","sourceElement","imgElement","captionWrapper","captionElement","isEditingCaption","range","selection","lastNode","_a","text","imageContainer","quillEditor","node","sources","img","caption","__publicField","error"],"mappings":";;;;AAIA,MAAMA,IAAoB,YAAY;AACpC,MAAI,OAAO,SAAW,IAAa,QAAO;AAE1C,MAAI;AAEF,UAAMC,KADS,MAAM,OAAO,qBAAO,GAAG,QACb,OAAO,mBAAmB;AAAA,IAEnD,MAAMC,UAAqBD,EAAmB;AAAA,MAK5C,OAAO,OAAOE,GAAsC;AAClD,cAAMC,IAAY,SAAS,cAAc,KAAK;AAC9C,QAAAA,EAAU,YAAY,wBACtBA,EAAU,MAAM,SAAS;AAEzB,cAAMC,IAAiB,SAAS,cAAc,SAAS;AAGvD,QAAAF,EAAM,QAAQ,QAAQ,CAAAG,MAAU;AAC9B,gBAAMC,IAAgB,SAAS,cAAc,QAAQ;AACrD,UAAAA,EAAc,aAAa,SAASD,EAAO,KAAK,GAChDC,EAAc,aAAa,UAAUD,EAAO,MAAM,GAClDC,EAAc,aAAa,QAAQD,EAAO,IAAI,GAC9CD,EAAe,YAAYE,CAAa;AAAA,QAC1C,CAAC;AAGD,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ACjC,SAAAC;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AA9OA,WAAAC,EADIrB,GACG,YAAW,YAClBqB,EAFIrB,GAEG,WAAU,QACjBqB,EAHIrB,GAGG,aAAY,yBA+OdA;AAAA,EACT,SAASsB,GAAO;AACd,mBAAQ,MAAM,iCAAiCA,CAAK,GAC7C;AAAA,EACT;AACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";var g=Object.defineProperty;var b=(d,a,s)=>a in d?g(d,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):d[a]=s;var y=(d,a,s)=>b(d,typeof a!="symbol"?a+"":a,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=async()=>{if(typeof window>"u")return null;try{const a=(await Promise.resolve().then(()=>require("./quill-
|
|
2
|
-
//# sourceMappingURL=PictureBlot-
|
|
1
|
+
"use client";"use strict";var g=Object.defineProperty;var b=(d,a,s)=>a in d?g(d,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):d[a]=s;var y=(d,a,s)=>b(d,typeof a!="symbol"?a+"":a,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=async()=>{if(typeof window>"u")return null;try{const a=(await Promise.resolve().then(()=>require("./quill-CfsOhlVA.cjs"))).default.import("blots/block/embed");class s extends a{static create(r){const p=document.createElement("div");p.className="ql-picture-container",p.style.margin="1em 0";const o=document.createElement("picture");r.sources.forEach(e=>{const i=document.createElement("source");i.setAttribute("media",e.media),i.setAttribute("srcset",e.srcset),i.setAttribute("type",e.type),o.appendChild(i)});const l=document.createElement("img");l.setAttribute("src",r.fallbackSrc),l.setAttribute("alt",r.alt),l.setAttribute("loading","lazy"),l.style.maxWidth="100%",l.style.height="auto",o.appendChild(l);const u=document.createElement("div");u.className="ql-picture-caption-wrapper",u.style.position="relative";const t=document.createElement("div");t.className="ql-picture-caption",t.innerHTML=r.caption||"Click to edit caption...",t.style.fontStyle="italic",t.style.color=r.caption?"#666":"#999",t.style.fontSize="14px",t.style.marginTop="8px",t.style.textAlign="center",t.style.minHeight="1.2em",t.style.outline="none",t.style.padding="4px",t.style.borderRadius="4px",t.style.cursor="text",t.style.border="1px solid transparent",t.contentEditable="false",t.setAttribute("data-original-caption",r.caption||"");let c=!1;return t.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),!c&&(c=!0,t.setAttribute("data-editing","true"),t.contentEditable="true",t.innerHTML==="Click to edit caption..."&&(t.innerHTML="",t.style.color="#666"),t.style.border="1px solid #ddd",setTimeout(()=>{var f;t.focus();const i=document.createRange(),n=window.getSelection();if(t.childNodes.length>0){const m=t.childNodes[t.childNodes.length-1];m&&m.nodeType===Node.TEXT_NODE?i.setStart(m,((f=m.textContent)==null?void 0:f.length)||0):m&&i.setStartAfter(m)}else i.setStart(t,0);i.collapse(!0),n==null||n.removeAllRanges(),n==null||n.addRange(i)},0))}),t.addEventListener("blur",()=>{setTimeout(()=>{if(c){c=!1,t.removeAttribute("data-editing"),t.contentEditable="false";const e=t.innerHTML.trim();(!e||e==="<br>")&&(t.innerHTML="Click to edit caption...",t.style.color="#999"),t.style.border="1px solid transparent"}},10)}),t.addEventListener("keydown",e=>{if(c){if(e.key==="Enter"||e.key==="Escape"){e.stopPropagation(),e.preventDefault(),t.blur();return}if(e.key==="Backspace"){const i=t.innerHTML.trim();if(!i||i==="<br>"||i==="Click to edit caption..."){e.stopPropagation(),e.preventDefault();const n=t.closest(".ql-picture-container");n&&n.parentNode&&(n.parentNode.removeChild(n),setTimeout(()=>{const f=document.querySelector(".ql-editor");f&&f.focus()},10));return}}e.stopPropagation()}}),t.addEventListener("input",e=>{c&&e.stopPropagation()}),t.addEventListener("mousedown",e=>{c&&e.stopPropagation()}),t.addEventListener("mouseup",e=>{c&&e.stopPropagation()}),t.addEventListener("paste",e=>{c&&e.stopPropagation()}),u.appendChild(t),p.appendChild(o),p.appendChild(u),p.contentEditable="false",p}static value(r){const p=Array.from(r.querySelectorAll("source")).map(t=>({media:t.getAttribute("media")||"",srcset:t.getAttribute("srcset")||"",type:t.getAttribute("type")||""})),o=r.querySelector("img"),l=r.querySelector(".ql-picture-caption");let u="";if(l){const t=l.innerHTML.trim();t&&t!=="Click to edit caption..."&&(u=t)}return{sources:p,fallbackSrc:(o==null?void 0:o.getAttribute("src"))||"",alt:(o==null?void 0:o.getAttribute("alt"))||"",caption:u}}}return y(s,"blotName","picture"),y(s,"tagName","div"),y(s,"className","ql-picture-container"),s}catch(d){return console.error("Failed to create PictureBlot:",d),null}};exports.default=E;
|
|
2
|
+
//# sourceMappingURL=PictureBlot-DK2nWljS.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PictureBlot-DVJ33YF8.cjs","sources":["../src/components/wazui/WazUiWysiwygInput/blots/PictureBlot.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { PictureBlotReturnValue, PictureBlotValue, QuillBlockEmbedStatic } from './types';\n\nconst createPictureBlot = async () => {\n if (typeof window === 'undefined') return null;\n\n try {\n const Quill = (await import('quill')).default;\n const BlockEmbed = Quill.import('blots/block/embed') as QuillBlockEmbedStatic;\n\n class PictureBlot extends (BlockEmbed as any) {\n static blotName = 'picture';\n static tagName = 'div';\n static className = 'ql-picture-container';\n\n static create(value: PictureBlotValue): HTMLElement {\n const container = document.createElement('div');\n container.className = 'ql-picture-container';\n container.style.margin = '1em 0';\n\n const pictureElement = document.createElement('picture');\n\n // Create source elements\n value.sources.forEach(source => {\n const sourceElement = document.createElement('source');\n sourceElement.setAttribute('media', source.media);\n sourceElement.setAttribute('srcset', source.srcset);\n sourceElement.setAttribute('type', source.type);\n pictureElement.appendChild(sourceElement);\n });\n\n // Create fallback img element\n const imgElement = document.createElement('img');\n imgElement.setAttribute('src', value.fallbackSrc);\n imgElement.setAttribute('alt', value.alt);\n imgElement.setAttribute('loading', 'lazy');\n imgElement.style.maxWidth = '100%';\n imgElement.style.height = 'auto';\n pictureElement.appendChild(imgElement);\n\n // Create caption element\n const captionWrapper = document.createElement('div');\n captionWrapper.className = 'ql-picture-caption-wrapper';\n captionWrapper.style.position = 'relative';\n\n const captionElement = document.createElement('div');\n captionElement.className = 'ql-picture-caption';\n captionElement.innerHTML = value.caption || 'Click to edit caption...';\n captionElement.style.fontStyle = 'italic';\n captionElement.style.color = value.caption ? '#666' : '#999';\n captionElement.style.fontSize = '14px';\n captionElement.style.marginTop = '8px';\n captionElement.style.textAlign = 'center';\n captionElement.style.minHeight = '1.2em';\n captionElement.style.outline = 'none';\n captionElement.style.padding = '4px';\n captionElement.style.borderRadius = '4px';\n captionElement.style.cursor = 'text';\n captionElement.style.border = '1px solid transparent';\n\n // Make it NOT contenteditable initially to prevent interference\n captionElement.contentEditable = 'false';\n\n // Store original caption value\n captionElement.setAttribute('data-original-caption', value.caption || '');\n\n // Flag to track editing state\n let isEditingCaption = false;\n\n // Enhanced click handler with better focus management\n captionElement.addEventListener('click', e => {\n e.stopPropagation();\n e.preventDefault();\n\n if (isEditingCaption) return; // Already editing\n\n isEditingCaption = true;\n\n // Mark the caption as being edited (for Quill to ignore)\n captionElement.setAttribute('data-editing', 'true');\n\n // Enter edit mode\n captionElement.contentEditable = 'true';\n\n // Handle placeholder\n if (captionElement.innerHTML === 'Click to edit caption...') {\n captionElement.innerHTML = '';\n captionElement.style.color = '#666';\n }\n\n captionElement.style.border = '1px solid #ddd';\n\n // Focus with a slight delay to ensure DOM is ready\n setTimeout(() => {\n captionElement.focus();\n\n // Set cursor position at the end\n const range = document.createRange();\n const selection = window.getSelection();\n\n if (captionElement.childNodes.length > 0) {\n const lastNode = captionElement.childNodes[captionElement.childNodes.length - 1];\n if (lastNode && lastNode.nodeType === Node.TEXT_NODE) {\n range.setStart(lastNode, lastNode.textContent?.length || 0);\n } else if (lastNode) {\n range.setStartAfter(lastNode);\n }\n } else {\n range.setStart(captionElement, 0);\n }\n\n range.collapse(true);\n selection?.removeAllRanges();\n selection?.addRange(range);\n }, 0);\n });\n\n // Enhanced blur handler\n captionElement.addEventListener('blur', () => {\n // Small delay to prevent immediate re-blur from Quill interference\n setTimeout(() => {\n if (isEditingCaption) {\n isEditingCaption = false;\n captionElement.removeAttribute('data-editing');\n\n // Exit edit mode\n captionElement.contentEditable = 'false';\n const text = captionElement.innerHTML.trim();\n if (!text || text === '<br>') {\n captionElement.innerHTML = 'Click to edit caption...';\n captionElement.style.color = '#999';\n }\n captionElement.style.border = '1px solid transparent';\n }\n }, 10);\n });\n\n // Improved keydown handler\n captionElement.addEventListener('keydown', e => {\n if (!isEditingCaption) return;\n\n // Handle Enter and Escape to exit edit mode\n if (e.key === 'Enter' || e.key === 'Escape') {\n e.stopPropagation();\n e.preventDefault();\n captionElement.blur();\n return;\n }\n\n // Handle backspace when caption is empty - delete the entire image\n if (e.key === 'Backspace') {\n const text = captionElement.innerHTML.trim();\n if (!text || text === '<br>' || text === 'Click to edit caption...') {\n e.stopPropagation();\n e.preventDefault();\n\n // Delete the entire image container\n const imageContainer = captionElement.closest('.ql-picture-container');\n if (imageContainer && imageContainer.parentNode) {\n imageContainer.parentNode.removeChild(imageContainer);\n\n // Try to focus back to the editor\n setTimeout(() => {\n const quillEditor = document.querySelector('.ql-editor');\n if (quillEditor) {\n (quillEditor as HTMLElement).focus();\n }\n }, 10);\n }\n return;\n }\n }\n\n // Stop all other events from reaching Quill during caption editing\n e.stopPropagation();\n });\n\n // Stop input events from reaching Quill during editing\n captionElement.addEventListener('input', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n // Prevent mouse events from reaching Quill during editing\n captionElement.addEventListener('mousedown', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n captionElement.addEventListener('mouseup', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n // Add paste event handler to prevent bubbling to main editor\n captionElement.addEventListener('paste', e => {\n if (isEditingCaption) {\n e.stopPropagation(); // Prevent bubbling to Quill's paste handler\n // Let the default paste behavior handle the text insertion into caption\n }\n });\n\n // Prevent mouse events from bubbling to Quill - REMOVE THESE\n // captionElement.addEventListener('mousedown', (e) => {\n // e.stopPropagation();\n // });\n\n // captionElement.addEventListener('click', (e) => {\n // e.stopPropagation();\n // captionElement.focus();\n // });\n\n captionWrapper.appendChild(captionElement);\n container.appendChild(pictureElement);\n container.appendChild(captionWrapper);\n\n // Make the container non-editable for Quill\n container.contentEditable = 'false';\n\n return container;\n }\n\n static value(node: HTMLElement): PictureBlotReturnValue {\n const sources = Array.from(node.querySelectorAll('source')).map(source => ({\n media: source.getAttribute('media') || '',\n srcset: source.getAttribute('srcset') || '',\n type: source.getAttribute('type') || '',\n }));\n\n const img = node.querySelector('img');\n const captionElement = node.querySelector('.ql-picture-caption');\n let caption = '';\n\n if (captionElement) {\n const text = captionElement.innerHTML.trim();\n if (text && text !== 'Click to edit caption...') {\n caption = text;\n }\n }\n\n return {\n sources,\n fallbackSrc: img?.getAttribute('src') || '',\n alt: img?.getAttribute('alt') || '',\n caption,\n };\n }\n }\n\n return PictureBlot;\n } catch (error) {\n console.error('Failed to create PictureBlot:', error);\n return null;\n }\n};\n\nexport default createPictureBlot;\n"],"names":["createPictureBlot","BlockEmbed","PictureBlot","value","container","pictureElement","source","sourceElement","imgElement","captionWrapper","captionElement","isEditingCaption","range","selection","lastNode","_a","text","imageContainer","quillEditor","node","sources","img","caption","__publicField","error"],"mappings":"iQAIA,MAAMA,EAAoB,SAAY,CACpC,GAAI,OAAO,OAAW,IAAa,OAAO,KAE1C,GAAI,CAEF,MAAMC,GADS,MAAM,QAAA,QAAA,EAAA,KAAA,IAAA,QAAO,sBAAO,CAAA,GAAG,QACb,OAAO,mBAAmB,EAEnD,MAAMC,UAAqBD,CAAmB,CAK5C,OAAO,OAAOE,EAAsC,CAClD,MAAMC,EAAY,SAAS,cAAc,KAAK,EAC9CA,EAAU,UAAY,uBACtBA,EAAU,MAAM,OAAS,QAEzB,MAAMC,EAAiB,SAAS,cAAc,SAAS,EAGvDF,EAAM,QAAQ,QAAQG,GAAU,CA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B,EAAO,CACd,eAAQ,MAAM,gCAAiCA,CAAK,EAC7C,IACT,CACF"}
|
|
1
|
+
{"version":3,"file":"PictureBlot-DK2nWljS.cjs","sources":["../src/components/wazui/WazUiWysiwygInput/blots/PictureBlot.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { PictureBlotReturnValue, PictureBlotValue, QuillBlockEmbedStatic } from './types';\n\nconst createPictureBlot = async () => {\n if (typeof window === 'undefined') return null;\n\n try {\n const Quill = (await import('quill')).default;\n const BlockEmbed = Quill.import('blots/block/embed') as QuillBlockEmbedStatic;\n\n class PictureBlot extends (BlockEmbed as any) {\n static blotName = 'picture';\n static tagName = 'div';\n static className = 'ql-picture-container';\n\n static create(value: PictureBlotValue): HTMLElement {\n const container = document.createElement('div');\n container.className = 'ql-picture-container';\n container.style.margin = '1em 0';\n\n const pictureElement = document.createElement('picture');\n\n // Create source elements\n value.sources.forEach(source => {\n const sourceElement = document.createElement('source');\n sourceElement.setAttribute('media', source.media);\n sourceElement.setAttribute('srcset', source.srcset);\n sourceElement.setAttribute('type', source.type);\n pictureElement.appendChild(sourceElement);\n });\n\n // Create fallback img element\n const imgElement = document.createElement('img');\n imgElement.setAttribute('src', value.fallbackSrc);\n imgElement.setAttribute('alt', value.alt);\n imgElement.setAttribute('loading', 'lazy');\n imgElement.style.maxWidth = '100%';\n imgElement.style.height = 'auto';\n pictureElement.appendChild(imgElement);\n\n // Create caption element\n const captionWrapper = document.createElement('div');\n captionWrapper.className = 'ql-picture-caption-wrapper';\n captionWrapper.style.position = 'relative';\n\n const captionElement = document.createElement('div');\n captionElement.className = 'ql-picture-caption';\n captionElement.innerHTML = value.caption || 'Click to edit caption...';\n captionElement.style.fontStyle = 'italic';\n captionElement.style.color = value.caption ? '#666' : '#999';\n captionElement.style.fontSize = '14px';\n captionElement.style.marginTop = '8px';\n captionElement.style.textAlign = 'center';\n captionElement.style.minHeight = '1.2em';\n captionElement.style.outline = 'none';\n captionElement.style.padding = '4px';\n captionElement.style.borderRadius = '4px';\n captionElement.style.cursor = 'text';\n captionElement.style.border = '1px solid transparent';\n\n // Make it NOT contenteditable initially to prevent interference\n captionElement.contentEditable = 'false';\n\n // Store original caption value\n captionElement.setAttribute('data-original-caption', value.caption || '');\n\n // Flag to track editing state\n let isEditingCaption = false;\n\n // Enhanced click handler with better focus management\n captionElement.addEventListener('click', e => {\n e.stopPropagation();\n e.preventDefault();\n\n if (isEditingCaption) return; // Already editing\n\n isEditingCaption = true;\n\n // Mark the caption as being edited (for Quill to ignore)\n captionElement.setAttribute('data-editing', 'true');\n\n // Enter edit mode\n captionElement.contentEditable = 'true';\n\n // Handle placeholder\n if (captionElement.innerHTML === 'Click to edit caption...') {\n captionElement.innerHTML = '';\n captionElement.style.color = '#666';\n }\n\n captionElement.style.border = '1px solid #ddd';\n\n // Focus with a slight delay to ensure DOM is ready\n setTimeout(() => {\n captionElement.focus();\n\n // Set cursor position at the end\n const range = document.createRange();\n const selection = window.getSelection();\n\n if (captionElement.childNodes.length > 0) {\n const lastNode = captionElement.childNodes[captionElement.childNodes.length - 1];\n if (lastNode && lastNode.nodeType === Node.TEXT_NODE) {\n range.setStart(lastNode, lastNode.textContent?.length || 0);\n } else if (lastNode) {\n range.setStartAfter(lastNode);\n }\n } else {\n range.setStart(captionElement, 0);\n }\n\n range.collapse(true);\n selection?.removeAllRanges();\n selection?.addRange(range);\n }, 0);\n });\n\n // Enhanced blur handler\n captionElement.addEventListener('blur', () => {\n // Small delay to prevent immediate re-blur from Quill interference\n setTimeout(() => {\n if (isEditingCaption) {\n isEditingCaption = false;\n captionElement.removeAttribute('data-editing');\n\n // Exit edit mode\n captionElement.contentEditable = 'false';\n const text = captionElement.innerHTML.trim();\n if (!text || text === '<br>') {\n captionElement.innerHTML = 'Click to edit caption...';\n captionElement.style.color = '#999';\n }\n captionElement.style.border = '1px solid transparent';\n }\n }, 10);\n });\n\n // Improved keydown handler\n captionElement.addEventListener('keydown', e => {\n if (!isEditingCaption) return;\n\n // Handle Enter and Escape to exit edit mode\n if (e.key === 'Enter' || e.key === 'Escape') {\n e.stopPropagation();\n e.preventDefault();\n captionElement.blur();\n return;\n }\n\n // Handle backspace when caption is empty - delete the entire image\n if (e.key === 'Backspace') {\n const text = captionElement.innerHTML.trim();\n if (!text || text === '<br>' || text === 'Click to edit caption...') {\n e.stopPropagation();\n e.preventDefault();\n\n // Delete the entire image container\n const imageContainer = captionElement.closest('.ql-picture-container');\n if (imageContainer && imageContainer.parentNode) {\n imageContainer.parentNode.removeChild(imageContainer);\n\n // Try to focus back to the editor\n setTimeout(() => {\n const quillEditor = document.querySelector('.ql-editor');\n if (quillEditor) {\n (quillEditor as HTMLElement).focus();\n }\n }, 10);\n }\n return;\n }\n }\n\n // Stop all other events from reaching Quill during caption editing\n e.stopPropagation();\n });\n\n // Stop input events from reaching Quill during editing\n captionElement.addEventListener('input', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n // Prevent mouse events from reaching Quill during editing\n captionElement.addEventListener('mousedown', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n captionElement.addEventListener('mouseup', e => {\n if (isEditingCaption) {\n e.stopPropagation();\n }\n });\n\n // Add paste event handler to prevent bubbling to main editor\n captionElement.addEventListener('paste', e => {\n if (isEditingCaption) {\n e.stopPropagation(); // Prevent bubbling to Quill's paste handler\n // Let the default paste behavior handle the text insertion into caption\n }\n });\n\n // Prevent mouse events from bubbling to Quill - REMOVE THESE\n // captionElement.addEventListener('mousedown', (e) => {\n // e.stopPropagation();\n // });\n\n // captionElement.addEventListener('click', (e) => {\n // e.stopPropagation();\n // captionElement.focus();\n // });\n\n captionWrapper.appendChild(captionElement);\n container.appendChild(pictureElement);\n container.appendChild(captionWrapper);\n\n // Make the container non-editable for Quill\n container.contentEditable = 'false';\n\n return container;\n }\n\n static value(node: HTMLElement): PictureBlotReturnValue {\n const sources = Array.from(node.querySelectorAll('source')).map(source => ({\n media: source.getAttribute('media') || '',\n srcset: source.getAttribute('srcset') || '',\n type: source.getAttribute('type') || '',\n }));\n\n const img = node.querySelector('img');\n const captionElement = node.querySelector('.ql-picture-caption');\n let caption = '';\n\n if (captionElement) {\n const text = captionElement.innerHTML.trim();\n if (text && text !== 'Click to edit caption...') {\n caption = text;\n }\n }\n\n return {\n sources,\n fallbackSrc: img?.getAttribute('src') || '',\n alt: img?.getAttribute('alt') || '',\n caption,\n };\n }\n }\n\n return PictureBlot;\n } catch (error) {\n console.error('Failed to create PictureBlot:', error);\n return null;\n }\n};\n\nexport default createPictureBlot;\n"],"names":["createPictureBlot","BlockEmbed","PictureBlot","value","container","pictureElement","source","sourceElement","imgElement","captionWrapper","captionElement","isEditingCaption","range","selection","lastNode","_a","text","imageContainer","quillEditor","node","sources","img","caption","__publicField","error"],"mappings":"iQAIA,MAAMA,EAAoB,SAAY,CACpC,GAAI,OAAO,OAAW,IAAa,OAAO,KAE1C,GAAI,CAEF,MAAMC,GADS,MAAM,QAAA,QAAA,EAAA,KAAA,IAAA,QAAO,sBAAO,CAAA,GAAG,QACb,OAAO,mBAAmB,EAEnD,MAAMC,UAAqBD,CAAmB,CAK5C,OAAO,OAAOE,EAAsC,CAClD,MAAMC,EAAY,SAAS,cAAc,KAAK,EAC9CA,EAAU,UAAY,uBACtBA,EAAU,MAAM,OAAS,QAEzB,MAAMC,EAAiB,SAAS,cAAc,SAAS,EAGvDF,EAAM,QAAQ,QAAQG,GAAU,CAC9B,MAAMC,EAAgB,SAAS,cAAc,QAAQ,EACrDA,EAAc,aAAa,QAASD,EAAO,KAAK,EAChDC,EAAc,aAAa,SAAUD,EAAO,MAAM,EAClDC,EAAc,aAAa,OAAQD,EAAO,IAAI,EAC9CD,EAAe,YAAYE,CAAa,CAC1C,CAAC,EAGD,MAAMC,EAAa,SAAS,cAAc,KAAK,EAC/CA,EAAW,aAAa,MAAOL,EAAM,WAAW,EAChDK,EAAW,aAAa,MAAOL,EAAM,GAAG,EACxCK,EAAW,aAAa,UAAW,MAAM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,GACF,EAAE,gBAAA,CAEN,CAAC,EAGDD,EAAe,iBAAiB,QAAS,GAAK,CACxCC,GACF,EAAE,gBAAA,CAGN,CAAC,EAYDF,EAAe,YAAYC,CAAc,EACzCN,EAAU,YAAYC,CAAc,EACpCD,EAAU,YAAYK,CAAc,EAGpCL,EAAU,gBAAkB,QAErBA,CACT,CAEA,OAAO,MAAMe,EAA2C,CACtD,MAAMC,EAAU,MAAM,KAAKD,EAAK,iBAAiB,QAAQ,CAAC,EAAE,IAAIb,IAAW,CACzE,MAAOA,EAAO,aAAa,OAAO,GAAK,GACvC,OAAQA,EAAO,aAAa,QAAQ,GAAK,GACzC,KAAMA,EAAO,aAAa,MAAM,GAAK,EAAA,EACrC,EAEIe,EAAMF,EAAK,cAAc,KAAK,EAC9BT,EAAiBS,EAAK,cAAc,qBAAqB,EAC/D,IAAIG,EAAU,GAEd,GAAIZ,EAAgB,CAClB,MAAMM,EAAON,EAAe,UAAU,KAAA,EAClCM,GAAQA,IAAS,6BACnBM,EAAUN,EAEd,CAEA,MAAO,CACL,QAAAI,EACA,aAAaC,GAAA,YAAAA,EAAK,aAAa,SAAU,GACzC,KAAKA,GAAA,YAAAA,EAAK,aAAa,SAAU,GACjC,QAAAC,CAAA,CAEJ,CAAA,CA9OA,OAAAC,EADIrB,EACG,WAAW,WAClBqB,EAFIrB,EAEG,UAAU,OACjBqB,EAHIrB,EAGG,YAAY,wBA+OdA,CACT,OAASsB,EAAO,CACd,eAAQ,MAAM,gCAAiCA,CAAK,EAC7C,IACT,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagesContentComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/wazui/PagesContentComponent/PagesContentComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AASrD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,
|
|
1
|
+
{"version":3,"file":"PagesContentComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/wazui/PagesContentComponent/PagesContentComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AASrD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAkTxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -47200,7 +47200,7 @@ const atA = ({ value: A, label: e, removeCaption: t }) => {
|
|
|
47200
47200
|
return (async () => {
|
|
47201
47201
|
if (!(typeof window > "u"))
|
|
47202
47202
|
try {
|
|
47203
|
-
const b = (await import("./quill-
|
|
47203
|
+
const b = (await import("./quill-D5usMbvq.js")).default, x = await (await import("./PictureBlot-B7Ope1o8.js")).default();
|
|
47204
47204
|
x && b.register("formats/picture", x, !0), o.current && (h = new b(o.current, {
|
|
47205
47205
|
theme: "snow",
|
|
47206
47206
|
modules: { ...$eA, toolbar: { container: `#${u.toolbarId}` } },
|
|
@@ -64849,7 +64849,7 @@ const elA = ({
|
|
|
64849
64849
|
}
|
|
64850
64850
|
}, Oy = PA`
|
|
64851
64851
|
mutation UpdateBlogMetadata($uuid: ID!, $metadata: JSON!) {
|
|
64852
|
-
updateBlogMetadata(input: { uuid: $uuid, metadata: $metadata }) {
|
|
64852
|
+
updateBlogMetadata(input: { uuid: $uuid, metadata: $metadata, merge: false }) {
|
|
64853
64853
|
metadata
|
|
64854
64854
|
}
|
|
64855
64855
|
}
|
|
@@ -65062,10 +65062,9 @@ const elA = ({
|
|
|
65062
65062
|
},
|
|
65063
65063
|
enabled: !0
|
|
65064
65064
|
}
|
|
65065
|
-
}
|
|
65065
|
+
};
|
|
65066
65066
|
return {
|
|
65067
|
-
|
|
65068
|
-
metadata: v,
|
|
65067
|
+
metadata: tlA(g),
|
|
65069
65068
|
uuid: e
|
|
65070
65069
|
};
|
|
65071
65070
|
} catch (g) {
|
|
@@ -65759,4 +65758,4 @@ export {
|
|
|
65759
65758
|
auA as y,
|
|
65760
65759
|
iuA as z
|
|
65761
65760
|
};
|
|
65762
|
-
//# sourceMappingURL=index-
|
|
65761
|
+
//# sourceMappingURL=index-CP3vOLLn.js.map
|