@hazem3500/palette 0.9.158 → 0.9.160

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/react.js CHANGED
@@ -1 +1 @@
1
- "use client";import{B as e,d as n,e as t,h as r}from"./chunk-EWC2YAAK.js";import{b as s}from"./chunk-ZMNGS2SD.js";import"./chunk-7AZHRTDG.js";import"./chunk-HHUTDVTM.js";import"./chunk-RBHY7UDS.js";import"./chunk-LMXFSXO6.js";import"./chunk-5HZI7HRR.js";import"./chunk-2BS2OWWH.js";import"./chunk-XOMOONGK.js";import"./chunk-TFFPX3O4.js";import"./chunk-VX6XCU4E.js";import"./chunk-FQXDOYYW.js";import"./chunk-GAHDL7C2.js";import{useEffect as o,useRef as i}from"react";function c(e){let n=i(null);o(()=>{if(n.current&&function(e,n){return[...new Set([...Object.keys(e),...Object.keys(n)])].every(t=>{if("shortcuts"===t||"features"===t||"frame"===t||"pins"===t){let r=e[t]??{},s=n[t]??{};return Object.keys({...r,...s}).every(e=>Object.is(r[e],s[e]))}if("design"===t){let t=e.design,r=n.design;if(!t||!r)return t===r;let s=t.themes??[],o=r.themes??[];return t.tokens===r.tokens&&t.components===r.components&&s.length===o.length&&s.every((e,n)=>e===o[n])}if("persistentRegions"===t)return e[t]?.length===n[t]?.length&&(e[t]??[]).every((e,r)=>e===n[t]?.[r]);if("onboarding"!==t)return Object.is(e[t],n[t]);let r=e.onboarding,s=n.onboarding;return r&&s?Object.keys({...r,...s}).every(e=>"sites"===e?r.sites?.length===s.sites?.length&&(r.sites??[]).every((e,n)=>e===s.sites?.[n]):Object.is(r[e],s[e])):r===s})}(n.current.config,e)||(n.current?.controller.destroy(),n.current=null,!1===e.enabled))return;let t={...e,...e.persistentRegions?{persistentRegions:[...e.persistentRegions]}:{},...e.onboarding?{onboarding:{...e.onboarding,...e.onboarding.sites?{sites:[...e.onboarding.sites]}:{}}}:{}};n.current={config:t,controller:s(t)}}),o(()=>()=>{n.current?.controller.destroy(),n.current=null},[])}function u(e){let r=i(null),s=i(null);return s.current||(s.current=e=>{r.current=e}),o(()=>{if(!0===e.enabled&&r.current)return n(r.current,e.component,e.props,e.onChange)},[e.enabled,e.component]),o(()=>{!0===e.enabled&&t(r.current,e.component,e.props,e.onChange)},[e.enabled,e.component,e.props,e.onChange]),{ref:s.current,"data-palette-inspectable":e.component.id,"data-komo-inspectable":e.component.id}}function a(e){o(()=>{if(!0!==e.enabled)return;let n=e.root??document.documentElement;return r(n,e.tokens)},[e.root,e.tokens,e.enabled])}var l=c,p=u,m=a;export{e as cssVariableTokens,l as useKomo,m as useKomoDesignTokens,p as useKomoInspectable,c as usePalette,a as usePaletteDesignTokens,u as usePaletteInspectable};
1
+ "use client";import{B as e,d as n,e as t,h as r}from"./chunk-EWC2YAAK.js";import{b as s}from"./chunk-5VLY5N3S.js";import"./chunk-7AZHRTDG.js";import"./chunk-HHUTDVTM.js";import"./chunk-RBHY7UDS.js";import"./chunk-LMXFSXO6.js";import"./chunk-5HZI7HRR.js";import"./chunk-2BS2OWWH.js";import"./chunk-XOMOONGK.js";import"./chunk-TFFPX3O4.js";import"./chunk-VX6XCU4E.js";import"./chunk-FQXDOYYW.js";import"./chunk-GAHDL7C2.js";import{useEffect as o,useRef as i}from"react";function c(e){let n=i(null);o(()=>{if(n.current&&function(e,n){return[...new Set([...Object.keys(e),...Object.keys(n)])].every(t=>{if("shortcuts"===t||"features"===t||"frame"===t||"pins"===t){let r=e[t]??{},s=n[t]??{};return Object.keys({...r,...s}).every(e=>Object.is(r[e],s[e]))}if("design"===t){let t=e.design,r=n.design;if(!t||!r)return t===r;let s=t.themes??[],o=r.themes??[];return t.tokens===r.tokens&&t.components===r.components&&s.length===o.length&&s.every((e,n)=>e===o[n])}if("persistentRegions"===t)return e[t]?.length===n[t]?.length&&(e[t]??[]).every((e,r)=>e===n[t]?.[r]);if("onboarding"!==t)return Object.is(e[t],n[t]);let r=e.onboarding,s=n.onboarding;return r&&s?Object.keys({...r,...s}).every(e=>"sites"===e?r.sites?.length===s.sites?.length&&(r.sites??[]).every((e,n)=>e===s.sites?.[n]):Object.is(r[e],s[e])):r===s})}(n.current.config,e)||(n.current?.controller.destroy(),n.current=null,!1===e.enabled))return;let t={...e,...e.persistentRegions?{persistentRegions:[...e.persistentRegions]}:{},...e.onboarding?{onboarding:{...e.onboarding,...e.onboarding.sites?{sites:[...e.onboarding.sites]}:{}}}:{}};n.current={config:t,controller:s(t)}}),o(()=>()=>{n.current?.controller.destroy(),n.current=null},[])}function u(e){let r=i(null),s=i(null);return s.current||(s.current=e=>{r.current=e}),o(()=>{if(!0===e.enabled&&r.current)return n(r.current,e.component,e.props,e.onChange)},[e.enabled,e.component]),o(()=>{!0===e.enabled&&t(r.current,e.component,e.props,e.onChange)},[e.enabled,e.component,e.props,e.onChange]),{ref:s.current,"data-palette-inspectable":e.component.id,"data-komo-inspectable":e.component.id}}function a(e){o(()=>{if(!0!==e.enabled)return;let n=e.root??document.documentElement;return r(n,e.tokens)},[e.root,e.tokens,e.enabled])}var l=c,p=u,m=a;export{e as cssVariableTokens,l as useKomo,m as useKomoDesignTokens,p as useKomoInspectable,c as usePalette,a as usePaletteDesignTokens,u as usePaletteInspectable};