smoothly 1.0.0-alpha.129 → 1.0.0-alpha.130

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.
@@ -14417,31 +14417,30 @@ const SmoothlyIcon = class {
14417
14417
  index.registerInstance(this, hostRef);
14418
14418
  this.color = undefined;
14419
14419
  this.fill = "solid";
14420
- this.name = undefined;
14420
+ this.name = "empty";
14421
14421
  this.size = "medium";
14422
14422
  this.toolTip = undefined;
14423
14423
  this.document = undefined;
14424
14424
  }
14425
14425
  async loadDocument() {
14426
- var _a;
14427
- if (this.name)
14428
- this.document =
14429
- this.name != "empty"
14430
- ? (_a = (await Data.Icon.load(this.name))) === null || _a === void 0 ? void 0 : _a.replace(/(?<=^<svg\s?)/, `$& role="img"`)
14431
- : `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
14432
- <title>Empty</title>
14433
- </svg>`;
14426
+ let result;
14427
+ if (this.name != "empty") {
14428
+ result = await Data.Icon.load(this.name);
14429
+ result = result === null || result === void 0 ? void 0 : result.replace(/(?<=^<svg\s?)/, `$& role="img"`).replace(` width="512" height="512"`, "").replace(/stroke:#000;/gi, "");
14430
+ if (result === null || result === void 0 ? void 0 : result.includes("<title>"))
14431
+ result = result.replace(/(<title>)[\w\d\s-]*(<\/title>)/, `<title>${this.toolTip || ""}</title>`);
14432
+ else
14433
+ result = result === null || result === void 0 ? void 0 : result.replace(/(.*>)(<\/svg>$)/, `$1<title>${this.toolTip || ""}</title>$2`);
14434
+ }
14435
+ return (result !== null && result !== void 0 ? result : `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
14436
+ <title>Empty</title>
14437
+ </svg>`);
14434
14438
  }
14435
14439
  async componentWillLoad() {
14436
- this.loadDocument();
14440
+ this.document = await this.loadDocument();
14437
14441
  }
14438
14442
  render() {
14439
- return (index.h(index.Host, { innerHTML: this.document
14440
- ? this.document
14441
- .replace(` width="512" height="512"`, "")
14442
- .replace(/(<title>)[\w\d\s-]*(<\/title>)/, `<title>${this.toolTip || ""}</title>`)
14443
- .replace(/stroke:#000;/gi, "")
14444
- : undefined }));
14443
+ return index.h(index.Host, { innerHTML: this.document });
14445
14444
  }
14446
14445
  static get watchers() { return {
14447
14446
  "name": ["loadDocument"]