@nectary/labs 2.11.3 → 2.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nectary/labs",
3
- "version": "2.11.3",
3
+ "version": "2.12.0",
4
4
  "files": [
5
5
  "**/*/*.css",
6
6
  "**/*/*.json",
@@ -19,7 +19,7 @@
19
19
  "dev": "vite build --watch"
20
20
  },
21
21
  "dependencies": {
22
- "@nectary/components": "5.40.0"
22
+ "@nectary/components": "5.41.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "22.12.0",
@@ -5,12 +5,12 @@ import "../phone-preview-rcs-channel-info/index.js";
5
5
  import "../phone-preview-rcs-channel-info-option/index.js";
6
6
  import "../phone-preview-rcs-channel-options/index.js";
7
7
  import "../phone-preview-rcs-channel-tabs/index.js";
8
- const templateHTML = '<style>\n:where(*, *::before, *::after) {\n box-sizing: border-box;\n padding: 0;\n border: 0;\n margin: 0;\n font: inherit;\n}\n\n:host {\n --banner-color: var(--sinch-sys-color-surface-tertiary-active);\n --banner-aspect-ratio: 1440 / 448;\n --logo-color: var(--sinch-sys-color-surface-secondary-default);\n\n display: flex;\n flex-flow: column;\n color: var(--sinch-sys-color-text-default);\n}\n\n#banner-img {\n display: block;\n aspect-ratio: var(--banner-aspect-ratio);\n margin-block-end: -40px;\n background: var(--banner-color);\n}\n\n#logo-img {\n block-size: 64px;\n inline-size: 64px;\n border-radius: 100%;\n background: var(--logo-color);\n align-self: center;\n}\n\n#brand-name {\n padding: 8px 24px;\n font: var(--sinch-sys-font-body-m);\n text-align: center;\n text-wrap: balance;\n word-wrap: break-word;\n}\n\n#brand-description {\n padding-inline: 24px;\n font: var(--sinch-sys-font-body-xs);\n text-align: center;\n text-wrap: balance;\n word-wrap: break-word;\n}\n\n#actions {\n align-self: center;\n padding-block: 32px 24px;\n}\n\n#tabs {\n padding-block-end: 8px;\n}\n\n#info-container {\n display: block;\n}\n\n#options-container {\n display: none;\n}\n</style>\n\n<img id="banner-img" alt="" />\n<img id="logo-img" alt="" />\n<h1 id="brand-name">Brand name</h1>\n<p id="brand-description">Brand description</p>\n<sinch-labs-phone-preview-rcs-channel-actions id="actions"></sinch-labs-phone-preview-rcs-channel-actions>\n<sinch-labs-phone-preview-rcs-channel-tabs id="tabs"></sinch-labs-phone-preview-rcs-channel-tabs>\n<sinch-labs-phone-preview-rcs-channel-info id="info-container">\n <slot name="contacts"></slot>\n</sinch-labs-phone-preview-rcs-channel-info>\n<sinch-labs-phone-preview-rcs-channel-options id="options-container"></sinch-labs-phone-preview-rcs-channel-options>\n';
8
+ const templateHTML = '<style>\n:where(*, *::before, *::after) {\n box-sizing: border-box;\n padding: 0;\n border: 0;\n margin: 0;\n font: inherit;\n}\n\n:host {\n --banner-color: var(--sinch-sys-color-surface-tertiary-active);\n --banner-aspect-ratio: 1440 / 448;\n --logo-color: var(--sinch-sys-color-surface-secondary-default);\n\n display: flex;\n flex-flow: column;\n color: var(--sinch-sys-color-text-default);\n}\n\n#banner {\n display: block;\n aspect-ratio: var(--banner-aspect-ratio);\n margin-block-end: -40px;\n background: var(--banner-color);\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n}\n\n#logo {\n block-size: 64px;\n inline-size: 64px;\n border-radius: 100%;\n background: var(--logo-color);\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n align-self: center;\n}\n\n#brand-name {\n padding: 8px 24px;\n font: var(--sinch-sys-font-body-m);\n text-align: center;\n text-wrap: balance;\n word-wrap: break-word;\n}\n\n#brand-description {\n padding-inline: 24px;\n font: var(--sinch-sys-font-body-xs);\n text-align: center;\n text-wrap: balance;\n word-wrap: break-word;\n}\n\n#actions {\n align-self: center;\n padding-block: 32px 24px;\n}\n\n#tabs {\n padding-block-end: 8px;\n}\n\n#info-container {\n display: block;\n}\n\n#options-container {\n display: none;\n}\n</style>\n\n<div id="banner"></div>\n<div id="logo"></div>\n<h1 id="brand-name">Brand name</h1>\n<p id="brand-description">Brand description</p>\n<sinch-labs-phone-preview-rcs-channel-actions id="actions"></sinch-labs-phone-preview-rcs-channel-actions>\n<sinch-labs-phone-preview-rcs-channel-tabs id="tabs"></sinch-labs-phone-preview-rcs-channel-tabs>\n<sinch-labs-phone-preview-rcs-channel-info id="info-container">\n <slot name="contacts"></slot>\n</sinch-labs-phone-preview-rcs-channel-info>\n<sinch-labs-phone-preview-rcs-channel-options id="options-container"></sinch-labs-phone-preview-rcs-channel-options>\n';
9
9
  const template = document.createElement("template");
10
10
  template.innerHTML = templateHTML;
11
11
  class PhonePreviewRcsChannel extends NectaryElement {
12
- #bannerImg;
13
- #logoImg;
12
+ #banner;
13
+ #logo;
14
14
  #brandName;
15
15
  #brandDescription;
16
16
  #actions;
@@ -23,8 +23,8 @@ class PhonePreviewRcsChannel extends NectaryElement {
23
23
  super();
24
24
  const shadowRoot = this.attachShadow();
25
25
  shadowRoot.appendChild(template.content.cloneNode(true));
26
- this.#bannerImg = shadowRoot.querySelector("#banner-img");
27
- this.#logoImg = shadowRoot.querySelector("#logo-img");
26
+ this.#banner = shadowRoot.querySelector("#banner");
27
+ this.#logo = shadowRoot.querySelector("#logo");
28
28
  this.#brandName = shadowRoot.querySelector("#brand-name");
29
29
  this.#brandDescription = shadowRoot.querySelector("#brand-description");
30
30
  this.#actions = shadowRoot.querySelector("#actions");
@@ -111,9 +111,8 @@ class PhonePreviewRcsChannel extends NectaryElement {
111
111
  if (!this.isDomConnected) {
112
112
  return;
113
113
  }
114
- const transparentIcon = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
115
- this.#bannerImg.src = this.banner !== "" ? this.banner : transparentIcon;
116
- this.#logoImg.src = this.logo !== "" ? this.logo : transparentIcon;
114
+ this.#banner.style.backgroundImage = this.banner !== "" ? `url(${JSON.stringify(this.banner)})` : "";
115
+ this.#logo.style.backgroundImage = this.logo !== "" ? `url(${JSON.stringify(this.logo)})` : "";
117
116
  this.#brandName.textContent = this.name !== "" ? this.name : "Brand name";
118
117
  this.#brandDescription.textContent = this.description !== "" ? this.description : "Brand description";
119
118
  const bannerColor = this.bannerColor !== "" ? this.bannerColor : this.color;
@@ -17,18 +17,24 @@
17
17
  color: var(--sinch-sys-color-text-default);
18
18
  }
19
19
 
20
- #banner-img {
20
+ #banner {
21
21
  display: block;
22
22
  aspect-ratio: var(--banner-aspect-ratio);
23
23
  margin-block-end: -40px;
24
24
  background: var(--banner-color);
25
+ background-position: center;
26
+ background-repeat: no-repeat;
27
+ background-size: cover;
25
28
  }
26
29
 
27
- #logo-img {
30
+ #logo {
28
31
  block-size: 64px;
29
32
  inline-size: 64px;
30
33
  border-radius: 100%;
31
34
  background: var(--logo-color);
35
+ background-position: center;
36
+ background-repeat: no-repeat;
37
+ background-size: cover;
32
38
  align-self: center;
33
39
  }
34
40
 
@@ -66,8 +72,8 @@
66
72
  }
67
73
  </style>
68
74
 
69
- <img id="banner-img" alt="" />
70
- <img id="logo-img" alt="" />
75
+ <div id="banner"></div>
76
+ <div id="logo"></div>
71
77
  <h1 id="brand-name">Brand name</h1>
72
78
  <p id="brand-description">Brand description</p>
73
79
  <sinch-labs-phone-preview-rcs-channel-actions id="actions"></sinch-labs-phone-preview-rcs-channel-actions>