@dile/ui 2.18.3 → 2.19.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.
@@ -47,22 +47,23 @@ export class DileCopyText extends LitElement {
47
47
 
48
48
  render() {
49
49
  return html`
50
- <a
51
- href="#"
52
- role="button"
53
- tabindex="0"
54
- @click="${this.handleCopy}"
55
- @keydown="${this.handleKeydown}"
56
- >
57
- <slot></slot>
58
- </a>
59
50
  <dile-floating-feedback
60
51
  id="copy-feedback"
61
52
  feedback="${this.feedbackText}"
62
53
  duration="${this.copiedDuration}"
63
54
  ?hideIcon=${this.hideIcon}
64
55
  .icon=${contentCopyIcon}
65
- ></dile-floating-feedback>
56
+ >
57
+ <a
58
+ href="#"
59
+ role="button"
60
+ tabindex="0"
61
+ @click="${this.handleCopy}"
62
+ @keydown="${this.handleKeydown}"
63
+ >
64
+ <slot></slot>
65
+ </a>
66
+ </dile-floating-feedback>
66
67
  `;
67
68
  }
68
69
 
@@ -35,7 +35,7 @@ export class DileFloatingFeedback extends LitElement {
35
35
 
36
36
  render() {
37
37
  return html`
38
- <div class="feedback-anchor"></div>
38
+ <slot class="feedback-anchor"></slot>
39
39
  `;
40
40
  }
41
41
 
@@ -116,8 +116,15 @@ export class DileFloatingFeedback extends LitElement {
116
116
  // Add content container to floating element
117
117
  floatingElement.appendChild(contentContainer);
118
118
 
119
- // Calculate position relative to this component
120
- const rect = this.getBoundingClientRect();
119
+ // Calculate position relative to the slot's content
120
+ const anchorElement = this.children[0];
121
+ if (!anchorElement) {
122
+ console.warn('dile-floating-feedback: No element in slot to anchor to');
123
+ floatingElement.remove();
124
+ return;
125
+ }
126
+
127
+ const rect = anchorElement.getBoundingClientRect();
121
128
  const x = rect.left + rect.width / 2;
122
129
  const y = rect.top;
123
130
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/ui",
3
- "version": "2.18.3",
3
+ "version": "2.19.0",
4
4
  "description": "UI Core components from dile-components.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "gitHead": "5a5d851418d9a02f6cf24e937005ee9361085678"
29
+ "gitHead": "b66783df8f27b601e24de791acde3451d93dfe07"
30
30
  }