@mhmo91/schmancy 0.9.26 → 0.9.27

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.
@@ -36876,13 +36876,53 @@ function Sp(e) {
36876
36876
  function Cp() {
36877
36877
  return vp.tokens ?? [];
36878
36878
  }
36879
- function wp(e) {
36879
+ var wp = new Set(/* @__PURE__ */ "a.an.and.or.the.of.in.on.at.to.for.with.is.it.this.that.these.those.be.by.as.are.was.i.you.we.my.your".split("."));
36880
+ function Tp(e) {
36881
+ let t = /* @__PURE__ */ new Set();
36882
+ for (let n of e.toLowerCase().match(/[a-z][a-z0-9]+/g) ?? []) n.length >= 2 && !wp.has(n) && t.add(n);
36883
+ return t;
36884
+ }
36885
+ var Ep = null;
36886
+ function Dp(e, t = 5) {
36887
+ Ep ||= bp().map((e) => {
36888
+ let t = Tp((e.tagName ?? "").replace(/-/g, " "));
36889
+ return {
36890
+ entry: e,
36891
+ body: Tp([
36892
+ e.tagName ?? "",
36893
+ e.summary ?? "",
36894
+ e.description ?? "",
36895
+ e.whenToUse ?? "",
36896
+ (e.examples ?? []).join(" ")
36897
+ ].join(" ")),
36898
+ tagTokens: t
36899
+ };
36900
+ });
36901
+ let n = Tp(e);
36902
+ if (n.size === 0) return [];
36903
+ let r = [];
36904
+ for (let e of Ep) {
36905
+ let t = 0;
36906
+ for (let r of n) e.tagTokens.has(r) ? t += 3 : e.body.has(r) && (t += 1);
36907
+ t > 0 && r.push({
36908
+ entry: e.entry,
36909
+ score: t
36910
+ });
36911
+ }
36912
+ return r.sort((e, t) => t.score - e.score), r.slice(0, t).map(({ entry: e, score: t }) => ({
36913
+ tag: e.tagName ?? "",
36914
+ score: t,
36915
+ summary: e.summary,
36916
+ examples: e.examples
36917
+ }));
36918
+ }
36919
+ function Op(e) {
36880
36920
  return bp().find((t) => t.tagName === e)?.platformPrimitive ?? null;
36881
36921
  }
36882
- function Tp() {
36922
+ function kp() {
36883
36923
  return bp().map((e) => e.tagName).filter((e) => customElements.get(e) !== void 0);
36884
36924
  }
36885
- function Ep() {
36925
+ function Ap() {
36886
36926
  let e = new Set(bp().map((e) => e.tagName)), t = [], n = document.querySelectorAll("*");
36887
36927
  for (let r of Array.from(n)) {
36888
36928
  let n = r.tagName.toLowerCase();
@@ -36898,7 +36938,7 @@ function Ep() {
36898
36938
  }
36899
36939
  return t;
36900
36940
  }
36901
- function Dp() {
36941
+ function jp() {
36902
36942
  let e = typeof HTMLTemplateElement < "u" ? HTMLTemplateElement.prototype : null, t = typeof ElementInternals < "u" ? ElementInternals.prototype : null;
36903
36943
  return {
36904
36944
  popover: typeof HTMLElement < "u" && "popover" in HTMLElement.prototype,
@@ -36917,29 +36957,30 @@ function Dp() {
36917
36957
  adoptedStyleSheets: typeof Document < "u" && "adoptedStyleSheets" in Document.prototype
36918
36958
  };
36919
36959
  }
36920
- var Op = null;
36921
- function kp() {
36922
- typeof window < "u" && (Op || (Op = function() {
36960
+ var Mp = null;
36961
+ function Np() {
36962
+ typeof window < "u" && (Mp || (Mp = function() {
36923
36963
  let e = new Blob([JSON.stringify(vp)], { type: "application/json" });
36924
36964
  return URL.createObjectURL(e);
36925
36965
  }(), window.schmancy = {
36926
36966
  manifest: vp,
36927
- manifestUrl: Op,
36967
+ manifestUrl: Mp,
36928
36968
  help: Sp,
36929
36969
  tokens: Cp,
36930
- platformPrimitive: wp,
36931
- registeredTags: Tp,
36932
- a11yAudit: Ep,
36933
- capabilities: Dp
36970
+ platformPrimitive: Op,
36971
+ registeredTags: kp,
36972
+ a11yAudit: Ap,
36973
+ capabilities: jp,
36974
+ findFor: Dp
36934
36975
  }));
36935
36976
  }
36936
- var Ap = class extends B() {
36977
+ var Pp = class extends B() {
36937
36978
  connectedCallback() {
36938
- super.connectedCallback(), kp();
36979
+ super.connectedCallback(), Np();
36939
36980
  }
36940
36981
  render() {
36941
36982
  return j``;
36942
36983
  }
36943
36984
  };
36944
- Ap = N([P("schmancy-skill")], Ap);
36985
+ Pp = N([P("schmancy-skill")], Pp);
36945
36986
  export { B as $LitElement, Mc as $dialog, hd as $notify, Nc as SchmancySheetPosition, ti as area, Oa as createContext, ai as lazy, gc as schmancyContentDrawer, Pa as select, Fa as selectItem, Pc as sheet, Oo as theme };