@meonode/ui 1.3.0-beta.1 → 1.4.0
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/cjs/components/portal-provider.client.cjs +1 -1
- package/dist/cjs/components/style-registry.cjs +1 -0
- package/dist/cjs/components/style-registry.client.cjs +1 -1
- package/dist/cjs/components/styled-renderer.client.cjs +1 -1
- package/dist/cjs/components/theme-provider.client.cjs +1 -1
- package/dist/cjs/core.node.cjs +1 -1
- package/dist/cjs/hoc/component.hoc.cjs +1 -1
- package/dist/cjs/main.cjs +1 -1
- package/dist/cjs/nextjs-registry/index.cjs +1 -1
- package/dist/cjs/node_modules/@emotion/hash/dist/emotion-hash.esm.cjs +1 -0
- package/dist/cjs/node_modules/@emotion/memoize/dist/emotion-memoize.esm.cjs +1 -0
- package/dist/cjs/node_modules/@emotion/serialize/dist/emotion-serialize.esm.cjs +1 -0
- package/dist/cjs/node_modules/@emotion/unitless/dist/emotion-unitless.esm.cjs +1 -0
- package/dist/cjs/node_modules/@emotion/utils/dist/emotion-utils.esm.cjs +1 -0
- package/dist/cjs/util/node.util.cjs +1 -1
- package/dist/cjs/util/server-emotion.util.cjs +1 -0
- package/dist/cjs/util/server-theme.util.cjs +1 -0
- package/dist/esm/components/portal-provider.client.js +1 -1
- package/dist/esm/components/style-registry.client.d.ts.map +1 -1
- package/dist/esm/components/style-registry.client.js +1 -1
- package/dist/esm/components/style-registry.d.ts +5 -0
- package/dist/esm/components/style-registry.d.ts.map +1 -0
- package/dist/esm/components/style-registry.js +1 -0
- package/dist/esm/components/styled-renderer.client.d.ts +1 -1
- package/dist/esm/components/styled-renderer.client.d.ts.map +1 -1
- package/dist/esm/components/styled-renderer.client.js +1 -1
- package/dist/esm/components/theme-provider.client.js +1 -1
- package/dist/esm/core.node.d.ts.map +1 -1
- package/dist/esm/core.node.js +1 -1
- package/dist/esm/hoc/component.hoc.js +1 -1
- package/dist/esm/main.d.ts +1 -0
- package/dist/esm/main.d.ts.map +1 -1
- package/dist/esm/main.js +1 -1
- package/dist/esm/nextjs-registry/index.d.ts +1 -4
- package/dist/esm/nextjs-registry/index.d.ts.map +1 -1
- package/dist/esm/nextjs-registry/index.js +1 -1
- package/dist/esm/node_modules/@emotion/hash/dist/emotion-hash.esm.js +1 -0
- package/dist/esm/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +1 -0
- package/dist/esm/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +1 -0
- package/dist/esm/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +1 -0
- package/dist/esm/node_modules/@emotion/utils/dist/emotion-utils.esm.js +1 -0
- package/dist/esm/types/node.type.d.ts +2 -0
- package/dist/esm/types/node.type.d.ts.map +1 -1
- package/dist/esm/util/node.util.d.ts +9 -6
- package/dist/esm/util/node.util.d.ts.map +1 -1
- package/dist/esm/util/node.util.js +1 -1
- package/dist/esm/util/server-emotion.util.d.ts +16 -0
- package/dist/esm/util/server-emotion.util.d.ts.map +1 -0
- package/dist/esm/util/server-emotion.util.js +1 -0
- package/dist/esm/util/server-theme.util.d.ts +10 -0
- package/dist/esm/util/server-theme.util.d.ts.map +1 -0
- package/dist/esm/util/server-theme.util.js +1 -0
- package/package.json +8 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../core.node.cjs"),t=require("../helper/data-channel.helper.cjs");const a=e.createContext(null);
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../core.node.cjs"),t=require("../helper/data-channel.helper.cjs");const a=e.createContext(null);function l({children:l}){const[c,o]=e.useState([]),s=e.useRef(0),n=e.useCallback((e,r)=>{const a=++s.current,l=t.createDataChannel(r);return o(r=>[...r,{id:a,Component:e,channel:l}]),{id:a,updateData:e=>l.set(e),close:()=>o(e=>e.filter(e=>e.id!==a))}},[]),u=e.useCallback(()=>{o(e=>e.slice(0,-1))},[]),d=e.useCallback(e=>{o(r=>r.filter(r=>r.id!==e))},[]),i=e.useCallback(()=>{o([])},[]),h=e.useMemo(()=>({stack:c,showPortal:n,hidePortal:u,hidePortalById:d,hideAll:i}),[c,n,u,d,i]);return r.Node(a.Provider,{value:h,children:l}).render()}l.__meonodeAcceptsServerCss=!0,exports.PortalContext=a,exports.default=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./style-registry.client.cjs");const r=require("../core.node.cjs").createNode(e.default);exports.StyleRegistry=r;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@emotion/react"),t=require("@emotion/cache"),n=require("../core.node.cjs"),o=require("next/navigation.js")
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@emotion/react"),t=require("@emotion/cache"),n=require("../core.node.cjs"),o=require("next/navigation.js"),i=require("../util/server-emotion.util.cjs"),s=require("../util/server-theme.util.cjs");function a({children:a}){const[c]=e.useState(()=>{const e="undefined"==typeof window?i.getServerEmotionCache():t({key:"meonode-css"});return e.compat=!0,e}),[d]=e.useState(()=>new Set);return o.useServerInsertedHTML(()=>{const r=Object.keys(c.inserted).filter(e=>!d.has(e)&&"string"==typeof c.inserted[e]),t=i.consumeServerEmotionRules().filter(e=>!d.has(e.id)),n=s.consumeServerThemeVariablesCss(),o=n&&!d.has(n.id)?[n]:[];if(0===r.length&&0===t.length&&0===o.length)return null;r.forEach(e=>d.add(e)),t.forEach(e=>d.add(e.id)),o.forEach(e=>d.add(e.id));const a=Array.from(new Set([...r,...t.map(e=>e.id),...o.map(e=>e.id)])).sort(),u=new Map([...t,...o].map(e=>[e.id,e.cssText])),l=a.map(e=>{const r=u.get(e);if("string"==typeof r)return r;const t=c.inserted[e];return"string"==typeof t?t:""}).filter(Boolean).join(""),m=a.join(" ");return e.createElement("style",{"data-emotion":`${c.key} ${m}`,dangerouslySetInnerHTML:{__html:l}})}),n.Node(r.CacheProvider,{value:c,children:a}).render()}a.__meonodeAcceptsServerCss=!0,exports.default=a;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@emotion/react"),r=require("./theme-provider.client.cjs"),s=require("../util/theme.util.cjs");function i({element:i,children:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@emotion/react"),r=require("./theme-provider.client.cjs"),s=require("../util/theme.util.cjs");function i({element:i,children:o,...c}){const l=e.useContext(r.ThemeContext),n=l?.theme,{css:u,...m}=c;let h=u,a=m;n&&(h=s.ThemeUtil.resolveObjWithTheme(u,n,{processFunctions:!0}),a=s.ThemeUtil.resolveObjWithTheme(m,n,{processFunctions:!1}));const d=s.ThemeUtil.resolveDefaultStyle(h);return t.jsx(i,{...a,css:d},o)}i.displayName="Styled",i.__meonodeAcceptsServerCss=!0,exports.default=i;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../core.node.cjs");const r=e.createContext(null);
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../core.node.cjs");const r=e.createContext(null);function o({children:o,theme:n}){const[c,s]=e.useState(n);if(!n)throw new Error("`theme` prop must be defined");const d={theme:c,setTheme:e=>{"function"==typeof e&&(e=e(c)),document.cookie=`theme=${e.mode}; path=/;`,s(e)}};return t.Node(r.Provider,{value:d,children:o}).render()}o.__meonodeAcceptsServerCss=!0,o.__meonodeProvidesServerTheme=!0,exports.ThemeContext=r,exports.default=o;
|
package/dist/cjs/core.node.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("./helper/react-is.helper.cjs"),n=require("./helper/common.helper.cjs"),r=require("./components/styled-renderer.client.cjs"),s=require("./constant/common.const.cjs"),o=require("./util/mount-tracker.util.cjs"),i=require("./components/meonode-unmounter.client.cjs"),
|
|
1
|
+
"use strict";var e=require("react"),t=require("./helper/react-is.helper.cjs"),n=require("./helper/common.helper.cjs"),r=require("./components/styled-renderer.client.cjs"),s=require("./constant/common.const.cjs"),o=require("./util/mount-tracker.util.cjs"),i=require("./components/meonode-unmounter.client.cjs"),l=require("./util/navigation-cache-manager.util.cjs"),a=require("./util/node.util.cjs"),c=require("./util/server-emotion.util.cjs"),d=require("./util/server-theme.util.cjs"),h=require("./util/theme.util.cjs");const u=Symbol.for("@meonode/ui/BaseNode/elementCache"),m=Symbol.for("@meonode/ui/BaseNode/navigationStarted"),p=Symbol.for("@meonode/ui/BaseNode/renderContextPool"),g=Symbol.for("@meonode/ui/BaseNode/cacheCleanupRegistry");class f{static _idCounter=0;instanceId="m"+ ++f._idCounter;element;rawProps={};isBaseNode=!0;_props;_deps;stableKey;lastPropsObj;lastSignature;static get elementCache(){return n.getGlobalState(u,()=>new Map)}static get _navigationStarted(){return n.getGlobalState(m,()=>({value:!1})).value}static set _navigationStarted(e){n.getGlobalState(m,()=>({value:!1})).value=e}static get renderContextPool(){return n.getGlobalState(p,()=>[])}static acquireRenderContext(){const e=f.renderContextPool;return e.length>0?e.pop():{workStack:new Array(512),renderedElements:new Map}}static releaseRenderContext(e){f.renderContextPool.length<50&&e.workStack.length<2048&&(e.workStack.length=0,e.renderedElements.clear(),f.renderContextPool.push(e))}constructor(e,r={},s){if(!t.isValidElementType(e)){const t=n.getComponentType(e);if(a.NodeUtil.isNodeInstance(e))throw new Error("Invalid element type: MeoNode UI instance provided!");throw new Error(`Invalid element type: ${t} provided!`)}if(this.element=e,this.rawProps=r,this._deps=s,a.NodeUtil.isServer&&a.NodeUtil.providesServerTheme(e)){const e=r.theme;if(e&&"object"==typeof e&&"system"in e){const t=e;d.setActiveServerTheme(t),d.registerServerThemeVariables(t)}}const{ref:o,children:i,...c}=r;this.stableKey=this._getStableKey(c),a.NodeUtil.isServer||f._navigationStarted||(l.NavigationCacheManagerUtil.getInstance().start(),f._navigationStarted=!0)}get props(){return this._props||(this._props=a.NodeUtil.processProps(this.rawProps,this.stableKey)),this._props}get dependencies(){return this._deps}_getStableKey({key:e,...t}){if(a.NodeUtil.isServer)return;if(this.lastPropsObj===t)return this.lastSignature;this.lastPropsObj=t;const r=Object.keys(t),o=r.length;if(o>100){const e=a.NodeUtil.extractCriticalProps(t,r);this.lastSignature=a.NodeUtil.createPropSignature(this.element,e),s.__DEBUG__&&o>200&&console.warn(`MeoNode: Large props (${o} keys) on "${n.getElementTypeName(this.element)}". Consider splitting.`)}else this.lastSignature=a.NodeUtil.createPropSignature(this.element,t);return null!=e?`${String(e)}:${this.lastSignature}`:this.lastSignature}static get cacheCleanupRegistry(){return n.getGlobalState(g,()=>new FinalizationRegistry(e=>{const{cacheKey:t,instanceId:n}=e,r=f.elementCache.get(t);r?.instanceId===n&&f.elementCache.delete(t),o.MountTrackerUtil.isMounted(t)&&o.MountTrackerUtil.untrackMount(t)}))}render(s=!1){const o=a.NodeUtil.shouldCacheElement(this)?f.elementCache.get(this.stableKey):void 0,l=a.NodeUtil.shouldNodeUpdate(o?.prevDeps,this._deps,s);if(!l&&o?.renderedElement)return o.accessCount+=1,o.renderedElement;const u=!l,m=f.acquireRenderContext();let{workStack:p}=m;const{renderedElements:g}=m;let y=0;try{const s=e=>{if(e>p.length){const t=Math.max(e,p.length<<1),n=new Array(t);for(let e=0;e<y;e++)n[e]=p[e];p=n}};for(p[y++]={node:this,isProcessed:!1,blocked:u,theme:void 0};y>0;){const o=p[y-1];if(!o){y--;continue}const{node:i,isProcessed:l,blocked:u,theme:m}=o,C=(e,t)=>{const n=e.theme;return n&&"object"==typeof n&&"system"in n?n:t??d.getActiveServerTheme()},N=e=>{if(!e)return!1;if("string"==typeof e)return e.includes("theme.");if("function"==typeof e)return!0;if("object"!=typeof e)return!1;if(Array.isArray(e)){for(const t of e)if(N(t))return!0;return!1}for(const t of Object.values(e))if(N(t))return!0;return!1};if(l){y--;const{children:s,key:o,css:l,nativeProps:u,disableEmotion:p,...v}=i.props,S=C(i.props,m);let b=[];if(s){const e=Array.isArray(s)?s:[s],t=e.length;b=new Array(t);for(let n=0;n<t;n++){const t=e[n];if(a.NodeUtil.isNodeInstance(t)){const e=g.get(t);if(!e)throw new Error(`[MeoNode] Missing rendered element for child node: ${t.stableKey}`);b[n]=e}else b[n]=t}}const _={...v,key:o,...u};let U;if(i.element===e.Fragment||t.isFragment(i.element))U=e.createElement(i.element,{key:o},...b);else{const t=!p&&(l||!n.hasNoStyleTag(i.element)),s=a.NodeUtil.isServer&&"string"!=typeof i.element,o=t&&s&&a.NodeUtil.isClientReference(i.element)&&N(l);if(t&&!s||o)U=e.createElement(r.default,{element:i.element,..._,css:l,suppressHydrationWarning:!0},...b);else if(t&&s&&!a.NodeUtil.acceptsServerCss(i.element)){const t=h.ThemeUtil.resolveObjWithTheme(l,S,{processFunctions:!0}),n=h.ThemeUtil.resolveDefaultStyle(t),r=c.compileServerEmotionClassName(d.replaceThemeTokensWithCssVars(n)),s=[_.className,r].filter(Boolean).join(" ")||void 0,o=s?{..._,className:s}:_;U=e.createElement(i.element,o,...b)}else{const n=t&&(!s||a.NodeUtil.acceptsServerCss(i.element))?{..._,css:l}:_;U=e.createElement(i.element,n,...b)}}if(i!==this&&a.NodeUtil.shouldCacheElement(i)){const e=f.elementCache.get(i.stableKey);if(e)e.prevDeps=i._deps,e.renderedElement=U,e.accessCount+=1;else{const e={prevDeps:i._deps,renderedElement:U,nodeRef:new WeakRef(i),createdAt:Date.now(),accessCount:1,instanceId:i.instanceId};f.elementCache.set(i.stableKey,e),f.cacheCleanupRegistry.register(i,{cacheKey:i.stableKey,instanceId:i.instanceId},i)}}g.set(i,U)}else{o.isProcessed=!0;const e=i.props.children,t=C(i.props,m);if(e){const n=Array.isArray(e)?e:[e];let r=0;for(let e=0;e<n.length;e++)a.NodeUtil.isNodeInstance(n[e])&&r++;s(y+r);for(let e=n.length-1;e>=0;e--){const r=n[e];if(!a.NodeUtil.isNodeInstance(r))continue;const s=a.NodeUtil.shouldCacheElement(r)?f.elementCache.get(r.stableKey):void 0,o=a.NodeUtil.shouldNodeUpdate(s?.prevDeps,r._deps,u);if(!o&&s?.renderedElement){g.set(r,s.renderedElement);continue}const i=u||!o;p[y++]={node:r,isProcessed:!1,blocked:i,theme:t}}}}}let o=g.get(this);if(!a.NodeUtil.isServer&&this.stableKey&&(o=e.createElement(i.default,{node:this},o)),a.NodeUtil.shouldCacheElement(this)){const e=f.elementCache.get(this.stableKey);if(e)e.prevDeps=this._deps,e.renderedElement=o,e.accessCount+=1;else{const e={prevDeps:this._deps,renderedElement:o,nodeRef:new WeakRef(this),createdAt:Date.now(),accessCount:1,instanceId:this.instanceId};f.elementCache.set(this.stableKey,e),f.cacheCleanupRegistry.register(this,{cacheKey:this.stableKey,instanceId:this.instanceId},this)}}return o}finally{for(let e=0;e<y;e++)p[e]=null;f.releaseRenderContext({workStack:p,renderedElements:g})}}static clearCaches(){const e=Array.from(f.elementCache.keys());s.__DEBUG__&&console.log(`[MeoNode] clearCaches: Clearing ${e.length} entries`);for(const t of e){const e=f.elementCache.get(t);if(e){const n=e.nodeRef?.deref();if(n)try{f.cacheCleanupRegistry.unregister(n),n.lastSignature=void 0,n.lastPropsObj=void 0}catch{s.__DEBUG__&&console.warn(`[MeoNode] Could not unregister ${t} from FinalizationRegistry`)}}}f.elementCache.clear(),o.MountTrackerUtil.cleanup(),s.__DEBUG__&&console.log("[MeoNode] All caches cleared")}}function y(e,t={},n){return new f(e,t,n)}y.clearCaches=f.clearCaches,exports.BaseNode=f,exports.Node=y,exports.createChildrenFirstNode=function(e,t){const n=(n,r,s)=>y(e,{...t,...r,children:n},s);return n.element=e,n},exports.createNode=function(e,t){const n=(n,r)=>y(e,{...t,...n},r);return n.element=e,n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../core.node.cjs"),r=require("../helper/common.helper.cjs"),n=require("../util/node.util.cjs");exports.Component=function(o){const t=r.getElementTypeName(o),s=r=>{const t=o(r);return t instanceof e.BaseNode||n.NodeUtil.isNodeInstance(t)?e.Node(t.element,t.rawProps).render():t};function
|
|
1
|
+
"use strict";var e=require("../core.node.cjs"),r=require("../helper/common.helper.cjs"),n=require("../util/node.util.cjs");exports.Component=function(o){const t=r.getElementTypeName(o),s=r=>{const t=o(r);return t instanceof e.BaseNode||n.NodeUtil.isNodeInstance(t)?e.Node(t.element,t.rawProps).render():t};function c(r={},n){return e.Node(s,r,n).render()}return s.displayName=`Renderer(${t})`,s.__meonodeAcceptsServerCss=!0,c.displayName=`Component(${t})`,c.__meonodeAcceptsServerCss=!0,c};
|
package/dist/cjs/main.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./constant/common.const.cjs"),t=require("./helper/data-channel.helper.cjs"),r=require("./core.node.cjs"),o=require("./hoc/component.hoc.cjs");require("react");var s=require("./components/react.node.cjs"),p=require("./components/html.node.cjs"),x=require("./components/theme-provider.cjs"),a=require("./components/portal-provider.cjs"),
|
|
1
|
+
"use strict";var e=require("./constant/common.const.cjs"),t=require("./helper/data-channel.helper.cjs"),r=require("./core.node.cjs"),o=require("./hoc/component.hoc.cjs");require("react");var s=require("./components/react.node.cjs"),p=require("./components/html.node.cjs"),x=require("./components/theme-provider.cjs"),a=require("./components/style-registry.cjs"),i=require("./components/portal-provider.cjs"),n=require("./components/portal-host.cjs"),l=require("./hook/useTheme.cjs"),S=require("./hook/usePortal.cjs"),c=require("./hook/useDataChannel.cjs");exports.setDebugMode=e.setDebugMode,exports.createDataChannel=t.createDataChannel,exports.Node=r.Node,exports.createChildrenFirstNode=r.createChildrenFirstNode,exports.createNode=r.createNode,exports.Component=o.Component,exports.Activity=s.Activity,exports.Fragment=s.Fragment,exports.Suspense=s.Suspense,exports.A=p.A,exports.Abbr=p.Abbr,exports.Absolute=p.Absolute,exports.Address=p.Address,exports.Area=p.Area,exports.Article=p.Article,exports.Aside=p.Aside,exports.Audio=p.Audio,exports.B=p.B,exports.Base=p.Base,exports.Bdi=p.Bdi,exports.Bdo=p.Bdo,exports.Blockquote=p.Blockquote,exports.Body=p.Body,exports.Br=p.Br,exports.Button=p.Button,exports.Canvas=p.Canvas,exports.Caption=p.Caption,exports.Center=p.Center,exports.Cite=p.Cite,exports.Code=p.Code,exports.Col=p.Col,exports.Colgroup=p.Colgroup,exports.Column=p.Column,exports.Container=p.Container,exports.Data=p.Data,exports.Datalist=p.Datalist,exports.Dd=p.Dd,exports.Details=p.Details,exports.Dfn=p.Dfn,exports.Dialog=p.Dialog,exports.Div=p.Div,exports.Dl=p.Dl,exports.Dt=p.Dt,exports.Em=p.Em,exports.Embed=p.Embed,exports.Fieldset=p.Fieldset,exports.Figcaption=p.Figcaption,exports.Figure=p.Figure,exports.Fixed=p.Fixed,exports.Footer=p.Footer,exports.Form=p.Form,exports.Grid=p.Grid,exports.H1=p.H1,exports.H2=p.H2,exports.H3=p.H3,exports.H4=p.H4,exports.H5=p.H5,exports.H6=p.H6,exports.Head=p.Head,exports.Header=p.Header,exports.Hgroup=p.Hgroup,exports.Hr=p.Hr,exports.Html=p.Html,exports.I=p.I,exports.Iframe=p.Iframe,exports.Img=p.Img,exports.Input=p.Input,exports.Kbd=p.Kbd,exports.Label=p.Label,exports.Legend=p.Legend,exports.Li=p.Li,exports.Link=p.Link,exports.Main=p.Main,exports.MapElement=p.MapElement,exports.Mark=p.Mark,exports.Menu=p.Menu,exports.Meta=p.Meta,exports.Meter=p.Meter,exports.Nav=p.Nav,exports.Noscript=p.Noscript,exports.ObjectElement=p.ObjectElement,exports.Ol=p.Ol,exports.Optgroup=p.Optgroup,exports.Option=p.Option,exports.Output=p.Output,exports.P=p.P,exports.Param=p.Param,exports.Picture=p.Picture,exports.Pre=p.Pre,exports.Progress=p.Progress,exports.Q=p.Q,exports.Relative=p.Relative,exports.Root=p.Root,exports.Row=p.Row,exports.Rp=p.Rp,exports.Rt=p.Rt,exports.Ruby=p.Ruby,exports.S=p.S,exports.Samp=p.Samp,exports.Script=p.Script,exports.Search=p.Search,exports.Section=p.Section,exports.Select=p.Select,exports.Small=p.Small,exports.Source=p.Source,exports.Span=p.Span,exports.Static=p.Static,exports.Sticky=p.Sticky,exports.Strong=p.Strong,exports.Style=p.Style,exports.Sub=p.Sub,exports.Summary=p.Summary,exports.Sup=p.Sup,exports.Svg=p.Svg,exports.SvgCircle=p.SvgCircle,exports.SvgDefs=p.SvgDefs,exports.SvgEllipse=p.SvgEllipse,exports.SvgG=p.SvgG,exports.SvgLine=p.SvgLine,exports.SvgLinearGradient=p.SvgLinearGradient,exports.SvgPath=p.SvgPath,exports.SvgPolygon=p.SvgPolygon,exports.SvgPolyline=p.SvgPolyline,exports.SvgRadialGradient=p.SvgRadialGradient,exports.SvgRect=p.SvgRect,exports.SvgStop=p.SvgStop,exports.SvgSymbol=p.SvgSymbol,exports.SvgText=p.SvgText,exports.SvgTspan=p.SvgTspan,exports.SvgUse=p.SvgUse,exports.Table=p.Table,exports.Tbody=p.Tbody,exports.Td=p.Td,exports.Template=p.Template,exports.Text=p.Text,exports.Textarea=p.Textarea,exports.Tfoot=p.Tfoot,exports.Th=p.Th,exports.Thead=p.Thead,exports.Time=p.Time,exports.Title=p.Title,exports.Tr=p.Tr,exports.Track=p.Track,exports.U=p.U,exports.Ul=p.Ul,exports.Var=p.Var,exports.Video=p.Video,exports.Wbr=p.Wbr,exports.ThemeProvider=x.ThemeProvider,exports.StyleRegistry=a.StyleRegistry,exports.PortalProvider=i.PortalProvider,exports.PortalHost=n.PortalHost,exports.useTheme=l.useTheme,exports.usePortal=S.usePortal,exports.useDataChannel=c.useDataChannel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../components/style-registry.
|
|
1
|
+
"use strict";var e=require("../components/style-registry.cjs");exports.StyleRegistry=e.StyleRegistry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(e){for(var t,r=0,c=0,o=e.length;o>=4;++c,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(c+2))<<16;case 2:r^=(255&e.charCodeAt(c+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(c)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../hash/dist/emotion-hash.esm.cjs"),r=require("../../unitless/dist/emotion-unitless.esm.cjs"),t=require("../../memoize/dist/emotion-memoize.esm.cjs"),n=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,i=function(e){return 45===e.charCodeAt(1)},s=function(e){return null!=e&&"boolean"!=typeof e},o=t.default(function(e){return i(e)?e:e.replace(n,"-$&").toLowerCase()}),l=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(a,function(e,r,t){return f={name:r,styles:t,next:f},r})}return 1===r.default[e]||i(e)||"number"!=typeof t||0===t?t:t+"px"};function u(e,r,t){if(null==t)return"";var n=t;if(void 0!==n.__emotion_styles)return n;switch(typeof t){case"boolean":return"";case"object":var a=t;if(1===a.anim)return f={name:a.name,styles:a.styles,next:f},a.name;var i=t;if(void 0!==i.styles){var v=i.next;if(void 0!==v)for(;void 0!==v;)f={name:v.name,styles:v.styles,next:f},v=v.next;return i.styles+";"}return function(e,r,t){var n="";if(Array.isArray(t))for(var a=0;a<t.length;a++)n+=u(e,r,t[a])+";";else for(var i in t){var f=t[i];if("object"!=typeof f){var v=f;null!=r&&void 0!==r[v]?n+=i+"{"+r[v]+"}":s(v)&&(n+=o(i)+":"+l(i,v)+";")}else if(!Array.isArray(f)||"string"!=typeof f[0]||null!=r&&void 0!==r[f[0]]){var c=u(e,r,f);switch(i){case"animation":case"animationName":n+=o(i)+":"+c+";";break;default:n+=i+"{"+c+"}"}}else for(var m=0;m<f.length;m++)s(f[m])&&(n+=o(i)+":"+l(i,f[m])+";")}return n}(e,r,t)}var c=t;if(null==r)return c;var m=r[c];return void 0!==m?m:c}var f,v=/label:\s*([^\s;{]+)\s*(;|$)/g;exports.serializeStyles=function(r,t,n){if(1===r.length&&"object"==typeof r[0]&&null!==r[0]&&void 0!==r[0].styles)return r[0];var a=!0,i="";f=void 0;var s=r[0];null==s||void 0===s.raw?(a=!1,i+=u(n,t,s)):i+=s[0];for(var o=1;o<r.length;o++){if(i+=u(n,t,r[o]),a)i+=s[o]}v.lastIndex=0;for(var l,c="";null!==(l=v.exec(i));)c+="-"+l[1];return{name:e.default(i)+c,styles:i,next:f}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e="undefined"!=typeof document,t=function(e,t,r){var i=e.key+"-"+t.name;void 0===e.registered[i]&&(e.registered[i]=t.styles)};exports.insertStyles=function(r,i,n){t(r,i);var s=r.key+"-"+i.name;if(void 0===r.inserted[i.name]){var d="",o=i;do{var v=r.insert(i===o?"."+s:"",o,r.sheet,!0);e||void 0===v||(d+=v),o=o.next}while(void 0!==o);if(!e&&0!==d.length)return d}},exports.registerStyles=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("../helper/react-is.helper.cjs"),o=require("../helper/common.helper.cjs"),
|
|
1
|
+
"use strict";var e=require("react"),t=require("../helper/react-is.helper.cjs"),o=require("../helper/common.helper.cjs"),r=require("../constant/common.const.cjs"),n=require("../core.node.cjs");const s=Symbol.for("@meonode/ui/NodeUtil/functionSignatureCache");class i{constructor(){}static isServer="undefined"==typeof window;static get _functionSignatureCache(){return o.getGlobalState(s,()=>new WeakMap)}static CRITICAL_PROPS=new Set(["css","className","disableEmotion","props"]);static _propFuncCache=new WeakMap;static isClientReference(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&e.$$typeof===Symbol.for("react.client.reference")}static acceptsServerCss(e){return"function"==typeof e&&!0===e.__meonodeAcceptsServerCss}static providesServerTheme(e){return"function"==typeof e&&!0===e.__meonodeProvidesServerTheme}static isNodeInstance=e=>e instanceof n.BaseNode;static isStyleProp=i.isServer||"undefined"==typeof document?()=>!1:e=>e in document.body.style;static hashString(e){let t=2166136261,o=5381;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t^=n,t=Math.imul(t,16777619),o=Math.imul(o,33)^n}return`${(t>>>0).toString(36)}_${(o>>>0).toString(36)}`}static hashCSS(e){const t=Object.keys(e);let o=t.length;for(let r=0;r<Math.min(t.length,10);r++){const n=t[r],s=e[n];o=(o<<5)-o+n.charCodeAt(0),o&=o,"string"==typeof s&&(o=(o<<5)-o+s.length)}return o.toString(36)}static createPropSignature(e,t){if(i.isServer)return;const r=o.getElementTypeName(e),n=Object.keys(t);n.length>1&&n.sort();const s=[`${r}:`];if("function"==typeof e){let t=i._functionSignatureCache.get(e);t||(t=i.hashString(e.toString()),i._functionSignatureCache.set(e,t)),s.push(t)}for(const e of n){const o=t[e];let r;const n=typeof o;if("string"===n||"number"===n||"boolean"===n)r=`${e}:${o};`;else if(null===o)r=`${e}:null;`;else if(void 0===o)r=`${e}:undefined;`;else if("css"===e&&"object"==typeof o)r=`css:${this.hashCSS(o)};`;else if(Array.isArray(o)){const t=o.filter(e=>{const t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===e});r=t.length===o.length?`${e}:[${t.join(",")}];`:`${e}:[${o.length}];`}else if(o&&o.isBaseNode)r=`${e}:${o.stableKey};`;else if("function"===n){let t=i._propFuncCache.get(o);t||(t=i.hashString(o.toString()),i._propFuncCache.set(o,t)),r=`${e}:${t};`}else{r=`${e}:{${Object.keys(o).sort().join(",")}};`}s.push(r)}return i.hashString(s.join(","))}static extractCriticalProps(e,t){const o={_keyCount:t.length};let r=0;for(const n of t){if(r>=50)break;if(i.CRITICAL_PROPS.has(n)){o[n]=e[n],r++;continue}const s=n.charCodeAt(0);111!==s||110!==n.charCodeAt(1)?!(97===s&&114===n.charCodeAt(1)&&105===n.charCodeAt(2)&&97===n.charCodeAt(3)||100===s&&97===n.charCodeAt(1)&&116===n.charCodeAt(2)&&97===n.charCodeAt(3))?t.length<=100&&i.isStyleProp(n)&&(o[n]=e[n],r++):(o[n]=e[n],r++):(o[n]=e[n],r++)}return o}static processProps(e={},t){const{ref:r,key:n,children:s,css:c,props:a={},disableEmotion:d,...l}=e;if(0===Object.keys(l).length&&!c)return o.omitUndefined({ref:r,key:n,disableEmotion:d,nativeProps:o.omitUndefined(a),children:i._processChildren(s,d)});const p={},f={},u=Object.keys(l);for(let e=0;e<u.length;e++){const t=u[e],o=l[t],r=typeof o;"string"===r||"number"===r||"boolean"===r?p[t]=o:f[t]=o}const h=o.getCSSProps(p),y=o.getCSSProps(f),m=o.getDOMProps(l),g={...h,...y,...c},b=i._processChildren(s,d,t);return o.omitUndefined({ref:r,key:n,css:g,...m,disableEmotion:d,nativeProps:o.omitUndefined(a),children:b})}static _processChildren(e,t,o){if(e)return"function"==typeof e?e:Array.isArray(e)?1===e.length?i.processRawNode(e[0],t,`${o}_0`):e.map((e,r)=>i.processRawNode(e,t,`${o}_${r}`)):i.processRawNode(e,t,o)}static shouldCacheElement(e){return!i.isServer&&!!e.stableKey&&!!e.dependencies}static shouldNodeUpdate(e,t,o){if(i.isServer)return!0;if(o)return!1;if(void 0===t)return!0;if(void 0===e)return!0;if(t.length!==e.length)return!0;for(let o=0;o<t.length;o++)if(!Object.is(t[o],e[o]))return!0;return!1}static processRawNode(o,r,s){if(null==o||"string"==typeof o||"number"==typeof o||"boolean"==typeof o)return o;if(i.isNodeInstance(o)){if(s||r&&!o.rawProps.disableEmotion){const e=new n.BaseNode(o.element,o.rawProps,o.dependencies);return e.stableKey=`${s}:${e.stableKey}`,r&&!e.rawProps.disableEmotion&&(e.rawProps.disableEmotion=!0),e}return o}if(i.isFunctionChild(o))return new n.BaseNode(i.functionRenderer,{props:{render:o,disableEmotion:r}},void 0);if(e.isValidElement(o)){if("string"==typeof o.type){const{style:e,...t}=o.props,s={...t,...e||{}};return new n.BaseNode(o.type,{...s,...null!==o.key&&void 0!==o.key?{key:o.key}:{},disableEmotion:r},void 0)}return new n.BaseNode(o.type,{...o.props,...null!==o.key&&void 0!==o.key?{key:o.key}:{},disableEmotion:r},void 0)}return t.isReactClassComponent(o)||t.isMemo(o)||t.isForwardRef(o)?new n.BaseNode(o,{disableEmotion:r},void 0):o instanceof e.Component?i.processRawNode(o.render(),r,s):o}static isFunctionChild(e){if("function"!=typeof e||t.isReactClassComponent(e)||t.isMemo(e)||t.isForwardRef(e))return!1;try{return!(e.prototype&&"function"==typeof e.prototype.render)}catch(e){return r.__DEBUG__&&console.error("MeoNode: Error checking if a node is a function child.",e),!0}}static functionRenderer({render:t,disableEmotion:s}){let c;try{c=t()}catch(e){r.__DEBUG__&&console.error("MeoNode: Error executing function-as-a-child.",e),c=null}if(null==c||"string"==typeof c||"number"==typeof c||"boolean"==typeof c)return c;if(i.isNodeInstance(c))return s&&!c.rawProps.disableEmotion?new n.BaseNode(c.element,{...c.rawProps,disableEmotion:!0}).render():c.render();if(Array.isArray(c)){const e=(e,t)=>{try{return`${o.getElementTypeName(e)}-${t}`}catch(e){return r.__DEBUG__&&console.error("MeoNode: Could not determine element type name for key in function-as-a-child.",e),`item-${t}`}};return c.map((t,o)=>i.renderProcessedNode({processedElement:i.processRawNode(t,s),passedKey:e(t,o),disableEmotion:s}))}if(c instanceof e.Component)return i.renderProcessedNode({processedElement:i.processRawNode(c.render(),s),disableEmotion:s});const a=i.processRawNode(c,s);return a?i.renderProcessedNode({processedElement:a,disableEmotion:s}):c}static renderProcessedNode({processedElement:o,passedKey:r,disableEmotion:s}){const c={};if(void 0!==r&&(c.key=r),i.isNodeInstance(o)){const e=o.rawProps?.key;return o.rawProps.disableEmotion=s,e===r?o.render():new n.BaseNode(o.element,{...o.rawProps,...c}).render()}return t.isReactClassComponent(o)?new n.BaseNode(o,{...c,disableEmotion:s}).render():o instanceof e.Component?o.render():"function"==typeof o?e.createElement(o,{key:r}):o}}exports.NodeUtil=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@emotion/cache"),o=require("../node_modules/@emotion/serialize/dist/emotion-serialize.esm.cjs"),t=require("../node_modules/@emotion/utils/dist/emotion-utils.esm.cjs"),r=require("../helper/common.helper.cjs");const n=Symbol.for("@meonode/ui/serverEmotionCache"),s=Symbol.for("@meonode/ui/serverEmotionRules");function i(){return r.getGlobalState(n,()=>e({key:"meonode-css"}))}function m(){return r.getGlobalState(s,()=>({byId:new Map}))}exports.compileServerEmotionClassName=function(e){if(!e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return;const r=i(),n=o.serializeStyles([e],r.registered),s=t.insertStyles(r,n),u=r.inserted[n.name],a="string"==typeof s?s:"string"==typeof u?u:void 0;if(a){const e=m();e.byId.has(n.name)||e.byId.set(n.name,a)}return`${r.key}-${n.name}`},exports.consumeServerEmotionRules=function(){const e=m();if(0===e.byId.size)return[];const o=Array.from(e.byId.entries()).map(([e,o])=>({id:e,cssText:o}));return e.byId.clear(),o},exports.getServerEmotionCache=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../helper/common.helper.cjs");const t=Symbol.for("@meonode/ui/serverActiveTheme"),r=Symbol.for("@meonode/ui/serverThemeVariables");function o(e){return`--meonode-theme-${e.replace(/[^\w.-]/g,"-").replace(/\./g,"-")}`}function n(){return e.getGlobalState(r,()=>({byName:new Map}))}exports.consumeServerThemeVariablesCss=function(){const e=n();if(0===e.byName.size)return;const t=Array.from(e.byName.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}:${t};`).join("");return e.byName.clear(),t?{id:"theme-vars",cssText:`:root{${t}}`}:void 0},exports.getActiveServerTheme=function(){return e.getGlobalState(t,()=>({})).activeTheme},exports.registerServerThemeVariables=function(e){if(!e?.system||"object"!=typeof e.system)return;const t=n(),r=[{path:"",value:e.system}];for(;r.length>0;){const e=r.pop();if(!e||!e.value||"object"!=typeof e.value)continue;const n=e.value;for(const[s,a]of Object.entries(n)){const n=e.path?`${e.path}.${s}`:s;if(null!=a)if("string"!=typeof a&&"number"!=typeof a&&"boolean"!=typeof a){if("object"==typeof a){const e=a.default;"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e||t.byName.set(o(n),String(e)),r.push({path:n,value:a})}}else t.byName.set(o(n),String(a))}}},exports.replaceThemeTokensWithCssVars=function(e){const t=e=>e.replace(/theme\.([a-zA-Z0-9_.-]+)/g,(e,t)=>`var(${o(t)})`),r=e=>{if("string"==typeof e)return t(e);if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>r(e));const o={};for(const[n,s]of Object.entries(e)){o[t(n)]=r(s)}return o};return r(e)},exports.setActiveServerTheme=function(r){e.getGlobalState(t,()=>({})).activeTheme=r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{createContext as e,useState as r,useRef as t,useCallback as o,useMemo as
|
|
2
|
+
import{createContext as e,useState as r,useRef as t,useCallback as o,useMemo as n}from"react";import{Node as l}from"../core.node.js";import{createDataChannel as d}from"../helper/data-channel.helper.js";const i=e(null);function c({children:e}){const[c,a]=r([]),s=t(0),h=o((e,r)=>{const t=++s.current,o=d(r);return a(r=>[...r,{id:t,Component:e,channel:o}]),{id:t,updateData:e=>o.set(e),close:()=>a(e=>e.filter(e=>e.id!==t))}},[]),p=o(()=>{a(e=>e.slice(0,-1))},[]),m=o(e=>{a(r=>r.filter(r=>r.id!==e))},[]),u=o(()=>{a([])},[]),f=n(()=>({stack:c,showPortal:h,hidePortal:p,hidePortalById:m,hideAll:u}),[c,h,p,m,u]);return l(i.Provider,{value:f,children:e}).render()}c.__meonodeAcceptsServerCss=!0;export{i as PortalContext,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-registry.client.d.ts","sourceRoot":"","sources":["../../../src/components/style-registry.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,YAAY,EAAY,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"style-registry.client.d.ts","sourceRoot":"","sources":["../../../src/components/style-registry.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,YAAY,EAAY,MAAM,OAAO,CAAA;AAgBlE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,uGAoD7E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useState as e,createElement as t}from"react";import{CacheProvider as
|
|
2
|
+
import{useState as e,createElement as t}from"react";import{CacheProvider as r}from"@emotion/react";import o from"@emotion/cache";import{Node as n}from"../core.node.js";import{useServerInsertedHTML as i}from"next/navigation.js";import{consumeServerEmotionRules as s,getServerEmotionCache as a}from"../util/server-emotion.util.js";import{consumeServerThemeVariablesCss as d}from"../util/server-theme.util.js";function m({children:m}){const[c]=e(()=>{const e="undefined"==typeof window?a():o({key:"meonode-css"});return e.compat=!0,e}),[f]=e(()=>new Set);return i(()=>{const e=Object.keys(c.inserted).filter(e=>!f.has(e)&&"string"==typeof c.inserted[e]),r=s().filter(e=>!f.has(e.id)),o=d(),n=o&&!f.has(o.id)?[o]:[];if(0===e.length&&0===r.length&&0===n.length)return null;e.forEach(e=>f.add(e)),r.forEach(e=>f.add(e.id)),n.forEach(e=>f.add(e.id));const i=Array.from(new Set([...e,...r.map(e=>e.id),...n.map(e=>e.id)])).sort(),a=new Map([...r,...n].map(e=>[e.id,e.cssText])),m=i.map(e=>{const t=a.get(e);if("string"==typeof t)return t;const r=c.inserted[e];return"string"==typeof r?r:""}).filter(Boolean).join(""),l=i.join(" ");return t("style",{"data-emotion":`${c.key} ${l}`,dangerouslySetInnerHTML:{__html:m}})}),n(r,{value:c,children:m}).render()}m.__meonodeAcceptsServerCss=!0;export{m as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import _StyleRegistry from '../components/style-registry.client.js';
|
|
2
|
+
export declare const StyleRegistry: (<AdditionalProps, ExactProps extends object = object>(props: import("../main").MergedProps<typeof _StyleRegistry, AdditionalProps, ExactProps>, deps?: import("../main").DependencyList) => import("../main").NodeInstance<typeof _StyleRegistry>) & {
|
|
3
|
+
element: typeof _StyleRegistry;
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=style-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-registry.d.ts","sourceRoot":"","sources":["../../../src/components/style-registry.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,0CAA0C,CAAA;AAGrE,eAAO,MAAM,aAAa;;CAA6B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"./style-registry.client.js";import{createNode as r}from"../core.node.js";const t=r(o);export{t as StyleRegistry};
|
|
@@ -2,7 +2,7 @@ import { type JSX, type ReactNode } from 'react';
|
|
|
2
2
|
import type { CssProp, NodeElement } from '../types/node.type.js';
|
|
3
3
|
export interface StyledRendererProps<E extends NodeElement> {
|
|
4
4
|
element: E;
|
|
5
|
-
children
|
|
5
|
+
children: ReactNode;
|
|
6
6
|
css: CssProp;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled-renderer.client.d.ts","sourceRoot":"","sources":["../../../src/components/styled-renderer.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAInE,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,WAAW;IACxD,OAAO,EAAE,CAAC,CAAA;IACV,QAAQ,
|
|
1
|
+
{"version":3,"file":"styled-renderer.client.d.ts","sourceRoot":"","sources":["../../../src/components/styled-renderer.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAInE,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,WAAW;IACxD,OAAO,EAAE,CAAC,CAAA;IACV,QAAQ,EAAE,SAAS,CAAA;IACnB,GAAG,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;;GASG;AACH,iBAAwB,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAChG,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,CAoB/C;kBAxBuB,cAAc;;;eAAd,cAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useContext as e}from"react";import{jsx as t}from"@emotion/react";import{ThemeContext as o}from"./theme-provider.client.js";import{ThemeUtil as r}from"../util/theme.util.js";function s({element:s,children:i
|
|
2
|
+
import{useContext as e}from"react";import{jsx as t}from"@emotion/react";import{ThemeContext as o}from"./theme-provider.client.js";import{ThemeUtil as r}from"../util/theme.util.js";function s({element:s,children:m,...i}){const c=e(o),l=c?.theme,{css:n,...p}=i;let h=n,u=p;l&&(h=r.resolveObjWithTheme(n,l,{processFunctions:!0}),u=r.resolveObjWithTheme(p,l,{processFunctions:!1}));const a=r.resolveDefaultStyle(h);return t(s,{...u,css:a},m)}s.displayName="Styled",s.__meonodeAcceptsServerCss=!0;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{createContext as e,useState as o}from"react";import{Node as
|
|
2
|
+
import{createContext as e,useState as o}from"react";import{Node as r}from"../core.node.js";const t=e(null);function n({children:e,theme:n}){const[m,c]=o(n);if(!n)throw new Error("`theme` prop must be defined");const d={theme:m,setTheme:e=>{"function"==typeof e&&(e=e(m)),document.cookie=`theme=${e.mode}; path=/;`,c(e)}};return r(t.Provider,{value:d,children:e}).render()}n.__meonodeAcceptsServerCss=!0,n.__meonodeProvidesServerTheme=!0;export{t as ThemeContext,n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../../src/core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CAAC,CAAC,CAAC,GAAG;IACtB,OAAO,EAAE,CAAC,CAAA;CACX,CAQJ"}
|
package/dist/esm/core.node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as e,createElement as t}from"react";import{isValidElementType as n,isFragment as s}from"./helper/react-is.helper.js";import{getGlobalState as r,getComponentType as o,hasNoStyleTag as i,getElementTypeName as a}from"./helper/common.helper.js";import l from"./components/styled-renderer.client.js";import{__DEBUG__ as c}from"./constant/common.const.js";import{MountTrackerUtil as d}from"./util/mount-tracker.util.js";import h from"./components/meonode-unmounter.client.js";import{NavigationCacheManagerUtil as m}from"./util/navigation-cache-manager.util.js";import{NodeUtil as p}from"./util/node.util.js";const
|
|
1
|
+
import{Fragment as e,createElement as t}from"react";import{isValidElementType as n,isFragment as s}from"./helper/react-is.helper.js";import{getGlobalState as r,getComponentType as o,hasNoStyleTag as i,getElementTypeName as a}from"./helper/common.helper.js";import l from"./components/styled-renderer.client.js";import{__DEBUG__ as c}from"./constant/common.const.js";import{MountTrackerUtil as d}from"./util/mount-tracker.util.js";import h from"./components/meonode-unmounter.client.js";import{NavigationCacheManagerUtil as m}from"./util/navigation-cache-manager.util.js";import{NodeUtil as p}from"./util/node.util.js";import{compileServerEmotionClassName as u}from"./util/server-emotion.util.js";import{setActiveServerTheme as f,registerServerThemeVariables as g,getActiveServerTheme as y,replaceThemeTokensWithCssVars as C}from"./util/server-theme.util.js";import{ThemeUtil as v}from"./util/theme.util.js";const S=Symbol.for("@meonode/ui/BaseNode/elementCache"),b=Symbol.for("@meonode/ui/BaseNode/navigationStarted"),w=Symbol.for("@meonode/ui/BaseNode/renderContextPool"),k=Symbol.for("@meonode/ui/BaseNode/cacheCleanupRegistry");class j{static _idCounter=0;instanceId="m"+ ++j._idCounter;element;rawProps={};isBaseNode=!0;_props;_deps;stableKey;lastPropsObj;lastSignature;static get elementCache(){return r(S,()=>new Map)}static get _navigationStarted(){return r(b,()=>({value:!1})).value}static set _navigationStarted(e){r(b,()=>({value:!1})).value=e}static get renderContextPool(){return r(w,()=>[])}static acquireRenderContext(){const e=j.renderContextPool;return e.length>0?e.pop():{workStack:new Array(512),renderedElements:new Map}}static releaseRenderContext(e){j.renderContextPool.length<50&&e.workStack.length<2048&&(e.workStack.length=0,e.renderedElements.clear(),j.renderContextPool.push(e))}constructor(e,t={},s){if(!n(e)){const t=o(e);if(p.isNodeInstance(e))throw new Error("Invalid element type: MeoNode UI instance provided!");throw new Error(`Invalid element type: ${t} provided!`)}if(this.element=e,this.rawProps=t,this._deps=s,p.isServer&&p.providesServerTheme(e)){const e=t.theme;if(e&&"object"==typeof e&&"system"in e){const t=e;f(t),g(t)}}const{ref:r,children:i,...a}=t;this.stableKey=this._getStableKey(a),p.isServer||j._navigationStarted||(m.getInstance().start(),j._navigationStarted=!0)}get props(){return this._props||(this._props=p.processProps(this.rawProps,this.stableKey)),this._props}get dependencies(){return this._deps}_getStableKey({key:e,...t}){if(p.isServer)return;if(this.lastPropsObj===t)return this.lastSignature;this.lastPropsObj=t;const n=Object.keys(t),s=n.length;if(s>100){const e=p.extractCriticalProps(t,n);this.lastSignature=p.createPropSignature(this.element,e),c&&s>200&&console.warn(`MeoNode: Large props (${s} keys) on "${a(this.element)}". Consider splitting.`)}else this.lastSignature=p.createPropSignature(this.element,t);return null!=e?`${String(e)}:${this.lastSignature}`:this.lastSignature}static get cacheCleanupRegistry(){return r(k,()=>new FinalizationRegistry(e=>{const{cacheKey:t,instanceId:n}=e,s=j.elementCache.get(t);s?.instanceId===n&&j.elementCache.delete(t),d.isMounted(t)&&d.untrackMount(t)}))}render(n=!1){const r=p.shouldCacheElement(this)?j.elementCache.get(this.stableKey):void 0,o=p.shouldNodeUpdate(r?.prevDeps,this._deps,n);if(!o&&r?.renderedElement)return r.accessCount+=1,r.renderedElement;const a=!o,c=j.acquireRenderContext();let{workStack:d}=c;const{renderedElements:m}=c;let f=0;try{const n=e=>{if(e>d.length){const t=Math.max(e,d.length<<1),n=new Array(t);for(let e=0;e<f;e++)n[e]=d[e];d=n}};for(d[f++]={node:this,isProcessed:!1,blocked:a,theme:void 0};f>0;){const r=d[f-1];if(!r){f--;continue}const{node:o,isProcessed:a,blocked:c,theme:h}=r,g=(e,t)=>{const n=e.theme;return n&&"object"==typeof n&&"system"in n?n:t??y()},S=e=>{if(!e)return!1;if("string"==typeof e)return e.includes("theme.");if("function"==typeof e)return!0;if("object"!=typeof e)return!1;if(Array.isArray(e)){for(const t of e)if(S(t))return!0;return!1}for(const t of Object.values(e))if(S(t))return!0;return!1};if(a){f--;const{children:n,key:r,css:a,nativeProps:c,disableEmotion:d,...y}=o.props,b=g(o.props,h);let w=[];if(n){const e=Array.isArray(n)?n:[n],t=e.length;w=new Array(t);for(let n=0;n<t;n++){const t=e[n];if(p.isNodeInstance(t)){const e=m.get(t);if(!e)throw new Error(`[MeoNode] Missing rendered element for child node: ${t.stableKey}`);w[n]=e}else w[n]=t}}const k={...y,key:r,...c};let P;if(o.element===e||s(o.element))P=t(o.element,{key:r},...w);else{const e=!d&&(a||!i(o.element)),n=p.isServer&&"string"!=typeof o.element,s=e&&n&&p.isClientReference(o.element)&&S(a);if(e&&!n||s)P=t(l,{element:o.element,...k,css:a,suppressHydrationWarning:!0},...w);else if(e&&n&&!p.acceptsServerCss(o.element)){const e=v.resolveObjWithTheme(a,b,{processFunctions:!0}),n=v.resolveDefaultStyle(e),s=u(C(n)),r=[k.className,s].filter(Boolean).join(" ")||void 0,i=r?{...k,className:r}:k;P=t(o.element,i,...w)}else{const s=e&&(!n||p.acceptsServerCss(o.element))?{...k,css:a}:k;P=t(o.element,s,...w)}}if(o!==this&&p.shouldCacheElement(o)){const e=j.elementCache.get(o.stableKey);if(e)e.prevDeps=o._deps,e.renderedElement=P,e.accessCount+=1;else{const e={prevDeps:o._deps,renderedElement:P,nodeRef:new WeakRef(o),createdAt:Date.now(),accessCount:1,instanceId:o.instanceId};j.elementCache.set(o.stableKey,e),j.cacheCleanupRegistry.register(o,{cacheKey:o.stableKey,instanceId:o.instanceId},o)}}m.set(o,P)}else{r.isProcessed=!0;const e=o.props.children,t=g(o.props,h);if(e){const s=Array.isArray(e)?e:[e];let r=0;for(let e=0;e<s.length;e++)p.isNodeInstance(s[e])&&r++;n(f+r);for(let e=s.length-1;e>=0;e--){const n=s[e];if(!p.isNodeInstance(n))continue;const r=p.shouldCacheElement(n)?j.elementCache.get(n.stableKey):void 0,o=p.shouldNodeUpdate(r?.prevDeps,n._deps,c);if(!o&&r?.renderedElement){m.set(n,r.renderedElement);continue}const i=c||!o;d[f++]={node:n,isProcessed:!1,blocked:i,theme:t}}}}}let r=m.get(this);if(!p.isServer&&this.stableKey&&(r=t(h,{node:this},r)),p.shouldCacheElement(this)){const e=j.elementCache.get(this.stableKey);if(e)e.prevDeps=this._deps,e.renderedElement=r,e.accessCount+=1;else{const e={prevDeps:this._deps,renderedElement:r,nodeRef:new WeakRef(this),createdAt:Date.now(),accessCount:1,instanceId:this.instanceId};j.elementCache.set(this.stableKey,e),j.cacheCleanupRegistry.register(this,{cacheKey:this.stableKey,instanceId:this.instanceId},this)}}return r}finally{for(let e=0;e<f;e++)d[e]=null;j.releaseRenderContext({workStack:d,renderedElements:m})}}static clearCaches(){const e=Array.from(j.elementCache.keys());c&&console.log(`[MeoNode] clearCaches: Clearing ${e.length} entries`);for(const t of e){const e=j.elementCache.get(t);if(e){const n=e.nodeRef?.deref();if(n)try{j.cacheCleanupRegistry.unregister(n),n.lastSignature=void 0,n.lastPropsObj=void 0}catch{c&&console.warn(`[MeoNode] Could not unregister ${t} from FinalizationRegistry`)}}}j.elementCache.clear(),d.cleanup(),c&&console.log("[MeoNode] All caches cleared")}}function P(e,t={},n){return new j(e,t,n)}function _(e,t){const n=(n,s)=>P(e,{...t,...n},s);return n.element=e,n}function E(e,t){const n=(n,s,r)=>P(e,{...t,...s,children:n},r);return n.element=e,n}P.clearCaches=j.clearCaches;export{j as BaseNode,P as Node,E as createChildrenFirstNode,_ as createNode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Node as e,BaseNode as r}from"../core.node.js";import{getElementTypeName as
|
|
1
|
+
import{Node as e,BaseNode as r}from"../core.node.js";import{getElementTypeName as o}from"../helper/common.helper.js";import{NodeUtil as n}from"../util/node.util.js";function t(t){const s=o(t),m=o=>{const s=t(o);return s instanceof r||n.isNodeInstance(s)?e(s.element,s.rawProps).render():s};function c(r={},o){return e(m,r,o).render()}return m.displayName=`Renderer(${s})`,m.__meonodeAcceptsServerCss=!0,c.displayName=`Component(${s})`,c.__meonodeAcceptsServerCss=!0,c}export{t as Component};
|
package/dist/esm/main.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './types/node.type.js';
|
|
|
6
6
|
export * from './components/react.node.js';
|
|
7
7
|
export * from './components/html.node.js';
|
|
8
8
|
export * from './components/theme-provider.js';
|
|
9
|
+
export * from './components/style-registry.js';
|
|
9
10
|
export * from './components/portal-provider.js';
|
|
10
11
|
export * from './components/portal-host.js';
|
|
11
12
|
export * from './hook/index.js';
|
package/dist/esm/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAGtE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAG7E,cAAc,mBAAmB,CAAA;AAGjC,cAAc,yBAAyB,CAAA;AAGvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA;AAClD,cAAc,gCAAgC,CAAA;AAG9C,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAGtE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAG7E,cAAc,mBAAmB,CAAA;AAGjC,cAAc,yBAAyB,CAAA;AAGvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,mCAAmC,CAAA;AACjD,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA;AAClD,cAAc,gCAAgC,CAAA;AAG9C,cAAc,oBAAoB,CAAA"}
|
package/dist/esm/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{setDebugMode}from"./constant/common.const.js";export{createDataChannel}from"./helper/data-channel.helper.js";export{Node,createChildrenFirstNode,createNode}from"./core.node.js";export{Component}from"./hoc/component.hoc.js";import"react";export{Activity,Fragment,Suspense}from"./components/react.node.js";export{A,Abbr,Absolute,Address,Area,Article,Aside,Audio,B,Base,Bdi,Bdo,Blockquote,Body,Br,Button,Canvas,Caption,Center,Cite,Code,Col,Colgroup,Column,Container,Data,Datalist,Dd,Details,Dfn,Dialog,Div,Dl,Dt,Em,Embed,Fieldset,Figcaption,Figure,Fixed,Footer,Form,Grid,H1,H2,H3,H4,H5,H6,Head,Header,Hgroup,Hr,Html,I,Iframe,Img,Input,Kbd,Label,Legend,Li,Link,Main,MapElement,Mark,Menu,Meta,Meter,Nav,Noscript,ObjectElement,Ol,Optgroup,Option,Output,P,Param,Picture,Pre,Progress,Q,Relative,Root,Row,Rp,Rt,Ruby,S,Samp,Script,Search,Section,Select,Small,Source,Span,Static,Sticky,Strong,Style,Sub,Summary,Sup,Svg,SvgCircle,SvgDefs,SvgEllipse,SvgG,SvgLine,SvgLinearGradient,SvgPath,SvgPolygon,SvgPolyline,SvgRadialGradient,SvgRect,SvgStop,SvgSymbol,SvgText,SvgTspan,SvgUse,Table,Tbody,Td,Template,Text,Textarea,Tfoot,Th,Thead,Time,Title,Tr,Track,U,Ul,Var,Video,Wbr}from"./components/html.node.js";export{ThemeProvider}from"./components/theme-provider.js";export{PortalProvider}from"./components/portal-provider.js";export{PortalHost}from"./components/portal-host.js";export{useTheme}from"./hook/useTheme.js";export{usePortal}from"./hook/usePortal.js";export{useDataChannel}from"./hook/useDataChannel.js";
|
|
1
|
+
export{setDebugMode}from"./constant/common.const.js";export{createDataChannel}from"./helper/data-channel.helper.js";export{Node,createChildrenFirstNode,createNode}from"./core.node.js";export{Component}from"./hoc/component.hoc.js";import"react";export{Activity,Fragment,Suspense}from"./components/react.node.js";export{A,Abbr,Absolute,Address,Area,Article,Aside,Audio,B,Base,Bdi,Bdo,Blockquote,Body,Br,Button,Canvas,Caption,Center,Cite,Code,Col,Colgroup,Column,Container,Data,Datalist,Dd,Details,Dfn,Dialog,Div,Dl,Dt,Em,Embed,Fieldset,Figcaption,Figure,Fixed,Footer,Form,Grid,H1,H2,H3,H4,H5,H6,Head,Header,Hgroup,Hr,Html,I,Iframe,Img,Input,Kbd,Label,Legend,Li,Link,Main,MapElement,Mark,Menu,Meta,Meter,Nav,Noscript,ObjectElement,Ol,Optgroup,Option,Output,P,Param,Picture,Pre,Progress,Q,Relative,Root,Row,Rp,Rt,Ruby,S,Samp,Script,Search,Section,Select,Small,Source,Span,Static,Sticky,Strong,Style,Sub,Summary,Sup,Svg,SvgCircle,SvgDefs,SvgEllipse,SvgG,SvgLine,SvgLinearGradient,SvgPath,SvgPolygon,SvgPolyline,SvgRadialGradient,SvgRect,SvgStop,SvgSymbol,SvgText,SvgTspan,SvgUse,Table,Tbody,Td,Template,Text,Textarea,Tfoot,Th,Thead,Time,Title,Tr,Track,U,Ul,Var,Video,Wbr}from"./components/html.node.js";export{ThemeProvider}from"./components/theme-provider.js";export{StyleRegistry}from"./components/style-registry.js";export{PortalProvider}from"./components/portal-provider.js";export{PortalHost}from"./components/portal-host.js";export{useTheme}from"./hook/useTheme.js";export{usePortal}from"./hook/usePortal.js";export{useDataChannel}from"./hook/useDataChannel.js";
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const StyleRegistry: (<AdditionalProps, ExactProps extends object = object>(props: import("../main").MergedProps<typeof _StyleRegistry, AdditionalProps, ExactProps>, deps?: import("../main").DependencyList) => import("../main").NodeInstance<typeof _StyleRegistry>) & {
|
|
3
|
-
element: typeof _StyleRegistry;
|
|
4
|
-
};
|
|
1
|
+
export * from '../components/style-registry.js';
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nextjs-registry/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nextjs-registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{StyleRegistry}from"../components/style-registry.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){for(var e,a=0,r=0,c=t.length;c>=4;++r,c-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),a=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&a)+(59797*(a>>>16)<<16);switch(c){case 3:a^=(255&t.charCodeAt(r+2))<<16;case 2:a^=(255&t.charCodeAt(r+1))<<8;case 1:a=1540483477*(65535&(a^=255&t.charCodeAt(r)))+(59797*(a>>>16)<<16)}return(((a=1540483477*(65535&(a^=a>>>13))+(59797*(a>>>16)<<16))^a>>>15)>>>0).toString(36)}export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../../hash/dist/emotion-hash.esm.js";import r from"../../unitless/dist/emotion-unitless.esm.js";import t from"../../memoize/dist/emotion-memoize.esm.js";var n=/[A-Z]|^ms/g,o=/_EMO_([^_]+?)_([^]*?)_EMO_/g,i=function(e){return 45===e.charCodeAt(1)},a=function(e){return null!=e&&"boolean"!=typeof e},s=t(function(e){return i(e)?e:e.replace(n,"-$&").toLowerCase()}),l=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(o,function(e,r,t){return u={name:r,styles:t,next:u},r})}return 1===r[e]||i(e)||"number"!=typeof t||0===t?t:t+"px"};function f(e,r,t){if(null==t)return"";var n=t;if(void 0!==n.__emotion_styles)return n;switch(typeof t){case"boolean":return"";case"object":var o=t;if(1===o.anim)return u={name:o.name,styles:o.styles,next:u},o.name;var i=t;if(void 0!==i.styles){var m=i.next;if(void 0!==m)for(;void 0!==m;)u={name:m.name,styles:m.styles,next:u},m=m.next;return i.styles+";"}return function(e,r,t){var n="";if(Array.isArray(t))for(var o=0;o<t.length;o++)n+=f(e,r,t[o])+";";else for(var i in t){var u=t[i];if("object"!=typeof u){var m=u;null!=r&&void 0!==r[m]?n+=i+"{"+r[m]+"}":a(m)&&(n+=s(i)+":"+l(i,m)+";")}else if(!Array.isArray(u)||"string"!=typeof u[0]||null!=r&&void 0!==r[u[0]]){var v=f(e,r,u);switch(i){case"animation":case"animationName":n+=s(i)+":"+v+";";break;default:n+=i+"{"+v+"}"}}else for(var c=0;c<u.length;c++)a(u[c])&&(n+=s(i)+":"+l(i,u[c])+";")}return n}(e,r,t)}var v=t;if(null==r)return v;var c=r[v];return void 0!==c?c:v}var u,m=/label:\s*([^\s;{]+)\s*(;|$)/g;function v(r,t,n){if(1===r.length&&"object"==typeof r[0]&&null!==r[0]&&void 0!==r[0].styles)return r[0];var o=!0,i="";u=void 0;var a=r[0];null==a||void 0===a.raw?(o=!1,i+=f(n,t,a)):i+=a[0];for(var s=1;s<r.length;s++){if(i+=f(n,t,r[s]),o)i+=a[s]}m.lastIndex=0;for(var l,v="";null!==(l=m.exec(i));)v+="-"+l[1];return{name:e(i)+v,styles:i,next:u}}export{v as serializeStyles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="undefined"!=typeof document,n=function(e,n,i){var r=e.key+"-"+n.name;void 0===e.registered[r]&&(e.registered[r]=n.styles)},i=function(i,r,t){n(i,r);var d=i.key+"-"+r.name;if(void 0===i.inserted[r.name]){var o="",v=r;do{var a=i.insert(r===v?"."+d:"",v,i.sheet,!0);e||void 0===a||(o+=a),v=v.next}while(void 0!==v);if(!e&&0!==o.length)return o}};export{i as insertStyles,n as registerStyles};
|
|
@@ -74,6 +74,8 @@ export interface WorkItem {
|
|
|
74
74
|
isProcessed: boolean;
|
|
75
75
|
/** Flag indicating if the node's children should be skipped (blocked) due to memoization. */
|
|
76
76
|
blocked: boolean;
|
|
77
|
+
/** Active inherited theme scope while traversing this subtree (server/runtime propagation). */
|
|
78
|
+
theme?: Theme;
|
|
77
79
|
}
|
|
78
80
|
/**
|
|
79
81
|
* Extracts props type from a given element type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.type.d.ts","sourceRoot":"","sources":["../../../src/types/node.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAM5C,6DAA6D;AAC7D,KAAK,YAAY,CAAC,CAAC,IAAI;KACpB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;CACxD,CAAC,MAAM,CAAC,CAAC,CAAA;AAEV,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,IAAI,CAAA;AAE9E;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,EAAE,CAAA;AAE3C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAA;AAM/D;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,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C,GAAG,GAAG;IACnC,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,0EAA0E;IAC1E,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;IAC7B,wCAAwC;IACxC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mCAAmC;IACnC,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,0EAA0E;IAC1E,UAAU,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,CAAA;IACxG,sCAAsC;IACtC,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,+CAA+C;IAC/C,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,+BAA+B;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB"}
|
|
@@ -12,17 +12,20 @@ export declare class NodeUtil {
|
|
|
12
12
|
private static get _functionSignatureCache();
|
|
13
13
|
private static readonly CRITICAL_PROPS;
|
|
14
14
|
private static _propFuncCache;
|
|
15
|
-
/**
|
|
16
|
-
* Runtime type guard for Promise-like values.
|
|
17
|
-
* Useful for server-side component invocation paths where a function
|
|
18
|
-
* may return either a sync node/element or an async result.
|
|
19
|
-
*/
|
|
20
|
-
static isPromiseLike<T = unknown>(value: unknown): value is PromiseLike<T>;
|
|
21
15
|
/**
|
|
22
16
|
* Detects React/Next client reference functions used by RSC.
|
|
23
17
|
* These must not be invoked on the server.
|
|
24
18
|
*/
|
|
25
19
|
static isClientReference(value: unknown): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Detects function components that explicitly opt in to receiving MeoNode
|
|
22
|
+
* `css` prop in server execution paths.
|
|
23
|
+
*/
|
|
24
|
+
static acceptsServerCss(value: unknown): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Detects components that provide a theme scope for server-side style resolution.
|
|
27
|
+
*/
|
|
28
|
+
static providesServerTheme(value: unknown): boolean;
|
|
26
29
|
/**
|
|
27
30
|
* Type guard to check if an object is a NodeInstance.
|
|
28
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.util.d.ts","sourceRoot":"","sources":["../../../src/util/node.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAyC,KAAK,SAAS,EAAiC,MAAM,OAAO,CAAA;AACnH,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,EACd,cAAc,EAEf,MAAM,yBAAyB,CAAA;AAQhC;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB,OAAO;IAGP,OAAc,QAAQ,UAAgC;IAGtD,OAAO,CAAC,MAAM,KAAK,uBAAuB,GAEzC;IAGD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAA2D;IAGjG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAiD;IAE9E
|
|
1
|
+
{"version":3,"file":"node.util.d.ts","sourceRoot":"","sources":["../../../src/util/node.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAyC,KAAK,SAAS,EAAiC,MAAM,OAAO,CAAA;AACnH,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,EACd,cAAc,EAEf,MAAM,yBAAyB,CAAA;AAQhC;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB,OAAO;IAGP,OAAc,QAAQ,UAAgC;IAGtD,OAAO,CAAC,MAAM,KAAK,uBAAuB,GAEzC;IAGD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAA2D;IAGjG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAiD;IAE9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SAAS,EAAE,aAAa,EAAE,OAAO,GAAG,OAAO;IA8B1I;;;;;;;;;;OAUG;WACW,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW;IAuE1G;;;;;;OAMG;WACW,eAAe,CAAC,CAAC,SAAS,eAAe,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,IAAI,YAAY,CAAC,CAAC,CAAC;IAYpG;;;;;;;;;;;OAWG;WACW,gBAAgB,CAAC,CAAC,SAAS,eAAe,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS;IA6D7I;;;;;;;;;;;;OAYG;WACW,mBAAmB,CAAC,EAChC,gBAAgB,EAChB,SAAS,EACT,cAAc,GACf,EAAE;QACD,gBAAgB,EAAE,WAAW,CAAA;QAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,cAAc,CAAC,EAAE,OAAO,CAAA;KACzB;CA+BF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{isValidElement as t,createElement as
|
|
1
|
+
import e,{isValidElement as t,createElement as r}from"react";import{isReactClassComponent as o,isMemo as n,isForwardRef as s}from"../helper/react-is.helper.js";import{getGlobalState as i,getElementTypeName as c,omitUndefined as a,getCSSProps as d,getDOMProps as l}from"../helper/common.helper.js";import{__DEBUG__ as p}from"../constant/common.const.js";import{BaseNode as f}from"../core.node.js";const u=Symbol.for("@meonode/ui/NodeUtil/functionSignatureCache");class h{constructor(){}static isServer="undefined"==typeof window;static get _functionSignatureCache(){return i(u,()=>new WeakMap)}static CRITICAL_PROPS=new Set(["css","className","disableEmotion","props"]);static _propFuncCache=new WeakMap;static isClientReference(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&e.$$typeof===Symbol.for("react.client.reference")}static acceptsServerCss(e){return"function"==typeof e&&!0===e.__meonodeAcceptsServerCss}static providesServerTheme(e){return"function"==typeof e&&!0===e.__meonodeProvidesServerTheme}static isNodeInstance=e=>e instanceof f;static isStyleProp=h.isServer||"undefined"==typeof document?()=>!1:e=>e in document.body.style;static hashString(e){let t=2166136261,r=5381;for(let o=0;o<e.length;o++){const n=e.charCodeAt(o);t^=n,t=Math.imul(t,16777619),r=Math.imul(r,33)^n}return`${(t>>>0).toString(36)}_${(r>>>0).toString(36)}`}static hashCSS(e){const t=Object.keys(e);let r=t.length;for(let o=0;o<Math.min(t.length,10);o++){const n=t[o],s=e[n];r=(r<<5)-r+n.charCodeAt(0),r&=r,"string"==typeof s&&(r=(r<<5)-r+s.length)}return r.toString(36)}static createPropSignature(e,t){if(h.isServer)return;const r=c(e),o=Object.keys(t);o.length>1&&o.sort();const n=[`${r}:`];if("function"==typeof e){let t=h._functionSignatureCache.get(e);t||(t=h.hashString(e.toString()),h._functionSignatureCache.set(e,t)),n.push(t)}for(const e of o){const r=t[e];let o;const s=typeof r;if("string"===s||"number"===s||"boolean"===s)o=`${e}:${r};`;else if(null===r)o=`${e}:null;`;else if(void 0===r)o=`${e}:undefined;`;else if("css"===e&&"object"==typeof r)o=`css:${this.hashCSS(r)};`;else if(Array.isArray(r)){const t=r.filter(e=>{const t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===e});o=t.length===r.length?`${e}:[${t.join(",")}];`:`${e}:[${r.length}];`}else if(r&&r.isBaseNode)o=`${e}:${r.stableKey};`;else if("function"===s){let t=h._propFuncCache.get(r);t||(t=h.hashString(r.toString()),h._propFuncCache.set(r,t)),o=`${e}:${t};`}else{o=`${e}:{${Object.keys(r).sort().join(",")}};`}n.push(o)}return h.hashString(n.join(","))}static extractCriticalProps(e,t){const r={_keyCount:t.length};let o=0;for(const n of t){if(o>=50)break;if(h.CRITICAL_PROPS.has(n)){r[n]=e[n],o++;continue}const s=n.charCodeAt(0);111!==s||110!==n.charCodeAt(1)?!(97===s&&114===n.charCodeAt(1)&&105===n.charCodeAt(2)&&97===n.charCodeAt(3)||100===s&&97===n.charCodeAt(1)&&116===n.charCodeAt(2)&&97===n.charCodeAt(3))?t.length<=100&&h.isStyleProp(n)&&(r[n]=e[n],o++):(r[n]=e[n],o++):(r[n]=e[n],o++)}return r}static processProps(e={},t){const{ref:r,key:o,children:n,css:s,props:i={},disableEmotion:c,...p}=e;if(0===Object.keys(p).length&&!s)return a({ref:r,key:o,disableEmotion:c,nativeProps:a(i),children:h._processChildren(n,c)});const f={},u={},y=Object.keys(p);for(let e=0;e<y.length;e++){const t=y[e],r=p[t],o=typeof r;"string"===o||"number"===o||"boolean"===o?f[t]=r:u[t]=r}const m=d(f),b=d(u),g=l(p),C={...m,...b,...s},S=h._processChildren(n,c,t);return a({ref:r,key:o,css:C,...g,disableEmotion:c,nativeProps:a(i),children:S})}static _processChildren(e,t,r){if(e)return"function"==typeof e?e:Array.isArray(e)?1===e.length?h.processRawNode(e[0],t,`${r}_0`):e.map((e,o)=>h.processRawNode(e,t,`${r}_${o}`)):h.processRawNode(e,t,r)}static shouldCacheElement(e){return!h.isServer&&!!e.stableKey&&!!e.dependencies}static shouldNodeUpdate(e,t,r){if(h.isServer)return!0;if(r)return!1;if(void 0===t)return!0;if(void 0===e)return!0;if(t.length!==e.length)return!0;for(let r=0;r<t.length;r++)if(!Object.is(t[r],e[r]))return!0;return!1}static processRawNode(r,i,c){if(null==r||"string"==typeof r||"number"==typeof r||"boolean"==typeof r)return r;if(h.isNodeInstance(r)){if(c||i&&!r.rawProps.disableEmotion){const e=new f(r.element,r.rawProps,r.dependencies);return e.stableKey=`${c}:${e.stableKey}`,i&&!e.rawProps.disableEmotion&&(e.rawProps.disableEmotion=!0),e}return r}if(h.isFunctionChild(r))return new f(h.functionRenderer,{props:{render:r,disableEmotion:i}},void 0);if(t(r)){if("string"==typeof r.type){const{style:e,...t}=r.props,o={...t,...e||{}};return new f(r.type,{...o,...null!==r.key&&void 0!==r.key?{key:r.key}:{},disableEmotion:i},void 0)}return new f(r.type,{...r.props,...null!==r.key&&void 0!==r.key?{key:r.key}:{},disableEmotion:i},void 0)}return o(r)||n(r)||s(r)?new f(r,{disableEmotion:i},void 0):r instanceof e.Component?h.processRawNode(r.render(),i,c):r}static isFunctionChild(e){if("function"!=typeof e||o(e)||n(e)||s(e))return!1;try{return!(e.prototype&&"function"==typeof e.prototype.render)}catch(e){return p&&console.error("MeoNode: Error checking if a node is a function child.",e),!0}}static functionRenderer({render:t,disableEmotion:r}){let o;try{o=t()}catch(e){p&&console.error("MeoNode: Error executing function-as-a-child.",e),o=null}if(null==o||"string"==typeof o||"number"==typeof o||"boolean"==typeof o)return o;if(h.isNodeInstance(o))return r&&!o.rawProps.disableEmotion?new f(o.element,{...o.rawProps,disableEmotion:!0}).render():o.render();if(Array.isArray(o)){const e=(e,t)=>{try{return`${c(e)}-${t}`}catch(e){return p&&console.error("MeoNode: Could not determine element type name for key in function-as-a-child.",e),`item-${t}`}};return o.map((t,o)=>h.renderProcessedNode({processedElement:h.processRawNode(t,r),passedKey:e(t,o),disableEmotion:r}))}if(o instanceof e.Component)return h.renderProcessedNode({processedElement:h.processRawNode(o.render(),r),disableEmotion:r});const n=h.processRawNode(o,r);return n?h.renderProcessedNode({processedElement:n,disableEmotion:r}):o}static renderProcessedNode({processedElement:t,passedKey:n,disableEmotion:s}){const i={};if(void 0!==n&&(i.key=n),h.isNodeInstance(t)){const e=t.rawProps?.key;return t.rawProps.disableEmotion=s,e===n?t.render():new f(t.element,{...t.rawProps,...i}).render()}return o(t)?new f(t,{...i,disableEmotion:s}).render():t instanceof e.Component?t.render():"function"==typeof t?r(t,{key:n}):t}}export{h as NodeUtil};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CssProp } from '../types/node.type.js';
|
|
2
|
+
export declare function getServerEmotionCache(): import("@emotion/utils").EmotionCache;
|
|
3
|
+
/**
|
|
4
|
+
* Compiles an Emotion-compatible css object to a stable className in server paths
|
|
5
|
+
* without relying on @emotion/react runtime APIs.
|
|
6
|
+
*/
|
|
7
|
+
export declare function compileServerEmotionClassName(css: CssProp): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Consumes pending server-compiled Emotion rules for injection into SSR output.
|
|
10
|
+
* Rules are drained so each request only emits newly added styles once.
|
|
11
|
+
*/
|
|
12
|
+
export declare function consumeServerEmotionRules(): Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
cssText: string;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=server-emotion.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-emotion.util.d.ts","sourceRoot":"","sources":["../../../src/util/server-emotion.util.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAStD,wBAAgB,qBAAqB,0CAEpC;AAMD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAmB9E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAOlF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@emotion/cache";import{serializeStyles as o}from"../node_modules/@emotion/serialize/dist/emotion-serialize.esm.js";import{insertStyles as n}from"../node_modules/@emotion/utils/dist/emotion-utils.esm.js";import{getGlobalState as t}from"../helper/common.helper.js";const r=Symbol.for("@meonode/ui/serverEmotionCache"),i=Symbol.for("@meonode/ui/serverEmotionRules");function s(){return t(r,()=>e({key:"meonode-css"}))}function m(){return t(i,()=>({byId:new Map}))}function d(e){if(!e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return;const t=s(),r=o([e],t.registered),i=n(t,r),d=t.inserted[r.name],f="string"==typeof i?i:"string"==typeof d?d:void 0;if(f){const e=m();e.byId.has(r.name)||e.byId.set(r.name,f)}return`${t.key}-${r.name}`}function f(){const e=m();if(0===e.byId.size)return[];const o=Array.from(e.byId.entries()).map(([e,o])=>({id:e,cssText:o}));return e.byId.clear(),o}export{d as compileServerEmotionClassName,f as consumeServerEmotionRules,s as getServerEmotionCache};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Theme } from '../types/node.type.js';
|
|
2
|
+
export declare function getActiveServerTheme(): Theme | undefined;
|
|
3
|
+
export declare function setActiveServerTheme(theme: Theme): void;
|
|
4
|
+
export declare function registerServerThemeVariables(theme: Theme): void;
|
|
5
|
+
export declare function consumeServerThemeVariablesCss(): {
|
|
6
|
+
id: string;
|
|
7
|
+
cssText: string;
|
|
8
|
+
} | undefined;
|
|
9
|
+
export declare function replaceThemeTokensWithCssVars<T>(value: T): T;
|
|
10
|
+
//# sourceMappingURL=server-theme.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-theme.util.d.ts","sourceRoot":"","sources":["../../../src/util/server-theme.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAapD,wBAAgB,oBAAoB,IAAI,KAAK,GAAG,SAAS,CAExD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAEvD;AAUD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CA6B/D;AAED,wBAAgB,8BAA8B,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAU5F;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAiB5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getGlobalState as e}from"../helper/common.helper.js";const t=Symbol.for("@meonode/ui/serverActiveTheme"),o=Symbol.for("@meonode/ui/serverThemeVariables");function r(){return e(t,()=>({})).activeTheme}function n(o){e(t,()=>({})).activeTheme=o}function s(e){return`--meonode-theme-${e.replace(/[^\w.-]/g,"-").replace(/\./g,"-")}`}function a(){return e(o,()=>({byName:new Map}))}function f(e){if(!e?.system||"object"!=typeof e.system)return;const t=a(),o=[{path:"",value:e.system}];for(;o.length>0;){const e=o.pop();if(!e||!e.value||"object"!=typeof e.value)continue;const r=e.value;for(const[n,a]of Object.entries(r)){const r=e.path?`${e.path}.${n}`:n;if(null!=a)if("string"!=typeof a&&"number"!=typeof a&&"boolean"!=typeof a){if("object"==typeof a){const e=a.default;"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e||t.byName.set(s(r),String(e)),o.push({path:r,value:a})}}else t.byName.set(s(r),String(a))}}}function i(){const e=a();if(0===e.byName.size)return;const t=Array.from(e.byName.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}:${t};`).join("");return e.byName.clear(),t?{id:"theme-vars",cssText:`:root{${t}}`}:void 0}function c(e){const t=e=>e.replace(/theme\.([a-zA-Z0-9_.-]+)/g,(e,t)=>`var(${s(t)})`),o=e=>{if("string"==typeof e)return t(e);if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>o(e));const r={};for(const[n,s]of Object.entries(e)){r[t(n)]=o(s)}return r};return o(e)}export{i as consumeServerThemeVariablesCss,r as getActiveServerTheme,f as registerServerThemeVariables,c as replaceThemeTokensWithCssVars,n as setActiveServerTheme};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meonode/ui",
|
|
3
3
|
"description": "A structured approach to component composition, direct CSS-first prop styling, built-in theming, smart prop handling (including raw property pass-through), and dynamic children.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"types": "./dist/main.d.ts",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"@emotion/cache": "^11.14.0",
|
|
55
55
|
"@emotion/jest": "^11.14.2",
|
|
56
56
|
"@emotion/styled": "^11.14.1",
|
|
57
|
-
"@eslint/js": "^
|
|
58
|
-
"@mui/material": "^
|
|
57
|
+
"@eslint/js": "^10.0.1",
|
|
58
|
+
"@mui/material": "^9.0.0",
|
|
59
59
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
60
60
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
61
|
-
"@rollup/plugin-terser": "^0.
|
|
61
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
62
62
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
63
63
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
64
64
|
"@semantic-release/github": "^12.0.6",
|
|
@@ -74,8 +74,9 @@
|
|
|
74
74
|
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
75
75
|
"@typescript-eslint/parser": "^8.55.0",
|
|
76
76
|
"cli-table3": "^0.6.5",
|
|
77
|
-
"eslint": "^
|
|
78
|
-
"eslint-plugin-
|
|
77
|
+
"eslint": "^10.2.1",
|
|
78
|
+
"eslint-plugin-import-x": "^4.16.2",
|
|
79
|
+
"eslint-plugin-jsdoc": "^62.9.0",
|
|
79
80
|
"eslint-plugin-prettier": "^5.5.5",
|
|
80
81
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
81
82
|
"husky": "^9.1.7",
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"prettier": "^3.8.1",
|
|
86
87
|
"react": "^19.2.4",
|
|
87
88
|
"react-dom": "^19.2.4",
|
|
88
|
-
"react-router-dom": "^7.
|
|
89
|
+
"react-router-dom": "^7.14.2",
|
|
89
90
|
"rollup": "^4.57.1",
|
|
90
91
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
91
92
|
"rollup-plugin-tsconfig-paths": "^1.5.2",
|