@wukazis/euphony 0.1.45
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/LICENSE +201 -0
- package/NOTICE +13 -0
- package/README.md +266 -0
- package/bin/euphony.js +4 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/assets/harmony-render-5ErAOXX9.js +3285 -0
- package/dist/assets/local-data-worker-CHLGzNeW.js +2 -0
- package/dist/assets/main-CmldcHcT.js +4047 -0
- package/dist/examples/euphony-convo-100.jsonl +8 -0
- package/dist/examples/simple-harmony-convos.jsonl +8 -0
- package/dist/favicon-48x48.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.svg +3 -0
- package/dist/global.css +38 -0
- package/dist/index.html +22 -0
- package/dist/web-app-manifest-192x192.png +0 -0
- package/dist/web-app-manifest-512x512.png +0 -0
- package/lib/chunks/conversation.js +612 -0
- package/lib/chunks/css/codex.js +1 -0
- package/lib/chunks/css/confirm-dialog.js +1 -0
- package/lib/chunks/css/conversation.js +1 -0
- package/lib/chunks/css/floating-toolbar.js +1 -0
- package/lib/chunks/css/input-dialog.js +1 -0
- package/lib/chunks/css/json-viewer.js +1 -0
- package/lib/chunks/css/menu.js +1 -0
- package/lib/chunks/css/message-code.js +1 -0
- package/lib/chunks/css/message-developer-content.js +1 -0
- package/lib/chunks/css/message-editor-popover.js +1 -0
- package/lib/chunks/css/message-hidden.js +1 -0
- package/lib/chunks/css/message-system-content.js +1 -0
- package/lib/chunks/css/message-text.js +1 -0
- package/lib/chunks/css/message-unsupported.js +1 -0
- package/lib/chunks/css/pagination.js +1 -0
- package/lib/chunks/css/preference-window.js +1 -0
- package/lib/chunks/css/search-window.js +1 -0
- package/lib/chunks/css/toast.js +1 -0
- package/lib/chunks/css/token-window.js +1 -0
- package/lib/chunks/css-inline.js +1 -0
- package/lib/chunks/dompurify.js +1 -0
- package/lib/chunks/harmony-types.js +1 -0
- package/lib/chunks/icon-cross.js +1 -0
- package/lib/chunks/icon-play.js +1 -0
- package/lib/chunks/marked.js +1 -0
- package/lib/chunks/prismjs.js +1 -0
- package/lib/chunks/shoelace.js +1131 -0
- package/lib/chunks/third-party.js +1 -0
- package/lib/chunks/utils.js +16 -0
- package/lib/components/app/app.d.ts +192 -0
- package/lib/components/app/local-data-worker.d.ts +35 -0
- package/lib/components/app/request-worker.d.ts +45 -0
- package/lib/components/app/url-manager.d.ts +25 -0
- package/lib/components/codex/codex.d.ts +50 -0
- package/lib/components/codex/codex.js +36 -0
- package/lib/components/confirm-dialog/confirm-dialog.d.ts +42 -0
- package/lib/components/confirm-dialog/confirm-dialog.js +41 -0
- package/lib/components/conversation/conversation.d.ts +259 -0
- package/lib/components/conversation/conversation.js +1 -0
- package/lib/components/floating-toolbar/floating-toolbar.d.ts +47 -0
- package/lib/components/floating-toolbar/floating-toolbar.js +32 -0
- package/lib/components/input-dialog/input-dialog.d.ts +43 -0
- package/lib/components/input-dialog/input-dialog.js +51 -0
- package/lib/components/json-viewer/json-viewer.d.ts +33 -0
- package/lib/components/json-viewer/json-viewer.js +8 -0
- package/lib/components/menu/menu.d.ts +38 -0
- package/lib/components/menu/menu.js +9 -0
- package/lib/components/message-code/message-code.d.ts +20 -0
- package/lib/components/message-code/message-code.js +10 -0
- package/lib/components/message-developer-content/message-developer-content.d.ts +45 -0
- package/lib/components/message-developer-content/message-developer-content.js +72 -0
- package/lib/components/message-editor-popover/message-editor-popover.d.ts +36 -0
- package/lib/components/message-editor-popover/message-editor-popover.js +85 -0
- package/lib/components/message-hidden/message-hidden.d.ts +38 -0
- package/lib/components/message-hidden/message-hidden.js +10 -0
- package/lib/components/message-system-content/message-system-content.d.ts +52 -0
- package/lib/components/message-system-content/message-system-content.js +74 -0
- package/lib/components/message-text/message-text.d.ts +36 -0
- package/lib/components/message-text/message-text.js +14 -0
- package/lib/components/message-unsupported/message-unsupported.d.ts +19 -0
- package/lib/components/message-unsupported/message-unsupported.js +26 -0
- package/lib/components/pagination/pagination.d.ts +29 -0
- package/lib/components/pagination/pagination.js +35 -0
- package/lib/components/preference-window/preference-window.d.ts +107 -0
- package/lib/components/preference-window/preference-window.js +319 -0
- package/lib/components/search-window/search-window.d.ts +44 -0
- package/lib/components/search-window/search-window.js +71 -0
- package/lib/components/toast/toast.d.ts +34 -0
- package/lib/components/toast/toast.js +77 -0
- package/lib/components/token-window/token-window.d.ts +96 -0
- package/lib/components/token-window/token-window.js +1 -0
- package/lib/config/config.d.ts +273 -0
- package/lib/euphony.d.ts +11 -0
- package/lib/euphony.js +1 -0
- package/lib/types/common-types.d.ts +176 -0
- package/lib/types/harmony-types.d.ts +72 -0
- package/lib/utils/api-manager.d.ts +42 -0
- package/lib/utils/codex-session.d.ts +7 -0
- package/lib/utils/dompurify-configs.d.ts +2 -0
- package/lib/utils/harmony-render.d.ts +4 -0
- package/lib/utils/marked-katex-extension.d.ts +22 -0
- package/lib/utils/patch-preview.d.ts +2 -0
- package/lib/utils/utils.d.ts +80 -0
- package/package.json +84 -0
- package/server-dist/node-main.js +1273 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { default as RadioGroupElement } from '@shoelace-style/shoelace/dist/components/radio-group/radio-group.js';
|
|
3
|
+
interface PreferenceOptions {
|
|
4
|
+
maxMessageHeight: boolean;
|
|
5
|
+
gridView: boolean;
|
|
6
|
+
expandAndCollapseAll: boolean;
|
|
7
|
+
advanced: boolean;
|
|
8
|
+
messageLabel: boolean;
|
|
9
|
+
focusMode: boolean;
|
|
10
|
+
comparisonWidth: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface DefaultPreferenceOptions {
|
|
13
|
+
gridView: boolean;
|
|
14
|
+
gridViewColumnWidth: number;
|
|
15
|
+
comparisonWidth: number;
|
|
16
|
+
}
|
|
17
|
+
export interface MessageLabelSettings {
|
|
18
|
+
absoluteTimestamp: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface AdvancedSettings {
|
|
21
|
+
renderHTMLBlock: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface FocusModeSettings {
|
|
24
|
+
author: string[];
|
|
25
|
+
recipient: string[];
|
|
26
|
+
contentType: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Preference window element.
|
|
30
|
+
*/
|
|
31
|
+
export declare class EuphonyPreferenceWindow extends LitElement {
|
|
32
|
+
enabledOptions: PreferenceOptions;
|
|
33
|
+
defaultOptions: DefaultPreferenceOptions;
|
|
34
|
+
isDarkTheme: boolean;
|
|
35
|
+
useCustomMessageHeight: boolean;
|
|
36
|
+
preferenceMaxMessageHeightMode: 'automatic' | 'no-limit' | 'custom';
|
|
37
|
+
preferenceCustomMaxMessageHeight: number;
|
|
38
|
+
preferenceCustomGridViewColumnWidth: number;
|
|
39
|
+
preferenceCustomComparisonWidth: number;
|
|
40
|
+
isAdvancedSectionCollapsed: boolean;
|
|
41
|
+
isFocusModeSectionCollapsed: boolean;
|
|
42
|
+
messageLabelSettings: MessageLabelSettings;
|
|
43
|
+
advancedSettings: AdvancedSettings;
|
|
44
|
+
focusModeSettings: FocusModeSettings;
|
|
45
|
+
isGridView: boolean;
|
|
46
|
+
radioGroupMaxMessageHeight: null | undefined | RadioGroupElement;
|
|
47
|
+
radioGroupLayout: null | undefined | RadioGroupElement;
|
|
48
|
+
popperTooltip: HTMLElement | undefined;
|
|
49
|
+
tooltipDebouncer: number | null;
|
|
50
|
+
constructor();
|
|
51
|
+
loadPreferencesFromStorage(): void;
|
|
52
|
+
writePreferencesToStorage(): void;
|
|
53
|
+
/**
|
|
54
|
+
* This method is called when the DOM is added for the first time
|
|
55
|
+
*/
|
|
56
|
+
firstUpdated(): void;
|
|
57
|
+
/**
|
|
58
|
+
* This method is called before new DOM is updated and rendered
|
|
59
|
+
* @param changedProperties Property that has been changed
|
|
60
|
+
*/
|
|
61
|
+
willUpdate(changedProperties: PropertyValues<this>): void;
|
|
62
|
+
initData(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* This method is called when the user starts dragging the window
|
|
65
|
+
* @param event The mouse event
|
|
66
|
+
*/
|
|
67
|
+
private onDragStart;
|
|
68
|
+
maxMessageHeightRadioChanged(): void;
|
|
69
|
+
maxMessageHeightRangeInput(event: Event): void;
|
|
70
|
+
maxMessageHeightRangeChanged(event: Event): void;
|
|
71
|
+
layoutRadioChanged(): void;
|
|
72
|
+
gridViewColumnWidthRangeInput(event: Event): void;
|
|
73
|
+
gridViewColumnWidthRangeChanged(event: Event): void;
|
|
74
|
+
comparisonWidthRangeInput(event: Event): void;
|
|
75
|
+
comparisonWidthRangeChanged(event: Event): void;
|
|
76
|
+
expandAllButtonClicked(): void;
|
|
77
|
+
collapseAllButtonClicked(): void;
|
|
78
|
+
translateAllButtonClicked(): void;
|
|
79
|
+
messageLabelCheckBoxChanged(e: InputEvent, name: 'absoluteTimestamp'): void;
|
|
80
|
+
advancedCheckboxChanged(e: InputEvent, name: 'renderHTMLBlock'): void;
|
|
81
|
+
focusModeCheckBoxChanged(e: InputEvent, name: 'author' | 'recipient' | 'contentType', value: string): void;
|
|
82
|
+
/**
|
|
83
|
+
* MouseEnter Event handler for all the buttons in the toolbar
|
|
84
|
+
* @param e Mouse event
|
|
85
|
+
*/
|
|
86
|
+
tooltipTargetMouseEnter(e: MouseEvent, type: 'absoluteTimestamp' | 'renderHTMLBlock' | 'focusModeAuthor' | 'focusModeRecipient' | 'focusModeMessageContentType', suffix?: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* MouseLeave Event handler for all the buttons in the toolbar
|
|
89
|
+
* @param e Mouse event
|
|
90
|
+
*/
|
|
91
|
+
tooltipTargetMouseLeave(useTransition?: boolean): void;
|
|
92
|
+
notifyParentMaxMessageHeight(): void;
|
|
93
|
+
notifyParentGridViewColumnWidth(): void;
|
|
94
|
+
notifyParentComparisonWidth(): void;
|
|
95
|
+
notifyParentLayoutChange(layout: 'list' | 'grid'): void;
|
|
96
|
+
notifyParentMessageLabelSettings(): void;
|
|
97
|
+
notifyParentAdvancedSettings(): void;
|
|
98
|
+
notifyParentFocusModeSettings(): void;
|
|
99
|
+
render(): import('lit').TemplateResult<1>;
|
|
100
|
+
static styles: import('lit').CSSResult[];
|
|
101
|
+
}
|
|
102
|
+
declare global {
|
|
103
|
+
interface HTMLElementTagNameMap {
|
|
104
|
+
'euphony-preference-window': EuphonyPreferenceWindow;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import{v as e,i as t,n as s,r as i,e as o,a,b as n,x as r,w as d}from"../../chunks/third-party.js";import{E as c}from"../../chunks/harmony-types.js";import{u as l}from"../../chunks/utils.js";import"../../chunks/shoelace.js";import{i as h}from"../../chunks/icon-cross.js";import{i as p}from"../../chunks/icon-play.js";import{c as g}from"../../chunks/css/preference-window.js";var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,v=(e,t,s,i)=>{for(var o,a=i>1?void 0:i?m(t,s):t,n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i?o(t,s,a):o(a))||a);return i&&a&&u(t,s,a),a};const f=3e3,b=300,M=200,C=800,w=300,k={absoluteTimestamp:!1},x={renderHTMLBlock:!1},$={author:[],recipient:[],contentType:[]},y=["user","assistant","system","developer","tool"].toSorted(),S=["all"].toSorted(),T=[...c].sort();let H=class extends a{constructor(){super(),this.enabledOptions={maxMessageHeight:!0,gridView:!1,expandAndCollapseAll:!0,advanced:!0,messageLabel:!0,focusMode:!0,comparisonWidth:!1},this.defaultOptions={gridView:!1,gridViewColumnWidth:b,comparisonWidth:w},this.isDarkTheme=!1,this.useCustomMessageHeight=!1,this.preferenceMaxMessageHeightMode="automatic",this.preferenceCustomMaxMessageHeight=300,this.preferenceCustomGridViewColumnWidth=b,this.preferenceCustomComparisonWidth=w,this.isAdvancedSectionCollapsed=!0,this.isFocusModeSectionCollapsed=!0,this.messageLabelSettings={...k},this.advancedSettings={...x},this.focusModeSettings={...$},this.isGridView=!1,this.tooltipDebouncer=null}loadPreferencesFromStorage(){const e=window.localStorage.getItem("preference-max-message-height-mode");e&&(this.preferenceMaxMessageHeightMode=e,this.useCustomMessageHeight="custom"===this.preferenceMaxMessageHeightMode);const t=window.localStorage.getItem("preference-max-message-height");t&&(this.preferenceCustomMaxMessageHeight=Math.max(0,Math.min(f,parseInt(t)))),"automatic"!==this.preferenceMaxMessageHeightMode&&this.notifyParentMaxMessageHeight();const s=window.localStorage.getItem("preference-comparison-width");if(s){const e=parseInt(s);this.preferenceCustomComparisonWidth=Math.max(M,Math.min(C,e)),this.preferenceCustomComparisonWidth!==w&&this.notifyParentComparisonWidth()}const i=window.localStorage.getItem("preference-message-label-settings");i&&(this.messageLabelSettings=JSON.parse(i),this.messageLabelSettings.absoluteTimestamp!==k.absoluteTimestamp&&this.notifyParentMessageLabelSettings());const o=window.localStorage.getItem("preference-advanced-settings");if(o){const e=JSON.parse(o);this.advancedSettings={...x,...e}}const a=window.localStorage.getItem("preference-focus-mode-settings");a&&(this.focusModeSettings=JSON.parse(a),(this.focusModeSettings.author.length>0||this.focusModeSettings.recipient.length>0||this.focusModeSettings.contentType.length>0)&&this.notifyParentFocusModeSettings())}writePreferencesToStorage(){window.localStorage.setItem("preference-max-message-height-mode",this.preferenceMaxMessageHeightMode),window.localStorage.setItem("preference-max-message-height",this.preferenceCustomMaxMessageHeight.toString()),window.localStorage.setItem("preference-comparison-width",this.preferenceCustomComparisonWidth.toString()),window.localStorage.setItem("preference-message-label-settings",JSON.stringify(this.messageLabelSettings)),window.localStorage.setItem("preference-advanced-settings",JSON.stringify(this.advancedSettings)),window.localStorage.setItem("preference-focus-mode-settings",JSON.stringify(this.focusModeSettings))}firstUpdated(){this.loadPreferencesFromStorage()}willUpdate(e){e.has("defaultOptions")&&(this.isGridView=this.defaultOptions.gridView,this.preferenceCustomGridViewColumnWidth=this.defaultOptions.gridViewColumnWidth,this.preferenceCustomComparisonWidth=this.defaultOptions.comparisonWidth)}async initData(){}onDragStart(e){e.preventDefault();const t=e.clientX,s=e.clientY,i=this.offsetTop,o=this.offsetLeft,a=e=>{const a=e.clientX-t,n=e.clientY-s;this.style.top=`${i+n}px`,this.style.left=`${o+a}px`},n=()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",a),window.addEventListener("mouseup",n)}maxMessageHeightRadioChanged(){if(!this.radioGroupMaxMessageHeight)throw Error("Radio group max message height not found");const e=this.radioGroupMaxMessageHeight.value;switch(e){case"automatic":this.preferenceMaxMessageHeightMode="automatic",this.useCustomMessageHeight=!1;break;case"no-limit":this.preferenceMaxMessageHeightMode="no-limit",this.useCustomMessageHeight=!1;break;case"custom":this.preferenceMaxMessageHeightMode="custom",this.useCustomMessageHeight=!0;break;default:throw Error(`Invalid value for max message height: ${e}`)}this.writePreferencesToStorage(),this.notifyParentMaxMessageHeight()}maxMessageHeightRangeInput(e){const t=e.target;this.preferenceCustomMaxMessageHeight=t.value,this.notifyParentMaxMessageHeight()}maxMessageHeightRangeChanged(e){const t=e.target;this.preferenceCustomMaxMessageHeight=t.value,this.writePreferencesToStorage(),this.notifyParentMaxMessageHeight()}layoutRadioChanged(){if(!this.radioGroupLayout)throw Error("Radio group layout not found");const e=this.radioGroupLayout.value;switch(e){case"list":this.isGridView=!1;break;case"grid":this.isGridView=!0;break;default:throw Error(`Invalid value for layout: ${e}`)}this.notifyParentLayoutChange(e),"grid"===e&&this.notifyParentGridViewColumnWidth()}gridViewColumnWidthRangeInput(e){const t=e.target;this.preferenceCustomGridViewColumnWidth=t.value,this.notifyParentGridViewColumnWidth()}gridViewColumnWidthRangeChanged(e){const t=e.target;this.preferenceCustomGridViewColumnWidth=t.value,this.writePreferencesToStorage(),this.notifyParentGridViewColumnWidth()}comparisonWidthRangeInput(e){const t=e.target;this.preferenceCustomComparisonWidth=t.value,this.notifyParentComparisonWidth()}comparisonWidthRangeChanged(e){const t=e.target;this.preferenceCustomComparisonWidth=t.value,this.writePreferencesToStorage(),this.notifyParentComparisonWidth()}expandAllButtonClicked(){this.dispatchEvent(new Event("expand-all-clicked",{bubbles:!0,composed:!0}))}collapseAllButtonClicked(){this.dispatchEvent(new Event("collapse-all-clicked",{bubbles:!0,composed:!0}))}translateAllButtonClicked(){this.dispatchEvent(new Event("translate-all-clicked",{bubbles:!0,composed:!0}))}messageLabelCheckBoxChanged(e,t){const s=e.target;this.messageLabelSettings[t]=s.checked,this.writePreferencesToStorage(),this.notifyParentMessageLabelSettings()}advancedCheckboxChanged(e,t){const s=e.target;this.advancedSettings[t]=s.checked,this.writePreferencesToStorage(),this.notifyParentAdvancedSettings()}focusModeCheckBoxChanged(e,t,s){e.target.checked?this.focusModeSettings[t].push(s):this.focusModeSettings[t]=this.focusModeSettings[t].filter(e=>e!==s),this.writePreferencesToStorage(),this.notifyParentFocusModeSettings()}tooltipTargetMouseEnter(e,t,s){if(e.stopPropagation(),e.preventDefault(),!this.popperTooltip)return void console.error("Popper tooltip not initialized.");const i=e.currentTarget;this.tooltipDebouncer&&clearTimeout(this.tooltipDebouncer),this.tooltipDebouncer=window.setTimeout(()=>{const e=this.popperTooltip.querySelector(".popper-label");let o="Button";switch(t){case"absoluteTimestamp":o="Always show the absolute timestamp of the message's create time instead of relative to the first message";break;case"renderHTMLBlock":o="Use a sandboxed iframe to render html code blocks in markdown. Refresh the page after changing this setting.";break;case"focusModeAuthor":o="Show messages with author "+(s?` ${s}`:"");break;case"focusModeRecipient":o="Show messages with recipient "+(s?` ${s}`:"");break;case"focusModeMessageContentType":o="Show messages with type "+(s?` ${s}`:"")}e.textContent=o,l(this.popperTooltip,i,"top",!0,7),this.popperTooltip.classList.remove("hidden")},500)}tooltipTargetMouseLeave(e=!0){this.popperTooltip?(this.tooltipDebouncer&&(clearTimeout(this.tooltipDebouncer),this.tooltipDebouncer=null),e?this.popperTooltip.classList.add("hidden"):(this.popperTooltip.classList.add("no-transition"),this.popperTooltip.classList.add("hidden"),setTimeout(()=>{this.popperTooltip.classList.remove("no-transition")},150))):console.error("popperTooltip are not initialized yet.")}notifyParentMaxMessageHeight(){let e="100vh";"no-limit"===this.preferenceMaxMessageHeightMode?e="none":"custom"===this.preferenceMaxMessageHeightMode&&(e=`${this.preferenceCustomMaxMessageHeight}px`);const t=new CustomEvent("max-message-height-changed",{bubbles:!0,composed:!0,detail:e});this.dispatchEvent(t)}notifyParentGridViewColumnWidth(){const e=new CustomEvent("grid-view-column-width-changed",{bubbles:!0,composed:!0,detail:`${this.preferenceCustomGridViewColumnWidth}px`});this.dispatchEvent(e)}notifyParentComparisonWidth(){const e=new CustomEvent("comparison-width-changed",{bubbles:!0,composed:!0,detail:`${this.preferenceCustomComparisonWidth}px`});this.dispatchEvent(e)}notifyParentLayoutChange(e){const t=new CustomEvent("layout-changed",{bubbles:!0,composed:!0,detail:e});this.dispatchEvent(t)}notifyParentMessageLabelSettings(){const e=new CustomEvent("message-label-changed",{bubbles:!0,composed:!0,detail:this.messageLabelSettings});this.dispatchEvent(e)}notifyParentAdvancedSettings(){const e=new CustomEvent("advanced-settings-changed",{bubbles:!0,composed:!0,detail:this.advancedSettings});this.dispatchEvent(e)}notifyParentFocusModeSettings(){const e=new CustomEvent("focus-mode-settings-changed",{bubbles:!0,composed:!0,detail:this.focusModeSettings});this.dispatchEvent(e)}render(){const e=n`
|
|
2
|
+
<div
|
|
3
|
+
id="popper-tooltip"
|
|
4
|
+
class="popper-tooltip hidden"
|
|
5
|
+
role="tooltip"
|
|
6
|
+
@click=${e=>{e.stopPropagation()}}
|
|
7
|
+
>
|
|
8
|
+
<div class="popper-content">
|
|
9
|
+
<span class="popper-label">Hello</span>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="popper-arrow"></div>
|
|
12
|
+
</div>
|
|
13
|
+
`;let t=n``;for(const e of y)t=n`${t}
|
|
14
|
+
<div
|
|
15
|
+
class="checkbox-group"
|
|
16
|
+
@mouseover=${t=>{this.tooltipTargetMouseEnter(t,"focusModeAuthor",e)}}
|
|
17
|
+
@mouseleave=${()=>{this.tooltipTargetMouseLeave()}}
|
|
18
|
+
>
|
|
19
|
+
<input
|
|
20
|
+
type="checkbox"
|
|
21
|
+
id="checkbox-focus-mode-author-${e}"
|
|
22
|
+
.checked=${this.focusModeSettings.author.includes(e)}
|
|
23
|
+
@change=${t=>{this.focusModeCheckBoxChanged(t,"author",e)}}
|
|
24
|
+
/>
|
|
25
|
+
<label for="checkbox-focus-mode-author-${e}">${e}</label>
|
|
26
|
+
</div> `;let s=n``;for(const e of S)s=n`${s}
|
|
27
|
+
<div
|
|
28
|
+
class="checkbox-group"
|
|
29
|
+
@mouseover=${t=>{this.tooltipTargetMouseEnter(t,"focusModeRecipient",e)}}
|
|
30
|
+
@mouseleave=${()=>{this.tooltipTargetMouseLeave()}}
|
|
31
|
+
>
|
|
32
|
+
<input
|
|
33
|
+
type="checkbox"
|
|
34
|
+
id="checkbox-focus-mode-recipient-${e}"
|
|
35
|
+
.checked=${this.focusModeSettings.recipient.includes(e)}
|
|
36
|
+
@change=${t=>{this.focusModeCheckBoxChanged(t,"recipient",e)}}
|
|
37
|
+
/>
|
|
38
|
+
<label for="checkbox-focus-mode-recipient-${e}"
|
|
39
|
+
>${e}</label
|
|
40
|
+
>
|
|
41
|
+
</div> `;let i=n``;for(const e of T)i=n`${i}
|
|
42
|
+
<div
|
|
43
|
+
class="checkbox-group"
|
|
44
|
+
@mouseover=${t=>{this.tooltipTargetMouseEnter(t,"focusModeMessageContentType",e)}}
|
|
45
|
+
@mouseleave=${()=>{this.tooltipTargetMouseLeave()}}
|
|
46
|
+
>
|
|
47
|
+
<input
|
|
48
|
+
type="checkbox"
|
|
49
|
+
id="checkbox-focus-mode-content-type-${e}"
|
|
50
|
+
.checked=${this.focusModeSettings.contentType.includes(e)}
|
|
51
|
+
@change=${t=>{this.focusModeCheckBoxChanged(t,"contentType",e)}}
|
|
52
|
+
/>
|
|
53
|
+
<label for="checkbox-focus-mode-content-type-${e}"
|
|
54
|
+
>${e}</label
|
|
55
|
+
>
|
|
56
|
+
</div> `;return n`
|
|
57
|
+
${e}
|
|
58
|
+
<div class="preference-window">
|
|
59
|
+
<div
|
|
60
|
+
class="header"
|
|
61
|
+
@mousedown=${e=>{this.onDragStart(e)}}
|
|
62
|
+
>
|
|
63
|
+
<span class="title">Preferences</span>
|
|
64
|
+
<button
|
|
65
|
+
class="close-button svg-icon"
|
|
66
|
+
@click=${()=>{const e=new CustomEvent("preference-window-close-clicked",{bubbles:!0,composed:!0});this.dispatchEvent(e)}}
|
|
67
|
+
>
|
|
68
|
+
${r(h)}
|
|
69
|
+
</button>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="content">
|
|
73
|
+
<div
|
|
74
|
+
class="setting-block"
|
|
75
|
+
?is-hidden=${!this.enabledOptions.maxMessageHeight}
|
|
76
|
+
>
|
|
77
|
+
<div class="setting-block-header">Max Message Height</div>
|
|
78
|
+
<div class="setting-block-content">
|
|
79
|
+
<div class="form-row">
|
|
80
|
+
<sl-radio-group
|
|
81
|
+
size="small"
|
|
82
|
+
name="max-message-height"
|
|
83
|
+
id="radio-group-max-message-height"
|
|
84
|
+
value=${this.preferenceMaxMessageHeightMode}
|
|
85
|
+
@sl-change=${()=>{this.maxMessageHeightRadioChanged()}}
|
|
86
|
+
>
|
|
87
|
+
<sl-radio size="small" value="automatic">Automatic</sl-radio>
|
|
88
|
+
<sl-radio size="small" value="no-limit">No Limit</sl-radio>
|
|
89
|
+
<sl-radio size="small" value="custom"
|
|
90
|
+
>Custom Height
|
|
91
|
+
(${this.preferenceCustomMaxMessageHeight}px)</sl-radio
|
|
92
|
+
>
|
|
93
|
+
</sl-radio-group>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div class="form-row">
|
|
97
|
+
<sl-range
|
|
98
|
+
@sl-input=${e=>{this.maxMessageHeightRangeInput(e)}}
|
|
99
|
+
@sl-change=${e=>{this.maxMessageHeightRangeChanged(e)}}
|
|
100
|
+
?disabled=${!this.useCustomMessageHeight}
|
|
101
|
+
min="50"
|
|
102
|
+
max=${f}
|
|
103
|
+
value=${this.preferenceCustomMaxMessageHeight}
|
|
104
|
+
></sl-range>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<div
|
|
110
|
+
class="divider"
|
|
111
|
+
?is-hidden=${!this.enabledOptions.maxMessageHeight}
|
|
112
|
+
></div>
|
|
113
|
+
|
|
114
|
+
<div
|
|
115
|
+
class="setting-block"
|
|
116
|
+
?is-hidden=${!this.enabledOptions.messageLabel}
|
|
117
|
+
>
|
|
118
|
+
<div class="setting-block-header">Message Labels</div>
|
|
119
|
+
<div class="setting-block-content">
|
|
120
|
+
<div class="form-block checkbox-block">
|
|
121
|
+
<div
|
|
122
|
+
class="checkbox-group"
|
|
123
|
+
@mouseover=${e=>{this.tooltipTargetMouseEnter(e,"absoluteTimestamp")}}
|
|
124
|
+
@mouseleave=${()=>{this.tooltipTargetMouseLeave()}}
|
|
125
|
+
>
|
|
126
|
+
<input
|
|
127
|
+
type="checkbox"
|
|
128
|
+
id="checkbox-absolute-timestamp"
|
|
129
|
+
.checked=${this.messageLabelSettings.absoluteTimestamp}
|
|
130
|
+
@change=${e=>{this.messageLabelCheckBoxChanged(e,"absoluteTimestamp")}}
|
|
131
|
+
/>
|
|
132
|
+
<label for="checkbox-absolute-timestamp"
|
|
133
|
+
>absolute timestamp</label
|
|
134
|
+
>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div
|
|
141
|
+
class="divider"
|
|
142
|
+
?is-hidden=${!this.enabledOptions.messageLabel}
|
|
143
|
+
></div>
|
|
144
|
+
|
|
145
|
+
<div
|
|
146
|
+
class="setting-block"
|
|
147
|
+
?is-hidden=${!this.enabledOptions.gridView}
|
|
148
|
+
>
|
|
149
|
+
<div class="setting-block-header">Layout</div>
|
|
150
|
+
<div class="setting-block-content">
|
|
151
|
+
<div class="form-row">
|
|
152
|
+
<sl-radio-group
|
|
153
|
+
size="small"
|
|
154
|
+
name="layout"
|
|
155
|
+
id="radio-group-layout"
|
|
156
|
+
value=${this.isGridView?"grid":"list"}
|
|
157
|
+
@sl-change=${()=>{this.layoutRadioChanged()}}
|
|
158
|
+
>
|
|
159
|
+
<sl-radio size="small" value="list">List View</sl-radio>
|
|
160
|
+
<sl-radio size="small" value="grid"
|
|
161
|
+
>Grid View (
|
|
162
|
+
${this.preferenceCustomGridViewColumnWidth}px)</sl-radio
|
|
163
|
+
>
|
|
164
|
+
</sl-radio-group>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div class="form-row">
|
|
168
|
+
<sl-range
|
|
169
|
+
@sl-input=${e=>{this.gridViewColumnWidthRangeInput(e)}}
|
|
170
|
+
@sl-change=${e=>{this.gridViewColumnWidthRangeChanged(e)}}
|
|
171
|
+
min="200"
|
|
172
|
+
max="800"
|
|
173
|
+
?disabled=${!this.isGridView}
|
|
174
|
+
value=${this.preferenceCustomGridViewColumnWidth}
|
|
175
|
+
></sl-range>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<div
|
|
181
|
+
class="divider"
|
|
182
|
+
?is-hidden=${!this.enabledOptions.gridView}
|
|
183
|
+
></div>
|
|
184
|
+
|
|
185
|
+
<div
|
|
186
|
+
class="setting-block"
|
|
187
|
+
?is-hidden=${!this.enabledOptions.comparisonWidth}
|
|
188
|
+
>
|
|
189
|
+
<div class="setting-block-header">
|
|
190
|
+
Comparison Width (${this.preferenceCustomComparisonWidth}px)
|
|
191
|
+
</div>
|
|
192
|
+
<div class="setting-block-content">
|
|
193
|
+
<div class="form-row">
|
|
194
|
+
<sl-range
|
|
195
|
+
@sl-input=${e=>{this.comparisonWidthRangeInput(e)}}
|
|
196
|
+
@sl-change=${e=>{this.comparisonWidthRangeChanged(e)}}
|
|
197
|
+
min=${M}
|
|
198
|
+
max=${C}
|
|
199
|
+
value=${this.preferenceCustomComparisonWidth}
|
|
200
|
+
></sl-range>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<div
|
|
206
|
+
class="divider"
|
|
207
|
+
?is-hidden=${!this.enabledOptions.comparisonWidth}
|
|
208
|
+
></div>
|
|
209
|
+
|
|
210
|
+
<div
|
|
211
|
+
class="setting-block"
|
|
212
|
+
?is-hidden=${!this.enabledOptions.focusMode}
|
|
213
|
+
>
|
|
214
|
+
<div class="setting-block-header">
|
|
215
|
+
<button
|
|
216
|
+
class="svg-icon collapse-icon"
|
|
217
|
+
?is-collapsed=${this.isFocusModeSectionCollapsed}
|
|
218
|
+
@click=${()=>{this.isFocusModeSectionCollapsed=!this.isFocusModeSectionCollapsed}}
|
|
219
|
+
>
|
|
220
|
+
${r(p)}
|
|
221
|
+
</button>
|
|
222
|
+
<span>Focus Mode</span>
|
|
223
|
+
</div>
|
|
224
|
+
<div
|
|
225
|
+
class="setting-block-content"
|
|
226
|
+
?is-hidden=${this.isFocusModeSectionCollapsed}
|
|
227
|
+
>
|
|
228
|
+
<div class="form-block checkbox-block">
|
|
229
|
+
<div class="form-block-header">Focus by author</div>
|
|
230
|
+
${t}
|
|
231
|
+
<div class="form-block-header">Focus by recipient</div>
|
|
232
|
+
${s}
|
|
233
|
+
<div class="form-block-header">Focus by content type</div>
|
|
234
|
+
${i}
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<div
|
|
240
|
+
class="divider"
|
|
241
|
+
?is-hidden=${!this.enabledOptions.focusMode}
|
|
242
|
+
></div>
|
|
243
|
+
|
|
244
|
+
<div
|
|
245
|
+
class="setting-block"
|
|
246
|
+
?is-hidden=${!this.enabledOptions.advanced}
|
|
247
|
+
>
|
|
248
|
+
<div class="setting-block-header">
|
|
249
|
+
<button
|
|
250
|
+
class="svg-icon collapse-icon"
|
|
251
|
+
?is-collapsed=${this.isAdvancedSectionCollapsed}
|
|
252
|
+
@click=${()=>{this.isAdvancedSectionCollapsed=!this.isAdvancedSectionCollapsed}}
|
|
253
|
+
>
|
|
254
|
+
${r(p)}
|
|
255
|
+
</button>
|
|
256
|
+
<span>Advanced</span>
|
|
257
|
+
</div>
|
|
258
|
+
<div
|
|
259
|
+
class="setting-block-content"
|
|
260
|
+
?is-hidden=${this.isAdvancedSectionCollapsed}
|
|
261
|
+
>
|
|
262
|
+
<div class="form-block checkbox-block">
|
|
263
|
+
<div
|
|
264
|
+
class="checkbox-group"
|
|
265
|
+
@mouseover=${e=>{this.tooltipTargetMouseEnter(e,"renderHTMLBlock")}}
|
|
266
|
+
@mouseleave=${()=>{this.tooltipTargetMouseLeave()}}
|
|
267
|
+
>
|
|
268
|
+
<input
|
|
269
|
+
type="checkbox"
|
|
270
|
+
id="checkbox-render-html-block"
|
|
271
|
+
.checked=${this.advancedSettings.renderHTMLBlock}
|
|
272
|
+
@change=${e=>{this.advancedCheckboxChanged(e,"renderHTMLBlock")}}
|
|
273
|
+
/>
|
|
274
|
+
<label for="checkbox-render-html-block"
|
|
275
|
+
>render html code block</label
|
|
276
|
+
>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
<div
|
|
283
|
+
class="divider"
|
|
284
|
+
?is-hidden=${!this.enabledOptions.advanced}
|
|
285
|
+
></div>
|
|
286
|
+
|
|
287
|
+
<div
|
|
288
|
+
class="setting-block"
|
|
289
|
+
?is-hidden=${!this.enabledOptions.expandAndCollapseAll}
|
|
290
|
+
>
|
|
291
|
+
<div class="setting-block-header">Quick Actions</div>
|
|
292
|
+
<div class="setting-block-content">
|
|
293
|
+
<div class="form-row form-row-quick-actions">
|
|
294
|
+
<button
|
|
295
|
+
class="text-button"
|
|
296
|
+
@click=${()=>{this.expandAllButtonClicked()}}
|
|
297
|
+
>
|
|
298
|
+
Expand All
|
|
299
|
+
</button>
|
|
300
|
+
<button
|
|
301
|
+
class="text-button"
|
|
302
|
+
@click=${()=>{this.collapseAllButtonClicked()}}
|
|
303
|
+
>
|
|
304
|
+
Collapse All
|
|
305
|
+
</button>
|
|
306
|
+
<button
|
|
307
|
+
class="text-button"
|
|
308
|
+
@click=${()=>{this.translateAllButtonClicked()}}
|
|
309
|
+
>
|
|
310
|
+
Translate All
|
|
311
|
+
</button>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
`}};H.styles=[t`
|
|
318
|
+
${e(g)}
|
|
319
|
+
`],v([s({type:Object})],H.prototype,"enabledOptions",2),v([s({type:Object})],H.prototype,"defaultOptions",2),v([s({type:Boolean,attribute:"is-dark-theme",reflect:!0})],H.prototype,"isDarkTheme",2),v([i()],H.prototype,"useCustomMessageHeight",2),v([i()],H.prototype,"preferenceMaxMessageHeightMode",2),v([i()],H.prototype,"preferenceCustomMaxMessageHeight",2),v([i()],H.prototype,"preferenceCustomGridViewColumnWidth",2),v([i()],H.prototype,"preferenceCustomComparisonWidth",2),v([i()],H.prototype,"isAdvancedSectionCollapsed",2),v([i()],H.prototype,"isFocusModeSectionCollapsed",2),v([i()],H.prototype,"isGridView",2),v([o("#radio-group-max-message-height")],H.prototype,"radioGroupMaxMessageHeight",2),v([o("#radio-group-layout")],H.prototype,"radioGroupLayout",2),v([o("#popper-tooltip")],H.prototype,"popperTooltip",2),H=v([d("euphony-preference-window")],H);export{H as EuphonyPreferenceWindow};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Confirm window element.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare class EuphonySearchWindow extends LitElement {
|
|
7
|
+
windowElement: HTMLElement | undefined;
|
|
8
|
+
showErrorMessage: boolean;
|
|
9
|
+
errorMessage: string | null;
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
isSearching: boolean;
|
|
12
|
+
constructor();
|
|
13
|
+
firstUpdated(): void;
|
|
14
|
+
/**
|
|
15
|
+
* This method is called before new DOM is updated and rendered
|
|
16
|
+
* @param changedProperties Property that has been changed
|
|
17
|
+
*/
|
|
18
|
+
willUpdate(changedProperties: PropertyValues<this>): void;
|
|
19
|
+
initData: () => Promise<void>;
|
|
20
|
+
show(): void;
|
|
21
|
+
close(): void;
|
|
22
|
+
searchSucceeded(): void;
|
|
23
|
+
searchFailed(errorMessage: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Simple query validation
|
|
26
|
+
* @param query - The query to validate
|
|
27
|
+
* @returns True if the query is valid, false otherwise
|
|
28
|
+
*/
|
|
29
|
+
isQueryValid(query: string): boolean;
|
|
30
|
+
cancelClicked(e: MouseEvent): void;
|
|
31
|
+
confirmClicked(e: MouseEvent): void;
|
|
32
|
+
/**
|
|
33
|
+
* This method is called when the user starts dragging the window
|
|
34
|
+
* @param event The mouse event
|
|
35
|
+
*/
|
|
36
|
+
private onDragStart;
|
|
37
|
+
render(): import('lit').TemplateResult<1>;
|
|
38
|
+
static styles: import('lit').CSSResult[];
|
|
39
|
+
}
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLElementTagNameMap {
|
|
42
|
+
'euphony-search-window': EuphonySearchWindow;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import{v as e,i as s,e as t,r as i,a,b as r,w as o}from"../../chunks/third-party.js";import{c as n}from"../../chunks/css/search-window.js";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c=(e,s,t,i)=>{for(var a,r=i>1?void 0:i?d(s,t):s,o=e.length-1;o>=0;o--)(a=e[o])&&(r=(i?a(s,t,r):a(r))||r);return i&&r&&l(s,t,r),r};const h=[{query:"[?metadata.adversarial==`false`]",description:'Find conversations whose ["metadata"]["adversarial"] is False'},{query:"[?contains(metadata.monster_meta.dataset_id, 'v7')]",description:'Find conversations whose ["metadata"]["monster_meta"]["dataset_id"] contains substring \'v7\''},{query:"[?metadata.count>`8` && contains(metadata.labels, 'K4')]",description:'Find conversations whose ["metadata"]["count"] is greater than 8 and ["metadata"]["labels"] list contains item "K4"'},{query:"[?messages[0].author.role=='assistant']",description:"Find conversations whose first message is from the assistant"}];let w=class extends a{constructor(){super(),this.showErrorMessage=!1,this.errorMessage=null,this.isOpen=!1,this.isSearching=!1,this.initData=async()=>{}}firstUpdated(){window.setTimeout(()=>{},1e3)}willUpdate(e){}show(){this.isOpen=!0}close(){this.isOpen=!1}searchSucceeded(){this.showErrorMessage=!1,this.isSearching=!1,this.errorMessage=null,this.close();const e=this.shadowRoot?.querySelector("textarea");e&&(e.value="")}searchFailed(e){this.errorMessage=e,this.showErrorMessage=!0,this.isSearching=!1}isQueryValid(e){return null!==/^\[\?.*\]$/.exec(e)}cancelClicked(e){e.stopPropagation(),!this.isSearching&&this.close()}confirmClicked(e){if(e.stopPropagation(),this.isSearching)return;const s=this.shadowRoot?.querySelector("textarea");if(!s)throw new Error("Text area not found");const t=s.value;if(!this.isQueryValid(t))return this.errorMessage="Make sure your query is formatted as [?expression]",void(this.showErrorMessage=!0);this.showErrorMessage=!1,this.isSearching=!0;const i=new CustomEvent("search-query-submitted",{bubbles:!0,composed:!0,detail:t});this.dispatchEvent(i)}onDragStart(e){if(e.preventDefault(),!this.windowElement)throw new Error("Window element not found");if(this.windowElement.style.top.includes("%")){const e=this.windowElement.clientHeight,s=this.windowElement.clientWidth,t=(window.innerHeight-e)/2,i=(window.innerWidth-s)/2;this.windowElement.style.top=`${t}px`,this.windowElement.style.left=`${i}px`,this.windowElement.style.transform=""}const s=e.clientX,t=e.clientY,i=this.windowElement.offsetTop,a=this.windowElement.offsetLeft,r=e=>{const r=e.clientX-s,o=e.clientY-t;this.windowElement.style.top=`${i+o}px`,this.windowElement.style.left=`${a+r}px`},o=()=>{window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",o)}render(){let e=r``;for(const s of h)e=r`${e}
|
|
2
|
+
<li class="example-item">
|
|
3
|
+
<div class="example-description">${s.description}</div>
|
|
4
|
+
<pre class="example-query">${s.query}</pre>
|
|
5
|
+
</li> `;return r`
|
|
6
|
+
<div class="back-drop" ?open=${this.isOpen}></div>
|
|
7
|
+
<div class="search-window" ?open=${this.isOpen}>
|
|
8
|
+
<div
|
|
9
|
+
class="header"
|
|
10
|
+
@mousedown=${e=>{this.onDragStart(e)}}
|
|
11
|
+
>
|
|
12
|
+
<div class="header-name">Filter data</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="content">
|
|
16
|
+
<div class="message">
|
|
17
|
+
Use
|
|
18
|
+
<a href="https://jmespath.org/tutorial.html" target="_blank"
|
|
19
|
+
>JMESPath query</a
|
|
20
|
+
>
|
|
21
|
+
to filter conversation data
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="query-example">
|
|
25
|
+
<div class="example-label">Examples</div>
|
|
26
|
+
<ul class="example-list">
|
|
27
|
+
${e}
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<textarea
|
|
32
|
+
class="query-input"
|
|
33
|
+
rows="3"
|
|
34
|
+
spellcheck="false"
|
|
35
|
+
placeholder="[?metadata.adversarial==\`false\`]"
|
|
36
|
+
@keydown=${e=>{e.stopPropagation()}}
|
|
37
|
+
></textarea>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="footer">
|
|
41
|
+
<div class="left-block">
|
|
42
|
+
<!-- Important to avoid new line and whitespace here -->
|
|
43
|
+
<!-- prettier-ignore -->
|
|
44
|
+
<div class="error-message" ?no-show=${!this.showErrorMessage}>${this.errorMessage}</div>
|
|
45
|
+
|
|
46
|
+
<div class="loader-container" ?is-loading=${this.isSearching}>
|
|
47
|
+
<div class="loader-label">Filtering</div>
|
|
48
|
+
<div class="loader"></div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="button-block">
|
|
53
|
+
<button
|
|
54
|
+
class="cancel-button"
|
|
55
|
+
@click=${e=>{this.cancelClicked(e)}}
|
|
56
|
+
>
|
|
57
|
+
Cancel
|
|
58
|
+
</button>
|
|
59
|
+
<button
|
|
60
|
+
class="confirm-button"
|
|
61
|
+
?is-searching=${this.isSearching}
|
|
62
|
+
@click=${e=>{this.confirmClicked(e)}}
|
|
63
|
+
>
|
|
64
|
+
Filter
|
|
65
|
+
</button>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
`}};w.styles=[s`
|
|
70
|
+
${e(n)}
|
|
71
|
+
`],c([t("div.search-window")],w.prototype,"windowElement",2),c([i()],w.prototype,"showErrorMessage",2),c([i()],w.prototype,"errorMessage",2),c([i()],w.prototype,"isOpen",2),c([i()],w.prototype,"isSearching",2),w=c([o("euphony-search-window")],w);export{w as EuphonySearchWindow};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Toast element.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare class NightjarToast extends LitElement {
|
|
7
|
+
type: 'success' | 'warning' | 'error';
|
|
8
|
+
message: string;
|
|
9
|
+
duration: number;
|
|
10
|
+
isHidden: boolean;
|
|
11
|
+
timer: null | number;
|
|
12
|
+
constructor();
|
|
13
|
+
/**
|
|
14
|
+
* This method is called before new DOM is updated and rendered
|
|
15
|
+
* @param changedProperties Property that has been changed
|
|
16
|
+
*/
|
|
17
|
+
willUpdate(changedProperties: PropertyValues<this>): void;
|
|
18
|
+
initData(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Show the toast message
|
|
21
|
+
*/
|
|
22
|
+
show(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Hide the toast message
|
|
25
|
+
*/
|
|
26
|
+
hide(): void;
|
|
27
|
+
render(): import('lit').TemplateResult<1>;
|
|
28
|
+
static styles: import('lit').CSSResult[];
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'nightjar-toast': NightjarToast;
|
|
33
|
+
}
|
|
34
|
+
}
|