@wavelengthusaf/web-components 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +471 -1
- package/dist/cjs/index.d.cts +32 -1
- package/dist/esm/index.d.ts +32 -1
- package/dist/esm/index.js +470 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -5563,6 +5563,476 @@ if (!customElements.get("wavelength-slider")) {
|
|
|
5563
5563
|
customElements.define("wavelength-slider", WavelengthSlider);
|
|
5564
5564
|
}
|
|
5565
5565
|
|
|
5566
|
+
// src/web-components/wavelength-sidebar.ts
|
|
5567
|
+
var template7 = `
|
|
5568
|
+
<style>
|
|
5569
|
+
:host {
|
|
5570
|
+
display: block;
|
|
5571
|
+
--bg-color: #1a1a2e;
|
|
5572
|
+
--txt-color: white;
|
|
5573
|
+
--label-color: white;
|
|
5574
|
+
--item-color: white;
|
|
5575
|
+
--arrow-color: white;
|
|
5576
|
+
--margin-top: 0px;
|
|
5577
|
+
--margin-bottom: 0px;
|
|
5578
|
+
--width: 240px;
|
|
5579
|
+
--height: auto;
|
|
5580
|
+
--global-border-radius: 12px;
|
|
5581
|
+
font-family: "Segoe UI", sans-serif;
|
|
5582
|
+
height: var(--height, auto);
|
|
5583
|
+
}
|
|
5584
|
+
.container {
|
|
5585
|
+
display: flex;
|
|
5586
|
+
flex-direction: column;
|
|
5587
|
+
margin-top: var(--margin-top, 0px);
|
|
5588
|
+
margin-bottom: var(--margin-bottom, 0px);
|
|
5589
|
+
width: var(--width, 240px);
|
|
5590
|
+
height: 100%;
|
|
5591
|
+
background-color: var(--bg-color, #1a1a2e);
|
|
5592
|
+
border-radius: var(--global-border-radius);
|
|
5593
|
+
overflow: hidden;
|
|
5594
|
+
overflow-y: auto;
|
|
5595
|
+
-webkit-overflow-scrolling: touch;
|
|
5596
|
+
box-sizing: border-box;
|
|
5597
|
+
}
|
|
5598
|
+
.container::-webkit-scrollbar {
|
|
5599
|
+
width: 6px;
|
|
5600
|
+
}
|
|
5601
|
+
.container::-webkit-scrollbar-track {
|
|
5602
|
+
background: transparent;
|
|
5603
|
+
margin: 10px 0;
|
|
5604
|
+
}
|
|
5605
|
+
.container::-webkit-scrollbar-thumb {
|
|
5606
|
+
background: color-mix(in srgb, var(--bg-color) 80%, white 20%);
|
|
5607
|
+
border-radius: 10px;
|
|
5608
|
+
}
|
|
5609
|
+
.container::-webkit-scrollbar-thumb:hover {
|
|
5610
|
+
background: color-mix(in srgb, var(--bg-color) 60%, white 40%);
|
|
5611
|
+
}
|
|
5612
|
+
.collapsible {
|
|
5613
|
+
display: flex;
|
|
5614
|
+
align-items: center;
|
|
5615
|
+
gap: 8px;
|
|
5616
|
+
background: none;
|
|
5617
|
+
border: none;
|
|
5618
|
+
cursor: pointer;
|
|
5619
|
+
width: 100%;
|
|
5620
|
+
padding: 10px 16px;
|
|
5621
|
+
text-align: left;
|
|
5622
|
+
font-size: 14px;
|
|
5623
|
+
font-weight: 700;
|
|
5624
|
+
color: var(--txt-color);
|
|
5625
|
+
letter-spacing: 0.04em;
|
|
5626
|
+
text-transform: uppercase;
|
|
5627
|
+
transition: background 0.2s;
|
|
5628
|
+
}
|
|
5629
|
+
.collapsible:hover {
|
|
5630
|
+
background-color: color-mix(in srgb, var(--bg-color) 80%, white 20%);
|
|
5631
|
+
}
|
|
5632
|
+
.arrow {
|
|
5633
|
+
width: 16px;
|
|
5634
|
+
height: 16px;
|
|
5635
|
+
flex-shrink: 0;
|
|
5636
|
+
transition: transform 0.3s ease;
|
|
5637
|
+
color: var(--arrow-color);
|
|
5638
|
+
}
|
|
5639
|
+
.collapsible.open .arrow {
|
|
5640
|
+
transform: rotate(270deg);
|
|
5641
|
+
}
|
|
5642
|
+
.arrow path {
|
|
5643
|
+
fill: none !important;
|
|
5644
|
+
stroke: var(--arrow-color);
|
|
5645
|
+
}
|
|
5646
|
+
|
|
5647
|
+
.panel {
|
|
5648
|
+
overflow: hidden;
|
|
5649
|
+
max-height: 0;
|
|
5650
|
+
transition: max-height 0.3s ease;
|
|
5651
|
+
}
|
|
5652
|
+
|
|
5653
|
+
.subheading {
|
|
5654
|
+
padding: 8px 16px 4px 32px;
|
|
5655
|
+
font-size: 11px;
|
|
5656
|
+
font-weight: 600;
|
|
5657
|
+
letter-spacing: 0.08em;
|
|
5658
|
+
text-transform: uppercase;
|
|
5659
|
+
color: var(--label-color);
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
.item-btn {
|
|
5663
|
+
display: block;
|
|
5664
|
+
width: 100%;
|
|
5665
|
+
background: none;
|
|
5666
|
+
border: none;
|
|
5667
|
+
cursor: pointer;
|
|
5668
|
+
padding: 7px 16px 7px 44px;
|
|
5669
|
+
text-align: left;
|
|
5670
|
+
font-size: 13px;
|
|
5671
|
+
color: var(--item-color);
|
|
5672
|
+
transition: background 0.15s;
|
|
5673
|
+
border-radius: 0;
|
|
5674
|
+
}
|
|
5675
|
+
|
|
5676
|
+
.item-btn:hover {
|
|
5677
|
+
background-color: color-mix(in srgb, var(--bg-color) 80%, white 20%);
|
|
5678
|
+
}
|
|
5679
|
+
|
|
5680
|
+
.item-btn {
|
|
5681
|
+
position: relative;
|
|
5682
|
+
overflow: hidden;
|
|
5683
|
+
}
|
|
5684
|
+
|
|
5685
|
+
.item-btn::after {
|
|
5686
|
+
content: "";
|
|
5687
|
+
position: absolute;
|
|
5688
|
+
inset: 0;
|
|
5689
|
+
background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
|
|
5690
|
+
opacity: 0;
|
|
5691
|
+
transform: scale(0);
|
|
5692
|
+
border-radius: inherit;
|
|
5693
|
+
pointer-events: none;
|
|
5694
|
+
transition: none;
|
|
5695
|
+
}
|
|
5696
|
+
|
|
5697
|
+
.item-btn:active {
|
|
5698
|
+
background-color: color-mix(in srgb, var(--bg-color) 65%, white 35%);
|
|
5699
|
+
transform: scale(0.98);
|
|
5700
|
+
transition:
|
|
5701
|
+
transform 0.08s ease,
|
|
5702
|
+
background-color 0.08s ease;
|
|
5703
|
+
}
|
|
5704
|
+
|
|
5705
|
+
.item-btn:active::after {
|
|
5706
|
+
animation: ripple 0.4s ease-out forwards;
|
|
5707
|
+
}
|
|
5708
|
+
|
|
5709
|
+
@keyframes ripple {
|
|
5710
|
+
0% {
|
|
5711
|
+
opacity: 1;
|
|
5712
|
+
transform: scale(0);
|
|
5713
|
+
}
|
|
5714
|
+
100% {
|
|
5715
|
+
opacity: 0;
|
|
5716
|
+
transform: scale(2.5);
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
|
|
5720
|
+
.collapsible:active {
|
|
5721
|
+
background-color: color-mix(in srgb, var(--bg-color) 65%, white 35%);
|
|
5722
|
+
transform: scale(0.99);
|
|
5723
|
+
transition:
|
|
5724
|
+
transform 0.08s ease,
|
|
5725
|
+
background-color 0.08s ease;
|
|
5726
|
+
}
|
|
5727
|
+
</style>
|
|
5728
|
+
<div id="container" class="container"></div>
|
|
5729
|
+
`;
|
|
5730
|
+
var WavelengthSideBar = class extends HTMLElement {
|
|
5731
|
+
constructor() {
|
|
5732
|
+
super();
|
|
5733
|
+
this._sections = [];
|
|
5734
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
5735
|
+
this.shadow.innerHTML = template7;
|
|
5736
|
+
}
|
|
5737
|
+
static get observedAttributes() {
|
|
5738
|
+
return ["sections"];
|
|
5739
|
+
}
|
|
5740
|
+
get sections() {
|
|
5741
|
+
return this._sections;
|
|
5742
|
+
}
|
|
5743
|
+
set sections(value) {
|
|
5744
|
+
this._sections = value;
|
|
5745
|
+
this._render();
|
|
5746
|
+
}
|
|
5747
|
+
connectedCallback() {
|
|
5748
|
+
this.container = this.shadowRoot.querySelector("#container");
|
|
5749
|
+
this._render();
|
|
5750
|
+
}
|
|
5751
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
5752
|
+
if (oldValue === newValue) return;
|
|
5753
|
+
if (name === "sections") {
|
|
5754
|
+
try {
|
|
5755
|
+
this.sections = JSON.parse(newValue);
|
|
5756
|
+
} catch (e) {
|
|
5757
|
+
console.error("WavelengthSideBar: Invalid JSON in attribute");
|
|
5758
|
+
}
|
|
5759
|
+
}
|
|
5760
|
+
}
|
|
5761
|
+
_render() {
|
|
5762
|
+
if (!this.container) return;
|
|
5763
|
+
this.container.innerHTML = "";
|
|
5764
|
+
if (!this._sections || !this._sections.length) return;
|
|
5765
|
+
const svgArrow = `
|
|
5766
|
+
<svg class="arrow" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" transform="rotate(180)" fill="none">
|
|
5767
|
+
<path d="M15 6L9 12L15 18" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke="currentColor"></path>
|
|
5768
|
+
</svg>
|
|
5769
|
+
`;
|
|
5770
|
+
this._sections.forEach((section) => {
|
|
5771
|
+
const sectionWrapper = document.createElement("div");
|
|
5772
|
+
sectionWrapper.style.display = "flex";
|
|
5773
|
+
sectionWrapper.style.flexDirection = "column";
|
|
5774
|
+
const button = document.createElement("button");
|
|
5775
|
+
button.classList.add("collapsible");
|
|
5776
|
+
button.innerHTML = `${svgArrow} <span>${section.title || section}</span>`;
|
|
5777
|
+
const panel = document.createElement("div");
|
|
5778
|
+
panel.classList.add("panel");
|
|
5779
|
+
if (section.subsections) {
|
|
5780
|
+
section.subsections.forEach((sub) => {
|
|
5781
|
+
if (sub.title) {
|
|
5782
|
+
const subheading = document.createElement("div");
|
|
5783
|
+
subheading.classList.add("subheading");
|
|
5784
|
+
subheading.textContent = sub.title;
|
|
5785
|
+
panel.appendChild(subheading);
|
|
5786
|
+
}
|
|
5787
|
+
if (sub.items) {
|
|
5788
|
+
sub.items.forEach((item) => {
|
|
5789
|
+
const itemBtn = document.createElement("button");
|
|
5790
|
+
itemBtn.classList.add("item-btn");
|
|
5791
|
+
itemBtn.textContent = item.title || item;
|
|
5792
|
+
itemBtn.onclick = () => {
|
|
5793
|
+
this.dispatchEvent(
|
|
5794
|
+
new CustomEvent("wavelength-sidebar-item-click", {
|
|
5795
|
+
detail: { item: item.title || item, section: section.title },
|
|
5796
|
+
bubbles: true,
|
|
5797
|
+
composed: true
|
|
5798
|
+
})
|
|
5799
|
+
);
|
|
5800
|
+
};
|
|
5801
|
+
panel.appendChild(itemBtn);
|
|
5802
|
+
});
|
|
5803
|
+
}
|
|
5804
|
+
});
|
|
5805
|
+
}
|
|
5806
|
+
button.onclick = (e) => {
|
|
5807
|
+
e.stopPropagation();
|
|
5808
|
+
const isOpen = button.classList.toggle("open");
|
|
5809
|
+
panel.style.maxHeight = isOpen ? `${panel.scrollHeight}px` : "0";
|
|
5810
|
+
};
|
|
5811
|
+
sectionWrapper.appendChild(button);
|
|
5812
|
+
sectionWrapper.appendChild(panel);
|
|
5813
|
+
this.container.appendChild(sectionWrapper);
|
|
5814
|
+
});
|
|
5815
|
+
}
|
|
5816
|
+
};
|
|
5817
|
+
if (!customElements.get("wavelength-sidebar")) {
|
|
5818
|
+
customElements.define("wavelength-sidebar", WavelengthSideBar);
|
|
5819
|
+
}
|
|
5820
|
+
|
|
5821
|
+
// src/web-components/wavelength-comment-display.ts
|
|
5822
|
+
var template8 = `
|
|
5823
|
+
<style>
|
|
5824
|
+
:host {
|
|
5825
|
+
display: block;
|
|
5826
|
+
--txt-color: #000000;
|
|
5827
|
+
--bg-color: rgb(122, 204, 231);
|
|
5828
|
+
--border: 1px solid color-mix(in srgb, rgb(122, 204, 231) 50%, black 70%);
|
|
5829
|
+
--icon-selected-color: #0acd55;
|
|
5830
|
+
}
|
|
5831
|
+
|
|
5832
|
+
.outer-wrapper {
|
|
5833
|
+
display: flex;
|
|
5834
|
+
flex-direction: row;
|
|
5835
|
+
align-items: flex-start;
|
|
5836
|
+
justify-content: space-between;
|
|
5837
|
+
gap: 10px;
|
|
5838
|
+
font-family: "Montserrat", sans-serif;
|
|
5839
|
+
background-color: color-mix(in srgb, var(--bg-color) 60%, transparent);
|
|
5840
|
+
border-radius: 10px;
|
|
5841
|
+
padding: 10px;
|
|
5842
|
+
border: var(--border);
|
|
5843
|
+
width: 350px;
|
|
5844
|
+
max-width: 100%;
|
|
5845
|
+
height: fit-content;
|
|
5846
|
+
min-height: min-content;
|
|
5847
|
+
box-sizing: border-box;
|
|
5848
|
+
overflow-y: visible;
|
|
5849
|
+
}
|
|
5850
|
+
|
|
5851
|
+
.inner-wrapper {
|
|
5852
|
+
display: flex;
|
|
5853
|
+
flex-direction: column;
|
|
5854
|
+
flex: 1;
|
|
5855
|
+
gap: 10px;
|
|
5856
|
+
font-family: "Montserrat", sans-serif;
|
|
5857
|
+
}
|
|
5858
|
+
|
|
5859
|
+
.author {
|
|
5860
|
+
display: block;
|
|
5861
|
+
font-weight: bold;
|
|
5862
|
+
font-size: 14px;
|
|
5863
|
+
color: var(--txt-color);
|
|
5864
|
+
}
|
|
5865
|
+
.header {
|
|
5866
|
+
display: flex;
|
|
5867
|
+
flex-direction: column;
|
|
5868
|
+
gap: 5px;
|
|
5869
|
+
}
|
|
5870
|
+
|
|
5871
|
+
.comment {
|
|
5872
|
+
display: block;
|
|
5873
|
+
font-style: italic;
|
|
5874
|
+
color: var(--txt-color);
|
|
5875
|
+
font-size: 12px;
|
|
5876
|
+
line-height: 1.4;
|
|
5877
|
+
word-break: break-word;
|
|
5878
|
+
}
|
|
5879
|
+
|
|
5880
|
+
.date {
|
|
5881
|
+
display: block;
|
|
5882
|
+
font-size: 9px;
|
|
5883
|
+
color: #666666;
|
|
5884
|
+
}
|
|
5885
|
+
|
|
5886
|
+
.icon {
|
|
5887
|
+
flex-shrink: 0;
|
|
5888
|
+
width: 20px;
|
|
5889
|
+
height: 20px;
|
|
5890
|
+
align-self: flex-start;
|
|
5891
|
+
stroke: #807f7f;
|
|
5892
|
+
stroke-width: 2;
|
|
5893
|
+
background-color: transparent;
|
|
5894
|
+
border-radius: 50%;
|
|
5895
|
+
transition:
|
|
5896
|
+
filter 0.2s ease,
|
|
5897
|
+
background-color 0.2s ease,
|
|
5898
|
+
stroke 0.2s ease;
|
|
5899
|
+
}
|
|
5900
|
+
|
|
5901
|
+
.icon:hover {
|
|
5902
|
+
cursor: pointer;
|
|
5903
|
+
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
|
|
5904
|
+
background-color: rgba(0, 0, 0, 0.08);
|
|
5905
|
+
}
|
|
5906
|
+
|
|
5907
|
+
.icon.selected {
|
|
5908
|
+
background-color: var(--icon-selected-color);
|
|
5909
|
+
}
|
|
5910
|
+
|
|
5911
|
+
.icon.selected .checkmark {
|
|
5912
|
+
stroke: #ffffff;
|
|
5913
|
+
}
|
|
5914
|
+
|
|
5915
|
+
.icon.selected .circle {
|
|
5916
|
+
stroke: var(--icon-selected-color);
|
|
5917
|
+
}
|
|
5918
|
+
</style>
|
|
5919
|
+
<div class="outer-wrapper">
|
|
5920
|
+
<div class="inner-wrapper">
|
|
5921
|
+
<div class="header">
|
|
5922
|
+
<span class="author">Ollie T. Orca</span>
|
|
5923
|
+
<span class="date">March 25, 2026</span>
|
|
5924
|
+
</div>
|
|
5925
|
+
<span class="comment">This is a comment.</span>
|
|
5926
|
+
</div>
|
|
5927
|
+
<svg class="icon" viewBox="2.5 2.5 19 19" xmlns="http://www.w3.org/2000/svg" fill="none">
|
|
5928
|
+
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
|
5929
|
+
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
|
5930
|
+
<g id="SVGRepo_iconCarrier">
|
|
5931
|
+
<g stroke-width="2">
|
|
5932
|
+
<path class="checkmark" stroke-linecap="round" stroke-linejoin="round" d="M8 13L10.5 15.5L16 10"></path>
|
|
5933
|
+
<path class="circle" d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z"></path>
|
|
5934
|
+
</g>
|
|
5935
|
+
</g>
|
|
5936
|
+
</svg>
|
|
5937
|
+
</div>
|
|
5938
|
+
`;
|
|
5939
|
+
var WavelengthCommentDisplay = class extends HTMLElement {
|
|
5940
|
+
constructor() {
|
|
5941
|
+
super();
|
|
5942
|
+
this.styleAttributes = ["width", "height", "txt-color", "bg-color", "border", "icon-selected-color"];
|
|
5943
|
+
this.contentAttributes = ["author", "comment", "date"];
|
|
5944
|
+
this.handleIconClick = () => {
|
|
5945
|
+
this.selected = !this.selected;
|
|
5946
|
+
this.dispatchEvent(
|
|
5947
|
+
new CustomEvent("wl-comment-clicked", {
|
|
5948
|
+
detail: { selected: this.selected },
|
|
5949
|
+
bubbles: true,
|
|
5950
|
+
composed: true
|
|
5951
|
+
})
|
|
5952
|
+
);
|
|
5953
|
+
};
|
|
5954
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
5955
|
+
this.shadow.innerHTML = template8;
|
|
5956
|
+
this.elements = {
|
|
5957
|
+
author: this.shadow.querySelector(".author"),
|
|
5958
|
+
comment: this.shadow.querySelector(".comment"),
|
|
5959
|
+
date: this.shadow.querySelector(".date"),
|
|
5960
|
+
icon: this.shadow.querySelector(".icon")
|
|
5961
|
+
};
|
|
5962
|
+
}
|
|
5963
|
+
static get observedAttributes() {
|
|
5964
|
+
return ["author", "comment", "date", "width", "height", "txt-color", "bg-color", "border", "icon-selected-color", "selected"];
|
|
5965
|
+
}
|
|
5966
|
+
get selected() {
|
|
5967
|
+
return this.hasAttribute("selected");
|
|
5968
|
+
}
|
|
5969
|
+
set selected(val) {
|
|
5970
|
+
if (val) {
|
|
5971
|
+
this.setAttribute("selected", "");
|
|
5972
|
+
} else {
|
|
5973
|
+
this.removeAttribute("selected");
|
|
5974
|
+
}
|
|
5975
|
+
}
|
|
5976
|
+
connectedCallback() {
|
|
5977
|
+
this.elements.icon.addEventListener("click", this.handleIconClick);
|
|
5978
|
+
this.applyStyles();
|
|
5979
|
+
this.applyContent();
|
|
5980
|
+
this.updateSelectedState();
|
|
5981
|
+
}
|
|
5982
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
5983
|
+
if (oldValue === newValue) return;
|
|
5984
|
+
if (name === "selected") {
|
|
5985
|
+
const icon = this.elements.icon;
|
|
5986
|
+
if (this.selected) {
|
|
5987
|
+
icon.classList.add("selected");
|
|
5988
|
+
} else {
|
|
5989
|
+
icon.classList.remove("selected");
|
|
5990
|
+
}
|
|
5991
|
+
}
|
|
5992
|
+
if (this.styleAttributes.includes(name)) {
|
|
5993
|
+
this.applyStyles();
|
|
5994
|
+
}
|
|
5995
|
+
if (this.contentAttributes.includes(name)) {
|
|
5996
|
+
this.applyContent();
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
disconnectedCallback() {
|
|
6000
|
+
this.elements.icon.removeEventListener("click", this.handleIconClick);
|
|
6001
|
+
}
|
|
6002
|
+
applyStyles() {
|
|
6003
|
+
this.styleAttributes.forEach((attr) => {
|
|
6004
|
+
const value = this.getAttribute(attr);
|
|
6005
|
+
if (value) {
|
|
6006
|
+
if (attr === "width" || attr === "height") {
|
|
6007
|
+
const wrapper = this.shadow.querySelector(".outer-wrapper");
|
|
6008
|
+
if (wrapper) wrapper.style.setProperty(attr, value);
|
|
6009
|
+
} else {
|
|
6010
|
+
this.style.setProperty(`--${attr}`, value);
|
|
6011
|
+
}
|
|
6012
|
+
}
|
|
6013
|
+
});
|
|
6014
|
+
}
|
|
6015
|
+
applyContent() {
|
|
6016
|
+
this.contentAttributes.forEach((attr) => {
|
|
6017
|
+
const value = this.getAttribute(attr);
|
|
6018
|
+
if (value) {
|
|
6019
|
+
const el = this.shadow.querySelector(`.${attr}`);
|
|
6020
|
+
if (el) el.textContent = value;
|
|
6021
|
+
}
|
|
6022
|
+
});
|
|
6023
|
+
}
|
|
6024
|
+
updateSelectedState() {
|
|
6025
|
+
const icon = this.elements.icon;
|
|
6026
|
+
if (!icon) return;
|
|
6027
|
+
icon.classList.toggle("selected", this.selected);
|
|
6028
|
+
}
|
|
6029
|
+
};
|
|
6030
|
+
if (!customElements.get("wavelength-comment-display")) {
|
|
6031
|
+
customElements.define("wavelength-comment-display", WavelengthCommentDisplay);
|
|
6032
|
+
}
|
|
6033
|
+
|
|
6034
|
+
|
|
6035
|
+
|
|
5566
6036
|
|
|
5567
6037
|
|
|
5568
6038
|
|
|
@@ -5593,5 +6063,5 @@ if (!customElements.get("wavelength-slider")) {
|
|
|
5593
6063
|
|
|
5594
6064
|
|
|
5595
6065
|
|
|
5596
|
-
exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.ChildDataTable = ChildDataTable; exports.SampleComponent = SampleComponent; exports.WavelengthBadge = WavelengthBadge; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthCheckbox = WavelengthCheckbox; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDialog = WavelengthDialog; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthFileDropZone = WavelengthFileDropZone; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthMenu = WavelengthMenu; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotificationPanel = WavelengthNotificationPanel; exports.WavelengthPagination = WavelengthPagination; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSwitch = WavelengthSwitch; exports.WavelengthTitleBar = WavelengthTitleBar; exports.WavelengthToolTip = WavelengthToolTip;
|
|
6066
|
+
exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.ChildDataTable = ChildDataTable; exports.SampleComponent = SampleComponent; exports.WavelengthBadge = WavelengthBadge; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthCheckbox = WavelengthCheckbox; exports.WavelengthCommentDisplay = WavelengthCommentDisplay; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDialog = WavelengthDialog; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthFileDropZone = WavelengthFileDropZone; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthMenu = WavelengthMenu; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotificationPanel = WavelengthNotificationPanel; exports.WavelengthPagination = WavelengthPagination; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSideBar = WavelengthSideBar; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSwitch = WavelengthSwitch; exports.WavelengthTitleBar = WavelengthTitleBar; exports.WavelengthToolTip = WavelengthToolTip;
|
|
5597
6067
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -2887,4 +2887,35 @@ declare class WavelengthSlider extends HTMLElement {
|
|
|
2887
2887
|
private calculatePosition;
|
|
2888
2888
|
}
|
|
2889
2889
|
|
|
2890
|
-
|
|
2890
|
+
declare class WavelengthSideBar extends HTMLElement {
|
|
2891
|
+
static get observedAttributes(): string[];
|
|
2892
|
+
private shadow;
|
|
2893
|
+
private _sections;
|
|
2894
|
+
private container;
|
|
2895
|
+
get sections(): any[];
|
|
2896
|
+
set sections(value: any[]);
|
|
2897
|
+
constructor();
|
|
2898
|
+
connectedCallback(): void;
|
|
2899
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
2900
|
+
private _render;
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
declare class WavelengthCommentDisplay extends HTMLElement {
|
|
2904
|
+
static get observedAttributes(): string[];
|
|
2905
|
+
private shadow;
|
|
2906
|
+
private styleAttributes;
|
|
2907
|
+
private contentAttributes;
|
|
2908
|
+
private elements;
|
|
2909
|
+
constructor();
|
|
2910
|
+
get selected(): boolean;
|
|
2911
|
+
set selected(val: boolean);
|
|
2912
|
+
connectedCallback(): void;
|
|
2913
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
2914
|
+
disconnectedCallback(): void;
|
|
2915
|
+
private applyStyles;
|
|
2916
|
+
private applyContent;
|
|
2917
|
+
private handleIconClick;
|
|
2918
|
+
private updateSelectedState;
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBadge, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthCommentDisplay, WavelengthConfirmationModal, type WavelengthConfirmationModalElements, WavelengthDatePicker, WavelengthDialog, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMenu, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPagination, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, WavelengthSearch, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSwitch, WavelengthTitleBar, WavelengthToolTip };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2887,4 +2887,35 @@ declare class WavelengthSlider extends HTMLElement {
|
|
|
2887
2887
|
private calculatePosition;
|
|
2888
2888
|
}
|
|
2889
2889
|
|
|
2890
|
-
|
|
2890
|
+
declare class WavelengthSideBar extends HTMLElement {
|
|
2891
|
+
static get observedAttributes(): string[];
|
|
2892
|
+
private shadow;
|
|
2893
|
+
private _sections;
|
|
2894
|
+
private container;
|
|
2895
|
+
get sections(): any[];
|
|
2896
|
+
set sections(value: any[]);
|
|
2897
|
+
constructor();
|
|
2898
|
+
connectedCallback(): void;
|
|
2899
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
2900
|
+
private _render;
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
declare class WavelengthCommentDisplay extends HTMLElement {
|
|
2904
|
+
static get observedAttributes(): string[];
|
|
2905
|
+
private shadow;
|
|
2906
|
+
private styleAttributes;
|
|
2907
|
+
private contentAttributes;
|
|
2908
|
+
private elements;
|
|
2909
|
+
constructor();
|
|
2910
|
+
get selected(): boolean;
|
|
2911
|
+
set selected(val: boolean);
|
|
2912
|
+
connectedCallback(): void;
|
|
2913
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
2914
|
+
disconnectedCallback(): void;
|
|
2915
|
+
private applyStyles;
|
|
2916
|
+
private applyContent;
|
|
2917
|
+
private handleIconClick;
|
|
2918
|
+
private updateSelectedState;
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBadge, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthCommentDisplay, WavelengthConfirmationModal, type WavelengthConfirmationModalElements, WavelengthDatePicker, WavelengthDialog, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMenu, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPagination, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, WavelengthSearch, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSwitch, WavelengthTitleBar, WavelengthToolTip };
|
package/dist/esm/index.js
CHANGED
|
@@ -5562,6 +5562,474 @@ var WavelengthSlider = class extends HTMLElement {
|
|
|
5562
5562
|
if (!customElements.get("wavelength-slider")) {
|
|
5563
5563
|
customElements.define("wavelength-slider", WavelengthSlider);
|
|
5564
5564
|
}
|
|
5565
|
+
|
|
5566
|
+
// src/web-components/wavelength-sidebar.ts
|
|
5567
|
+
var template7 = `
|
|
5568
|
+
<style>
|
|
5569
|
+
:host {
|
|
5570
|
+
display: block;
|
|
5571
|
+
--bg-color: #1a1a2e;
|
|
5572
|
+
--txt-color: white;
|
|
5573
|
+
--label-color: white;
|
|
5574
|
+
--item-color: white;
|
|
5575
|
+
--arrow-color: white;
|
|
5576
|
+
--margin-top: 0px;
|
|
5577
|
+
--margin-bottom: 0px;
|
|
5578
|
+
--width: 240px;
|
|
5579
|
+
--height: auto;
|
|
5580
|
+
--global-border-radius: 12px;
|
|
5581
|
+
font-family: "Segoe UI", sans-serif;
|
|
5582
|
+
height: var(--height, auto);
|
|
5583
|
+
}
|
|
5584
|
+
.container {
|
|
5585
|
+
display: flex;
|
|
5586
|
+
flex-direction: column;
|
|
5587
|
+
margin-top: var(--margin-top, 0px);
|
|
5588
|
+
margin-bottom: var(--margin-bottom, 0px);
|
|
5589
|
+
width: var(--width, 240px);
|
|
5590
|
+
height: 100%;
|
|
5591
|
+
background-color: var(--bg-color, #1a1a2e);
|
|
5592
|
+
border-radius: var(--global-border-radius);
|
|
5593
|
+
overflow: hidden;
|
|
5594
|
+
overflow-y: auto;
|
|
5595
|
+
-webkit-overflow-scrolling: touch;
|
|
5596
|
+
box-sizing: border-box;
|
|
5597
|
+
}
|
|
5598
|
+
.container::-webkit-scrollbar {
|
|
5599
|
+
width: 6px;
|
|
5600
|
+
}
|
|
5601
|
+
.container::-webkit-scrollbar-track {
|
|
5602
|
+
background: transparent;
|
|
5603
|
+
margin: 10px 0;
|
|
5604
|
+
}
|
|
5605
|
+
.container::-webkit-scrollbar-thumb {
|
|
5606
|
+
background: color-mix(in srgb, var(--bg-color) 80%, white 20%);
|
|
5607
|
+
border-radius: 10px;
|
|
5608
|
+
}
|
|
5609
|
+
.container::-webkit-scrollbar-thumb:hover {
|
|
5610
|
+
background: color-mix(in srgb, var(--bg-color) 60%, white 40%);
|
|
5611
|
+
}
|
|
5612
|
+
.collapsible {
|
|
5613
|
+
display: flex;
|
|
5614
|
+
align-items: center;
|
|
5615
|
+
gap: 8px;
|
|
5616
|
+
background: none;
|
|
5617
|
+
border: none;
|
|
5618
|
+
cursor: pointer;
|
|
5619
|
+
width: 100%;
|
|
5620
|
+
padding: 10px 16px;
|
|
5621
|
+
text-align: left;
|
|
5622
|
+
font-size: 14px;
|
|
5623
|
+
font-weight: 700;
|
|
5624
|
+
color: var(--txt-color);
|
|
5625
|
+
letter-spacing: 0.04em;
|
|
5626
|
+
text-transform: uppercase;
|
|
5627
|
+
transition: background 0.2s;
|
|
5628
|
+
}
|
|
5629
|
+
.collapsible:hover {
|
|
5630
|
+
background-color: color-mix(in srgb, var(--bg-color) 80%, white 20%);
|
|
5631
|
+
}
|
|
5632
|
+
.arrow {
|
|
5633
|
+
width: 16px;
|
|
5634
|
+
height: 16px;
|
|
5635
|
+
flex-shrink: 0;
|
|
5636
|
+
transition: transform 0.3s ease;
|
|
5637
|
+
color: var(--arrow-color);
|
|
5638
|
+
}
|
|
5639
|
+
.collapsible.open .arrow {
|
|
5640
|
+
transform: rotate(270deg);
|
|
5641
|
+
}
|
|
5642
|
+
.arrow path {
|
|
5643
|
+
fill: none !important;
|
|
5644
|
+
stroke: var(--arrow-color);
|
|
5645
|
+
}
|
|
5646
|
+
|
|
5647
|
+
.panel {
|
|
5648
|
+
overflow: hidden;
|
|
5649
|
+
max-height: 0;
|
|
5650
|
+
transition: max-height 0.3s ease;
|
|
5651
|
+
}
|
|
5652
|
+
|
|
5653
|
+
.subheading {
|
|
5654
|
+
padding: 8px 16px 4px 32px;
|
|
5655
|
+
font-size: 11px;
|
|
5656
|
+
font-weight: 600;
|
|
5657
|
+
letter-spacing: 0.08em;
|
|
5658
|
+
text-transform: uppercase;
|
|
5659
|
+
color: var(--label-color);
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
.item-btn {
|
|
5663
|
+
display: block;
|
|
5664
|
+
width: 100%;
|
|
5665
|
+
background: none;
|
|
5666
|
+
border: none;
|
|
5667
|
+
cursor: pointer;
|
|
5668
|
+
padding: 7px 16px 7px 44px;
|
|
5669
|
+
text-align: left;
|
|
5670
|
+
font-size: 13px;
|
|
5671
|
+
color: var(--item-color);
|
|
5672
|
+
transition: background 0.15s;
|
|
5673
|
+
border-radius: 0;
|
|
5674
|
+
}
|
|
5675
|
+
|
|
5676
|
+
.item-btn:hover {
|
|
5677
|
+
background-color: color-mix(in srgb, var(--bg-color) 80%, white 20%);
|
|
5678
|
+
}
|
|
5679
|
+
|
|
5680
|
+
.item-btn {
|
|
5681
|
+
position: relative;
|
|
5682
|
+
overflow: hidden;
|
|
5683
|
+
}
|
|
5684
|
+
|
|
5685
|
+
.item-btn::after {
|
|
5686
|
+
content: "";
|
|
5687
|
+
position: absolute;
|
|
5688
|
+
inset: 0;
|
|
5689
|
+
background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
|
|
5690
|
+
opacity: 0;
|
|
5691
|
+
transform: scale(0);
|
|
5692
|
+
border-radius: inherit;
|
|
5693
|
+
pointer-events: none;
|
|
5694
|
+
transition: none;
|
|
5695
|
+
}
|
|
5696
|
+
|
|
5697
|
+
.item-btn:active {
|
|
5698
|
+
background-color: color-mix(in srgb, var(--bg-color) 65%, white 35%);
|
|
5699
|
+
transform: scale(0.98);
|
|
5700
|
+
transition:
|
|
5701
|
+
transform 0.08s ease,
|
|
5702
|
+
background-color 0.08s ease;
|
|
5703
|
+
}
|
|
5704
|
+
|
|
5705
|
+
.item-btn:active::after {
|
|
5706
|
+
animation: ripple 0.4s ease-out forwards;
|
|
5707
|
+
}
|
|
5708
|
+
|
|
5709
|
+
@keyframes ripple {
|
|
5710
|
+
0% {
|
|
5711
|
+
opacity: 1;
|
|
5712
|
+
transform: scale(0);
|
|
5713
|
+
}
|
|
5714
|
+
100% {
|
|
5715
|
+
opacity: 0;
|
|
5716
|
+
transform: scale(2.5);
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
|
|
5720
|
+
.collapsible:active {
|
|
5721
|
+
background-color: color-mix(in srgb, var(--bg-color) 65%, white 35%);
|
|
5722
|
+
transform: scale(0.99);
|
|
5723
|
+
transition:
|
|
5724
|
+
transform 0.08s ease,
|
|
5725
|
+
background-color 0.08s ease;
|
|
5726
|
+
}
|
|
5727
|
+
</style>
|
|
5728
|
+
<div id="container" class="container"></div>
|
|
5729
|
+
`;
|
|
5730
|
+
var WavelengthSideBar = class extends HTMLElement {
|
|
5731
|
+
constructor() {
|
|
5732
|
+
super();
|
|
5733
|
+
this._sections = [];
|
|
5734
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
5735
|
+
this.shadow.innerHTML = template7;
|
|
5736
|
+
}
|
|
5737
|
+
static get observedAttributes() {
|
|
5738
|
+
return ["sections"];
|
|
5739
|
+
}
|
|
5740
|
+
get sections() {
|
|
5741
|
+
return this._sections;
|
|
5742
|
+
}
|
|
5743
|
+
set sections(value) {
|
|
5744
|
+
this._sections = value;
|
|
5745
|
+
this._render();
|
|
5746
|
+
}
|
|
5747
|
+
connectedCallback() {
|
|
5748
|
+
this.container = this.shadowRoot.querySelector("#container");
|
|
5749
|
+
this._render();
|
|
5750
|
+
}
|
|
5751
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
5752
|
+
if (oldValue === newValue) return;
|
|
5753
|
+
if (name === "sections") {
|
|
5754
|
+
try {
|
|
5755
|
+
this.sections = JSON.parse(newValue);
|
|
5756
|
+
} catch (e) {
|
|
5757
|
+
console.error("WavelengthSideBar: Invalid JSON in attribute");
|
|
5758
|
+
}
|
|
5759
|
+
}
|
|
5760
|
+
}
|
|
5761
|
+
_render() {
|
|
5762
|
+
if (!this.container) return;
|
|
5763
|
+
this.container.innerHTML = "";
|
|
5764
|
+
if (!this._sections || !this._sections.length) return;
|
|
5765
|
+
const svgArrow = `
|
|
5766
|
+
<svg class="arrow" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" transform="rotate(180)" fill="none">
|
|
5767
|
+
<path d="M15 6L9 12L15 18" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke="currentColor"></path>
|
|
5768
|
+
</svg>
|
|
5769
|
+
`;
|
|
5770
|
+
this._sections.forEach((section) => {
|
|
5771
|
+
const sectionWrapper = document.createElement("div");
|
|
5772
|
+
sectionWrapper.style.display = "flex";
|
|
5773
|
+
sectionWrapper.style.flexDirection = "column";
|
|
5774
|
+
const button = document.createElement("button");
|
|
5775
|
+
button.classList.add("collapsible");
|
|
5776
|
+
button.innerHTML = `${svgArrow} <span>${section.title || section}</span>`;
|
|
5777
|
+
const panel = document.createElement("div");
|
|
5778
|
+
panel.classList.add("panel");
|
|
5779
|
+
if (section.subsections) {
|
|
5780
|
+
section.subsections.forEach((sub) => {
|
|
5781
|
+
if (sub.title) {
|
|
5782
|
+
const subheading = document.createElement("div");
|
|
5783
|
+
subheading.classList.add("subheading");
|
|
5784
|
+
subheading.textContent = sub.title;
|
|
5785
|
+
panel.appendChild(subheading);
|
|
5786
|
+
}
|
|
5787
|
+
if (sub.items) {
|
|
5788
|
+
sub.items.forEach((item) => {
|
|
5789
|
+
const itemBtn = document.createElement("button");
|
|
5790
|
+
itemBtn.classList.add("item-btn");
|
|
5791
|
+
itemBtn.textContent = item.title || item;
|
|
5792
|
+
itemBtn.onclick = () => {
|
|
5793
|
+
this.dispatchEvent(
|
|
5794
|
+
new CustomEvent("wavelength-sidebar-item-click", {
|
|
5795
|
+
detail: { item: item.title || item, section: section.title },
|
|
5796
|
+
bubbles: true,
|
|
5797
|
+
composed: true
|
|
5798
|
+
})
|
|
5799
|
+
);
|
|
5800
|
+
};
|
|
5801
|
+
panel.appendChild(itemBtn);
|
|
5802
|
+
});
|
|
5803
|
+
}
|
|
5804
|
+
});
|
|
5805
|
+
}
|
|
5806
|
+
button.onclick = (e) => {
|
|
5807
|
+
e.stopPropagation();
|
|
5808
|
+
const isOpen = button.classList.toggle("open");
|
|
5809
|
+
panel.style.maxHeight = isOpen ? `${panel.scrollHeight}px` : "0";
|
|
5810
|
+
};
|
|
5811
|
+
sectionWrapper.appendChild(button);
|
|
5812
|
+
sectionWrapper.appendChild(panel);
|
|
5813
|
+
this.container.appendChild(sectionWrapper);
|
|
5814
|
+
});
|
|
5815
|
+
}
|
|
5816
|
+
};
|
|
5817
|
+
if (!customElements.get("wavelength-sidebar")) {
|
|
5818
|
+
customElements.define("wavelength-sidebar", WavelengthSideBar);
|
|
5819
|
+
}
|
|
5820
|
+
|
|
5821
|
+
// src/web-components/wavelength-comment-display.ts
|
|
5822
|
+
var template8 = `
|
|
5823
|
+
<style>
|
|
5824
|
+
:host {
|
|
5825
|
+
display: block;
|
|
5826
|
+
--txt-color: #000000;
|
|
5827
|
+
--bg-color: rgb(122, 204, 231);
|
|
5828
|
+
--border: 1px solid color-mix(in srgb, rgb(122, 204, 231) 50%, black 70%);
|
|
5829
|
+
--icon-selected-color: #0acd55;
|
|
5830
|
+
}
|
|
5831
|
+
|
|
5832
|
+
.outer-wrapper {
|
|
5833
|
+
display: flex;
|
|
5834
|
+
flex-direction: row;
|
|
5835
|
+
align-items: flex-start;
|
|
5836
|
+
justify-content: space-between;
|
|
5837
|
+
gap: 10px;
|
|
5838
|
+
font-family: "Montserrat", sans-serif;
|
|
5839
|
+
background-color: color-mix(in srgb, var(--bg-color) 60%, transparent);
|
|
5840
|
+
border-radius: 10px;
|
|
5841
|
+
padding: 10px;
|
|
5842
|
+
border: var(--border);
|
|
5843
|
+
width: 350px;
|
|
5844
|
+
max-width: 100%;
|
|
5845
|
+
height: fit-content;
|
|
5846
|
+
min-height: min-content;
|
|
5847
|
+
box-sizing: border-box;
|
|
5848
|
+
overflow-y: visible;
|
|
5849
|
+
}
|
|
5850
|
+
|
|
5851
|
+
.inner-wrapper {
|
|
5852
|
+
display: flex;
|
|
5853
|
+
flex-direction: column;
|
|
5854
|
+
flex: 1;
|
|
5855
|
+
gap: 10px;
|
|
5856
|
+
font-family: "Montserrat", sans-serif;
|
|
5857
|
+
}
|
|
5858
|
+
|
|
5859
|
+
.author {
|
|
5860
|
+
display: block;
|
|
5861
|
+
font-weight: bold;
|
|
5862
|
+
font-size: 14px;
|
|
5863
|
+
color: var(--txt-color);
|
|
5864
|
+
}
|
|
5865
|
+
.header {
|
|
5866
|
+
display: flex;
|
|
5867
|
+
flex-direction: column;
|
|
5868
|
+
gap: 5px;
|
|
5869
|
+
}
|
|
5870
|
+
|
|
5871
|
+
.comment {
|
|
5872
|
+
display: block;
|
|
5873
|
+
font-style: italic;
|
|
5874
|
+
color: var(--txt-color);
|
|
5875
|
+
font-size: 12px;
|
|
5876
|
+
line-height: 1.4;
|
|
5877
|
+
word-break: break-word;
|
|
5878
|
+
}
|
|
5879
|
+
|
|
5880
|
+
.date {
|
|
5881
|
+
display: block;
|
|
5882
|
+
font-size: 9px;
|
|
5883
|
+
color: #666666;
|
|
5884
|
+
}
|
|
5885
|
+
|
|
5886
|
+
.icon {
|
|
5887
|
+
flex-shrink: 0;
|
|
5888
|
+
width: 20px;
|
|
5889
|
+
height: 20px;
|
|
5890
|
+
align-self: flex-start;
|
|
5891
|
+
stroke: #807f7f;
|
|
5892
|
+
stroke-width: 2;
|
|
5893
|
+
background-color: transparent;
|
|
5894
|
+
border-radius: 50%;
|
|
5895
|
+
transition:
|
|
5896
|
+
filter 0.2s ease,
|
|
5897
|
+
background-color 0.2s ease,
|
|
5898
|
+
stroke 0.2s ease;
|
|
5899
|
+
}
|
|
5900
|
+
|
|
5901
|
+
.icon:hover {
|
|
5902
|
+
cursor: pointer;
|
|
5903
|
+
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
|
|
5904
|
+
background-color: rgba(0, 0, 0, 0.08);
|
|
5905
|
+
}
|
|
5906
|
+
|
|
5907
|
+
.icon.selected {
|
|
5908
|
+
background-color: var(--icon-selected-color);
|
|
5909
|
+
}
|
|
5910
|
+
|
|
5911
|
+
.icon.selected .checkmark {
|
|
5912
|
+
stroke: #ffffff;
|
|
5913
|
+
}
|
|
5914
|
+
|
|
5915
|
+
.icon.selected .circle {
|
|
5916
|
+
stroke: var(--icon-selected-color);
|
|
5917
|
+
}
|
|
5918
|
+
</style>
|
|
5919
|
+
<div class="outer-wrapper">
|
|
5920
|
+
<div class="inner-wrapper">
|
|
5921
|
+
<div class="header">
|
|
5922
|
+
<span class="author">Ollie T. Orca</span>
|
|
5923
|
+
<span class="date">March 25, 2026</span>
|
|
5924
|
+
</div>
|
|
5925
|
+
<span class="comment">This is a comment.</span>
|
|
5926
|
+
</div>
|
|
5927
|
+
<svg class="icon" viewBox="2.5 2.5 19 19" xmlns="http://www.w3.org/2000/svg" fill="none">
|
|
5928
|
+
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
|
5929
|
+
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
|
5930
|
+
<g id="SVGRepo_iconCarrier">
|
|
5931
|
+
<g stroke-width="2">
|
|
5932
|
+
<path class="checkmark" stroke-linecap="round" stroke-linejoin="round" d="M8 13L10.5 15.5L16 10"></path>
|
|
5933
|
+
<path class="circle" d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z"></path>
|
|
5934
|
+
</g>
|
|
5935
|
+
</g>
|
|
5936
|
+
</svg>
|
|
5937
|
+
</div>
|
|
5938
|
+
`;
|
|
5939
|
+
var WavelengthCommentDisplay = class extends HTMLElement {
|
|
5940
|
+
constructor() {
|
|
5941
|
+
super();
|
|
5942
|
+
this.styleAttributes = ["width", "height", "txt-color", "bg-color", "border", "icon-selected-color"];
|
|
5943
|
+
this.contentAttributes = ["author", "comment", "date"];
|
|
5944
|
+
this.handleIconClick = () => {
|
|
5945
|
+
this.selected = !this.selected;
|
|
5946
|
+
this.dispatchEvent(
|
|
5947
|
+
new CustomEvent("wl-comment-clicked", {
|
|
5948
|
+
detail: { selected: this.selected },
|
|
5949
|
+
bubbles: true,
|
|
5950
|
+
composed: true
|
|
5951
|
+
})
|
|
5952
|
+
);
|
|
5953
|
+
};
|
|
5954
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
5955
|
+
this.shadow.innerHTML = template8;
|
|
5956
|
+
this.elements = {
|
|
5957
|
+
author: this.shadow.querySelector(".author"),
|
|
5958
|
+
comment: this.shadow.querySelector(".comment"),
|
|
5959
|
+
date: this.shadow.querySelector(".date"),
|
|
5960
|
+
icon: this.shadow.querySelector(".icon")
|
|
5961
|
+
};
|
|
5962
|
+
}
|
|
5963
|
+
static get observedAttributes() {
|
|
5964
|
+
return ["author", "comment", "date", "width", "height", "txt-color", "bg-color", "border", "icon-selected-color", "selected"];
|
|
5965
|
+
}
|
|
5966
|
+
get selected() {
|
|
5967
|
+
return this.hasAttribute("selected");
|
|
5968
|
+
}
|
|
5969
|
+
set selected(val) {
|
|
5970
|
+
if (val) {
|
|
5971
|
+
this.setAttribute("selected", "");
|
|
5972
|
+
} else {
|
|
5973
|
+
this.removeAttribute("selected");
|
|
5974
|
+
}
|
|
5975
|
+
}
|
|
5976
|
+
connectedCallback() {
|
|
5977
|
+
this.elements.icon.addEventListener("click", this.handleIconClick);
|
|
5978
|
+
this.applyStyles();
|
|
5979
|
+
this.applyContent();
|
|
5980
|
+
this.updateSelectedState();
|
|
5981
|
+
}
|
|
5982
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
5983
|
+
if (oldValue === newValue) return;
|
|
5984
|
+
if (name === "selected") {
|
|
5985
|
+
const icon = this.elements.icon;
|
|
5986
|
+
if (this.selected) {
|
|
5987
|
+
icon.classList.add("selected");
|
|
5988
|
+
} else {
|
|
5989
|
+
icon.classList.remove("selected");
|
|
5990
|
+
}
|
|
5991
|
+
}
|
|
5992
|
+
if (this.styleAttributes.includes(name)) {
|
|
5993
|
+
this.applyStyles();
|
|
5994
|
+
}
|
|
5995
|
+
if (this.contentAttributes.includes(name)) {
|
|
5996
|
+
this.applyContent();
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
disconnectedCallback() {
|
|
6000
|
+
this.elements.icon.removeEventListener("click", this.handleIconClick);
|
|
6001
|
+
}
|
|
6002
|
+
applyStyles() {
|
|
6003
|
+
this.styleAttributes.forEach((attr) => {
|
|
6004
|
+
const value = this.getAttribute(attr);
|
|
6005
|
+
if (value) {
|
|
6006
|
+
if (attr === "width" || attr === "height") {
|
|
6007
|
+
const wrapper = this.shadow.querySelector(".outer-wrapper");
|
|
6008
|
+
if (wrapper) wrapper.style.setProperty(attr, value);
|
|
6009
|
+
} else {
|
|
6010
|
+
this.style.setProperty(`--${attr}`, value);
|
|
6011
|
+
}
|
|
6012
|
+
}
|
|
6013
|
+
});
|
|
6014
|
+
}
|
|
6015
|
+
applyContent() {
|
|
6016
|
+
this.contentAttributes.forEach((attr) => {
|
|
6017
|
+
const value = this.getAttribute(attr);
|
|
6018
|
+
if (value) {
|
|
6019
|
+
const el = this.shadow.querySelector(`.${attr}`);
|
|
6020
|
+
if (el) el.textContent = value;
|
|
6021
|
+
}
|
|
6022
|
+
});
|
|
6023
|
+
}
|
|
6024
|
+
updateSelectedState() {
|
|
6025
|
+
const icon = this.elements.icon;
|
|
6026
|
+
if (!icon) return;
|
|
6027
|
+
icon.classList.toggle("selected", this.selected);
|
|
6028
|
+
}
|
|
6029
|
+
};
|
|
6030
|
+
if (!customElements.get("wavelength-comment-display")) {
|
|
6031
|
+
customElements.define("wavelength-comment-display", WavelengthCommentDisplay);
|
|
6032
|
+
}
|
|
5565
6033
|
export {
|
|
5566
6034
|
BaseWavelengthInput,
|
|
5567
6035
|
BaseWavelengthMultiSelectAutocomplete,
|
|
@@ -5571,6 +6039,7 @@ export {
|
|
|
5571
6039
|
WavelengthBanner,
|
|
5572
6040
|
WavelengthButton,
|
|
5573
6041
|
WavelengthCheckbox,
|
|
6042
|
+
WavelengthCommentDisplay,
|
|
5574
6043
|
WavelengthConfirmationModal,
|
|
5575
6044
|
WavelengthDatePicker,
|
|
5576
6045
|
WavelengthDialog,
|
|
@@ -5588,6 +6057,7 @@ export {
|
|
|
5588
6057
|
WavelengthPopUpMenu,
|
|
5589
6058
|
WavelengthProgressBar,
|
|
5590
6059
|
WavelengthSearch,
|
|
6060
|
+
WavelengthSideBar,
|
|
5591
6061
|
WavelengthSlider,
|
|
5592
6062
|
WavelengthSnackbar,
|
|
5593
6063
|
WavelengthSwitch,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@wavelengthusaf/web-components",
|
|
3
3
|
"author": "563 EWS - Wavelength",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.20.0",
|
|
6
6
|
"description": "Common component library used by Wavelength developers (NATIVE WEB COMPONENTS)",
|
|
7
7
|
"main": "/dist/cjs/index.cjs",
|
|
8
8
|
"module": "/dist/esm/index.js",
|