@prometa/sleek 0.0.9 → 0.0.11

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/dist/sleek.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./utils.cjs");function L(r,{resolveTagName:f=h,watch:E=!0}={}){const t=new EventTarget,i=Object.fromEntries(Object.entries(r).map(([e,n])=>[f(e),n]));d(),E&&v();function c(e){if(i[e]){if(o("element:load-start",{tagName:e},{cancelable:!0})===!1)return;i[e]().then(()=>o("element:loading",{tagName:e})).catch(s=>o("element:load-error",{tagName:e,error:s})).then(()=>o("element:load-end",{tagName:e}))}}function d(e=document){e.querySelectorAll(Object.keys(i).join(",")).forEach(n=>{m(n.tagName.toLowerCase())&&c(n.tagName.toLowerCase())})}function v(){new MutationObserver(n=>{o("observer:scan-start"),n.forEach(s=>{s.addedNodes.forEach(l=>{if(l.nodeType===Node.ELEMENT_NODE){const a=l;o("observer:scan-node",{node:a});const u=a.tagName.toLowerCase();m(u)&&c(u),d(a)}})}),o("observer:scan-end")}).observe(document.body,{childList:!0,subtree:!0})}function o(e,n={},s={}){return t.dispatchEvent(new CustomEvent(e,{detail:n,...s}))}return{addEventListener:t.addEventListener.bind(t),on:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t),off:t.removeEventListener.bind(t)}}function m(r){return r.includes("-")&&!customElements.get(r)}function h(r){return r.split("/").pop().split(".").shift().toLowerCase()}exports.trySafeEval=b.trySafeEval;exports.loadCustomElements=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./utils.cjs");function L({maps:o}){window.SLEEK||(window.SLEEK={}),window.SLEEK.maps=o}function w(o,{resolveTagName:f=p,watch:m=!0}={}){const t=new EventTarget,i=Object.fromEntries(Object.entries(o).map(([e,n])=>[f(e),n]));c(),m&&v();function a(e){if(i[e]){if(r("element:load-start",{tagName:e},{cancelable:!0})===!1)return;i[e]().then(()=>r("element:loading",{tagName:e})).catch(s=>r("element:load-error",{tagName:e,error:s})).then(()=>r("element:load-end",{tagName:e}))}}function c(e=document){e.querySelectorAll(Object.keys(i).join(",")).forEach(n=>{E(n.tagName.toLowerCase())&&a(n.tagName.toLowerCase())})}function v(){new MutationObserver(n=>{r("observer:scan-start"),n.forEach(s=>{s.addedNodes.forEach(u=>{if(u.nodeType===Node.ELEMENT_NODE){const d=u;r("observer:scan-node",{node:d});const l=d.tagName.toLowerCase();E(l)&&a(l),c(d)}})}),r("observer:scan-end")}).observe(document.body,{childList:!0,subtree:!0})}function r(e,n={},s={}){return t.dispatchEvent(new CustomEvent(e,{detail:n,...s}))}return{addEventListener:t.addEventListener.bind(t),on:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t),off:t.removeEventListener.bind(t)}}function E(o){return o.includes("-")&&!customElements.get(o)}function p(o){return o.split("/").pop().split(".").shift().toLowerCase()}exports.trySafeEval=b.trySafeEval;exports.loadCustomElements=w;exports.setup=L;
package/dist/sleek.js CHANGED
@@ -1,38 +1,41 @@
1
- import { t as w } from "./utils.js";
2
- function L(r, {
3
- resolveTagName: m = b,
4
- watch: E = !0
1
+ import { t as C } from "./utils.js";
2
+ function L({ maps: o }) {
3
+ window.SLEEK || (window.SLEEK = {}), window.SLEEK.maps = o;
4
+ }
5
+ function w(o, {
6
+ resolveTagName: f = b,
7
+ watch: m = !0
5
8
  } = {}) {
6
9
  const t = new EventTarget(), i = Object.fromEntries(
7
- Object.entries(r).map(([e, n]) => [m(e), n])
10
+ Object.entries(o).map(([e, n]) => [f(e), n])
8
11
  );
9
- a(), E && v();
10
- function d(e) {
12
+ a(), m && v();
13
+ function c(e) {
11
14
  if (i[e]) {
12
- if (o("element:load-start", { tagName: e }, { cancelable: !0 }) === !1) return;
13
- i[e]().then(() => o("element:loading", { tagName: e })).catch((s) => o("element:load-error", { tagName: e, error: s })).then(() => o("element:load-end", { tagName: e }));
15
+ if (r("element:load-start", { tagName: e }, { cancelable: !0 }) === !1) return;
16
+ i[e]().then(() => r("element:loading", { tagName: e })).catch((s) => r("element:load-error", { tagName: e, error: s })).then(() => r("element:load-end", { tagName: e }));
14
17
  }
15
18
  }
16
19
  function a(e = document) {
17
20
  e.querySelectorAll(Object.keys(i).join(",")).forEach((n) => {
18
- f(n.tagName.toLowerCase()) && d(n.tagName.toLowerCase());
21
+ E(n.tagName.toLowerCase()) && c(n.tagName.toLowerCase());
19
22
  });
20
23
  }
21
24
  function v() {
22
25
  new MutationObserver((n) => {
23
- o("observer:scan-start"), n.forEach((s) => {
24
- s.addedNodes.forEach((l) => {
25
- if (l.nodeType === Node.ELEMENT_NODE) {
26
- const c = l;
27
- o("observer:scan-node", { node: c });
28
- const u = c.tagName.toLowerCase();
29
- f(u) && d(u), a(c);
26
+ r("observer:scan-start"), n.forEach((s) => {
27
+ s.addedNodes.forEach((u) => {
28
+ if (u.nodeType === Node.ELEMENT_NODE) {
29
+ const d = u;
30
+ r("observer:scan-node", { node: d });
31
+ const l = d.tagName.toLowerCase();
32
+ E(l) && c(l), a(d);
30
33
  }
31
34
  });
32
- }), o("observer:scan-end");
35
+ }), r("observer:scan-end");
33
36
  }).observe(document.body, { childList: !0, subtree: !0 });
34
37
  }
35
- function o(e, n = {}, s = {}) {
38
+ function r(e, n = {}, s = {}) {
36
39
  return t.dispatchEvent(new CustomEvent(e, { detail: n, ...s }));
37
40
  }
38
41
  return {
@@ -42,13 +45,14 @@ function L(r, {
42
45
  off: t.removeEventListener.bind(t)
43
46
  };
44
47
  }
45
- function f(r) {
46
- return r.includes("-") && !customElements.get(r);
48
+ function E(o) {
49
+ return o.includes("-") && !customElements.get(o);
47
50
  }
48
- function b(r) {
49
- return r.split("/").pop().split(".").shift().toLowerCase();
51
+ function b(o) {
52
+ return o.split("/").pop().split(".").shift().toLowerCase();
50
53
  }
51
54
  export {
52
- L as loadCustomElements,
53
- w as trySafeEval
55
+ w as loadCustomElements,
56
+ L as setup,
57
+ C as trySafeEval
54
58
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prometa/sleek",
3
3
  "private": false,
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -24,6 +24,7 @@
24
24
  "preview": "vite preview"
25
25
  },
26
26
  "dependencies": {
27
+ "@googlemaps/js-api-loader": "^1.16.10",
27
28
  "chart.js": "^4.4.8",
28
29
  "chartjs-adapter-date-fns": "^3.0.0",
29
30
  "chartjs-plugin-annotation": "^3.1.0",
@@ -32,6 +33,7 @@
32
33
  "tom-select": "^2.4.3"
33
34
  },
34
35
  "devDependencies": {
36
+ "@types/google.maps": "^3.58.1",
35
37
  "vite": "^6.2.0",
36
38
  "vite-plugin-dts": "^4.5.3"
37
39
  }