@wrrdev/fenix-ui 1.1.0 → 1.1.1

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/README.md CHANGED
@@ -18,7 +18,7 @@ import { FenixUI } from '@wrrdev/fenix-ui'; // API de tema/tokens (índice)
18
18
  FenixUI.theme('dark');
19
19
  ```
20
20
 
21
- > 📦 npm: [`@wrrdev/fenix-ui`](https://www.npmjs.com/package/@wrrdev/fenix-ui) — **v1.1.0**, acesso público.
21
+ > 📦 npm: [`@wrrdev/fenix-ui`](https://www.npmjs.com/package/@wrrdev/fenix-ui) — **v1.1.1**, acesso público.
22
22
  > Subpaths disponíveis: `./theme`, `./tokens`, `./jsx`, `./vue`, `./button`, `./badge`, `./spinner`, `./select`, `./input`, `./switch`, `./textarea`, `./checkbox`, `./radio`, `./calendar`, `./datepicker`, `./multiselect`, `./table`, `./floatlabel`, `./dialog`, `./toast`, `./tooltip`, `./tabs`, `./progress`, `./skeleton`, `./alert`, `./drawer`, `./dropdown`, `./sidebar`, `./pagination`, `./autocomplete`, `./auto-import` e o curinga `./components/*`.
23
23
 
24
24
 
@@ -65,7 +65,7 @@ Carregue o bundle **UMD** único: ele registra todos os componentes e expõe os
65
65
  <fx-toast></fx-toast>
66
66
 
67
67
  <!--
68
- 🔗 Links diretos para CDN (versão 1.1.0):
68
+ 🔗 Links diretos para CDN (versão 1.1.1):
69
69
  • https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
70
70
  • https://unpkg.com/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
71
71
  -->
@@ -1,24 +1,32 @@
1
1
  const scriptRel = "modulepreload";
2
- const assetsURL = function(dep) {
3
- return "/" + dep;
2
+ const assetsURL = function(dep, importerUrl) {
3
+ return new URL(dep, importerUrl).href;
4
4
  };
5
5
  const seen = {};
6
6
  const __vitePreload = function preload(baseModule, deps, importerUrl) {
7
7
  let promise = Promise.resolve();
8
8
  if (deps && deps.length > 0) {
9
- document.getElementsByTagName("link");
9
+ const links = document.getElementsByTagName("link");
10
10
  const cspNonceMeta = document.querySelector(
11
11
  "meta[property=csp-nonce]"
12
12
  );
13
13
  const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
14
14
  promise = Promise.allSettled(
15
15
  deps.map((dep) => {
16
- dep = assetsURL(dep);
16
+ dep = assetsURL(dep, importerUrl);
17
17
  if (dep in seen) return;
18
18
  seen[dep] = true;
19
19
  const isCss = dep.endsWith(".css");
20
20
  const cssSelector = isCss ? '[rel="stylesheet"]' : "";
21
- if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
21
+ const isBaseRelative = !!importerUrl;
22
+ if (isBaseRelative) {
23
+ for (let i = links.length - 1; i >= 0; i--) {
24
+ const link2 = links[i];
25
+ if (link2.href === dep && (!isCss || link2.rel === "stylesheet")) {
26
+ return;
27
+ }
28
+ }
29
+ } else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
22
30
  return;
23
31
  }
24
32
  const link = document.createElement("link");
@@ -1 +1 @@
1
- {"version":3,"file":"preload-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"preload-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["icons/index.js","icons/names.js","icons/base-css.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../icons/index.js","../../icons/names.js","../../icons/base-css.js"])))=>i.map(i=>d[i]);
2
2
  import { __vitePreload } from "../../_virtual/preload-helper.js";
3
3
  import { FxElement } from "../../core/base.js";
4
4
  import { css } from "../../core/css.js";
@@ -13,7 +13,7 @@ const _FxAlert = class _FxAlert extends FxElement {
13
13
  const variant = this.getAttr("variant", "info");
14
14
  const title = this.getAttr("title");
15
15
  const iconName = this.getAttr("icon");
16
- if (isFenixIconName(iconName)) void __vitePreload(() => import("../../icons/index.js"), true ? __vite__mapDeps([0,1,2]) : void 0);
16
+ if (isFenixIconName(iconName)) void __vitePreload(() => import("../../icons/index.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url);
17
17
  const icons = {
18
18
  info: "ℹ",
19
19
  success: "✓",
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["icons/index.js","icons/names.js","icons/base-css.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../icons/index.js","../../icons/names.js","../../icons/base-css.js"])))=>i.map(i=>d[i]);
2
2
  import { __vitePreload } from "../../_virtual/preload-helper.js";
3
3
  import { FxElement } from "../../core/base.js";
4
4
  import { css } from "../../core/css.js";
@@ -28,7 +28,7 @@ const _FxConfirmPopup = class _FxConfirmPopup extends FxElement {
28
28
  const message = this.getAttr("message");
29
29
  const icon = this.getAttr("icon");
30
30
  const iconIsFx = isFenixIconName(icon);
31
- if (iconIsFx) void __vitePreload(() => import("../../icons/index.js"), true ? __vite__mapDeps([0,1,2]) : void 0);
31
+ if (iconIsFx) void __vitePreload(() => import("../../icons/index.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url);
32
32
  const acceptLabel = this.getAttr("accept-label", "Sim");
33
33
  const rejectLabel = this.getAttr("reject-label", "Não");
34
34
  this.setTemplate(`
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["icons/index.js","icons/names.js","icons/base-css.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../icons/index.js","../../icons/names.js","../../icons/base-css.js"])))=>i.map(i=>d[i]);
2
2
  var __typeError = (msg) => {
3
3
  throw TypeError(msg);
4
4
  };
@@ -109,7 +109,7 @@ render_fn = function() {
109
109
  const color = KIND_COLOR[kind] ?? KIND_COLOR.info;
110
110
  const iconName = this.getAttribute("icon");
111
111
  const isFxIcon = !!iconName && /^[a-z][a-z0-9_]*$/.test(iconName);
112
- if (isFxIcon) void __vitePreload(() => import("../../icons/index.js"), true ? __vite__mapDeps([0,1,2]) : void 0);
112
+ if (isFxIcon) void __vitePreload(() => import("../../icons/index.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url);
113
113
  const iconContent = isFxIcon ? iconName : KIND_ICON[kind] ?? KIND_ICON.info;
114
114
  this.shadowRoot.innerHTML = `
115
115
  <style>${CARD_CSS}</style>
@@ -4283,8 +4283,7 @@ function resolveFontUrl() {
4283
4283
  if (typeof __FENIX_ICONS_FONT_URL__ !== "undefined" && __FENIX_ICONS_FONT_URL__) {
4284
4284
  return __FENIX_ICONS_FONT_URL__;
4285
4285
  }
4286
- const moduleUrl = import.meta.url;
4287
- return new URL("./fenix-icons.woff2", moduleUrl).toString();
4286
+ return new URL("" + new URL("assets/fenix-icons-DmgotBzD.woff2", import.meta.url).href, import.meta.url).toString();
4288
4287
  }
4289
4288
  const FONT_URL = resolveFontUrl();
4290
4289
  const STYLE_ID = "fenix-icons";