@cas-smartdesign/element-utils 1.0.2 → 1.0.3

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/docs/doc.mjs CHANGED
@@ -100,8 +100,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),C=u,v=d),w===void 0&&(
100
100
  `);document.head.appendChild(yr);Je.registerLanguage("typescript",Oo);Je.registerLanguage("html",ko);Je.registerLanguage("css",Io);function Po(...r){const e=document.createElement("div"),t=document.createElement("div");t.classList.add("tab-control");const n=document.createElement("div");return r.forEach(i=>{e.appendChild(i),i.addEventListener("click",()=>{r.forEach(o=>o.removeAttribute("selected")),i.setAttribute("selected",""),n.innerHTML="",n.appendChild(i.content),n.className=i.className,n.classList.add("tab-content")})}),t.appendChild(e),t.appendChild(n),n.classList.add("tab-content"),r[0].setAttribute("selected",""),n.appendChild(r[0].content),t}function he(r,e){const t=document.createElement("div");return t.role="tab",t.tabIndex=0,t.innerText=r,t.content=e,e.tagName=="PRE"&&t.classList.add("code"),t}function fe(r,e){const t=document.createElement(r);return typeof e=="string"?t.innerHTML=e:e.forEach(n=>{t.appendChild(n)}),t}async function Lo(r,e,t){var n,i,o;const s=e.mainContent,l=fe("div",s);l.id=`example-preview-${t}`;const a=typeof e.css=="string"||(n=e.css)==null?void 0:n.label,c=typeof e.css=="string"?e.css:(i=e.css)==null?void 0:i.content,h=Po(he("Preview",l),he("HTML",Te("html",s)),...c?[he(a??"CSS",Te("css",c))]:[],...e.initializer&&e.initializer.content?[he(e.initializer.label??"TS",Te("typescript",e.initializer.content))]:[],...(e.additionalSources||[]).map(g=>he(g.label,Te(g.language,g.content))));e.description&&r.appendChild(fe("div",e.description));const b=fe("div",[h]);b.classList.add("example"),r.appendChild(b),c&&To(`#${l.id}`,c),(o=e.initializer)!=null&&o.initialize&&await e.initializer.initialize(l)}function Te(r,e){let t=e.split(/\r?\n/).map(n=>{const i=n.indexOf("///");if(i>-1){const o=n.substring(i+3).trimStart();return o?n.replace(/^(\s*)([^\s].*)$/,`$1${o}`):void 0}return n}).filter(n=>typeof n<"u").join(`
101
101
  `).trim();return r&&r!="raw"&&(t=Je.highlight(t,{language:r}).value),fe("pre",[fe("code",t)])}function To(r,e){const t=document.createElement("style");t.innerHTML=_().use(ks({prefix:r})).process(e).css,document.head.appendChild(t)}async function jo(r,e=document.body){const t=zo(e);let n=0;Object.keys(r).forEach(async i=>{const o=document.createElement("div");o.className="example-container",t.appendChild(o);const s=r[i].default;Lo(o,s,n++)})}function $o(r){const e=document.createElement("div");e.id="examples-container";const t=r.querySelector("#examples");return t?t.after(e):r.appendChild(e),e}function zo(r){return r.children?$o(r):r}const Bo=`<h1 id="@cas-smartdesign/element-utils">@cas-smartdesign/element-utils</h1>
102
102
  <p>A utility collection for @cas-smartdesign elements.</p>
103
- <h2 id="examples">Examples</h2>
104
- `;document.querySelector("#markdown-container").innerHTML=Bo;jo(Object.assign({"./examples/keydown-delegator/index.ts":Lr}));
103
+ `,Do=document.querySelector("#markdown-container");Do.innerHTML=Bo;jo(Object.assign({"./examples/keydown-delegator/index.ts":Lr}),document.querySelector(".markdown-body"));
105
104
  function __vite__mapDeps(indexes) {
106
105
  if (!__vite__mapDeps.viteFileDeps) {
107
106
  __vite__mapDeps.viteFileDeps = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cas-smartdesign/element-utils",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A utility collection for @cas-smartdesign elements.",
5
5
  "main": "dist/element-utils-with-externals.js",
6
6
  "module": "dist/element-utils.mjs",
@@ -15,8 +15,8 @@
15
15
  "access": "public"
16
16
  },
17
17
  "devDependencies": {
18
- "@cas-smartdesign/element-preview": "^0.2.1",
19
- "@cas-smartdesign/license-generator": "^1.6.1"
18
+ "@cas-smartdesign/element-preview": "^0.2.2",
19
+ "@cas-smartdesign/license-generator": "^1.6.3"
20
20
  },
21
21
  "scripts": {
22
22
  "version": "pnpm version",
package/readme.md CHANGED
@@ -1,5 +1,3 @@
1
1
  # @cas-smartdesign/element-utils
2
2
 
3
3
  A utility collection for @cas-smartdesign elements.
4
-
5
- ## Examples