@wazobiatech/wazui 1.0.28 → 1.0.29

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.
@@ -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-CHOTIP6r.js")).default.import("blots/block/embed");
8
+ const a = (await import("./quill-BwREFauP.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-B-um6LWG.js.map
102
+ //# sourceMappingURL=PictureBlot-CX-e979g.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PictureBlot-B-um6LWG.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,EA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,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-CX-e979g.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;AAC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A,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,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-CHSiUZ4y.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-BRQyAryr.cjs.map
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-B8jLsVN2.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-DyTkCWww.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PictureBlot-BRQyAryr.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,OAAQ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Blot.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,6BAC3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YC,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":"columns.d.ts","sourceRoot":"","sources":["../../../../src/components/wazui/BlogPostsComponent/columns.tsx"],"names":[],"mappings":"AAaA,OAAO,EAEL,WAAW,EAEX,YAAY,EACb,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAajD,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,CAyG1F;AACD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,SAAS,GACV,EAAE;IACD,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,EAAE,CAoGhB;AAED,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAa3C,CAAC"}
1
+ {"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../../../src/components/wazui/BlogPostsComponent/columns.tsx"],"names":[],"mappings":"AAaA,OAAO,EAEL,WAAW,EAEX,YAAY,EACb,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAajD,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,CA2G1F;AACD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,SAAS,GACV,EAAE;IACD,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,EAAE,CAoGhB;AAED,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAa3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"WazUiPostCard.d.ts","sourceRoot":"","sources":["../../../../src/components/wazui/WazUiPostCard/WazUiPostCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAO7C,iBAAS,aAAa,CAAC,EACrB,IAAI,EAAE,IAAI,EACV,SAAS,EACT,aAAa,EACb,WAAgB,EAChB,WAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,aAAa,GACd,EAAE,kBAAkB,GAAG,EAAE,2CAiIzB;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"WazUiPostCard.d.ts","sourceRoot":"","sources":["../../../../src/components/wazui/WazUiPostCard/WazUiPostCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAO7C,iBAAS,aAAa,CAAC,EACrB,IAAI,EAAE,IAAI,EACV,SAAS,EACT,aAAa,EACb,WAAgB,EAChB,WAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,aAAa,GACd,EAAE,kBAAkB,GAAG,EAAE,2CAoIzB;AAED,eAAe,aAAa,CAAC"}
@@ -47293,7 +47293,7 @@ const EtA = ({ value: A, label: e, removeCaption: t }) => {
47293
47293
  return (async () => {
47294
47294
  if (!(typeof window > "u"))
47295
47295
  try {
47296
- const b = (await import("./quill-CHOTIP6r.js")).default, z = await (await import("./PictureBlot-B-um6LWG.js")).default();
47296
+ const b = (await import("./quill-BwREFauP.js")).default, z = await (await import("./PictureBlot-CX-e979g.js")).default();
47297
47297
  z && b.register("formats/picture", z, !0), o.current && (h = new b(o.current, {
47298
47298
  theme: "snow",
47299
47299
  modules: { ...DtA, toolbar: { container: `#${u.toolbarId}` } },
@@ -53811,13 +53811,13 @@ function TC({
53811
53811
  onEditClick: i,
53812
53812
  onRepostClick: c
53813
53813
  }) {
53814
- var g;
53814
+ var v;
53815
53815
  let u = {};
53816
- const f = A.status === Ke.PUBLISHED, d = f ? n : `${n}/preview`;
53816
+ const f = A.status === Ke.PUBLISHED, d = f ? n : `${n}/preview`, g = !f && A.published_at && (/* @__PURE__ */ new Date(A.published_at + "Z")).getTime() && /* @__PURE__ */ new Date(A.published_at + "Z") > /* @__PURE__ */ new Date();
53817
53817
  try {
53818
53818
  u = JSON.parse(A == null ? void 0 : A.featured_image);
53819
- } catch (v) {
53820
- console.log(v);
53819
+ } catch (m) {
53820
+ console.log(m);
53821
53821
  }
53822
53822
  return /* @__PURE__ */ l.jsxs(
53823
53823
  Mr,
@@ -53836,10 +53836,10 @@ function TC({
53836
53836
  {
53837
53837
  variant: "outline",
53838
53838
  className: Z("text-xs absolute z-10 top-2 left-2 bg-muted text-muted-foreground", {
53839
- hidden: f || A.published_at && /* @__PURE__ */ new Date(A.published_at + "Z") < /* @__PURE__ */ new Date(),
53840
- "border-[#F0D08A] bg-[#FFF4E0] text-[#6B4400]": !f && A.published_at
53839
+ hidden: f,
53840
+ "border-[#F0D08A] bg-[#FFF4E0] text-[#6B4400]": g
53841
53841
  }),
53842
- children: A.published_at ? "Scheduled" : "Draft"
53842
+ children: g ? "Scheduled" : "Draft"
53843
53843
  }
53844
53844
  ),
53845
53845
  /* @__PURE__ */ l.jsx(
@@ -53879,7 +53879,7 @@ function TC({
53879
53879
  "a",
53880
53880
  {
53881
53881
  href: `${r}/${A.uuid}`,
53882
- onClick: (v) => v.preventDefault(),
53882
+ onClick: (m) => m.preventDefault(),
53883
53883
  className: "leading-0",
53884
53884
  children: /* @__PURE__ */ l.jsx(
53885
53885
  yA,
@@ -53942,7 +53942,7 @@ function TC({
53942
53942
  ] })
53943
53943
  ] }),
53944
53944
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between gap-2 text-muted-foreground", children: [
53945
- /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center w-4.5 h-4.5 font-semi-bold rounded-full bg-secondary", children: /* @__PURE__ */ l.jsx("p", { className: "text-[8px] text-black", children: Gi(((g = A.author) == null ? void 0 : g.name) || "") }) }),
53945
+ /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center w-4.5 h-4.5 font-semi-bold rounded-full bg-secondary", children: /* @__PURE__ */ l.jsx("p", { className: "text-[8px] text-black", children: Gi(((v = A.author) == null ? void 0 : v.name) || "") }) }),
53946
53946
  /* @__PURE__ */ l.jsx(Zi, { date: new Date(A.updated_at || ""), locale: "en-US", className: "text-xs" })
53947
53947
  ] })
53948
53948
  ] })
@@ -56591,8 +56591,8 @@ function GC({ postBaseUrl: A }) {
56591
56591
  header: "Post",
56592
56592
  meta: { width: "grow" },
56593
56593
  cell: ({ row: e }) => {
56594
- var a, o;
56595
- const t = e.original, n = JSON.parse(t.featured_image), r = t.status === Ke.PUBLISHED, s = r ? A : `${A}/preview`;
56594
+ var o, i;
56595
+ const t = e.original, n = JSON.parse(t.featured_image), r = t.status === Ke.PUBLISHED, s = r ? A : `${A}/preview`, a = !r && t.published_at && (/* @__PURE__ */ new Date(t.published_at + "Z")).getTime() && /* @__PURE__ */ new Date(t.published_at + "Z") > /* @__PURE__ */ new Date();
56596
56596
  return /* @__PURE__ */ l.jsxs("div", { className: "flex flex-row items-center justify-between flex-1 w-full h-16 gap-4 min-w-110 pr-15 ", children: [
56597
56597
  /* @__PURE__ */ l.jsx(
56598
56598
  cs,
@@ -56620,18 +56620,18 @@ function GC({ postBaseUrl: A }) {
56620
56620
  }
56621
56621
  ),
56622
56622
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
56623
- /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center w-[20px] h-[20px] rounded-full bg-secondary", children: /* @__PURE__ */ l.jsx("p", { className: "text-[7.43px] text-black uppercase", children: Gi((a = t == null ? void 0 : t.author) == null ? void 0 : a.name) }) }),
56624
- /* @__PURE__ */ l.jsx("p", { className: "text-xs capitalize text-muted-foreground", children: (o = t == null ? void 0 : t.author) == null ? void 0 : o.name })
56623
+ /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center w-[20px] h-[20px] rounded-full bg-secondary", children: /* @__PURE__ */ l.jsx("p", { className: "text-[7.43px] text-black uppercase", children: Gi((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) }) }),
56624
+ /* @__PURE__ */ l.jsx("p", { className: "text-xs capitalize text-muted-foreground", children: (i = t == null ? void 0 : t.author) == null ? void 0 : i.name })
56625
56625
  ] }),
56626
56626
  /* @__PURE__ */ l.jsx(
56627
56627
  yt,
56628
56628
  {
56629
56629
  variant: "outline",
56630
56630
  className: Z("text-xs absolute top-0 right-0 bg-muted text-muted-foreground", {
56631
- hidden: r || t.published_at && /* @__PURE__ */ new Date(t.published_at + "Z") < /* @__PURE__ */ new Date(),
56632
- "border-[#F0D08A] bg-[#FFF4E0] text-[#6B4400]": !r && t.published_at
56631
+ hidden: r,
56632
+ "border-[#F0D08A] bg-[#FFF4E0] text-[#6B4400]": a
56633
56633
  }),
56634
- children: t.published_at ? "Scheduled" : "Draft"
56634
+ children: a ? "Scheduled" : "Draft"
56635
56635
  }
56636
56636
  )
56637
56637
  ]
@@ -68338,4 +68338,4 @@ export {
68338
68338
  pfA as y,
68339
68339
  wfA as z
68340
68340
  };
68341
- //# sourceMappingURL=index-CPaCRsdW.js.map
68341
+ //# sourceMappingURL=index-D_rNa2hx.js.map
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/dist/index-D_rNa2hx.js.map
3
+ size: 35395317 bytes
4
+ sha256: 1b6dda50e8a043ca8b2e83eba93764b4a8edb219639d7d313d804bd63a043759