@fluid-topics/ft-copy-block 1.2.17 → 1.2.19

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.
@@ -1,3 +1,4 @@
1
+ import { PropertyValues } from "lit";
1
2
  import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
2
3
  import { FtCopyBlockProperties } from "./ft-copy-block.properties";
3
4
  import { FtLitElementWithI18n } from "@fluid-topics/ft-i18n";
@@ -7,5 +8,6 @@ export declare class FtCopyBlock extends FtLitElementWithI18n implements FtCopyB
7
8
  private tooltip?;
8
9
  constructor();
9
10
  protected render(): import("lit").TemplateResult<1>;
11
+ protected firstUpdated(props: PropertyValues): void;
10
12
  private copyContents;
11
13
  }
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html, nothing } from "lit";
8
8
  import { query } from "lit/decorators.js";
9
+ import { PostResizeEvent, PreResizeEvent } from "@fluid-topics/ft-wc-utils";
9
10
  import { FtButton } from "@fluid-topics/ft-button";
10
11
  import { FtTooltip } from "@fluid-topics/ft-tooltip";
11
12
  import { styles } from "./ft-copy-block.styles";
@@ -14,6 +15,7 @@ import { FtLitElementWithI18n } from "@fluid-topics/ft-i18n";
14
15
  class FtCopyBlock extends FtLitElementWithI18n {
15
16
  constructor() {
16
17
  super();
18
+ this.dispatchEvent(new PreResizeEvent());
17
19
  this.addI18nContext(copyBlock, defaultCopyBlockMessages);
18
20
  }
19
21
  render() {
@@ -33,6 +35,10 @@ class FtCopyBlock extends FtLitElementWithI18n {
33
35
  </div>
34
36
  `;
35
37
  }
38
+ firstUpdated(props) {
39
+ super.firstUpdated(props);
40
+ this.updateComplete.then(() => this.dispatchEvent(new PostResizeEvent()));
41
+ }
36
42
  async copyContents() {
37
43
  try {
38
44
  await navigator.clipboard.writeText(this.shadowRoot.host.innerText);