@posiwise/utils 0.0.149 → 0.0.151
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/fesm2022/posiwise-utils-quill.mjs +576 -113
- package/fesm2022/posiwise-utils-quill.mjs.map +1 -1
- package/fesm2022/posiwise-utils.mjs +2 -5
- package/fesm2022/posiwise-utils.mjs.map +1 -1
- package/package.json +2 -1
- package/types/posiwise-utils-quill.d.ts +158 -1
- package/types/posiwise-utils.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posiwise-utils-quill.mjs","names":[],"sources":["../../../../libs/utils/quill/src/lib/quill-paste-guard.ts","../../../../libs/utils/quill/src/lib/quill-helper.ts"],"sourcesContent":["import Quill from 'quill';\n\n/**\n * Stops an image being PASTED into a Quill editor as an inline `data:` URI.\n *\n * Quill's default clipboard module turns a pasted screenshot into\n * `<img src=\"data:image/png;base64,…\">`, which stores the entire file inside the document. The\n * toolbar's image button cannot do this (it prompts for a URL) and dropped images are stripped by\n * NoDragDrop, so paste was the one remaining way in — and it was unhandled in this shared config,\n * which eleven editors across the app rely on.\n *\n * It is not merely a size problem. Embedded bytes bypass the image host and its CDN, cannot be\n * cached, resized or replaced, and are re-sent from the database on every page view. One live\n * CloudOlive post reached 1.4 MB from nine pasted PNGs, against 19 KB of actual prose.\n *\n * main-api rejects these on save as the backstop; this is the prevention, and the reason an author\n * finds out while they are still writing rather than when they press save.\n */\n\nconst DATA_URI_IMAGE = /^data:image\\//i;\n\nexport const PASTED_IMAGE_MESSAGE =\n 'That image was pasted, so it would be stored inside the article itself rather than on the ' +\n 'image host — which makes the page much heavier for every reader. Upload the image somewhere ' +\n 'first, then use the image button in the toolbar to add it by URL.';\n\n/** True when the clipboard carries an image FILE — a screenshot, or an image copied from disk. */\nexport function clipboardHasImageFile(clipboardData: DataTransfer | null | undefined): boolean {\n if (!clipboardData) {\n return false;\n }\n const items = Array.from(clipboardData.items ?? []);\n if (items.some(item => item.kind === 'file' && item.type?.startsWith('image/'))) {\n return true;\n }\n // Safari populates `files` without always setting `items[].kind`, so check both.\n return Array.from(clipboardData.files ?? []).some(file => file.type?.startsWith('image/'));\n}\n\n/** True when this src embeds the file in the document instead of referencing it. */\nexport function isEmbeddedImageSrc(src: string | null | undefined): boolean {\n return DATA_URI_IMAGE.test((src ?? '').trim());\n}\n\n/**\n * Quill module. Register once, then enable with `pasteGuard: true` (or\n * `pasteGuard: { onBlocked: fn }` to replace the default alert with a toast).\n */\nexport class PasteGuard {\n private readonly notify: (message: string) => void;\n\n constructor(quill: Quill, options?: { onBlocked?: (message: string) => void }) {\n this.notify = options?.onBlocked ?? (message => globalThis.alert?.(message));\n\n // Capture phase: run before Quill's own clipboard handler turns the file into a delta.\n quill.root.addEventListener(\n 'paste',\n event => this.handlePaste(event as ClipboardEvent),\n true\n );\n\n // A separate vector: pasting HTML copied from another page, which can carry a `data:` <img>\n // with no file on the clipboard at all. Quill matches on the parsed DOM, so drop those\n // there — and leave https images alone, since pasting a real image URL is fine.\n // Quill types the matcher's first argument as Node, so narrow before reading the attribute.\n const Delta = Quill.import('delta');\n quill.clipboard.addMatcher('IMG', (node: Node, delta) => {\n const src = node instanceof Element ? node.getAttribute('src') : null;\n if (!isEmbeddedImageSrc(src)) {\n return delta;\n }\n this.notify(PASTED_IMAGE_MESSAGE);\n return new Delta();\n });\n }\n\n private handlePaste(event: ClipboardEvent): void {\n if (!clipboardHasImageFile(event.clipboardData)) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.notify(PASTED_IMAGE_MESSAGE);\n }\n}\n","import Quill from 'quill';\nimport * as ImageResize from 'quill-resize-image';\n\nimport { PasteGuard } from './quill-paste-guard';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst BlockEmbed = Quill.import('formats/image') as any;\n\nclass NoDragImage extends BlockEmbed {\n static create(value) {\n const node = super.create();\n node.setAttribute('src', value.url);\n node.setAttribute('alt', value.alt || '');\n node.setAttribute('class', 'no-drag-image');\n node.setAttribute('draggable', 'false');\n\n node.style.width = value.width || '300px'; // Default width\n node.style.height = value.height || 'auto';\n\n if (value.align) {\n switch (value.align) {\n case 'left':\n node.style.float = 'left';\n node.style.marginRight = '1em';\n break;\n case 'right':\n node.style.float = 'right';\n node.style.marginLeft = '1em';\n break;\n case 'center':\n node.style.display = 'block';\n node.style.marginLeft = 'auto';\n node.style.marginRight = 'auto';\n break;\n default:\n node.style.float = 'none';\n }\n }\n\n return node;\n }\n\n static value(node) {\n return {\n url: node.getAttribute('src'),\n alt: node.getAttribute('alt'),\n width: node.getAttribute('data-width') || node.style.width,\n height: node.getAttribute('data-height') || node.style.height,\n align: node.style.float || 'center'\n };\n }\n}\n\nclass NoDragDrop {\n constructor(quill, _options) {\n quill.root.addEventListener('drop', this.handleDrop.bind(this, quill));\n quill.root.addEventListener('dragover', this.preventDefault);\n }\n\n preventDefault(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleDrop(quill, e) {\n this.preventDefault(e);\n\n // Create a MutationObserver to detect inserted images\n const observer = new MutationObserver(mutations => {\n this.removeInsertedImages(quill, mutations);\n });\n\n // Start observing for added nodes\n observer.observe(quill.root, { childList: true, subtree: true });\n\n // Stop observing after a short delay\n setTimeout(() => {\n observer.disconnect();\n }, 1000); // Adjust the timeout as needed\n }\n\n removeInsertedImages(quill, mutations) {\n mutations.forEach(mutation => {\n mutation.addedNodes.forEach(node => {\n if (node instanceof HTMLImageElement) {\n node.remove();\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n node.querySelectorAll('img').forEach(img => img.remove());\n }\n });\n });\n }\n}\n\nNoDragImage['blotName'] = 'no-drag-image';\nNoDragImage['tagName'] = 'img';\nQuill.register(NoDragImage);\nQuill.register('modules/noDragDrop', NoDragDrop);\nQuill.register('modules/imageResize', ImageResize.default || ImageResize);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst BlockEmbedVideo = Quill.import('blots/block/embed') as any;\nclass NoDragVideo extends BlockEmbedVideo {\n static create(value) {\n const node = document.createElement('iframe');\n node.setAttribute('src', value.url);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', 'true');\n node.setAttribute('width', value.width || '100%'); // Default width\n node.setAttribute('height', value.height || '200px'); // Default height\n node.setAttribute('class', 'no-drag-media');\n node.setAttribute('contenteditable', 'false'); // Prevent content from being editable\n\n // Add proper allow attribute for YouTube and other video embeds\n if (value.url && (value.url.includes('youtube.com') || value.url.includes('youtu.be'))) {\n node.setAttribute(\n 'allow',\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'\n );\n // Ensure YouTube embed URL format is correct\n if (\n value.url &&\n !value.url.includes('youtube-nocookie.com') &&\n !value.url.includes('enablejsapi=1')\n ) {\n try {\n const url = new URL(value.url);\n url.searchParams.set('enablejsapi', '1');\n if (typeof window !== 'undefined' && window.location) {\n url.searchParams.set('origin', window.location.origin);\n }\n node.setAttribute('src', url.toString());\n } catch {\n // If URL parsing fails, keep original src and just add query params manually\n const separator = value.url.includes('?') ? '&' : '?';\n node.setAttribute('src', `${value.url}${separator}enablejsapi=1`);\n }\n }\n } else if (value.url && value.url.includes('loom.com')) {\n node.setAttribute(\n 'allow',\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'\n );\n } else {\n // Default allow for other iframes\n node.setAttribute('allow', 'fullscreen');\n }\n\n // Create a container for both video/iframe and buttons\n const container = document.createElement('div');\n container.setAttribute('class', 'media-container');\n container.style.position = 'relative';\n container.style.width = '100%';\n container.style.height = 'auto';\n container.appendChild(node); // Append video/iframe to the container\n\n // Append remove button so video can be deleted after save/update (backspace often doesn't work on reloaded content)\n if (!container.querySelector('.media-remove-button')) {\n const removeButton = this.createRemoveButton(container);\n removeButton.setAttribute('contenteditable', 'false');\n container.appendChild(removeButton);\n }\n\n // Append align buttons if not already present\n if (!container.querySelector('.media-align-buttons')) {\n const alignButtons = this.createAlignButtons(container);\n alignButtons.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable\n container.appendChild(alignButtons);\n }\n\n // Append resize buttons if not already present\n if (!container.querySelector('.media-resize-buttons')) {\n const resizeButtons = this.createResizeButtons(container);\n resizeButtons.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable\n container.appendChild(resizeButtons);\n }\n\n container.setAttribute('contenteditable', 'false'); // Prevent the entire container from being editable\n\n return container;\n }\n\n static createAlignButtons(container) {\n const buttonContainer = document.createElement('div');\n buttonContainer.setAttribute('class', 'media-align-buttons');\n buttonContainer.style.position = 'absolute';\n buttonContainer.style.top = '0';\n buttonContainer.style.right = '0';\n buttonContainer.style.display = 'flex';\n buttonContainer.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable\n\n const leftButton = this.createButton('Left', () => {\n container.style.textAlign = 'left';\n container.setAttribute('data-align', 'left'); // Save alignment\n });\n\n const centerButton = this.createButton('Center', () => {\n container.style.textAlign = 'center';\n container.setAttribute('data-align', 'center'); // Save alignment\n });\n\n const rightButton = this.createButton('Right', () => {\n container.style.textAlign = 'right';\n container.setAttribute('data-align', 'right'); // Save alignment\n });\n\n buttonContainer.appendChild(leftButton);\n buttonContainer.appendChild(centerButton);\n buttonContainer.appendChild(rightButton);\n\n return buttonContainer;\n }\n\n static createRemoveButton(container) {\n const wrapper = document.createElement('div');\n wrapper.setAttribute('class', 'media-remove-button');\n wrapper.style.position = 'absolute';\n wrapper.style.top = '0';\n wrapper.style.left = '0';\n wrapper.style.display = 'flex';\n wrapper.setAttribute('contenteditable', 'false');\n\n const removeButton = this.createButton('Remove', () => {\n const mediaContainer = container.classList.contains('media-container')\n ? container\n : container.closest('.media-container');\n if (mediaContainer) {\n const blot = Quill.find(mediaContainer);\n if (blot && 'remove' in blot && typeof blot.remove === 'function') {\n (blot as { remove: () => void }).remove();\n } else {\n // Content loaded from saved HTML may not be a Quill blot; remove from DOM so save persists the change\n mediaContainer.remove();\n }\n }\n });\n removeButton.style.background = 'rgb(243, 67, 67)';\n removeButton.style.color = 'white';\n removeButton.style.border = 'none';\n removeButton.style.padding = '2px 8px';\n removeButton.style.marginTop = '2px';\n removeButton.style.borderRadius = '4px';\n removeButton.title = 'Remove video';\n wrapper.appendChild(removeButton);\n\n return wrapper;\n }\n\n static createResizeButtons(container) {\n const buttonContainer = document.createElement('div');\n buttonContainer.setAttribute('class', 'media-resize-buttons');\n buttonContainer.style.position = 'absolute';\n buttonContainer.style.bottom = '5px'; // Adjust position above the bottom edge\n buttonContainer.style.right = '5px';\n buttonContainer.style.display = 'flex';\n buttonContainer.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable\n\n const updateWidthAndHeight = (mediaElement, width, height) => {\n mediaElement.style.width = width;\n mediaElement.style.height = height;\n container.setAttribute('data-width', width); // Save width\n container.setAttribute('data-height', height); // Save height\n };\n\n const increaseWidthButton = this.createButton('Increase Width', () => {\n const mediaElement = container.querySelector('.no-drag-media');\n const currentWidth = parseInt(mediaElement.style.width || '100%');\n updateWidthAndHeight(mediaElement, `${currentWidth + 20}px`, mediaElement.style.height);\n });\n\n const decreaseWidthButton = this.createButton('Decrease Width', () => {\n const mediaElement = container.querySelector('.no-drag-media');\n const currentWidth = parseInt(mediaElement.style.width || '100%');\n updateWidthAndHeight(\n mediaElement,\n `${Math.max(100, currentWidth - 20)}px`,\n mediaElement.style.height\n );\n });\n\n const increaseHeightButton = this.createButton('Increase Height', () => {\n const mediaElement = container.querySelector('.no-drag-media');\n const currentHeight = parseInt(mediaElement.style.height || '200px'); // Default height\n updateWidthAndHeight(mediaElement, mediaElement.style.width, `${currentHeight + 20}px`);\n });\n\n const decreaseHeightButton = this.createButton('Decrease Height', () => {\n const mediaElement = container.querySelector('.no-drag-media');\n const currentHeight = parseInt(mediaElement.style.height || '200px'); // Default height\n updateWidthAndHeight(\n mediaElement,\n mediaElement.style.width,\n `${Math.max(100, currentHeight - 20)}px`\n );\n });\n\n buttonContainer.appendChild(increaseWidthButton);\n buttonContainer.appendChild(decreaseWidthButton);\n buttonContainer.appendChild(increaseHeightButton);\n buttonContainer.appendChild(decreaseHeightButton);\n\n return buttonContainer;\n }\n\n static createButton(label, onClick) {\n const button = document.createElement('button');\n button.innerHTML = label;\n button.style.margin = '0 5px';\n button.style.cursor = 'pointer';\n\n // Prevent Quill from treating this as part of the content\n button.setAttribute('contenteditable', 'false');\n button.style.pointerEvents = 'auto'; // Allow button clicks but don't let Quill interact with them\n\n button.onclick = event => {\n event.preventDefault(); // Prevent default action\n event.stopPropagation(); // Prevent the event from bubbling up and being interpreted by Quill\n onClick(); // Execute the button's action\n };\n\n return button;\n }\n\n static value(container) {\n const iframe = container.querySelector('iframe');\n return {\n url: iframe?.getAttribute('src'),\n width: container.getAttribute('data-width') || iframe?.getAttribute('width'),\n height: container.getAttribute('data-height') || iframe?.getAttribute('height'),\n align: container.getAttribute('data-align') || 'center' // Default to center if no alignment\n };\n }\n}\n\nNoDragVideo['blotName'] = 'no-drag-video';\nNoDragVideo['tagName'] = 'div'; // TagName is set to div to hold buttons\nQuill.register(NoDragVideo);\n\nexport class QuillHelper {\n static init() {\n if (!Quill.imports['formats/no-drag-image']) {\n Quill.register(NoDragImage);\n }\n if (!Quill.imports['formats/no-drag-video']) {\n Quill.register(NoDragVideo);\n }\n if (!Quill.imports['modules/imageResize']) {\n Quill.register('modules/imageResize', ImageResize.default || ImageResize);\n }\n if (!Quill.imports['modules/noDragDrop']) {\n Quill.register('modules/noDragDrop', NoDragDrop);\n }\n if (!Quill.imports['modules/pasteGuard']) {\n Quill.register('modules/pasteGuard', PasteGuard);\n }\n }\n\n static getEditorConfig(additionalToolbarConfig = []) {\n const defaultToolbarConfig = [\n ['bold', 'italic', 'underline', 'strike'], // toggled buttons\n ['blockquote', 'code-block'],\n [{ header: 1 }, { header: 2 }], // custom button values\n [{ list: 'ordered' }, { list: 'bullet' }],\n [{ script: 'sub' }, { script: 'super' }], // superscript/subscript\n [{ indent: '-1' }, { indent: '+1' }], // outdent/indent\n [{ direction: 'rtl' }], // text direction\n [{ header: [1, 2, 3, 4, 5, 6, false] }],\n [{ color: [] }, { background: [] }], // dropdown with defaults from theme\n [{ align: [] }],\n ['link', 'image', 'video'],\n ['clean'], // remove formatting button\n ['table'] // table button\n ];\n\n const mergedToolbarConfig = [...defaultToolbarConfig, ...additionalToolbarConfig];\n\n return {\n toolbar: {\n container: mergedToolbarConfig,\n handlers: {\n image: function () {\n const range = this.quill.getSelection();\n const value = prompt('Enter image URL:');\n if (value) {\n this.quill.insertEmbed(range.index, 'no-drag-image', { url: value });\n this.quill.insertText(range.index + 1, '\\n', Quill.sources.USER);\n }\n },\n video: function () {\n const range = this.quill.getSelection();\n let value = prompt('Enter video URL:');\n if (value?.includes('youtube.com/watch?v=')) {\n const videoId = value.split('v=')[1];\n value = `https://www.youtube.com/embed/${videoId}`;\n } else if (value?.includes('youtu.be/')) {\n const videoId = value.split('.be/')[1];\n value = `https://www.youtube.com/embed/${videoId}`;\n } else if (value?.includes('loom.com/share/')) {\n const videoId = value.split('share/')[1];\n value = `https://www.loom.com/embed/${videoId}`;\n } else if (value?.includes('capture.dropbox.com/')) {\n const videoId = value.split('capture.dropbox.com/')[1];\n if (videoId.includes('embed')) {\n value = `https://capture.dropbox.com/${videoId}`;\n } else {\n value = `https://capture.dropbox.com/embed/${videoId}`;\n }\n }\n if (value) {\n const useIframe =\n value.includes('youtube.com') ||\n value.includes('youtu.be') ||\n value.includes('loom.com') ||\n value.includes('drop');\n this.quill.insertEmbed(range.index, 'no-drag-video', {\n url: value,\n isEdit: true,\n width: useIframe ? '560px' : '640px', // Different width for iframe vs video\n height: useIframe ? '315px' : '360px' // Different height for iframe vs video\n });\n this.quill.insertText(range.index + 1, '\\n', Quill.sources.USER);\n }\n }\n }\n },\n imageResize: {\n displaySize: true\n },\n noDragDrop: true,\n pasteGuard: true\n };\n }\n}\n"],"mappings":";;AAmBA,MAAM,iBAAiB;AAEvB,MAAa,uBACT;AAKJ,SAAgB,sBAAsB,eAA8C;CAChF,IAAI,CAAC,eACD,OAAO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KAAK;QACL,QAAQ;QACR,OAAO,YAAY,UAAU;QAC7B,QAAQ,YAAY,UAAU;OACjC,CAAA;OACD,KAAK,MAAM,WAAW,MAAM,QAAQ,GAAG,MAAM,MAAM,QAAQ,IAAI;MACnE;KACJ;IACH;GACJ;GACD,aAAa,EACT,aAAa,KAChB;GACD,YAAY;GACZ,YAAY;EACf;CACL;AACH"}
|
|
1
|
+
{"version":3,"file":"posiwise-utils-quill.mjs","names":[],"sources":["../../../../libs/utils/quill/src/lib/quill-image-preview.ts","../../../../libs/utils/quill/src/lib/quill-upload-indicator.ts","../../../../libs/utils/quill/src/lib/quill-image-upload.ts","../../../../libs/utils/quill/src/lib/editor-image-dialog/editor-image-dialog.component.ts","../../../../libs/utils/quill/src/lib/editor-image-dialog/editor-image-dialog.component.html","../../../../libs/utils/quill/src/lib/quill-default-image-upload.ts","../../../../libs/utils/quill/src/lib/quill-image-link-import.ts","../../../../libs/utils/quill/src/lib/quill-paste-guard.ts","../../../../libs/utils/quill/src/lib/editor-image-upload.directive.ts","../../../../libs/utils/quill/src/lib/quill-no-drag-image.ts","../../../../libs/utils/quill/src/lib/quill-video-controls.ts","../../../../libs/utils/quill/src/lib/quill-no-drag-video.ts","../../../../libs/utils/quill/src/lib/quill-helper.ts"],"sourcesContent":["import Quill from 'quill';\n\ntype PreviewQuill = Pick<Quill, 'insertEmbed' | 'insertText' | 'deleteText' | 'getContents'> & {\n getModule?: (name: string) => unknown;\n};\n\ntype HistoryModule = { ignoreChange: boolean; transform: (delta: unknown) => void };\n\nconst EMBED = 'no-drag-image';\n\n/**\n * Applies a change that undo must not record (the temporary preview), while still moving undo's\n * stored positions past it. Without this, Undo could bring back a preview whose local file is gone.\n */\nfunction outsideHistory(quill: PreviewQuill, change: () => unknown): void {\n const history = quill.getModule?.('history') as HistoryModule | null | undefined;\n if (!history) {\n change();\n return;\n }\n history.ignoreChange = true;\n let delta: unknown;\n try {\n delta = change();\n } finally {\n history.ignoreChange = false;\n }\n if (delta) {\n history.transform(delta);\n }\n}\n\n/** Where the image with `url` is now; the user may have typed or deleted around it. */\nfunction indexOfImage(quill: PreviewQuill, url: string): number {\n let index = 0;\n for (const op of quill.getContents().ops) {\n const insert = op.insert as string | Record<string, { url?: string }> | undefined;\n if (typeof insert === 'object' && insert?.[EMBED]?.url === url) {\n return index;\n }\n index += typeof insert === 'string' ? insert.length : 1;\n }\n return -1;\n}\n\n/**\n * Shows a picked or pasted image file in the text straight away, dimmed, while it uploads\n * (posiwise-frontend#4272), like GitLab. The preview points at a local copy of the file, so it is\n * only ever temporary: the returned function swaps it for the uploaded image's URL (resolving with\n * the index after it), or removes it when the upload failed or the user deleted it meanwhile\n * (resolving with null). Without browser support for local copies it returns null and the caller\n * inserts the image when the upload finishes, as before.\n */\nexport function showImagePreview(\n quill: PreviewQuill,\n index: number,\n file: File\n): ((url: string | null) => number | null) | null {\n if (typeof URL.createObjectURL !== 'function') {\n return null;\n }\n const local = URL.createObjectURL(file);\n outsideHistory(quill, () => quill.insertEmbed(index, EMBED, { url: local }, Quill.sources.API));\n outsideHistory(quill, () => quill.insertText(index + 1, '\\n', Quill.sources.API));\n\n return url => {\n const at = indexOfImage(quill, local);\n if (at >= 0) {\n outsideHistory(quill, () => quill.deleteText(at, 1, Quill.sources.API));\n }\n URL.revokeObjectURL(local);\n if (at < 0 || !url) {\n return null;\n }\n quill.insertEmbed(at, EMBED, { url }, Quill.sources.USER);\n return at + 2;\n };\n}\n","/** What the indicator needs from an editor; a real Quill has both. */\nexport type IndicatorQuill = { root: HTMLElement; container?: HTMLElement };\n\nconst HOST_CLASS = 'ql-upload-host';\nconst CHIP_CLASS = 'ql-upload-indicator';\n\n/**\n * Shows the app's spinner with `label` in a chip centred on the line between the toolbar and the\n * text while an image uploads (posiwise-frontend#4272), like GitLab's, and returns a function that\n * removes it. The chip sits on the editor's wrapper, outside the content, so it never covers the\n * text and is never saved; not in `.ql-container`, whose scrolling would clip it. Styled by\n * `.ql-upload-indicator` (core-styles); only its height comes from here, because the toolbar's\n * height varies by editor and screen width.\n */\nexport function showUploadIndicator(quill: IndicatorQuill, label = ''): () => void {\n const container = quill.container ?? quill.root.parentElement;\n const host = container?.parentElement;\n if (!container || !host) {\n return () => undefined;\n }\n host.classList.add(HOST_CLASS);\n const doc = host.ownerDocument;\n const chip = doc.createElement('div');\n chip.className = CHIP_CLASS;\n chip.setAttribute('role', 'status');\n const spinner = doc.createElement('i');\n spinner.className = 'fa fa-spinner fa-spin';\n spinner.setAttribute('aria-hidden', 'true');\n chip.append(spinner, ` ${label}`);\n chip.style.setProperty('--upload-top', `${container.offsetTop}px`);\n host.append(chip);\n return () => {\n chip.remove();\n if (!host.querySelector(`.${CHIP_CLASS}`)) {\n host.classList.remove(HOST_CLASS);\n }\n };\n}\n","import Quill from 'quill';\n\nimport { showImagePreview } from './quill-image-preview';\nimport { IndicatorQuill, showUploadIndicator } from './quill-upload-indicator';\n\n/**\n * Uploading images from a Quill editor (posiwise-frontend#4272).\n *\n * The file goes to S3 through main-api and the editor inserts only its URL, so no image bytes are\n * ever stored in the document. The image button, paste and drop all end in `insertUploadedImages`.\n */\n\n/** Uploads one file and resolves with its public URL. Rejects after telling the user why. */\nexport type QuillImageUploader = (file: File) => Promise<string>;\n\n/** What the user picked in the \"Add image\" box. */\nexport type EditorImageChoice = { url: string } | { files: File[] };\n\nexport interface QuillImageUploadOptions {\n upload: QuillImageUploader;\n /** Copies an image from a link into our storage and resolves with OUR URL. */\n importUrl?: (url: string) => Promise<string>;\n /** Asks the user for a link or files. Without it the image button opens the file picker. */\n choose?: () => Promise<EditorImageChoice | null>;\n /** Text shown over the editor while an image is dragged onto it. */\n dropLabel?: () => string;\n /** Text next to the spinner shown in the body while an image uploads. */\n busyLabel?: () => string;\n}\n\n/** Mirrors main-api's `main_api_editor_image` purpose. No SVG: it can carry script. */\nexport const EDITOR_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif', 'image/webp'];\n\ntype EditorQuill = Pick<\n Quill,\n 'insertEmbed' | 'insertText' | 'deleteText' | 'getContents' | 'setSelection' | 'getSelection'\n> &\n IndicatorQuill & { getModule?: (name: string) => unknown };\n\nfunction insertImageUrl(quill: EditorQuill, index: number, url: string): void {\n quill.insertEmbed(index, 'no-drag-image', { url }, Quill.sources.USER);\n quill.insertText(index + 1, '\\n', Quill.sources.USER);\n}\n\n/**\n * Uploads one file (or link) and puts the image at `at`. A file shows a dimmed preview there\n * meanwhile; a link has no local copy to preview. Resolves with where the next image goes.\n */\nasync function uploadOne<T>(\n quill: EditorQuill,\n at: number,\n item: T,\n toUrl: (item: T) => Promise<string>,\n busyLabel?: string\n): Promise<number> {\n const hide = showUploadIndicator(quill, busyLabel);\n const settlePreview = item instanceof File ? showImagePreview(quill, at, item) : null;\n let url: string | null;\n try {\n url = await toUrl(item).catch(() => null);\n } finally {\n hide();\n }\n if (settlePreview) {\n return settlePreview(url) ?? at;\n }\n if (!url) {\n return at;\n }\n insertImageUrl(quill, at, url);\n return at + 2;\n}\n\n/**\n * Turns each file (or link) into our URL one after another and inserts the images at `index`, in\n * order. A spinner chip shows on the editor's top edge, and the editor is `aria-busy` meanwhile,\n * which also holds its form's save button (buttonBusy).\n */\nexport async function insertUploadedImages<T>(\n quill: EditorQuill,\n index: number,\n items: T[],\n toUrl: (item: T) => Promise<string>,\n busyLabel?: string\n): Promise<void> {\n let at = index;\n quill.root.setAttribute('aria-busy', 'true');\n try {\n for (const item of items) {\n const next = await uploadOne(quill, at, item, toUrl, busyLabel);\n if (next !== at) {\n at = next;\n quill.setSelection(at, Quill.sources.SILENT);\n }\n }\n } finally {\n quill.root.removeAttribute('aria-busy');\n }\n}\n\n/** Opens the browser's file picker for images. Must run inside a click handler. */\nexport function pickImageFiles(onPicked: (files: File[]) => void, doc: Document = document): void {\n const input = doc.createElement('input');\n input.type = 'file';\n input.accept = EDITOR_IMAGE_TYPES.join(',');\n input.multiple = true;\n input.addEventListener('change', () => {\n const files = Array.from(input.files ?? []);\n if (files.length) {\n onPicked(files);\n }\n });\n input.click();\n}\n\n/** Image button: a link is inserted as it is, chosen files are uploaded. */\nexport async function chooseImage(\n quill: EditorQuill,\n options: QuillImageUploadOptions\n): Promise<void> {\n const index = quill.getSelection(true)?.index ?? 0;\n if (!options.choose) {\n pickImageFiles(files =>\n insertUploadedImages(quill, index, files, options.upload, options.busyLabel?.())\n );\n return;\n }\n const choice = await options.choose();\n if (!choice) {\n return;\n }\n if ('url' in choice) {\n insertImageUrl(quill, index, choice.url);\n } else {\n await insertUploadedImages(\n quill,\n index,\n choice.files,\n options.upload,\n options.busyLabel?.()\n );\n }\n}\n\n/** Quill `uploader` module config: Quill hands it every pasted or dropped file. */\nexport function imageUploaderModule(options: QuillImageUploadOptions) {\n return {\n mimetypes: EDITOR_IMAGE_TYPES,\n handler(this: { quill: EditorQuill }, range: { index: number }, files: File[]) {\n insertUploadedImages(\n this.quill,\n range.index,\n files,\n options.upload,\n options.busyLabel?.()\n );\n }\n };\n}\n\nconst DROP_CLASS = 'ql-image-drop';\n\n/**\n * Quill module: highlights the editor only while a file is dragged over it, so the drop target is\n * clear without a permanent hint in the text. Styled by `.ql-container.ql-image-drop` (core-styles).\n */\nexport class ImageDropHint {\n constructor(quill: { container: HTMLElement }, options?: { label?: () => string }) {\n const container = quill.container;\n const show = (event: DragEvent) => {\n if (Array.from(event.dataTransfer?.types ?? []).includes('Files')) {\n container.setAttribute('data-drop-label', options?.label?.() ?? '');\n container.classList.add(DROP_CLASS);\n }\n };\n const hide = (event: DragEvent) => {\n if (event.type === 'drop' || !container.contains(event.relatedTarget as Node | null)) {\n container.classList.remove(DROP_CLASS);\n }\n };\n container.addEventListener('dragenter', show);\n container.addEventListener('dragover', show);\n container.addEventListener('dragleave', hide);\n container.addEventListener('drop', hide);\n }\n}\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { ButtonBusyDirective } from '@posiwise/directives';\n\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { EDITOR_IMAGE_TYPES, EditorImageChoice } from '../quill-image-upload';\n\nconst LINK = /^https?:\\/\\/\\S+$/i;\n\n/**\n * \"Add image\" box opened by the editor's image button (posiwise-frontend#4272): add by link, or\n * upload from the computer. A link is copied into our storage first (`importUrl`) and the box\n * returns OUR URL, so the body never points at another site. The upload button is its own click, so\n * the browser always lets it open the file picker.\n */\n@Component({\n selector: 'pw-editor-image-dialog',\n templateUrl: './editor-image-dialog.component.html',\n styleUrl: './editor-image-dialog.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ButtonBusyDirective, FormsModule, TranslocoPipe]\n})\nexport class EditorImageDialogComponent {\n readonly modal = inject(NgbActiveModal);\n private readonly cdr = inject(ChangeDetectorRef);\n readonly accept = EDITOR_IMAGE_TYPES.join(',');\n\n /** Copies the linked image into our storage; set by `openEditorImageDialog`. */\n importUrl: (url: string) => Promise<string>;\n link = '';\n triedLink = false;\n importing = false;\n\n get linkValid(): boolean {\n return LINK.test(this.link.trim());\n }\n\n async addLink(): Promise<void> {\n this.triedLink = true;\n if (!this.linkValid || this.importing) {\n return;\n }\n this.importing = true;\n try {\n const url = await this.importUrl(this.link.trim());\n this.modal.close({ url } satisfies EditorImageChoice);\n } catch {\n // main-api's error toast says why; the box stays open to try another link.\n } finally {\n this.importing = false;\n this.cdr.markForCheck();\n }\n }\n\n filesPicked(input: HTMLInputElement): void {\n const files = Array.from(input.files ?? []);\n if (files.length) {\n this.modal.close({ files } satisfies EditorImageChoice);\n }\n }\n}\n\n/** Resolves with what the user chose (a link already copied to our URL), or null when closed. */\nexport function openEditorImageDialog(\n modal: NgbModal,\n importUrl: (url: string) => Promise<string>\n): Promise<EditorImageChoice | null> {\n // Not closable mid-copy: closing would drop an image that is already being stored.\n const ref = modal.open(EditorImageDialogComponent, {\n centered: true,\n size: 'md',\n beforeDismiss: () => !dialog?.importing\n });\n // Read lazily by beforeDismiss, i.e. only after this line has run.\n const dialog = ref.componentInstance as EditorImageDialogComponent;\n dialog.importUrl = importUrl;\n return ref.result.then(\n (choice: EditorImageChoice) => choice ?? null,\n () => null\n );\n}\n","<div class=\"pw-editor-image\">\n <div class=\"pw-editor-image__header\">\n <h5 class=\"pw-editor-image__title\" id=\"pw-editor-image-title\">{{ 'Common.Upload.Image.Title' | transloco }}</h5>\n <button type=\"button\"\n class=\"btn-close\"\n [disabled]=\"importing\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n\n <form class=\"pw-editor-image__link\" (ngSubmit)=\"addLink()\">\n <label class=\"form-label\" for=\"pw-editor-image-link\">{{ 'Common.Upload.Image.LinkLabel' | transloco }}</label>\n <div class=\"input-group\">\n <input id=\"pw-editor-image-link\"\n name=\"link\"\n type=\"url\"\n class=\"form-control\"\n autocomplete=\"off\"\n [readonly]=\"importing\"\n [class.is-invalid]=\"triedLink && !linkValid\"\n [placeholder]=\"'Common.Upload.Image.LinkPlaceholder' | transloco\"\n [(ngModel)]=\"link\">\n <button type=\"submit\" class=\"btn btn-primary\" [buttonBusy]=\"importing\">{{ 'Common.Upload.Image.Add' | transloco }}</button>\n </div>\n @if (triedLink && !linkValid) {\n <div class=\"invalid-feedback d-block\" role=\"alert\">{{ 'Common.Upload.Image.LinkInvalid' | transloco }}</div>\n }\n </form>\n\n <div class=\"pw-editor-image__or\">{{ 'Common.Upload.Image.Or' | transloco }}</div>\n\n <input #fileInput\n type=\"file\"\n class=\"d-none\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'Common.Upload.Image.Upload' | transloco\"\n multiple\n [accept]=\"accept\"\n (change)=\"filesPicked(fileInput)\">\n <button type=\"button\" class=\"btn btn-outline-primary w-100\" [disabled]=\"importing\" (click)=\"fileInput.click()\">\n <i class=\"fa fa-upload\" aria-hidden=\"true\"></i>\n {{ 'Common.Upload.Image.Upload' | transloco }}\n </button>\n <p class=\"pw-editor-image__hint\">{{ 'Common.Upload.Image.Hint' | transloco }}</p>\n</div>\n","import { inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { EditorImageUploadService, PermissionService } from '@posiwise/common-services';\n\nimport { translate } from '@jsverse/transloco';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { openEditorImageDialog } from './editor-image-dialog/editor-image-dialog.component';\nimport { QuillImageUploadOptions } from './quill-image-upload';\n\n/**\n * Image upload for every editor built with `QuillHelper.getEditorConfig()` (posiwise-frontend#4272),\n * without each component wiring it: the editors build their config in their constructor, where\n * `inject` works. Images go to the subscription the user has selected, which is the one these\n * editors save their content to.\n *\n * Outside an injection context (plain code, unit tests) it returns undefined and the editor keeps\n * the URL-only image button.\n */\nexport function defaultImageUpload(): QuillImageUploadOptions | undefined {\n let route: ActivatedRoute | null;\n try {\n route = inject(ActivatedRoute, { optional: true });\n } catch {\n return undefined;\n }\n return editorImageUpload(() => uploadSubscriptionId(route));\n}\n\n/**\n * Same as `defaultImageUpload`, for an editor that saves its content to a subscription it resolves\n * itself (e.g. from the route or local storage). Call it from a constructor or field initialiser:\n * `QuillHelper.getEditorConfig([], editorImageUpload(() => this.subscriptionId))`.\n */\nexport function editorImageUpload(\n subscriptionId: () => number | null | undefined\n): QuillImageUploadOptions | undefined {\n let service: EditorImageUploadService | null;\n let modal: NgbModal | null;\n try {\n service = inject(EditorImageUploadService, { optional: true });\n modal = inject(NgbModal, { optional: true });\n } catch {\n return undefined;\n }\n if (!service) {\n return undefined;\n }\n const { upload, importUrl } = service.forSubscription(subscriptionId);\n return {\n upload,\n importUrl,\n choose: modal ? () => openEditorImageDialog(modal, importUrl) : undefined,\n dropLabel: () => translate('Common.Upload.Image.Drop'),\n busyLabel: () => translate('Common.Upload.Image.Uploading')\n };\n}\n\n/**\n * The selected subscription, read at upload time. On a subscription page (`/:slug/...`) it must be\n * that slug's subscription; if the two ever differ, no subscription is returned and the upload is\n * refused rather than stored under another subscription. A `slug` deeper in the URL names a record\n * (e.g. `/admin/resources/:slug`), not a subscription, and is ignored.\n */\nexport function uploadSubscriptionId(route: ActivatedRoute | null): number | undefined {\n const selected = PermissionService.selectedSubscription;\n const path = route?.snapshot?.pathFromRoot ?? [];\n const firstSegment = path.flatMap(r => r.url ?? []).map(segment => segment.path)[0];\n const slug = path.map(r => r.params?.['slug']).find(value => value && value === firstSegment);\n if (slug && selected?.slug !== slug) {\n return undefined;\n }\n return selected?.id;\n}\n","import Quill from 'quill';\n\nimport { insertUploadedImages } from './quill-image-upload';\n\n/**\n * Keeps editor bodies on our own storage (posiwise-frontend#4272): an image pasted from a web page,\n * or dragged in from another site, arrives as a link to that site. This module takes those links\n * out of the paste/drop, copies each image into our storage (`importUrl`) and inserts OUR URL.\n * Image FILES are handled by Quill's uploader; `data:` images are refused by PasteGuard.\n */\n\nconst EXTERNAL = /^https?:\\/\\//i;\n\n/** Already ours: same-origin (`/downloads`, `/s3-local`) or an uploaded editor image. */\nexport function isOwnImage(src: string): boolean {\n return src.startsWith('/') || /\\/editor_images\\/\\d+\\//.test(src);\n}\n\nfunction needsImport(src: string | null | undefined): src is string {\n return !!src && EXTERNAL.test(src) && !isOwnImage(src);\n}\n\n/** External image links in dropped data: `<img src>` from HTML, else the dragged URL itself. */\nexport function droppedImageLinks(data: DataTransfer | null | undefined): string[] {\n const html = data?.getData('text/html');\n if (html) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n const srcs = Array.from(doc.images, img => img.getAttribute('src')).filter(needsImport);\n if (srcs.length) {\n return srcs;\n }\n }\n const link = data?.getData('text/uri-list')?.split('\\n')[0]?.trim();\n return needsImport(link) ? [link] : [];\n}\n\ntype ImportOptions = {\n importUrl?: (url: string) => Promise<string>;\n busyLabel?: () => string;\n};\n\n/** Quill module: `imageLinkImport: { importUrl, busyLabel }`. Does nothing without an importer. */\nexport class ImageLinkImport {\n private pending: string[] = [];\n\n constructor(\n private readonly quill: Quill,\n private readonly options?: ImportOptions\n ) {\n if (!options?.importUrl) {\n return;\n }\n const Delta = Quill.import('delta');\n quill.clipboard.addMatcher('IMG', (node: Node, delta) => {\n const src = node instanceof Element ? node.getAttribute('src') : null;\n if (!needsImport(src)) {\n return delta;\n }\n this.pending.push(src);\n return new Delta();\n });\n // Quill converts the paste synchronously; the links it set aside are copied right after.\n quill.root.addEventListener('paste', () => setTimeout(() => this.importPending(), 0));\n quill.root.addEventListener('drop', event => this.onDrop(event as DragEvent));\n }\n\n private importPending(): void {\n const links = this.pending.splice(0);\n if (links.length) {\n this.insert(links);\n }\n }\n\n private onDrop(event: DragEvent): void {\n if (event.dataTransfer?.files?.length) {\n return; // a file: Quill's uploader stores it\n }\n const links = droppedImageLinks(event.dataTransfer);\n if (links.length) {\n event.preventDefault();\n this.insert(links);\n }\n }\n\n private insert(links: string[]): void {\n const index = this.quill.getSelection(true)?.index ?? this.quill.getLength();\n insertUploadedImages(\n this.quill as never,\n index,\n links,\n this.options.importUrl,\n this.options.busyLabel?.()\n );\n }\n}\n","import Quill from 'quill';\n\n/**\n * Stops an image being PASTED into a Quill editor as an inline `data:` URI.\n *\n * Quill's default clipboard module turns a pasted screenshot into\n * `<img src=\"data:image/png;base64,…\">`, which stores the entire file inside the document. The\n * toolbar's image button cannot do this (it prompts for a URL) and dropped images are stripped by\n * NoDragDrop, so paste was the one remaining way in — and it was unhandled in this shared config,\n * which eleven editors across the app rely on.\n *\n * It is not merely a size problem. Embedded bytes bypass the image host and its CDN, cannot be\n * cached, resized or replaced, and are re-sent from the database on every page view. One live\n * CloudOlive post reached 1.4 MB from nine pasted PNGs, against 19 KB of actual prose.\n *\n * main-api rejects these on save as the backstop; this is the prevention, and the reason an author\n * finds out while they are still writing rather than when they press save.\n */\n\nconst DATA_URI_IMAGE = /^data:image\\//i;\n\nexport const PASTED_IMAGE_MESSAGE =\n 'That image was pasted, so it would be stored inside the article itself rather than on the ' +\n 'image host — which makes the page much heavier for every reader. Upload the image somewhere ' +\n 'first, then use the image button in the toolbar to add it by URL.';\n\n/** True when the clipboard carries an image FILE — a screenshot, or an image copied from disk. */\nexport function clipboardHasImageFile(clipboardData: DataTransfer | null | undefined): boolean {\n if (!clipboardData) {\n return false;\n }\n const items = Array.from(clipboardData.items ?? []);\n if (items.some(item => item.kind === 'file' && item.type?.startsWith('image/'))) {\n return true;\n }\n // Safari populates `files` without always setting `items[].kind`, so check both.\n return Array.from(clipboardData.files ?? []).some(file => file.type?.startsWith('image/'));\n}\n\n/** True when this src embeds the file in the document instead of referencing it. */\nexport function isEmbeddedImageSrc(src: string | null | undefined): boolean {\n return DATA_URI_IMAGE.test((src ?? '').trim());\n}\n\n/**\n * Quill module. Register once, then enable with `pasteGuard: true` (or\n * `pasteGuard: { onBlocked: fn }` to replace the default alert with a toast).\n */\nexport class PasteGuard {\n private readonly notify: (message: string) => void;\n private readonly allowImageFiles: boolean;\n\n /**\n * `allowImageFiles`: the editor uploads pasted image files (Quill's `uploader` module), so let\n * them through. Pasted HTML carrying a `data:` image is still dropped.\n */\n constructor(\n quill: Quill,\n options?: { onBlocked?: (message: string) => void; allowImageFiles?: boolean }\n ) {\n this.notify = options?.onBlocked ?? (message => globalThis.alert?.(message));\n this.allowImageFiles = options?.allowImageFiles ?? false;\n\n // Capture phase: run before Quill's own clipboard handler turns the file into a delta.\n quill.root.addEventListener(\n 'paste',\n event => this.handlePaste(event as ClipboardEvent),\n true\n );\n\n // A separate vector: pasting HTML copied from another page, which can carry a `data:` <img>\n // with no file on the clipboard at all. Quill matches on the parsed DOM, so drop those\n // there — and leave https images alone, since pasting a real image URL is fine.\n // Quill types the matcher's first argument as Node, so narrow before reading the attribute.\n const Delta = Quill.import('delta');\n quill.clipboard.addMatcher('IMG', (node: Node, delta) => {\n const src = node instanceof Element ? node.getAttribute('src') : null;\n if (!isEmbeddedImageSrc(src)) {\n return delta;\n }\n this.notify(PASTED_IMAGE_MESSAGE);\n return new Delta();\n });\n }\n\n private handlePaste(event: ClipboardEvent): void {\n if (this.allowImageFiles || !clipboardHasImageFile(event.clipboardData)) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.notify(PASTED_IMAGE_MESSAGE);\n }\n}\n","import { DestroyRef, Directive, inject, OnInit } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { QuillEditorComponent } from 'ngx-quill';\nimport type Quill from 'quill';\n\nimport { defaultImageUpload } from './quill-default-image-upload';\nimport { ImageLinkImport } from './quill-image-link-import';\nimport {\n chooseImage,\n EDITOR_IMAGE_TYPES,\n ImageDropHint,\n imageUploaderModule,\n QuillImageUploadOptions\n} from './quill-image-upload';\nimport { PasteGuard } from './quill-paste-guard';\n\n/**\n * Image upload for a `<quill-editor>` that has no `[modules]` of its own (posiwise-frontend#4272):\n * `<quill-editor pwEditorImages …>` gets the same \"Add image\" box, paste/drop upload and drop\n * highlight as editors built with `QuillHelper.getEditorConfig()`. It wires the created editor,\n * because a component's ngx-quill config can't be changed from outside.\n */\n@Directive({\n selector: '[pwEditorImages]',\n standalone: true\n})\nexport class EditorImageUploadDirective implements OnInit {\n private readonly editor = inject(QuillEditorComponent, { self: true });\n private readonly destroyRef = inject(DestroyRef);\n private readonly options = defaultImageUpload();\n\n ngOnInit(): void {\n if (!this.options) {\n return;\n }\n this.editor.onEditorCreated\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((quill: Quill) => wireImageUpload(quill, this.options));\n }\n}\n\n/** Gives an already-created editor the image button, paste/drop upload and drop highlight. */\nexport function wireImageUpload(quill: Quill, options: QuillImageUploadOptions): void {\n const editor = quill as unknown as Parameters<typeof chooseImage>[0];\n const toolbar = quill.getModule('toolbar') as {\n addHandler(name: string, handler: () => void): void;\n } | null;\n toolbar?.addHandler('image', () => chooseImage(editor, options));\n\n const uploader = quill.getModule('uploader') as {\n options: { mimetypes?: string[]; handler?: unknown };\n } | null;\n if (uploader) {\n uploader.options.mimetypes = EDITOR_IMAGE_TYPES;\n uploader.options.handler = imageUploaderModule(options).handler;\n }\n new PasteGuard(quill, { allowImageFiles: true });\n new ImageDropHint(quill, { label: options.dropLabel });\n new ImageLinkImport(quill, { importUrl: options.importUrl, busyLabel: options.busyLabel });\n}\n","import Quill from 'quill';\nimport * as ImageResize from 'quill-resize-image';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst BlockEmbed = Quill.import('formats/image') as any;\n\nexport class NoDragImage extends BlockEmbed {\n static create(value) {\n const node = super.create();\n node.setAttribute('src', value.url);\n node.setAttribute('alt', value.alt || '');\n node.setAttribute('class', 'no-drag-image');\n node.setAttribute('draggable', 'false');\n\n node.style.width = value.width || '300px'; // Default width\n node.style.height = value.height || 'auto';\n\n if (value.align) {\n switch (value.align) {\n case 'left':\n node.style.float = 'left';\n node.style.marginRight = '1em';\n break;\n case 'right':\n node.style.float = 'right';\n node.style.marginLeft = '1em';\n break;\n case 'center':\n node.style.display = 'block';\n node.style.marginLeft = 'auto';\n node.style.marginRight = 'auto';\n break;\n default:\n node.style.float = 'none';\n }\n }\n\n return node;\n }\n\n static value(node) {\n return {\n url: node.getAttribute('src'),\n alt: node.getAttribute('alt'),\n width: node.getAttribute('data-width') || node.style.width,\n height: node.getAttribute('data-height') || node.style.height,\n align: node.style.float || 'center'\n };\n }\n}\n\nexport class NoDragDrop {\n constructor(quill, _options) {\n quill.root.addEventListener('drop', this.handleDrop.bind(this, quill));\n quill.root.addEventListener('dragover', this.preventDefault);\n }\n\n preventDefault(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleDrop(quill, e) {\n this.preventDefault(e);\n\n // Create a MutationObserver to detect inserted images\n const observer = new MutationObserver(mutations => {\n this.removeInsertedImages(quill, mutations);\n });\n\n // Start observing for added nodes\n observer.observe(quill.root, { childList: true, subtree: true });\n\n // Stop observing after a short delay\n setTimeout(() => {\n observer.disconnect();\n }, 1000); // Adjust the timeout as needed\n }\n\n removeInsertedImages(quill, mutations) {\n mutations.forEach(mutation => {\n mutation.addedNodes.forEach(node => {\n if (node instanceof HTMLImageElement) {\n node.remove();\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n node.querySelectorAll('img').forEach(img => img.remove());\n }\n });\n });\n }\n}\n\nNoDragImage['blotName'] = 'no-drag-image';\nNoDragImage['tagName'] = 'img';\nQuill.register(NoDragImage);\nQuill.register('modules/noDragDrop', NoDragDrop);\nQuill.register('modules/imageResize', ImageResize.default || ImageResize);\n","import Quill from 'quill';\n\n/** Buttons drawn over an embedded video in the editor. */\n\nexport function createAlignButtons(container) {\n const buttonContainer = document.createElement('div');\n buttonContainer.setAttribute('class', 'media-align-buttons');\n buttonContainer.style.position = 'absolute';\n buttonContainer.style.top = '0';\n buttonContainer.style.right = '0';\n buttonContainer.style.display = 'flex';\n buttonContainer.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable\n\n const leftButton = createButton('Left', () => {\n container.style.textAlign = 'left';\n container.setAttribute('data-align', 'left'); // Save alignment\n });\n\n const centerButton = createButton('Center', () => {\n container.style.textAlign = 'center';\n container.setAttribute('data-align', 'center'); // Save alignment\n });\n\n const rightButton = createButton('Right', () => {\n container.style.textAlign = 'right';\n container.setAttribute('data-align', 'right'); // Save alignment\n });\n\n buttonContainer.appendChild(leftButton);\n buttonContainer.appendChild(centerButton);\n buttonContainer.appendChild(rightButton);\n\n return buttonContainer;\n}\n\nexport function createRemoveButton(container) {\n const wrapper = document.createElement('div');\n wrapper.setAttribute('class', 'media-remove-button');\n wrapper.style.position = 'absolute';\n wrapper.style.top = '0';\n wrapper.style.left = '0';\n wrapper.style.display = 'flex';\n wrapper.setAttribute('contenteditable', 'false');\n\n const removeButton = createButton('Remove', () => {\n const mediaContainer = container.classList.contains('media-container')\n ? container\n : container.closest('.media-container');\n if (mediaContainer) {\n const blot = Quill.find(mediaContainer);\n if (blot && 'remove' in blot && typeof blot.remove === 'function') {\n (blot as { remove: () => void }).remove();\n } else {\n // Content loaded from saved HTML may not be a Quill blot; remove from DOM so save persists the change\n mediaContainer.remove();\n }\n }\n });\n removeButton.style.background = 'rgb(243, 67, 67)';\n removeButton.style.color = 'white';\n removeButton.style.border = 'none';\n removeButton.style.padding = '2px 8px';\n removeButton.style.marginTop = '2px';\n removeButton.style.borderRadius = '4px';\n removeButton.title = 'Remove video';\n wrapper.appendChild(removeButton);\n\n return wrapper;\n}\n\nexport function createResizeButtons(container) {\n const buttonContainer = document.createElement('div');\n buttonContainer.setAttribute('class', 'media-resize-buttons');\n buttonContainer.style.position = 'absolute';\n buttonContainer.style.bottom = '5px'; // Adjust position above the bottom edge\n buttonContainer.style.right = '5px';\n buttonContainer.style.display = 'flex';\n buttonContainer.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable\n\n const updateWidthAndHeight = (mediaElement, width, height) => {\n mediaElement.style.width = width;\n mediaElement.style.height = height;\n container.setAttribute('data-width', width); // Save width\n container.setAttribute('data-height', height); // Save height\n };\n\n const increaseWidthButton = createButton('Increase Width', () => {\n const mediaElement = container.querySelector('.no-drag-media');\n const currentWidth = parseInt(mediaElement.style.width || '100%');\n updateWidthAndHeight(mediaElement, `${currentWidth + 20}px`, mediaElement.style.height);\n });\n\n const decreaseWidthButton = createButton('Decrease Width', () => {\n const mediaElement = container.querySelector('.no-drag-media');\n const currentWidth = parseInt(mediaElement.style.width || '100%');\n updateWidthAndHeight(\n mediaElement,\n `${Math.max(100, currentWidth - 20)}px`,\n mediaElement.style.height\n );\n });\n\n const increaseHeightButton = createButton('Increase Height', () => {\n const mediaElement = container.querySelector('.no-drag-media');\n const currentHeight = parseInt(mediaElement.style.height || '200px'); // Default height\n updateWidthAndHeight(mediaElement, mediaElement.style.width, `${currentHeight + 20}px`);\n });\n\n const decreaseHeightButton = createButton('Decrease Height', () => {\n const mediaElement = container.querySelector('.no-drag-media');\n const currentHeight = parseInt(mediaElement.style.height || '200px'); // Default height\n updateWidthAndHeight(\n mediaElement,\n mediaElement.style.width,\n `${Math.max(100, currentHeight - 20)}px`\n );\n });\n\n buttonContainer.appendChild(increaseWidthButton);\n buttonContainer.appendChild(decreaseWidthButton);\n buttonContainer.appendChild(increaseHeightButton);\n buttonContainer.appendChild(decreaseHeightButton);\n\n return buttonContainer;\n}\n\nexport function createButton(label, onClick) {\n const button = document.createElement('button');\n button.innerHTML = label;\n button.style.margin = '0 5px';\n button.style.cursor = 'pointer';\n\n // Prevent Quill from treating this as part of the content\n button.setAttribute('contenteditable', 'false');\n button.style.pointerEvents = 'auto'; // Allow button clicks but don't let Quill interact with them\n\n button.onclick = event => {\n event.preventDefault(); // Prevent default action\n event.stopPropagation(); // Prevent the event from bubbling up and being interpreted by Quill\n onClick(); // Execute the button's action\n };\n\n return button;\n}\n","import Quill from 'quill';\n\nimport {\n createAlignButtons,\n createRemoveButton,\n createResizeButtons\n} from './quill-video-controls';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst BlockEmbedVideo = Quill.import('blots/block/embed') as any;\nexport class NoDragVideo extends BlockEmbedVideo {\n static create(value) {\n const node = document.createElement('iframe');\n node.setAttribute('src', value.url);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', 'true');\n node.setAttribute('width', value.width || '100%'); // Default width\n node.setAttribute('height', value.height || '200px'); // Default height\n node.setAttribute('class', 'no-drag-media');\n node.setAttribute('contenteditable', 'false'); // Prevent content from being editable\n\n // Add proper allow attribute for YouTube and other video embeds\n if (value.url && (value.url.includes('youtube.com') || value.url.includes('youtu.be'))) {\n node.setAttribute(\n 'allow',\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'\n );\n // Ensure YouTube embed URL format is correct\n if (\n value.url &&\n !value.url.includes('youtube-nocookie.com') &&\n !value.url.includes('enablejsapi=1')\n ) {\n try {\n const url = new URL(value.url);\n url.searchParams.set('enablejsapi', '1');\n if (typeof window !== 'undefined' && window.location) {\n url.searchParams.set('origin', window.location.origin);\n }\n node.setAttribute('src', url.toString());\n } catch {\n // If URL parsing fails, keep original src and just add query params manually\n const separator = value.url.includes('?') ? '&' : '?';\n node.setAttribute('src', `${value.url}${separator}enablejsapi=1`);\n }\n }\n } else if (value.url && value.url.includes('loom.com')) {\n node.setAttribute(\n 'allow',\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'\n );\n } else {\n // Default allow for other iframes\n node.setAttribute('allow', 'fullscreen');\n }\n\n // Create a container for both video/iframe and buttons\n const container = document.createElement('div');\n container.setAttribute('class', 'media-container');\n container.style.position = 'relative';\n container.style.width = '100%';\n container.style.height = 'auto';\n container.appendChild(node); // Append video/iframe to the container\n\n // Append remove button so video can be deleted after save/update (backspace often doesn't work on reloaded content)\n if (!container.querySelector('.media-remove-button')) {\n const removeButton = createRemoveButton(container);\n removeButton.setAttribute('contenteditable', 'false');\n container.appendChild(removeButton);\n }\n\n // Append align buttons if not already present\n if (!container.querySelector('.media-align-buttons')) {\n const alignButtons = createAlignButtons(container);\n alignButtons.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable\n container.appendChild(alignButtons);\n }\n\n // Append resize buttons if not already present\n if (!container.querySelector('.media-resize-buttons')) {\n const resizeButtons = createResizeButtons(container);\n resizeButtons.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable\n container.appendChild(resizeButtons);\n }\n\n container.setAttribute('contenteditable', 'false'); // Prevent the entire container from being editable\n\n return container;\n }\n\n static value(container) {\n const iframe = container.querySelector('iframe');\n return {\n url: iframe?.getAttribute('src'),\n width: container.getAttribute('data-width') || iframe?.getAttribute('width'),\n height: container.getAttribute('data-height') || iframe?.getAttribute('height'),\n align: container.getAttribute('data-align') || 'center' // Default to center if no alignment\n };\n }\n}\n\nNoDragVideo['blotName'] = 'no-drag-video';\nNoDragVideo['tagName'] = 'div'; // TagName is set to div to hold buttons\nQuill.register(NoDragVideo);\n","import Quill from 'quill';\nimport * as ImageResize from 'quill-resize-image';\n\nimport { defaultImageUpload } from './quill-default-image-upload';\nimport { ImageLinkImport } from './quill-image-link-import';\nimport {\n chooseImage,\n ImageDropHint,\n imageUploaderModule,\n QuillImageUploadOptions\n} from './quill-image-upload';\nimport { NoDragDrop, NoDragImage } from './quill-no-drag-image';\nimport { NoDragVideo } from './quill-no-drag-video';\nimport { PasteGuard } from './quill-paste-guard';\n\nexport class QuillHelper {\n static init() {\n if (!Quill.imports['formats/no-drag-image']) {\n Quill.register(NoDragImage);\n }\n if (!Quill.imports['formats/no-drag-video']) {\n Quill.register(NoDragVideo);\n }\n if (!Quill.imports['modules/imageResize']) {\n Quill.register('modules/imageResize', ImageResize.default || ImageResize);\n }\n if (!Quill.imports['modules/noDragDrop']) {\n Quill.register('modules/noDragDrop', NoDragDrop);\n }\n if (!Quill.imports['modules/pasteGuard']) {\n Quill.register('modules/pasteGuard', PasteGuard);\n }\n if (!Quill.imports['modules/imageDropHint']) {\n Quill.register('modules/imageDropHint', ImageDropHint);\n }\n if (!Quill.imports['modules/imageLinkImport']) {\n Quill.register('modules/imageLinkImport', ImageLinkImport);\n }\n }\n\n /**\n * `imageUpload` uploads images to S3 instead of only accepting a URL (#4272). Called from a\n * constructor it defaults to the selected subscription; see `defaultImageUpload`.\n */\n static getEditorConfig(\n additionalToolbarConfig = [],\n imageUpload: QuillImageUploadOptions | undefined = defaultImageUpload()\n ) {\n const defaultToolbarConfig = [\n ['bold', 'italic', 'underline', 'strike'], // toggled buttons\n ['blockquote', 'code-block'],\n [{ header: 1 }, { header: 2 }], // custom button values\n [{ list: 'ordered' }, { list: 'bullet' }],\n [{ script: 'sub' }, { script: 'super' }], // superscript/subscript\n [{ indent: '-1' }, { indent: '+1' }], // outdent/indent\n [{ direction: 'rtl' }], // text direction\n [{ header: [1, 2, 3, 4, 5, 6, false] }],\n [{ color: [] }, { background: [] }], // dropdown with defaults from theme\n [{ align: [] }],\n ['link', 'image', 'video'],\n ['clean'], // remove formatting button\n ['table'] // table button\n ];\n\n const mergedToolbarConfig = [...defaultToolbarConfig, ...additionalToolbarConfig];\n\n return {\n toolbar: {\n container: mergedToolbarConfig,\n handlers: {\n image: function () {\n if (imageUpload) {\n chooseImage(this.quill, imageUpload);\n return;\n }\n const range = this.quill.getSelection();\n const value = prompt('Enter image URL:');\n if (value) {\n this.quill.insertEmbed(range.index, 'no-drag-image', { url: value });\n this.quill.insertText(range.index + 1, '\\n', Quill.sources.USER);\n }\n },\n video: function () {\n const range = this.quill.getSelection();\n let value = prompt('Enter video URL:');\n if (value?.includes('youtube.com/watch?v=')) {\n const videoId = value.split('v=')[1];\n value = `https://www.youtube.com/embed/${videoId}`;\n } else if (value?.includes('youtu.be/')) {\n const videoId = value.split('.be/')[1];\n value = `https://www.youtube.com/embed/${videoId}`;\n } else if (value?.includes('loom.com/share/')) {\n const videoId = value.split('share/')[1];\n value = `https://www.loom.com/embed/${videoId}`;\n } else if (value?.includes('capture.dropbox.com/')) {\n const videoId = value.split('capture.dropbox.com/')[1];\n if (videoId.includes('embed')) {\n value = `https://capture.dropbox.com/${videoId}`;\n } else {\n value = `https://capture.dropbox.com/embed/${videoId}`;\n }\n }\n if (value) {\n const useIframe =\n value.includes('youtube.com') ||\n value.includes('youtu.be') ||\n value.includes('loom.com') ||\n value.includes('drop');\n this.quill.insertEmbed(range.index, 'no-drag-video', {\n url: value,\n isEdit: true,\n width: useIframe ? '560px' : '640px', // Different width for iframe vs video\n height: useIframe ? '315px' : '360px' // Different height for iframe vs video\n });\n this.quill.insertText(range.index + 1, '\\n', Quill.sources.USER);\n }\n }\n }\n },\n imageResize: {\n displaySize: true\n },\n // With uploads, Quill's uploader takes dropped files; NoDragDrop would delete the result.\n ...(imageUpload\n ? {\n uploader: imageUploaderModule(imageUpload),\n imageDropHint: { label: imageUpload.dropLabel },\n imageLinkImport: {\n importUrl: imageUpload.importUrl,\n busyLabel: imageUpload.busyLabel\n },\n pasteGuard: { allowImageFiles: true }\n }\n : { noDragDrop: true, pasteGuard: true })\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAQA,MAAM,QAAQ;AAMd,SAAS,eAAe,OAAqB,QAAqB;CAC9D,MAAM,UAAU,MAAM,YAAY,SAAS;CAC3C,IAAI,CAAC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AO,SAAS,sBAAsB,GAEtC,QAAQ,iCADQ,MAAM,MAAM,IAAI,CAAC,CAAC;WAE/B,IAAI,OAAO,SAAS,WAAW,GAElC,QAAQ,iCADQ,MAAM,MAAM,MAAM,CAAC,CAAC;WAEjC,IAAI,OAAO,SAAS,iBAAiB,GAExC,QAAQ,8BADQ,MAAM,MAAM,QAAQ,CAAC,CAAC;WAEnC,IAAI,OAAO,SAAS,sBAAsB,GAAG;OAChD,MAAM,UAAU,MAAM,MAAM,sBAAsB,CAAC,CAAC;OACpD,IAAI,QAAQ,SAAS,OAAO,GACxB,QAAQ,+BAA+B;YAEvC,QAAQ,qCAAqC;MAErD;MACA,IAAI,OAAO;OACP,MAAM,YACF,MAAM,SAAS,aAAa,KAC5B,MAAM,SAAS,UAAU,KACzB,MAAM,SAAS,UAAU,KACzB,MAAM,SAAS,MAAM;OACzB,KAAK,MAAM,YAAY,MAAM,OAAO,iBAAiB;QACjD,KAAK;QACL,QAAQ;QACR,OAAO,YAAY,UAAU;QAC7B,QAAQ,YAAY,UAAU;OACjC,CAAA;OACD,KAAK,MAAM,WAAW,MAAM,QAAQ,GAAG,MAAM,MAAM,QAAQ,IAAI;MACnE;KACJ;IACH;GACJ;GACD,aAAa,EACT,aAAa,KAChB;GAED,GAAI,cACE;IACI,UAAU,oBAAoB,WAAW;IACzC,eAAe,EAAE,OAAO,YAAY,UAAS;IAC7C,iBAAiB;KACb,WAAW,YAAY;KACvB,WAAW,YAAY;IAC1B;IACD,YAAY,EAAE,iBAAiB,KAAI;GACtC,IACD;IAAE,YAAY;IAAM,YAAY;GAAI;EAC7C;CACL;AACH"}
|
|
@@ -669,9 +669,6 @@ var ResourceHeaderComponent = class ResourceHeaderComponent extends AppBaseCompo
|
|
|
669
669
|
canEditResources() {
|
|
670
670
|
return this.canEditResourcesValue;
|
|
671
671
|
}
|
|
672
|
-
navigateToLogin() {
|
|
673
|
-
window.location.href = "/login";
|
|
674
|
-
}
|
|
675
672
|
static {
|
|
676
673
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
677
674
|
minVersion: "12.0.0",
|
|
@@ -711,7 +708,7 @@ var ResourceHeaderComponent = class ResourceHeaderComponent extends AppBaseCompo
|
|
|
711
708
|
usesInheritance: true,
|
|
712
709
|
usesOnChanges: true,
|
|
713
710
|
ngImport: i0,
|
|
714
|
-
template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n }\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-8 d-flex align-items-md-center\">\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n }\n <div class=\"flex-grow-1 d-flex justify-content-md-center\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n @for (item of navbarItems; track item) {\n <li class=\"nav-item\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n [attr.href]=\"item.subtitles?.length ? '#' : item.path\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"onNavbarItemClick(item, $event)\"\n >\n {{ item?.title }}\n @if (item.subtitles.length > 0 && item.open) {\n <i class=\"fa-solid fa-caret-down\"></i>\n }\n </a>\n @if (item.subtitles.length > 0 && item.open) {\n <div class=\"popup position-absolute\"\n >\n <ul>\n @for (sub of item.subtitles; track sub) {\n <li\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </li>\n }\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\"
|
|
711
|
+
template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n }\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-8 d-flex align-items-md-center\">\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n }\n <div class=\"flex-grow-1 d-flex justify-content-md-center\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n @for (item of navbarItems; track item) {\n <li class=\"nav-item\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n [attr.href]=\"item.subtitles?.length ? '#' : item.path\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"onNavbarItemClick(item, $event)\"\n >\n {{ item?.title }}\n @if (item.subtitles.length > 0 && item.open) {\n <i class=\"fa-solid fa-caret-down\"></i>\n }\n </a>\n @if (item.subtitles.length > 0 && item.open) {\n <div class=\"popup position-absolute\"\n >\n <ul>\n @for (sub of item.subtitles; track sub) {\n <li\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </li>\n }\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\" href=\"/login\">Log In</a>\n </li>\n </ul>\n </div>\n </div>\n\n <!-- Always 3 columns for login -->\n <div class=\"col-md-2 d-none d-md-flex justify-content-end\">\n <a class=\"sign-btn sign-header-btn\" href=\"/login\">Log In</a>\n </div>\n\n </div>\n </div>\n </div>\n</nav>\n\n<ng-template #logoEditModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Logo</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <pw-custom-uploader\n [title]=\"'Main Logo'\"\n [controlName]=\"'logo_main'\"\n [aspectRatio]=\"'fullLogo'\"\n [previewData]=\"{ url: logo, name: 'logo_main.png' }\"\n (saveEvent)=\"onSaveLogo($event)\">\n </pw-custom-uploader>\n </div>\n</ng-template>",
|
|
715
712
|
styles: [".navbar-custom-background{background-color:#00000080;box-shadow:2px 2px 15px 2px #0000001f;transition:width 2s,height 2s,transform 2s background-color .5s ease;z-index:9999}.fixed-top{position:fixed!important}.primary-button{background-color:#000;border-radius:50px;color:#fff;font: 600 16.3px Montserrat-Regular,sans-serif;padding:5px 16px!important;width:auto;display:flex;gap:15px;align-items:center;justify-content:space-between}.logo_img{width:60%!important;min-width:159px!important}.navbar-toggle-icon{width:25px}.navbar-nav .nav-link{display:inline-flex!important;white-space:nowrap;gap:4px}.fa-caret-down{font-family:\"Font Awesome 6 Pro\",sans-serif;font-weight:900}.popup{top:90%;background-color:transparent;padding:10px;z-index:1000}.popup ul{list-style-type:none;padding:0;margin:0}.popup ul li{padding:5px 10px;font: 500 14px Montserrat-Regular,sans-serif}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}.dropdown-container{position:relative;display:inline-block}.navbar-nav{visibility:visible!important;display:flex!important}.nav-link{text-transform:uppercase}@media(min-width:500px){.navbar-nav .nav-item button{margin-top:10px}}@media(min-width:1200px){.navbar-nav .nav-item .nav-link{padding-bottom:0!important;padding-top:0!important}.popup{top:3.4rem!important;background-color:transparent;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.router-link-active{color:#000!important}}@media(max-width:1200px){.navbar-nav .nav-item .nav-link{font-size:15px!important}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.popup ul li:hover{background-color:#f1f1f1}.mb-icon{width:200px}.container-wrapper{padding:10px 20px!important}.dropdown-container{position:relative;display:inline-block}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}}@media(max-width:500px){.logo_img{width:60%!important;margin-left:auto;margin-right:0;display:block;transition:margin .5s ease,width .5s ease}.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul{list-style-type:none;padding:0;margin:0}.dropdown-container{position:relative;display:inline-block}}.resource-header .nav-link.scrolled-nav-link{color:#fff!important}.resource-header .sign-btn,.resource-header .sign-header-btn{text-decoration:none!important;background:var(--first)!important;color:#fff!important;border-radius:var(--public-btn-radius)!important;border:0!important;height:40px!important;padding:0 20px!important;font-size:14px!important;font-weight:600!important;text-transform:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;transition:background-color .2s ease,box-shadow .2s ease!important}.resource-header .sign-btn:hover,.resource-header .sign-header-btn:hover{background:color-mix(in srgb,var(--first) 88%,#000 12%)!important;color:#fff!important;border:0!important;box-shadow:0 10px 24px -12px var(--first)!important}\n"],
|
|
716
713
|
dependencies: [
|
|
717
714
|
{
|
|
@@ -775,7 +772,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
775
772
|
NgClass,
|
|
776
773
|
CustomUploaderComponent
|
|
777
774
|
],
|
|
778
|
-
template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n }\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-8 d-flex align-items-md-center\">\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n }\n <div class=\"flex-grow-1 d-flex justify-content-md-center\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n @for (item of navbarItems; track item) {\n <li class=\"nav-item\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n [attr.href]=\"item.subtitles?.length ? '#' : item.path\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"onNavbarItemClick(item, $event)\"\n >\n {{ item?.title }}\n @if (item.subtitles.length > 0 && item.open) {\n <i class=\"fa-solid fa-caret-down\"></i>\n }\n </a>\n @if (item.subtitles.length > 0 && item.open) {\n <div class=\"popup position-absolute\"\n >\n <ul>\n @for (sub of item.subtitles; track sub) {\n <li\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </li>\n }\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\"
|
|
775
|
+
template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n }\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-8 d-flex align-items-md-center\">\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n }\n <div class=\"flex-grow-1 d-flex justify-content-md-center\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n @for (item of navbarItems; track item) {\n <li class=\"nav-item\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n [attr.href]=\"item.subtitles?.length ? '#' : item.path\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"onNavbarItemClick(item, $event)\"\n >\n {{ item?.title }}\n @if (item.subtitles.length > 0 && item.open) {\n <i class=\"fa-solid fa-caret-down\"></i>\n }\n </a>\n @if (item.subtitles.length > 0 && item.open) {\n <div class=\"popup position-absolute\"\n >\n <ul>\n @for (sub of item.subtitles; track sub) {\n <li\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </li>\n }\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\" href=\"/login\">Log In</a>\n </li>\n </ul>\n </div>\n </div>\n\n <!-- Always 3 columns for login -->\n <div class=\"col-md-2 d-none d-md-flex justify-content-end\">\n <a class=\"sign-btn sign-header-btn\" href=\"/login\">Log In</a>\n </div>\n\n </div>\n </div>\n </div>\n</nav>\n\n<ng-template #logoEditModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Logo</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <pw-custom-uploader\n [title]=\"'Main Logo'\"\n [controlName]=\"'logo_main'\"\n [aspectRatio]=\"'fullLogo'\"\n [previewData]=\"{ url: logo, name: 'logo_main.png' }\"\n (saveEvent)=\"onSaveLogo($event)\">\n </pw-custom-uploader>\n </div>\n</ng-template>",
|
|
779
776
|
styles: [".navbar-custom-background{background-color:#00000080;box-shadow:2px 2px 15px 2px #0000001f;transition:width 2s,height 2s,transform 2s background-color .5s ease;z-index:9999}.fixed-top{position:fixed!important}.primary-button{background-color:#000;border-radius:50px;color:#fff;font: 600 16.3px Montserrat-Regular,sans-serif;padding:5px 16px!important;width:auto;display:flex;gap:15px;align-items:center;justify-content:space-between}.logo_img{width:60%!important;min-width:159px!important}.navbar-toggle-icon{width:25px}.navbar-nav .nav-link{display:inline-flex!important;white-space:nowrap;gap:4px}.fa-caret-down{font-family:\"Font Awesome 6 Pro\",sans-serif;font-weight:900}.popup{top:90%;background-color:transparent;padding:10px;z-index:1000}.popup ul{list-style-type:none;padding:0;margin:0}.popup ul li{padding:5px 10px;font: 500 14px Montserrat-Regular,sans-serif}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}.dropdown-container{position:relative;display:inline-block}.navbar-nav{visibility:visible!important;display:flex!important}.nav-link{text-transform:uppercase}@media(min-width:500px){.navbar-nav .nav-item button{margin-top:10px}}@media(min-width:1200px){.navbar-nav .nav-item .nav-link{padding-bottom:0!important;padding-top:0!important}.popup{top:3.4rem!important;background-color:transparent;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.router-link-active{color:#000!important}}@media(max-width:1200px){.navbar-nav .nav-item .nav-link{font-size:15px!important}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.popup ul li:hover{background-color:#f1f1f1}.mb-icon{width:200px}.container-wrapper{padding:10px 20px!important}.dropdown-container{position:relative;display:inline-block}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}}@media(max-width:500px){.logo_img{width:60%!important;margin-left:auto;margin-right:0;display:block;transition:margin .5s ease,width .5s ease}.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul{list-style-type:none;padding:0;margin:0}.dropdown-container{position:relative;display:inline-block}}.resource-header .nav-link.scrolled-nav-link{color:#fff!important}.resource-header .sign-btn,.resource-header .sign-header-btn{text-decoration:none!important;background:var(--first)!important;color:#fff!important;border-radius:var(--public-btn-radius)!important;border:0!important;height:40px!important;padding:0 20px!important;font-size:14px!important;font-weight:600!important;text-transform:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;transition:background-color .2s ease,box-shadow .2s ease!important}.resource-header .sign-btn:hover,.resource-header .sign-header-btn:hover{background:color-mix(in srgb,var(--first) 88%,#000 12%)!important;color:#fff!important;border:0!important;box-shadow:0 10px 24px -12px var(--first)!important}\n"]
|
|
780
777
|
}]
|
|
781
778
|
}],
|