@wazobiatech/wazui 1.0.18 → 1.0.19
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-DGBQjpAZ.cjs → PictureBlot-C3zTKmbF.cjs} +2 -2
- package/dist/{PictureBlot-DGBQjpAZ.cjs.map → PictureBlot-C3zTKmbF.cjs.map} +1 -1
- package/dist/{PictureBlot-CuQ5ljp8.js → PictureBlot-MSfDN8pZ.js} +2 -2
- package/dist/{PictureBlot-CuQ5ljp8.js.map → PictureBlot-MSfDN8pZ.js.map} +1 -1
- package/dist/{index-Dpn3iEy7.js → index-BRNhIADp.js} +9 -9
- package/dist/index-BRNhIADp.js.map +4 -0
- package/dist/{index-CNPUJHkP.cjs → index-rT8s8Gwo.cjs} +5 -5
- package/dist/index-rT8s8Gwo.cjs.map +4 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{quill-C953-2d7.cjs → quill-5Qs-5M5I.cjs} +2 -2
- package/dist/{quill-C953-2d7.cjs.map → quill-5Qs-5M5I.cjs.map} +1 -1
- package/dist/{quill-C8jr1UOY.js → quill-Cf8RoCN5.js} +2 -2
- package/dist/{quill-C8jr1UOY.js.map → quill-Cf8RoCN5.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-CNPUJHkP.cjs.map +0 -4
- package/dist/index-Dpn3iEy7.js.map +0 -4
|
@@ -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-5Qs-5M5I.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-C3zTKmbF.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PictureBlot-DGBQjpAZ.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,EACzCA,EAAW,MAAM,SAAW,OAC5BA,EAAW,MAAM,OAAS,OAC1BH,EAAe,YAAYG,CAAU,EAGrC,MAAMC,EAAiB,SAAS,cAAc,KAAK,EACnDA,EAAe,UAAY,6BAC3BA,EAAe,MAAM,SAAW,WAEhC,MAAMC,EAAiB,SAAS,cAAc,KAAK,EACnDA,EAAe,UAAY,qBAC3BA,EAAe,UAAYP,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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
|
+
{"version":3,"file":"PictureBlot-C3zTKmbF.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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AU,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"}
|
|
@@ -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-Cf8RoCN5.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-MSfDN8pZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PictureBlot-CuQ5ljp8.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","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c,GAGpCL,EAAU,kBAAkB,SAErBA;AAAA,MACT;AAAA,MAEA,OAAO,MAAMe,GAA2C;AACtD,cAAMC,IAAU,MAAM,KAAKD,EAAK,iBAAiB,QAAQ,CAAC,EAAE,IAAI,CAAAb,OAAW;AAAA,UACzE,OAAOA,EAAO,aAAa,OAAO,KAAK;AAAA,UACvC,QAAQA,EAAO,aAAa,QAAQ,KAAK;AAAA,UACzC,MAAMA,EAAO,aAAa,MAAM,KAAK;AAAA,QAAA,EACrC,GAEIe,IAAMF,EAAK,cAAc,KAAK,GAC9BT,IAAiBS,EAAK,cAAc,qBAAqB;AAC/D,YAAIG,IAAU;AAEd,YAAIZ,GAAgB;AAClB,gBAAMM,IAAON,EAAe,UAAU,KAAA;AACtC,UAAIM,KAAQA,MAAS,+BACnBM,IAAUN;AAAA,QAEd;AAEA,eAAO;AAAA,UACL,SAAAI;AAAA,UACA,cAAaC,KAAA,gBAAAA,EAAK,aAAa,WAAU;AAAA,UACzC,MAAKA,KAAA,gBAAAA,EAAK,aAAa,WAAU;AAAA,UACjC,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
|
+
{"version":3,"file":"PictureBlot-MSfDN8pZ.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,QAAAA,EAAW,aAAa,OAAOL,EAAM,WAAW,GAChDK,EAAW,aAAa,OAAOL,EAAM,GAAG,GACxCK,EAAW,aAAa,WAAW,MAAM,GACzCA,EAAW,MAAM,WAAW,QAC5BA,EAAW,MAAM,SAAS,QAC1BH,EAAe,YAAYG,CAAU;AAGrC,cAAMC,IAAiB,SAAS,cAAc,KAAK;AACnD,QAAAA,EAAe,YAAY,8BAC3BA,EAAe,MAAM,WAAW;AAEhC,cAAMC,IAAiB,SAAS,cAAc,KAAK;AACnD,QAAAA,EAAe,YAAY,sBAC3BA,EAAe,YAAYP,EAAM,WAAW,4BAC5CO,EAAe,MAAM,YAAY,UACjCA,EAAe,MAAM,QAAQP,EAAM,UAAU,SAAS,QACtDO,EAAe,MAAM,WAAW,QAChCA,EAAe,MAA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,EAAU,YAAYC,CAAc,GACpCD,EAAU,YAAYK,CAAc,GAGpCL,EAAU,kBAAkB,SAErBA;AAAA,MACT;AAAA,MAEA,OAAO,MAAMe,GAA2C;AACtD,cAAMC,IAAU,MAAM,KAAKD,EAAK,iBAAiB,QAAQ,CAAC,EAAE,IAAI,CAAAb,OAAW;AAAA,UACzE,OAAOA,EAAO,aAAa,OAAO,KAAK;AAAA,UACvC,QAAQA,EAAO,aAAa,QAAQ,KAAK;AAAA,UACzC,MAAMA,EAAO,aAAa,MAAM,KAAK;AAAA,QAAA,EACrC,GAEIe,IAAMF,EAAK,cAAc,KAAK,GAC9BT,IAAiBS,EAAK,cAAc,qBAAqB;AAC/D,YAAIG,IAAU;AAEd,YAAIZ,GAAgB;AAClB,gBAAMM,IAAON,EAAe,UAAU,KAAA;AACtC,UAAIM,KAAQA,MAAS,+BACnBM,IAAUN;AAAA,QAEd;AAEA,eAAO;AAAA,UACL,SAAAI;AAAA,UACA,cAAaC,KAAA,gBAAAA,EAAK,aAAa,WAAU;AAAA,UACzC,MAAKA,KAAA,gBAAAA,EAAK,aAAa,WAAU;AAAA,UACjC,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;"}
|
|
@@ -37995,13 +37995,13 @@ function $K() {
|
|
|
37995
37995
|
NEXT_PUBLIC_DOLOS_TRANSFORMATION_ENDPOINT: "https://images.twistedfood.co.uk",
|
|
37996
37996
|
NEXT_PUBLIC_RECIPE_GRAPHQL_URL: "https://recipes-api.junglecreations.com/graphql",
|
|
37997
37997
|
NEXT_PUBLIC_PHOENIX_ENDPOINT: "http://51.38.80.88:8001/graphql",
|
|
37998
|
-
NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT: "https://mercury.
|
|
37999
|
-
NEXT_PUBLIC_MERCURY_GRAPHQL_URL: "https://mercury.
|
|
38000
|
-
NEXT_PUBLIC_ATHENS_APP_ID: "
|
|
38001
|
-
NEXT_PUBLIC_ATHENS_APP_SECRET: "
|
|
37998
|
+
NEXT_PUBLIC_MERCURY_TOKEN_ENDPOINT: "https://mercury.hivedeck.com/project/token",
|
|
37999
|
+
NEXT_PUBLIC_MERCURY_GRAPHQL_URL: "https://mercury.hivedeck.com/graphql",
|
|
38000
|
+
NEXT_PUBLIC_ATHENS_APP_ID: "app_3d7e343fff5fef896823b54e6510dca1",
|
|
38001
|
+
NEXT_PUBLIC_ATHENS_APP_SECRET: "0e023a846205864d4979dbf607248b61add945588919716281f776ede013693b",
|
|
38002
38002
|
NEXT_PUBLIC_REVALIDATION_TWISTEDFOOD_TOKEN: "token",
|
|
38003
38003
|
NEXT_PUBLIC_REVALIDATION_VT_TOKEN: "df870c4335ad9d4402dfccdf7000a3c9",
|
|
38004
|
-
NEXT_PUBLIC_MUSE_GRAPHQL_URL: "https://muse.
|
|
38004
|
+
NEXT_PUBLIC_MUSE_GRAPHQL_URL: "https://muse.hivedeck.com/graphql",
|
|
38005
38005
|
NEXT_PUBLIC_TWITTER_EMBED_ENDPOINT: "http://localhost:3000/api/twitter-embeds",
|
|
38006
38006
|
NEXT_PUBLIC_PROMETHEUS_GRAPHQL_ENDPOINT: "https://prometheus.tiadara.com/graphql"
|
|
38007
38007
|
};
|
|
@@ -47265,7 +47265,7 @@ const ytA = ({ value: A, label: e, removeCaption: t }) => {
|
|
|
47265
47265
|
return (async () => {
|
|
47266
47266
|
if (!(typeof window > "u"))
|
|
47267
47267
|
try {
|
|
47268
|
-
const b = (await import("./quill-
|
|
47268
|
+
const b = (await import("./quill-Cf8RoCN5.js")).default, z = await (await import("./PictureBlot-MSfDN8pZ.js")).default();
|
|
47269
47269
|
z && b.register("formats/picture", z, !0), o.current && (h = new b(o.current, {
|
|
47270
47270
|
theme: "snow",
|
|
47271
47271
|
modules: { ...gtA, toolbar: { container: `#${u.toolbarId}` } },
|
|
@@ -66882,7 +66882,7 @@ const KlA = ({
|
|
|
66882
66882
|
},
|
|
66883
66883
|
imageGalleryConfig: {
|
|
66884
66884
|
...t,
|
|
66885
|
-
cropperAspectRatio: "
|
|
66885
|
+
cropperAspectRatio: "1:1",
|
|
66886
66886
|
type: "inline"
|
|
66887
66887
|
}
|
|
66888
66888
|
},
|
|
@@ -67397,7 +67397,7 @@ function ffA({
|
|
|
67397
67397
|
refetchOnWindowFocus: !1
|
|
67398
67398
|
});
|
|
67399
67399
|
}
|
|
67400
|
-
const Sy = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_ATHENS_APP_ID: "
|
|
67400
|
+
const Sy = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_ATHENS_APP_ID: "app_3d7e343fff5fef896823b54e6510dca1", VITE_ATHENS_APP_SECRET: "0e023a846205864d4979dbf607248b61add945588919716281f776ede013693b", VITE_DOLOS_TRANSFORMATION_ENDPOINT: "https://images.twistedfood.co.uk", VITE_DOLOS_URL: "https://dolos.tiadara.com/graphql", VITE_MERCURY_GRAPHQL_URL: "https://mercury.hivedeck.com/graphql", VITE_MERCURY_TOKEN_ENDPOINT: "https://mercury.hivedeck.com/project/token", VITE_MUSE_GRAPHQL_URL: "https://muse.hivedeck.com/graphql", VITE_PHOENIX_ENDPOINT: "http://51.38.80.88:8001/graphql", VITE_PROMETHEUS_GRAPHQL_ENDPOINT: "https://prometheus.tiadara.com/graphql", VITE_RECIPE_GRAPHQL_URL: "https://recipes-api.junglecreations.com/graphql", VITE_REVALIDATION_TWISTEDFOOD_TOKEN: "token", VITE_REVALIDATION_VT_TOKEN: "df870c4335ad9d4402dfccdf7000a3c9", VITE_TWITTER_EMBED_ENDPOINT: "http://localhost:3000/api/twitter-embeds" }, Bj = Ie({
|
|
67401
67401
|
NEXT_PUBLIC_DOLOS_URL: pA().default("https://localhost:3001"),
|
|
67402
67402
|
NEXT_PUBLIC_RECIPE_GRAPHQL_URL: pA().default("https://localhost:3002"),
|
|
67403
67403
|
NEXT_PUBLIC_PHOENIX_ENDPOINT: pA().default("https://localhost:3004"),
|
|
@@ -67716,4 +67716,4 @@ export {
|
|
|
67716
67716
|
UuA as y,
|
|
67717
67717
|
$uA as z
|
|
67718
67718
|
};
|
|
67719
|
-
//# sourceMappingURL=index-
|
|
67719
|
+
//# sourceMappingURL=index-BRNhIADp.js.map
|