@aquera/nile-elements 2.0.23 → 2.0.24
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/README.md +4 -0
- package/dist/index.js +53 -4
- package/dist/nile-side-bar-header/nile-side-bar-header.css.cjs.js +1 -1
- package/dist/nile-side-bar-header/nile-side-bar-header.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-header/nile-side-bar-header.css.esm.js +2 -2
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +49 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +1 -1
- package/dist/src/nile-side-bar-header/nile-side-bar-header.css.js +2 -2
- package/dist/src/nile-side-bar-header/nile-side-bar-header.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +49 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/screenshots/wysiwyg-focus-state-focused.png +0 -0
- package/docs/screenshots/wysiwyg-focus-state-unfocused.png +0 -0
- package/package.json +1 -1
- package/src/nile-side-bar-header/nile-side-bar-header.css.ts +2 -2
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +49 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +1 -1
package/README.md
CHANGED
|
@@ -91,6 +91,10 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
|
91
91
|
|
|
92
92
|
In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
|
|
93
93
|
|
|
94
|
+
#### Version 2.0.24 (November 16, 2026)
|
|
95
|
+
- Nile Side Bar Header: Fixed the top and bottom padding. The header now has 12px top and 16px bottom padding in both themes (UIF-1419)
|
|
96
|
+
- Nile WYSIWYG Editor: Added a focused (active) state, similar to CKEditor. While the caret is in the document, the writing area below the toolbar gets a brand-blue border. The toolbar keeps its neutral frame (UIF-1420)
|
|
97
|
+
|
|
94
98
|
#### Version 2.0.23 (November 13, 2026)
|
|
95
99
|
- Nile App Shell: Added `page-title`, `description` and `breadcrumb` slots. Icon-button tooltips now use `nile-lite-tooltip` (new `disableTooltip`, `controlTooltipPlacement`, `textTooltipPlacement`). The top bar height now grows with its content and NxtGen nav widths are 260/72px. Breaking: `--nile-app-shell-side-nav-bg`, `-border` and `-padding` are no longer read (UIF-1414)
|
|
96
100
|
- Nile App Shell Nav Toggle: Always shows the `ng-panel-left` icon (UIF-1414)
|
package/dist/index.js
CHANGED
|
@@ -20596,7 +20596,7 @@ nile-rich-text-editor[disabled] .editor figure.rte-image {
|
|
|
20596
20596
|
${this._renderTrigger()}
|
|
20597
20597
|
${e}
|
|
20598
20598
|
</nile-popover>
|
|
20599
|
-
`:e}};e([de({type:String,attribute:!0,reflect:!0})],Yk.prototype,"type",void 0),e([de({type:String,attribute:!0,reflect:!0})],Yk.prototype,"value",void 0),e([de({type:String,reflect:!0})],Yk.prototype,"swatchTooltip",void 0),e([de({type:Number,reflect:!0})],Yk.prototype,"recentColorsCount",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"noFill",void 0),e([de({type:String,reflect:!0})],Yk.prototype,"mode",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"showCanvas",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"showHue",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"showInputs",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"showActions",void 0),e([de({type:Boolean,reflect:!0,attribute:!0})],Yk.prototype,"open",void 0),e([de({attribute:"palette",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.map((e=>"string"==typeof e?{color:e,name:e}:e&&"string"==typeof e.color?{color:e.color,name:e.name||e.color}:null)).filter(Boolean):[]}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],Yk.prototype,"palette",void 0),e([he()],Yk.prototype,"_view",void 0),e([he()],Yk.prototype,"_recentColors",void 0),e([he()],Yk.prototype,"_hue",void 0),e([he()],Yk.prototype,"_sat",void 0),e([he()],Yk.prototype,"_val",void 0),e([he()],Yk.prototype,"_colorMode",void 0),e([he()],Yk.prototype,"_hexInput",void 0),e([he()],Yk.prototype,"_r",void 0),e([he()],Yk.prototype,"_g",void 0),e([he()],Yk.prototype,"_b",void 0),Yk=e([ce("nile-color-picker")],Yk);function Zk(){return function(){if("undefined"==typeof window||"function"!=typeof getComputedStyle)return null;try{return getComputedStyle(document.documentElement).getPropertyValue("--nile-version").trim().replace(/^["']|["']$/g,"")||null}catch{return null}}()??"1.3.6"}if("undefined"!=typeof window){window.nileElementsVersion='"2.0.
|
|
20599
|
+
`:e}};e([de({type:String,attribute:!0,reflect:!0})],Yk.prototype,"type",void 0),e([de({type:String,attribute:!0,reflect:!0})],Yk.prototype,"value",void 0),e([de({type:String,reflect:!0})],Yk.prototype,"swatchTooltip",void 0),e([de({type:Number,reflect:!0})],Yk.prototype,"recentColorsCount",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"noFill",void 0),e([de({type:String,reflect:!0})],Yk.prototype,"mode",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"showCanvas",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"showHue",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"showInputs",void 0),e([de({type:Boolean,reflect:!0})],Yk.prototype,"showActions",void 0),e([de({type:Boolean,reflect:!0,attribute:!0})],Yk.prototype,"open",void 0),e([de({attribute:"palette",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.map((e=>"string"==typeof e?{color:e,name:e}:e&&"string"==typeof e.color?{color:e.color,name:e.name||e.color}:null)).filter(Boolean):[]}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],Yk.prototype,"palette",void 0),e([he()],Yk.prototype,"_view",void 0),e([he()],Yk.prototype,"_recentColors",void 0),e([he()],Yk.prototype,"_hue",void 0),e([he()],Yk.prototype,"_sat",void 0),e([he()],Yk.prototype,"_val",void 0),e([he()],Yk.prototype,"_colorMode",void 0),e([he()],Yk.prototype,"_hexInput",void 0),e([he()],Yk.prototype,"_r",void 0),e([he()],Yk.prototype,"_g",void 0),e([he()],Yk.prototype,"_b",void 0),Yk=e([ce("nile-color-picker")],Yk);function Zk(){return function(){if("undefined"==typeof window||"function"!=typeof getComputedStyle)return null;try{return getComputedStyle(document.documentElement).getPropertyValue("--nile-version").trim().replace(/^["']|["']$/g,"")||null}catch{return null}}()??"1.3.6"}if("undefined"!=typeof window){window.nileElementsVersion='"2.0.24"';let e=null;Object.defineProperty(window,"nileVersion",{configurable:!0,get:()=>e??Zk(),set:t=>{e=t}}),window.process=window.process||{env:{NODE_ENV:"production"}}}const _k=s`
|
|
20600
20600
|
.utility-control::part(base) {
|
|
20601
20601
|
width: var(--nile-app-shell-utility-size, 32px);
|
|
20602
20602
|
height: var(--nile-app-shell-utility-size, 32px);
|
|
@@ -22030,8 +22030,8 @@ nile-rich-text-editor[disabled] .editor figure.rte-image {
|
|
|
22030
22030
|
display: flex;
|
|
22031
22031
|
align-items: center;
|
|
22032
22032
|
justify-content: space-between;
|
|
22033
|
-
padding-top: var(--nile-spacing-
|
|
22034
|
-
padding-bottom: var(--nile-spacing-
|
|
22033
|
+
padding-top: var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
22034
|
+
padding-bottom: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
22035
22035
|
padding-left: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
22036
22036
|
padding-right: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
22037
22037
|
top: 0;
|
|
@@ -27464,6 +27464,55 @@ a {
|
|
|
27464
27464
|
box-sizing: border-box;
|
|
27465
27465
|
}
|
|
27466
27466
|
|
|
27467
|
+
/* --- Focused (active) state: only the writing area is highlighted, the
|
|
27468
|
+
toolbar keeps the neutral frame (like CKEditor). The surface pulls itself
|
|
27469
|
+
1px over the frame/toolbar divider with negative margins, so its border
|
|
27470
|
+
replaces those lines instead of doubling them, with no layout shift. --- */
|
|
27471
|
+
.nile-wysiwyg__surface {
|
|
27472
|
+
border: 1px solid transparent;
|
|
27473
|
+
margin: -1px;
|
|
27474
|
+
position: relative;
|
|
27475
|
+
/* A themed surface background must not paint over the frame's border. */
|
|
27476
|
+
background-clip: padding-box;
|
|
27477
|
+
transition: border-color 0.15s ease;
|
|
27478
|
+
}
|
|
27479
|
+
|
|
27480
|
+
/* The surface is the bottom of the frame unless the counter follows it
|
|
27481
|
+
(the floating menus after it are absolutely positioned). */
|
|
27482
|
+
.nile-wysiwyg__surface {
|
|
27483
|
+
border-radius: 0 0 var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px))
|
|
27484
|
+
var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px));
|
|
27485
|
+
}
|
|
27486
|
+
|
|
27487
|
+
.nile-wysiwyg__surface:first-child {
|
|
27488
|
+
border-radius: var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px));
|
|
27489
|
+
}
|
|
27490
|
+
|
|
27491
|
+
.nile-wysiwyg__surface:has(+ .nile-wysiwyg__counter) {
|
|
27492
|
+
border-bottom-left-radius: 0;
|
|
27493
|
+
border-bottom-right-radius: 0;
|
|
27494
|
+
}
|
|
27495
|
+
|
|
27496
|
+
.nile-wysiwyg__surface:first-child:has(+ .nile-wysiwyg__counter) {
|
|
27497
|
+
border-radius: var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px))
|
|
27498
|
+
var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px)) 0 0;
|
|
27499
|
+
}
|
|
27500
|
+
|
|
27501
|
+
:host(:not([disabled]):not([readonly]):not([fullscreen]))
|
|
27502
|
+
.nile-wysiwyg--focused
|
|
27503
|
+
.nile-wysiwyg__surface {
|
|
27504
|
+
border-color: var(
|
|
27505
|
+
--nile-wysiwyg-focus-border-color,
|
|
27506
|
+
var(--nile-colors-primary-500, var(--ng-colors-border-brand))
|
|
27507
|
+
);
|
|
27508
|
+
}
|
|
27509
|
+
|
|
27510
|
+
@media (prefers-reduced-motion: reduce) {
|
|
27511
|
+
.nile-wysiwyg__surface {
|
|
27512
|
+
transition: none;
|
|
27513
|
+
}
|
|
27514
|
+
}
|
|
27515
|
+
|
|
27467
27516
|
/* --- Fullscreen (distraction-free) mode --- */
|
|
27468
27517
|
:host([fullscreen]) {
|
|
27469
27518
|
position: fixed;
|
|
@@ -30734,7 +30783,7 @@ a {
|
|
|
30734
30783
|
</div>
|
|
30735
30784
|
`}};e([de({type:Boolean,reflect:!0})],hK.prototype,"open",void 0),e([pe("textarea")],hK.prototype,"textarea",void 0),hK=e([ce("nile-wysiwyg-markdown-panel")],hK);const NK=[{key:"heading1",label:"Heading 1",hint:"#",command:"heading",attrs:{level:1}},{key:"heading2",label:"Heading 2",hint:"##",command:"heading",attrs:{level:2}},{key:"heading3",label:"Heading 3",hint:"###",command:"heading",attrs:{level:3}},{key:"bulletList",label:"Bulleted list",hint:"-",command:"bulletList"},{key:"orderedList",label:"Numbered list",hint:"1.",command:"orderedList"},{key:"taskList",label:"Checklist",hint:"[ ]",command:"taskList"},{key:"blockquote",label:"Blockquote",hint:">",command:"blockquote"},{key:"codeBlock",label:"Code block",hint:"```",command:"codeBlock"},{key:"table",label:"Table",hint:"3×3",command:"insertTable",attrs:{rows:3,cols:3}},{key:"image",label:"Image",command:"openImage"},{key:"embed",label:"Video embed",hint:"YouTube…",command:"openEmbed"},{key:"bookmark",label:"Bookmark (anchor)",command:"openBookmark"},{key:"horizontalRule",label:"Divider",hint:"---",command:"horizontalRule"}];let pK=0;const DK={fromAttribute:e=>Eq(e)};let yK=class extends Fe{static get styles(){return[VV]}constructor(){super(),this.value="",this.placeholder="",this.disabled=!1,this.readonly=!1,this.toolbar=kq,this.bubbleMenu=!1,this.sanitize=!0,this.singleLine=!1,this.name="",this.required=!1,this.allowBase64Images=!0,this.uploadFromComputer=!1,this.imageMaxFileSize=2097152,this.mentions={},this.noSlashCommands=!1,this.noEmoji=!1,this.noTableMenu=!1,this.maxLength=0,this.showCounter=!1,this.stickyToolbar=!1,this.snippets=[],this.mergeFields=[],this.templates=[],this.autosaveInterval=0,this.pasteAsPlainText=!1,this.noMarkdownPaste=!1,this.emailFidelity=!1,this.allowedStyles={},this.noTextTransform=!1,this.fullscreen=!1,this.showBlocks=!1,this.noTheme=!1,this.noThemeComponents=[],this.hasFocus=!1,this.sourceMode=!1,this.counter={words:0,characters:0},this.insertMenuMode=null,this.normalizedAllowedStyles=new Map,this.mentionMatch=null,this.slashMatch=null,this.emojiMatch=null,this.activeSuggestSource=null,this.suggestDismissed=null,this.mentionQueryToken="",this.lastAutosaveValue="",this.defaultValue="",this.syncingValue=!1,this.lastSourceHtml="",this.lastSerializedValue="",this.pendingChange=!1,this.previousBodyOverflow=null,this.onAnyScroll=()=>{this.bubbleMenuEl&&[this.bubbleMenuEl,this.tableMenuEl,this.codeMenuEl,this.imageMenuEl,this.embedMenuEl].forEach((e=>{e?.open&&(e.open=!1)}))},this.renderProbe=null,this.painterDragActive=!1,this.onPainterPointerDown=()=>{this.view&&Aq(this.view.state)&&(this.painterDragActive=!0)},this.onPainterPointerUp=()=>{this.painterDragActive&&(this.painterDragActive=!1,requestAnimationFrame((()=>{if(!this.view)return;if(this.view.state.selection.empty||!Aq(this.view.state))return;const e=fq(this.view.state);e&&this.view.dispatch(e)})))},this.onOutsidePointerDown=e=>{const t=this.floatingPanels.filter((e=>!!e&&e.open));if(!t.length)return;const i=e.composedPath();if(t.some((e=>i.includes(e))))return;const n=i.includes(this)||!!this.shadowRoot&&i.includes(this.shadowRoot);this.closeAllPanels(n)},"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this.hasUpdated&&!this.view&&this.updateComplete.then((()=>this.mountView())),document.addEventListener("pointerdown",this.onOutsidePointerDown,!0),document.addEventListener("mouseup",this.onPainterPointerUp),document.addEventListener("scroll",this.onAnyScroll,{capture:!0,passive:!0}),this.syncAuthoredToolbar(),this.syncAuthoredBubble(),this.toolbarObserver||(this.toolbarObserver=new MutationObserver((()=>{this.syncAuthoredToolbar(),this.syncAuthoredBubble()}))),this.toolbarObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["name","label","icon","divider","overflow"]})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onOutsidePointerDown,!0),document.removeEventListener("mouseup",this.onPainterPointerUp),document.removeEventListener("scroll",this.onAnyScroll,{capture:!0}),this.surfaceEl?.removeEventListener("scroll",this.onAnyScroll),this.toolbarObserver?.disconnect(),this.changeTimer&&clearTimeout(this.changeTimer),this.autosaveTimer&&clearInterval(this.autosaveTimer),null!==this.previousBodyOverflow&&(document.body.style.overflow=this.previousBodyOverflow,this.previousBodyOverflow=null),this.view?.destroy(),this.view=void 0}firstUpdated(){this.defaultValue=this.value,this.syncAuthoredToolbar(),this.syncAuthoredBubble(),this.mountView()}syncAuthoredToolbar(){const e=this.querySelectorAll("nile-wysiwyg-toolbar-item"),t=e.length?Array.from(e).map((e=>({name:e.hasAttribute("divider")?"|":e.getAttribute("name")||"",label:e.getAttribute("label")||void 0,icon:e.getAttribute("icon")||void 0,overflow:e.hasAttribute("overflow")||void 0}))).filter((e=>e.name)):void 0;JSON.stringify(t)!==JSON.stringify(this.authoredToolbar)&&(this.authoredToolbar=t)}syncAuthoredBubble(){const e=this.querySelectorAll("nile-wysiwyg-bubble-item"),t=e.length?Array.from(e).map((e=>({name:e.hasAttribute("divider")?"|":e.getAttribute("name")||"",label:e.getAttribute("label")||void 0,icon:e.getAttribute("icon")||void 0}))).filter((e=>e.name)):void 0;JSON.stringify(t)!==JSON.stringify(this.authoredBubble)&&(this.authoredBubble=t)}updated(e){e.has("allowedStyles")&&(this.normalizedAllowedStyles=function(e){const t=new Map;if(!e||"object"!=typeof e)return t;for(const[i,n]of Object.entries(e)){const e=String(i).toLowerCase();if(!xW.has(e)){console.warn(`[nile-wysiwyg-editor] allowedStyles: ignoring tag "${i}" (unsupported tag)`);continue}if(!Array.isArray(n))continue;const o=t.get(e)??new Set;for(const t of n){const i=String(t);if(bW(i))o.add(i);else{const n=AW.has(i)?"denylisted":fW.has(i)?"already handled by a built-in":"invalid property name";console.warn(`[nile-wysiwyg-editor] allowedStyles: ignoring "${e}: ${t}" (${n})`)}}o.size&&t.set(e,o)}return t}(this.allowedStyles));const t=e.has("value")&&!!this.view&&!this.syncingValue&&this.serializeDoc(this.view.state.doc)!==this.value;t&&this.setContent(this.value),this.syncingValue=!1,(e.has("disabled")||e.has("readonly"))&&this.view&&this.view.setProps({}),e.has("placeholder")&&this.view&&this.view.dispatch(this.view.state.tr),e.has("required")&&this.updateValidity(),e.has("autosaveInterval")&&this.restartAutosave(),(e.has("pasteAsPlainText")||e.has("fullscreen")||e.has("showBlocks"))&&this.view&&(this.toolbarState=this.snapshotToolbar(this.view.state)),e.has("noTextTransform")&&this.view&&!e.has("value")&&this.view.updateState(this.buildState(this.view.state.doc)),(e.has("emailFidelity")&&this.view&&!t||e.has("allowedStyles")&&this.view&&!t)&&this.setContent(this.reparseSource()),(e.has("noTableMenu")||e.has("emailFidelity"))&&this.updateOverlays(),e.has("fullscreen")&&(this.fullscreen?null===this.previousBodyOverflow&&(this.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden"):null!==this.previousBodyOverflow&&(document.body.style.overflow=this.previousBodyOverflow,this.previousBodyOverflow=null))}restartAutosave(){this.autosaveTimer&&clearInterval(this.autosaveTimer),this.autosaveTimer=void 0,this.autosaveInterval>0&&(this.lastAutosaveValue=this.value,this.autosaveTimer=setInterval((()=>{this.view&&this.value!==this.lastAutosaveValue&&(this.lastAutosaveValue=this.value,this.emit("nile-autosave",this.buildChangeDetail(this.view.state.doc)))}),this.autosaveInterval))}buildState(e){return wq({schema:h$,doc:e,getPlaceholder:()=>this.placeholder,singleLine:this.singleLine,onLinkShortcut:()=>this.openLinkEditor(),onFindShortcut:()=>this.openFindBar(),onShortcutHelp:()=>this.openShortcutHelp(),onImageFiles:(e,t)=>{for(const i of e)this.insertImageFile(i,t)},mentions:{getTriggers:()=>Object.keys(this.mentions),onChange:e=>{this.mentionMatch=e,this.updateSuggestList()},onKeyDown:e=>this.handleSuggestKey(e,"mention")},slashCommands:{onChange:e=>{this.slashMatch=e,this.updateSuggestList()},onKeyDown:e=>this.handleSuggestKey(e,"slash")},emoji:{onChange:e=>{this.emojiMatch=e,this.updateSuggestList()},onKeyDown:e=>this.handleSuggestKey(e,"emoji")},getMaxLength:()=>this.maxLength,getForcePlainText:()=>this.pasteAsPlainText,getMarkdownPaste:()=>!this.noMarkdownPaste,getEmailFidelity:()=>this.emailFidelity,getAllowedStyles:()=>this.normalizedAllowedStyles,getSanitize:()=>this.sanitize,textTransform:!this.noTextTransform})}snapshotToolbar(e){return{...OG(e),pasteAsPlainText:this.pasteAsPlainText,fullscreen:this.fullscreen,showBlocks:this.showBlocks,formatPainter:Aq(e)}}reparseSource(){return this.value===this.lastSerializedValue?this.lastSourceHtml:this.value}serializeDoc(e){return A$(e,this.emailFidelity?this.emailRenderDefaults():void 0)}emailRenderDefaults(){const e=this.shadowRoot;if(!e||!this.isConnected)return{borderColor:null,headerBackground:null};if(!this.renderProbe||!this.renderProbe.isConnected){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;border-top:1px solid var(--nile-wysiwyg-table-border, var(--nile-colors-neutral-300, var(--ng-colors-border-primary)));background-color:var(--nile-wysiwyg-table-header-bg, var(--nile-colors-neutral-50, var(--ng-colors-bg-secondary)));",e.appendChild(t),this.renderProbe=t}const t=getComputedStyle(this.renderProbe),i=t.backgroundColor;return{borderColor:"solid"===t.borderTopStyle?t.borderTopColor:null,headerBackground:i&&"transparent"!==i&&"rgba(0, 0, 0, 0)"!==i?i:null}}emailOptions(){return{emailFidelity:this.emailFidelity,allowedStyles:this.normalizedAllowedStyles}}mountView(){if(this.view||!this.surfaceEl)return;let e=this.value?T$(h$,this.value,this.sanitize,this.emailOptions()):void 0;e&&this.singleLine&&(e=eH(e)),this.view=new CV(this.surfaceEl,{state:this.buildState(e),dispatchTransaction:e=>this.handleTransaction(e),editable:()=>!this.disabled&&!this.readonly,transformPastedHTML:e=>{const t=qF(e)?tG(e):e;let i=this.sanitize?EB(t,this.emailOptions()):t;return this.emailFidelity&&(i=hB(i)),i},handleDOMEvents:{mousedown:()=>(this.closeSpecialChars(!1),this.closeInsertMenu(!1),!1),focus:()=>(this.hasFocus=!0,this.updateOverlays(),this.emit("nile-focus"),!1),blur:(e,t)=>{const i=t.relatedTarget;return i&&(this.shadowRoot?.contains(i)||this.contains(i))||(this.hasFocus=!1,this.flushChange(),this.updateOverlays(),this.closeSuggestList(),this.closeSpecialChars(!1),this.emit("nile-blur")),!1}},attributes:{role:"textbox","aria-multiline":this.singleLine?"false":"true"},nodeViews:{task_item:(e,t,i)=>new Lq(e,t,i),image:(e,t,i)=>new hG(e,t,i),figure:(e,t,i)=>new NG(e,t,i),embed:(e,t,i)=>new pG(e,t,i),styleBlock:e=>new TG(e),math:e=>new AG(e,this.mathRenderer)}}),this.view.dom.addEventListener("mousedown",this.onPainterPointerDown),this.surfaceEl.addEventListener("scroll",this.onAnyScroll,{passive:!0}),this.toolbarState=this.snapshotToolbar(this.view.state),this.counter=v$(this.view.state.doc),this.syncFormValue(this.view.state.doc)}handleTransaction(e){if(!this.view)return;const t=this.view.state.apply(e);if(this.view.updateState(t),e.selectionSet&&!t.selection.empty&&Aq(t)&&!this.painterDragActive){const e=fq(t);if(e)return void this.view.dispatch(e)}if(this.toolbarState=this.snapshotToolbar(t),this.emit("nile-selection-change",this.toolbarState),this.updateOverlays(),this.findBarEl?.open){const e=cH(t);this.findBarEl.matchCount=e.matches.length,this.findBarEl.activeIndex=e.activeIndex}if(e.docChanged){const e=this.buildChangeDetail(t.doc);this.syncingValue=!0,this.value=e.value,this.syncFormValue(t.doc),this.emit("nile-input",e),this.counter=v$(t.doc),this.emit("nile-word-count",this.counter),this.scheduleChange()}}buildChangeDetail(e){const t=w$(e)?"":this.serializeDoc(e);return{value:t,json:b$(e),content:t}}scheduleChange(){this.pendingChange=!0,this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout((()=>this.flushChange()),250)}flushChange(){this.pendingChange&&this.view&&(this.pendingChange=!1,this.changeTimer&&clearTimeout(this.changeTimer),this.emit("nile-change",this.buildChangeDetail(this.view.state.doc)))}syncFormValue(e){if(!this.internals)return;const t=w$(e)?"":this.serializeDoc(e);this.internals.setFormValue(""===t?null:t),this.updateValidity()}updateValidity(){if(!this.internals)return;const e=this.view?w$(this.view.state.doc):""===this.value;this.required&&e?this.internals.setValidity({valueMissing:!0},"Please fill out this field.",this.surfaceEl??void 0):this.internals.setValidity({})}formResetCallback(){this.setContent(this.defaultValue)}formDisabledCallback(e){this.disabled=e}checkValidity(){return!this.internals||this.internals.checkValidity()}reportValidity(){return!this.internals||this.internals.reportValidity()}positionOverlay(e,t,i){if(!this.view||!this.baseEl)return;const n=i??this.view.state.selection.from,o=this.view.coordsAtPos(n),r=this.baseEl.getBoundingClientRect(),s=Math.max(4,Math.min(o.left-r.left,r.width-e.offsetWidth-4));e.style.left=`${s}px`,e.style.top="above"===t?`${Math.max(4,o.top-r.top-e.offsetHeight-8)}px`:o.bottom-r.top+6+"px"}positionOverlayBelowAnchor(e,t){if(!this.baseEl)return;const i=this.baseEl.getBoundingClientRect(),n=t.getBoundingClientRect(),o=Math.max(4,Math.min(n.left-i.left,i.width-e.offsetWidth-4));e.style.right="auto",e.style.left=`${o}px`,e.style.top=n.bottom-i.top+6+"px"}toolbarButton(e){return this.toolbarEl?.shadowRoot?.querySelector(`button[aria-label="${e}"]`)??null}updateOverlays(){if(!this.bubbleMenuEl)return;const e=this.linkEditorEl?.open||this.imagePanelEl?.open||this.embedPanelEl?.open||this.bookmarkPanelEl?.open||this.emojiPickerEl?.open,t=this.bubbleMenu&&this.hasFocus&&!!this.toolbarState&&!this.toolbarState.selectionEmpty&&!this.toolbarState.imageSelected&&!this.toolbarState.embedSelected&&!e;if(this.bubbleMenuEl.open=t,t&&(this.bubbleMenuEl.toolbarState=this.toolbarState,this.bubbleMenuEl.updateComplete.then((()=>this.positionOverlay(this.bubbleMenuEl,"above")))),this.tableMenuEl){const t=!this.noTableMenu&&this.hasFocus&&!!this.toolbarState&&this.toolbarState.inTable&&!(this.emailFidelity&&this.toolbarState.tableLayout)&&!e;this.tableMenuEl.open=t,t&&this.tableMenuEl.updateComplete.then((()=>this.positionOverlay(this.tableMenuEl,"below")))}if(this.codeMenuEl){const t=this.hasFocus&&!!this.toolbarState&&this.toolbarState.inCodeBlock&&!e;this.codeMenuEl.open=t,t&&(this.codeMenuEl.language=this.toolbarState.codeBlockLanguage??"",this.codeMenuEl.updateComplete.then((()=>this.positionOverlay(this.codeMenuEl,"above"))))}if(this.imageMenuEl){const t=this.hasFocus&&!!this.toolbarState&&this.toolbarState.imageSelected&&!e;this.imageMenuEl.open=t,t&&(this.imageMenuEl.toolbarState=this.toolbarState,this.imageMenuEl.updateComplete.then((()=>this.positionOverlay(this.imageMenuEl,"above"))))}if(this.embedMenuEl){const t=this.hasFocus&&!!this.toolbarState&&this.toolbarState.embedSelected&&!e;this.embedMenuEl.open=t,t&&(this.embedMenuEl.toolbarState=this.toolbarState,this.embedMenuEl.updateComplete.then((()=>this.positionOverlay(this.embedMenuEl,"above"))))}}openSpecialChars(){this.view&&this.specialCharsEl&&!this.disabled&&!this.readonly&&(this.specialCharsEl.open=!0,this.specialCharsEl.updateComplete.then((()=>this.positionOverlay(this.specialCharsEl,"below"))))}closeSpecialChars(e=!0){this.specialCharsEl&&(this.specialCharsEl.open=!1),e&&this.view?.focus()}insertSpecialChar(e){this.view&&(this.view.dispatch(this.view.state.tr.insertText(e).scrollIntoView()),this.view.focus())}openInsertMenu(e){if(!this.view||!this.insertMenuEl||this.disabled||this.readonly)return;this.insertMenuMode=e;const t=this.insertMenuEl;"merge"===e?(t.heading="Merge field",t.emptyText="No merge fields configured.",t.items=this.mergeFields.map((e=>({label:e.label,description:`{{${e.id}}}`})))):(t.heading="Template",t.emptyText="No templates configured.",t.items=this.templates.map((e=>({label:e.label,description:e.description})))),t.open=!0,this.bubbleMenuEl&&(this.bubbleMenuEl.open=!1),t.updateComplete.then((()=>this.positionOverlay(t,"below")))}closeInsertMenu(e=!0){this.insertMenuEl&&(this.insertMenuEl.open=!1),this.insertMenuMode=null,e&&this.view?.focus()}handleInsertSelect(e){const t=this.insertMenuMode;if(this.closeInsertMenu(),this.view)if("merge"===t){const t=this.mergeFields[e];t&&this.execCommand("insertMergeField",{id:t.id,label:t.label})}else if("template"===t){const t=this.templates[e];t&&this.insertHTML(t.html)}}insertMergeField(e,t){this.execCommand("insertMergeField",{id:e,label:t??null})}changeCase(e){this.execCommand("changeCase",{textCase:e})}openMathPanel(){this.view&&this.mathPanelEl&&!this.disabled&&!this.readonly&&(this.mathPanelEl.reset(),this.mathPanelEl.open=!0,this.bubbleMenuEl&&(this.bubbleMenuEl.open=!1),this.tableMenuEl&&(this.tableMenuEl.open=!1),this.mathPanelEl.updateComplete.then((()=>{const e=this.toolbarButton("Insert math (LaTeX)");e?this.positionOverlayBelowAnchor(this.mathPanelEl,e):this.positionOverlay(this.mathPanelEl,"below"),this.mathPanelEl.focusInput()})))}closeMathPanel(e=!0){this.mathPanelEl&&(this.mathPanelEl.open=!1),e&&this.view?.focus()}openMarkdownPanel(){this.view&&this.markdownPanelEl&&!this.disabled&&!this.readonly&&(this.markdownPanelEl.reset(),this.markdownPanelEl.open=!0,this.bubbleMenuEl&&(this.bubbleMenuEl.open=!1),this.tableMenuEl&&(this.tableMenuEl.open=!1),this.markdownPanelEl.updateComplete.then((()=>{const e=this.toolbarButton("Insert from Markdown");e?this.positionOverlayBelowAnchor(this.markdownPanelEl,e):this.positionOverlay(this.markdownPanelEl,"below"),this.markdownPanelEl.focusInput()})))}closeMarkdownPanel(e=!0){this.markdownPanelEl&&(this.markdownPanelEl.open=!1),e&&this.view?.focus()}applyMath(e,t){this.closeMathPanel(),this.execCommand("insertMath",{latex:e,mathDisplay:t})}insertMath(e,t="inline"){this.execCommand("insertMath",{latex:e,mathDisplay:t})}openEmojiPicker(){this.view&&this.emojiPickerEl&&!this.disabled&&!this.readonly&&(this.emojiPickerEl.open=!0,this.bubbleMenuEl&&(this.bubbleMenuEl.open=!1),this.tableMenuEl&&(this.tableMenuEl.open=!1),this.emojiPickerEl.updateComplete.then((()=>{this.positionOverlay(this.emojiPickerEl,"below"),this.emojiPickerEl.focusInput()})))}closeEmojiPicker(e=!0){this.emojiPickerEl&&(this.emojiPickerEl.open=!1),e&&this.view?.focus()}openEmbedPanel(){this.view&&this.embedPanelEl&&!this.disabled&&!this.readonly&&(this.embedPanelEl.reset(),this.embedPanelEl.open=!0,this.bubbleMenuEl&&(this.bubbleMenuEl.open=!1),this.tableMenuEl&&(this.tableMenuEl.open=!1),this.embedPanelEl.updateComplete.then((()=>{const e=this.toolbarButton("Embed video (YouTube, Vimeo, Loom)");e?this.positionOverlayBelowAnchor(this.embedPanelEl,e):this.positionOverlay(this.embedPanelEl,"below"),this.embedPanelEl.focusInput()})))}closeEmbedPanel(e=!0){this.embedPanelEl&&(this.embedPanelEl.open=!1),e&&this.view?.focus()}openBookmarkPanel(){this.view&&this.bookmarkPanelEl&&!this.disabled&&!this.readonly&&(this.bookmarkPanelEl.open=!0,this.bubbleMenuEl&&(this.bubbleMenuEl.open=!1),this.tableMenuEl&&(this.tableMenuEl.open=!1),this.bookmarkPanelEl.updateComplete.then((()=>{this.positionOverlay(this.bookmarkPanelEl,"below"),this.bookmarkPanelEl.focusInput()})))}closeBookmarkPanel(e=!0){this.bookmarkPanelEl&&(this.bookmarkPanelEl.open=!1),e&&this.view?.focus()}openImagePanel(){if(!this.view||!this.imagePanelEl||this.disabled||this.readonly)return;const e=xF(this.view.state);e?this.imagePanelEl.prefill({src:e.node.attrs.src,alt:e.node.attrs.alt??"",caption:e.isFigure?e.node.textContent:""}):this.imagePanelEl.reset(),this.imagePanelEl.open=!0,this.bubbleMenuEl&&(this.bubbleMenuEl.open=!1),this.tableMenuEl&&(this.tableMenuEl.open=!1),this.imagePanelEl.updateComplete.then((()=>{const e=this.toolbarButton("Insert image");e?this.positionOverlayBelowAnchor(this.imagePanelEl,e):this.positionOverlay(this.imagePanelEl,"below"),this.imagePanelEl.focusInput()}))}closeImagePanel(e=!0){this.imagePanelEl&&(this.imagePanelEl.open=!1),e&&this.view?.focus()}insertImageAt(e,t,i,n=null){if(this.view){if(null!==i){const e=this.view.state.doc.resolve(Math.min(i,this.view.state.doc.content.size));this.view.dispatch(this.view.state.tr.setSelection(rZ.near(e)))}this.execCommand("insertImage",{src:e,alt:t,caption:n})}}async insertImageFile(e,t=null,i){if(!this.view)return;const n=i?.alt??null,o=i?.caption??null;if(!this.emit("nile-image-upload-request",{file:e,insert:(e,i)=>this.insertImageAt(e,i??n,t,o)},!0,!0,!0).defaultPrevented)if(this.uploadHandler){pK+=1;const i=`nile-upload-${pK}`,r=t??this.view.state.selection.from;this.view.dispatch(this.view.state.tr.setMeta(iH,{add:{id:i,pos:r}}));try{const{src:t,alt:r}=await this.uploadHandler(e),s=this.view?function(e,t){const i=iH.getState(e),n=i?.find(void 0,void 0,(e=>e.id===t));return n&&n.length?n[0].from:null}(this.view.state,i):null;this.view?.dispatch(this.view.state.tr.setMeta(iH,{remove:{id:i}})),this.insertImageAt(t,n??r??null,s,o)}catch(t){this.view?.dispatch(this.view.state.tr.setMeta(iH,{remove:{id:i}})),this.emit("nile-image-upload-error",{file:e,error:t})}}else if(this.allowBase64Images){const i=await function(e){return new Promise(((t,i)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>i(n.error),n.readAsDataURL(e)}))}(e);this.insertImageAt(i,n,t,o)}}dismissKeyFor(e,t){return`${e}:${t.trigger}:${t.from}`}handleSuggestKey(e,t){if(this.activeSuggestSource!==t||!this.suggestListEl?.open)return!1;switch(e.key){case"ArrowDown":return this.suggestListEl.next(),!0;case"ArrowUp":return this.suggestListEl.prev(),!0;case"Enter":case"Tab":return this.suggestListEl.selectCurrent();case"Escape":{const e="mention"===t?this.mentionMatch:"slash"===t?this.slashMatch:this.emojiMatch;return e&&(this.suggestDismissed=this.dismissKeyFor(t,e)),this.closeSuggestList(),!0}default:return!1}}closeSuggestList(){this.suggestListEl&&(this.suggestListEl.open=!1),this.activeSuggestSource=null}updateSuggestList(){if(!this.suggestListEl||!this.view)return;const e=this.mentionMatch?.active?this.mentionMatch:null,t=!this.noSlashCommands&&this.slashMatch?.active?this.slashMatch:null,i=!this.noEmoji&&this.emojiMatch?.active?this.emojiMatch:null,n=e?"mention":t?"slash":i?"emoji":null,o=e??t??i;if(n&&o&&!this.disabled&&!this.readonly){if(this.suggestDismissed!==this.dismissKeyFor(n,o)){if(this.suggestDismissed=null,"mention"===n){const e=this.mentions[o.trigger]??[],t=o.query.toLowerCase();this.suggestListEl.items=e.filter((e=>e.label.toLowerCase().includes(t)));const i=`${o.trigger} ${o.query}`;this.mentionQueryToken=i,this.emit("nile-mention-query",{trigger:o.trigger,query:o.query,provide:e=>{this.mentionQueryToken===i&&Array.isArray(e)&&(this.suggestListEl.items=e.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}})}else if("slash"===n){const e=o.query.toLowerCase(),t=this.snippets.map((e=>({key:`snippet:${e.key}`,label:e.label,hint:"snippet"})));this.suggestListEl.items=[...NK,...t].filter((t=>t.label.toLowerCase().includes(e)))}else{const e=o.query.toLowerCase();if(this.suggestListEl.items=Cq.filter((t=>t.name.includes(e))).slice(0,12).map((e=>({key:e.name,label:`${e.char} ${e.name}`}))),0===this.suggestListEl.items.length)return void this.closeSuggestList()}this.activeSuggestSource=n,this.suggestListEl.resetActive(),this.suggestListEl.open=!0,this.suggestListEl.updateComplete.then((()=>this.positionOverlay(this.suggestListEl,"below",o.from)))}}else this.closeSuggestList()}handleSuggestSelect(e){if(this.view){if("mention"===this.activeSuggestSource&&this.mentionMatch?.active){const t=this.mentionMatch,{state:i}=this.view,n=i.schema.nodes.mention.create({trigger:t.trigger,key:e.key,label:e.label});this.view.dispatch(i.tr.replaceWith(t.from,t.to,[n,i.schema.text(" ")])),this.view.focus(),this.emit("nile-mention-select",{trigger:t.trigger,key:e.key,label:e.label})}else if("slash"===this.activeSuggestSource&&this.slashMatch?.active){const t=this.slashMatch;if(this.view.dispatch(this.view.state.tr.delete(t.from,t.to)),this.closeSuggestList(),e.key.startsWith("snippet:")){const t=this.snippets.find((t=>`snippet:${t.key}`===e.key));return void(t&&this.insertHTML(t.html))}const i=NK.find((t=>t.key===e.key));if(!i)return;"openImage"===i.command?this.openImagePanel():"openEmbed"===i.command?this.openEmbedPanel():"openBookmark"===i.command?this.openBookmarkPanel():this.execCommand(i.command,i.attrs)}else if("emoji"===this.activeSuggestSource&&this.emojiMatch?.active){const t=this.emojiMatch,i=Cq.find((t=>t.name===e.key));i&&(this.view.dispatch(this.view.state.tr.insertText(i.char,t.from,t.to)),this.view.focus())}this.closeSuggestList()}}openFindBar(){if(!this.findBarEl||this.sourceMode)return;this.findBarEl.open=!0;const e=this.view?cH(this.view.state):null;this.findBarEl.matchCount=e?.matches.length??0,this.findBarEl.activeIndex=e?.activeIndex??0,this.findBarEl.updateComplete.then((()=>{const e=this.toolbarButton("Find & replace (Ctrl+F)");e&&this.positionOverlayBelowAnchor(this.findBarEl,e),this.findBarEl.focusInput()}))}closeFindBar(){this.view&&this.view.dispatch(this.view.state.tr.setMeta(sH,{type:"clear"})),this.findBarEl&&(this.findBarEl.open=!1),this.view?.focus()}find(e){return this.view?(this.view.dispatch(function(e,t,i){return e.tr.setMeta(sH,{type:"search",query:t,caseSensitive:i})}(this.view.state,e)),this.scrollToActiveMatch(),cH(this.view.state).matches.length):0}findNext(){this.view&&(this.view.dispatch(uH(this.view.state,"next")),this.scrollToActiveMatch())}findPrev(){this.view&&(this.view.dispatch(uH(this.view.state,"prev")),this.scrollToActiveMatch())}replace(e){if(!this.view)return;const t=function(e,t){const i=cH(e),n=i.matches[i.activeIndex];return n?e.tr.insertText(t,n.from,n.to):null}(this.view.state,e);t&&this.view.dispatch(t)}replaceAll(e){if(!this.view)return;const t=function(e,t){const i=cH(e);if(!i.matches.length)return null;const n=e.tr;for(const e of[...i.matches].reverse())n.insertText(t,e.from,e.to);return n}(this.view.state,e);t&&this.view.dispatch(t)}scrollToActiveMatch(){if(!this.view)return;const e=cH(this.view.state),t=e.matches[e.activeIndex];t&&this.view.dispatch(this.view.state.tr.setSelection(rZ.create(this.view.state.doc,t.from,t.to)).scrollIntoView())}toggleSourceView(){this.sourceMode?this.applySourceView(this.sourceViewEl?.currentValue??null):(this.sourceMode=!0,this.updateComplete.then((()=>{this.sourceViewEl&&(this.sourceViewEl.value=this.getHTML(),this.sourceViewEl.focusInput())})))}applySourceView(e){this.sourceMode=!1,null!==e&&this.setContent(e,!0),this.updateComplete.then((()=>this.view?.focus()))}getWordCount(){return this.view?v$(this.view.state.doc):{words:0,characters:0}}toggleFormatPainter(){if(!this.view)return;const e=Aq(this.view.state)?this.view.state.tr.setMeta(xq,{type:"disarm"}):function(e){const t=function(e){const{$from:t,empty:i}=e.selection;return i?e.storedMarks??t.marks():t.marksAcross(e.selection.$to)??t.marks()}(e);return e.tr.setMeta(xq,{type:"arm",marks:t})}(this.view.state);e&&this.view.dispatch(e),this.view.focus()}get contentRoot(){return this.view?.dom??null}exportFilename(e){return`${(this.name||"document").replace(/[^\w.-]+/g,"-").replace(/^-+|-+$/g,"")||"document"}.${e}`}downloadBlob(e,t,i){const n=new Blob([e],{type:t}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=i,r.style.display="none",document.body.appendChild(r),r.click(),r.remove(),setTimeout((()=>URL.revokeObjectURL(o)),0)}getInlineStyledHTML(){const e=this.contentRoot;return this.view&&e&&!w$(this.view.state.doc)?lG(e):""}exportInlineHtml(e){const t=this.getInlineStyledHTML();if(!t)return;const i=`<!DOCTYPE html>\n<html><head><meta charset="utf-8"></head><body>${t}</body></html>`;this.downloadBlob(i,"text/html;charset=utf-8",e??this.exportFilename("html"))}exportToWord(e){const t=this.getInlineStyledHTML();if(!t)return;const i=cG(t,this.name||"Document");this.downloadBlob(i,"application/msword",e??this.exportFilename("doc"))}exportToPdf(e={}){const t=this.getInlineStyledHTML();if(!t)return;const i=uG(t,{title:this.name||"Document",...e}),n=document.createElement("iframe");n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"fixed",right:"0",bottom:"0",width:"0",height:"0",border:"0"}),document.body.appendChild(n);const o=()=>{setTimeout((()=>n.remove()),1e3)};n.onload=()=>{const e=n.contentWindow;e?(e.focus(),e.addEventListener("afterprint",o,{once:!0}),e.print()):o()};const r=n.contentDocument;r?(r.open(),r.write(i),r.close()):n.remove()}importFromWord(e,t=!0){if(!e)return;const i=qF(e)?tG(e):e;this.setContent(i,t)}importFromWordFile(){const e=document.createElement("input");e.type="file",e.accept=".htm,.html,text/html",e.style.display="none",e.addEventListener("change",(()=>{const t=e.files?.[0];e.remove(),t&&t.text().then((e=>this.importFromWord(e)))})),document.body.appendChild(e),e.click()}openShortcutHelp(){this.shortcutHelpEl&&(this.shortcutHelpEl.open=!0,this.shortcutHelpEl.focusPanel())}closeShortcutHelp(){this.shortcutHelpEl&&(this.shortcutHelpEl.open=!1),this.view?.focus()}toggleFullscreen(){this.fullscreen=!this.fullscreen,this.view?.focus()}openLinkEditor(){if(!this.view||!this.linkEditorEl||this.disabled||this.readonly)return;const e=this.toolbarState??OG(this.view.state);this.linkEditorEl.href=e.linkHref??"",this.linkEditorEl.text="",this.linkEditorEl.allowText=e.selectionEmpty&&!e.linkActive,this.linkEditorEl.canRemove=e.linkActive,this.linkEditorEl.open=!0,this.bubbleMenuEl&&(this.bubbleMenuEl.open=!1),this.linkEditorEl.updateComplete.then((()=>{this.positionOverlay(this.linkEditorEl,"below"),this.linkEditorEl.focusInput()}))}closeLinkEditor(e=!0){this.linkEditorEl&&(this.linkEditorEl.open=!1),e&&this.view?.focus()}applyLink(e,t){if(!this.view)return;const{state:i}=this.view,n=i.schema.marks.link;if(i.selection.empty&&!DF(i.selection.$from,n)){const o=t||e,r=i.schema.text(o,[n.create({href:e})]);this.view.dispatch(i.tr.replaceSelectionWith(r,!1).scrollIntoView())}else this.execCommand("link",{href:e});this.closeLinkEditor()}get pmView(){return this.view}get json(){return this.view?b$(this.view.state.doc):null}set json(e){e&&this.setContent(e)}focus(){this.view?.focus()}blur(){this.view?.dom?.blur()}getHTML(){return this.view&&!w$(this.view.state.doc)?this.serializeDoc(this.view.state.doc):""}getJSON(){return this.json}getText(){return this.view?f$(this.view.state.doc):""}getMarkdown(){return this.view&&!w$(this.view.state.doc)?EF(this.view.state.doc):""}setMarkdown(e,t=!1){this.setContent(JF(e),t)}insertMarkdown(e){this.insertHTML(JF(e))}setContent(e,t=!1){if(!this.view)return void("string"==typeof e&&(this.value=e));"string"==typeof e&&(this.lastSourceHtml=e);let i="string"==typeof e?T$(h$,e,this.sanitize,this.emailOptions()):O$(h$,e);this.singleLine&&(i=eH(i)),this.view.updateState(this.buildState(i)),this.toolbarState=this.snapshotToolbar(this.view.state),this.syncingValue=!0,this.value=w$(i)?"":this.serializeDoc(i),this.lastSerializedValue=this.value,this.syncFormValue(i),t&&(this.emit("nile-input",this.buildChangeDetail(i)),this.emit("nile-change",this.buildChangeDetail(i)))}clear(){this.setContent("")}insertHTML(e){if(!this.view)return;const t=x$(h$,e,this.sanitize,this.emailOptions());this.view.dispatch(this.view.state.tr.replaceSelection(t).scrollIntoView()),this.view.focus()}execCommand(e,t){if(!this.view)return!1;const i=fF(this.view.state,e,t);if(!i)return!1;const n=i(this.view.state,this.view.dispatch,this.view);return this.view.focus(),n}isCommandActive(e){const t=this.toolbarState;if(!t)return!1;switch(e){case"bold":return t.bold;case"italic":return t.italic;case"underline":return t.underline;case"strike":return t.strike;case"code":return t.code;case"link":return t.linkActive;case"bulletList":return t.inBulletList;case"orderedList":return t.inOrderedList;case"blockquote":return t.inBlockquote;default:return!1}}handleCommand(e){e.stopPropagation();const{name:t,attrs:i}=e.detail;if("openLink"!==t)if("openImage"!==t)if("openEmbed"!==t)if("openBookmark"!==t){if("toggleShowBlocks"===t)return this.showBlocks=!this.showBlocks,void this.view?.focus();if("toggleSource"!==t)return"togglePastePlainText"===t?(this.pasteAsPlainText=!this.pasteAsPlainText,void this.view?.focus()):void("toggleFullscreen"!==t?"openShortcutHelp"!==t?"openSpecialChars"!==t?"openEmoji"!==t?"openFind"!==t?"exportPdf"!==t?"exportWord"!==t?"exportInlineHtml"!==t?"importWord"!==t?"toggleFormatPainter"!==t?"openMergeField"!==t?"openTemplate"!==t?"openMarkdown"!==t?"openMath"!==t?this.execCommand(t,i):this.openMathPanel():this.openMarkdownPanel():this.openInsertMenu("template"):this.openInsertMenu("merge"):this.toggleFormatPainter():this.importFromWordFile():this.exportInlineHtml():this.exportToWord():this.exportToPdf():this.openFindBar():this.openEmojiPicker():this.openSpecialChars():this.openShortcutHelp():this.toggleFullscreen());this.toggleSourceView()}else this.openBookmarkPanel();else this.openEmbedPanel();else this.openImagePanel();else this.openLinkEditor()}handleBaseKeydown(e){if("Escape"!==e.key||e.defaultPrevented)return;if(this.specialCharsEl?.open)return void this.closeSpecialChars();if(!this.fullscreen)return;this.linkEditorEl?.open||this.imagePanelEl?.open||this.embedPanelEl?.open||this.bookmarkPanelEl?.open||this.emojiPickerEl?.open||this.findBarEl?.open||this.shortcutHelpEl?.open||this.suggestListEl?.open||(this.fullscreen=!1)}handleChromeFocusOut(e){const t=e.relatedTarget;t&&(this.shadowRoot?.contains(t)||this.contains(t))||this.view?.hasFocus()||(this.hasFocus=!1,this.updateOverlays())}get floatingPanels(){return[this.linkEditorEl,this.imagePanelEl,this.embedPanelEl,this.bookmarkPanelEl,this.specialCharsEl,this.emojiPickerEl,this.insertMenuEl,this.mathPanelEl,this.markdownPanelEl]}closeAllPanels(e=!0){this.linkEditorEl?.open&&this.closeLinkEditor(e),this.imagePanelEl?.open&&this.closeImagePanel(e),this.embedPanelEl?.open&&this.closeEmbedPanel(e),this.bookmarkPanelEl?.open&&this.closeBookmarkPanel(e),this.specialCharsEl?.open&&this.closeSpecialChars(e),this.emojiPickerEl?.open&&this.closeEmojiPicker(e),this.insertMenuEl?.open&&this.closeInsertMenu(e),this.mathPanelEl?.open&&this.closeMathPanel(e),this.markdownPanelEl?.open&&this.closeMarkdownPanel(e)}noThemeComponentsAttr(){return Eq(this.noThemeComponents).join(" ")}render(){const e=(this.authoredToolbar?.length??0)>0,t=("none"!==this.toolbar||e)&&!this.readonly;return R`
|
|
30736
30785
|
<div
|
|
30737
|
-
class="nile-wysiwyg ${this.showBlocks?"nile-wysiwyg--show-blocks":""}"
|
|
30786
|
+
class="nile-wysiwyg ${this.showBlocks?"nile-wysiwyg--show-blocks":""} ${this.hasFocus?"nile-wysiwyg--focused":""}"
|
|
30738
30787
|
part="base"
|
|
30739
30788
|
data-no-theme=${this.noThemeComponentsAttr()||B}
|
|
30740
30789
|
@wysiwyg-command=${this.handleCommand}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-top: var(--nile-spacing-
|
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-top: var(--nile-spacing-lg, var(--ng-spacing-lg));\n padding-bottom: var(--nile-spacing-xl, var(--ng-spacing-xl));\n padding-left: var(--nile-spacing-xl, var(--ng-spacing-xl));\n padding-right: var(--nile-spacing-xl, var(--ng-spacing-xl));\n top: 0;\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary));\n}\n\n/* Opt-in: drop the surface color so the header sits on whatever is behind it. */\n:host([background='transparent']) {\n background: transparent;\n}\n\n.header-content {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n}\n\n\n:host([collapsed]) .header-content {\n flex-direction: column;\n justify-content: center;\n gap: var(--nile-spacing-lg, var(--ng-spacing-md));\n}\n\n\n\n \n \n::slotted([slot='logo']) {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-bold, var(--ng-font-weight-bold));\n letter-spacing: -0.02em;\n color: var(--nile-colors-dark-900, var(--ng-colors-graylightmode-900));\n text-transform: none;\n}\n\n/* The workspace switcher fills the row rather than centering at its text width. */\n::slotted(nile-side-bar-header-switcher) {\n flex: 1 1 auto;\n align-self: stretch;\n min-width: 0;\n}\n\n::slotted([slot='actions']) {\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md);\n}\n\n"]))));}};});
|
|
2
2
|
//# sourceMappingURL=nile-side-bar-header.css.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-side-bar-header.css.cjs.js","sources":["../../../src/nile-side-bar-header/nile-side-bar-header.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * SideBarHeader CSS\n */\nexport const styles = css`\n :host {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-top: var(--nile-spacing-
|
|
1
|
+
{"version":3,"file":"nile-side-bar-header.css.cjs.js","sources":["../../../src/nile-side-bar-header/nile-side-bar-header.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * SideBarHeader CSS\n */\nexport const styles = css`\n :host {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-top: var(--nile-spacing-lg, var(--ng-spacing-lg));\n padding-bottom: var(--nile-spacing-xl, var(--ng-spacing-xl));\n padding-left: var(--nile-spacing-xl, var(--ng-spacing-xl));\n padding-right: var(--nile-spacing-xl, var(--ng-spacing-xl));\n top: 0;\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary));\n}\n\n/* Opt-in: drop the surface color so the header sits on whatever is behind it. */\n:host([background='transparent']) {\n background: transparent;\n}\n\n.header-content {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n}\n\n\n:host([collapsed]) .header-content {\n flex-direction: column;\n justify-content: center;\n gap: var(--nile-spacing-lg, var(--ng-spacing-md));\n}\n\n\n\n \n \n::slotted([slot='logo']) {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-bold, var(--ng-font-weight-bold));\n letter-spacing: -0.02em;\n color: var(--nile-colors-dark-900, var(--ng-colors-graylightmode-900));\n text-transform: none;\n}\n\n/* The workspace switcher fills the row rather than centering at its text width. */\n::slotted(nile-side-bar-header-switcher) {\n flex: 1 1 auto;\n align-self: stretch;\n min-width: 0;\n}\n\n::slotted([slot='actions']) {\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md);\n}\n\n`;\n\nexport default [styles];"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
@@ -3,8 +3,8 @@ import{css as e}from"lit";const t=e`
|
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
justify-content: space-between;
|
|
6
|
-
padding-top: var(--nile-spacing-
|
|
7
|
-
padding-bottom: var(--nile-spacing-
|
|
6
|
+
padding-top: var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
7
|
+
padding-bottom: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
8
8
|
padding-left: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
9
9
|
padding-right: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
10
10
|
top: 0;
|