@editora/ui-core 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/package.json +11 -3
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xi=require("@editora/icons"),Lt=[],$e=new WeakMap;class Mn{constructor(t){this.subs=new Set,this.value=t}get(){const t=Lt[Lt.length-1];if(t){this.subs.add(t);let e=$e.get(t);e||(e=new Set,$e.set(t,e)),e.add(this)}return this.value}set(t){if(Object.is(this.value,t))return;this.value=t;const e=Array.from(this.subs);for(const i of e)i()}removeSubscriber(t){this.subs.delete(t)}}function On(n){const t=new Mn(n);return{get:()=>t.get(),set:e=>t.set(e),subscribe:e=>{const i=()=>e();return t.subs.add(i),()=>t.subs.delete(i)}}}function Ti(n){const t=$e.get(n);if(t){for(const e of t)e.removeSubscriber(n);$e.delete(n)}}function Pn(n){let t;const e=()=>{if(Ti(e),t)try{t()}catch{}Lt.push(e);try{const i=n();typeof i=="function"?t=i:t=void 0}finally{Lt.pop()}};return e(),()=>{if(Ti(e),t)try{t()}catch{}}}function Rn(n){let t,e=!0;const i=()=>{e=!1;const r=()=>{t=n()};Lt.push(r);try{t=n()}finally{Lt.pop()}};return{get(){return e&&i(),t}}}class v extends HTMLElement{constructor(){super(),this._isRendering=!1,this._renderRequested=!1,this._renderScheduled=!1,this._hasRendered=!1,this._visibilityGuardApplied=!1,this._lastRenderedContent=null,this.root=this.attachShadow({mode:"open"})}connectedCallback(){!this._hasRendered&&!this._visibilityGuardApplied&&(this.style.getPropertyValue("visibility").trim()||(this.style.setProperty("visibility","hidden"),this._visibilityGuardApplied=!0)),this._scheduleRender()}disconnectedCallback(){try{if(typeof this.close=="function")try{this.close()}catch{}if(typeof this._cleanup=="function"){try{this._cleanup()}catch{}this._cleanup=void 0}if(typeof this.__menuCleanup=="function"){try{this.__menuCleanup()}catch{}this.__menuCleanup=null}const t=this._portalEl;if(t&&t.parentElement)try{t.parentElement.removeChild(t)}catch{}}catch{}}attributeChangedCallback(t,e,i){e!==i&&this.isConnected&&(t&&!this.shouldRenderOnAttributeChange(t,e??null,i??null)||this._scheduleRender())}shouldRenderOnAttributeChange(t,e,i){return!0}setContent(t,e){!(e!=null&&e.force)&&this._lastRenderedContent===t||(this.root.innerHTML=t,this._lastRenderedContent=t)}invalidateContentCache(){this._lastRenderedContent=null}requestRender(){this._scheduleRender()}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this._requestRender()}))}_requestRender(){if(this._isRendering){this._renderRequested=!0;return}this._isRendering=!0;try{this.render()}finally{this._isRendering=!1,this._hasRendered||(this._hasRendered=!0,this._visibilityGuardApplied&&(this.style.removeProperty("visibility"),this._visibilityGuardApplied=!1))}this._renderRequested&&(this._renderRequested=!1,this._scheduleRender())}}const Bn=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const xi=require("@editora/icons"),Lt=[],$e=new WeakMap;class Mn{constructor(t){this.subs=new Set,this.value=t}get(){const t=Lt[Lt.length-1];if(t){this.subs.add(t);let e=$e.get(t);e||(e=new Set,$e.set(t,e)),e.add(this)}return this.value}set(t){if(Object.is(this.value,t))return;this.value=t;const e=Array.from(this.subs);for(const i of e)i()}removeSubscriber(t){this.subs.delete(t)}}function On(n){const t=new Mn(n);return{get:()=>t.get(),set:e=>t.set(e),subscribe:e=>{const i=()=>e();return t.subs.add(i),()=>t.subs.delete(i)}}}function Ti(n){const t=$e.get(n);if(t){for(const e of t)e.removeSubscriber(n);$e.delete(n)}}function Pn(n){let t;const e=()=>{if(Ti(e),t)try{t()}catch{}Lt.push(e);try{const i=n();typeof i=="function"?t=i:t=void 0}finally{Lt.pop()}};return e(),()=>{if(Ti(e),t)try{t()}catch{}}}function Rn(n){let t,e=!0;const i=()=>{e=!1;const r=()=>{t=n()};Lt.push(r);try{t=n()}finally{Lt.pop()}};return{get(){return e&&i(),t}}}class v extends HTMLElement{constructor(){super(),this._isRendering=!1,this._renderRequested=!1,this._renderScheduled=!1,this._hasRendered=!1,this._visibilityGuardApplied=!1,this._lastRenderedContent=null,this.root=this.attachShadow({mode:"open"})}connectedCallback(){!this._hasRendered&&!this._visibilityGuardApplied&&(this.style.getPropertyValue("visibility").trim()||(this.style.setProperty("visibility","hidden"),this._visibilityGuardApplied=!0)),this._scheduleRender()}disconnectedCallback(){try{if(typeof this.close=="function")try{this.close()}catch{}if(typeof this._cleanup=="function"){try{this._cleanup()}catch{}this._cleanup=void 0}if(typeof this.__menuCleanup=="function"){try{this.__menuCleanup()}catch{}this.__menuCleanup=null}const t=this._portalEl;if(t&&t.parentElement)try{t.parentElement.removeChild(t)}catch{}}catch{}}attributeChangedCallback(t,e,i){e!==i&&this.isConnected&&(t&&!this.shouldRenderOnAttributeChange(t,e??null,i??null)||this._scheduleRender())}shouldRenderOnAttributeChange(t,e,i){return!0}setContent(t,e){!(e!=null&&e.force)&&this._lastRenderedContent===t||(this.root.innerHTML=t,this._lastRenderedContent=t)}invalidateContentCache(){this._lastRenderedContent=null}requestRender(){this._scheduleRender()}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this._requestRender()}))}_requestRender(){if(this._isRendering){this._renderRequested=!0;return}this._isRendering=!0;try{this.render()}finally{this._isRendering=!1,this._hasRendered||(this._hasRendered=!0,this._visibilityGuardApplied&&(this.style.removeProperty("visibility"),this._visibilityGuardApplied=!1))}this._renderRequested&&(this._renderRequested=!1,this._scheduleRender())}}const Bn=`
2
2
  :host {
3
3
  --ui-btn-radius: var(--ui-radius, 10px);
4
4
  --ui-btn-padding: var(--ui-padding, 10px 14px);
package/package.json CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
2
  "name": "@editora/ui-core",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Framework-agnostic Web Components and primitives for the Editora UI ecosystem",
5
- "main": "dist/index.js",
5
+ "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.esm.js",
12
+ "require": "./dist/index.cjs.js",
13
+ "default": "./dist/index.esm.js"
14
+ }
15
+ },
8
16
  "files": [
9
17
  "dist"
10
18
  ],
@@ -27,7 +35,7 @@
27
35
  "access": "public"
28
36
  },
29
37
  "dependencies": {
30
- "@editora/icons": "^0.1.2"
38
+ "@editora/icons": "^0.1.3"
31
39
  },
32
40
  "keywords": [
33
41
  "editora",