@gem-sdk/core 19.0.0-staging.10 → 19.0.0-staging.18
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=require("zustand");const t={desktop:!0,tablet:!0,mobile:!0},r=e.create((e,r)=>({elementMap:new Map,setElement:({id:r,element:l,deviceVisibility:n})=>{e(e=>{let u=new Map(e.elementMap);if(l){let e=u.get(r);u.set(r,{current:l,d:n||e?.d||t})}else{let e=u.get(r);e?u.set(r,{...e,current:null}):u.delete(r)}return{elementMap:u}})},removeElement:t=>{e(e=>{let r=new Map(e.elementMap);return r.delete(t),{elementMap:r}})},getFirstVisibleElement:e=>{let{elementMap:t}=r();for(let[,r]of t)if(r.current&&r.d[e])return r.current;return null}}));exports.useStickyStore=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{create as
|
|
1
|
+
import{create as e}from"zustand";let t={desktop:!0,tablet:!0,mobile:!0},l=e((e,l)=>({elementMap:new Map,setElement:({id:l,element:r,deviceVisibility:n})=>{e(e=>{let m=new Map(e.elementMap);if(r){let e=m.get(l);m.set(l,{current:r,d:n||e?.d||t})}else{let e=m.get(l);e?m.set(l,{...e,current:null}):m.delete(l)}return{elementMap:m}})},removeElement:t=>{e(e=>{let l=new Map(e.elementMap);return l.delete(t),{elementMap:l}})},getFirstVisibleElement:e=>{let{elementMap:t}=l();for(let[,l]of t)if(l.current&&l.d[e])return l.current;return null}}));export{l as useStickyStore};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -42771,9 +42771,9 @@ type AddonProviderProps = Pick<AddonContextProps, 'components'> & {
|
|
|
42771
42771
|
|
|
42772
42772
|
declare const AddonProvider: React.FC<AddonProviderProps>;
|
|
42773
42773
|
declare const useAddons: () => Record<string, React.ComponentType<any>>;
|
|
42774
|
-
declare const useAddon: (id?: string) => React.FC<BaseProps & {
|
|
42774
|
+
declare const useAddon: (id?: string) => React.ComponentType<any> | React.FC<BaseProps & {
|
|
42775
42775
|
children?: React.ReactNode;
|
|
42776
|
-
}
|
|
42776
|
+
}>;
|
|
42777
42777
|
|
|
42778
42778
|
type BuilderComponentProps = {
|
|
42779
42779
|
components: Record<string, React.ComponentType<any>>;
|
|
@@ -42785,9 +42785,9 @@ type BuilderComponentProviderProps = Pick<BuilderComponentProps, 'components'> &
|
|
|
42785
42785
|
};
|
|
42786
42786
|
|
|
42787
42787
|
declare const BuilderComponentProvider: React.FC<BuilderComponentProviderProps>;
|
|
42788
|
-
declare const useBuilderComponent: (id?: string) => React.
|
|
42788
|
+
declare const useBuilderComponent: (id?: string) => React.FC<BaseProps & {
|
|
42789
42789
|
children?: React.ReactNode;
|
|
42790
|
-
}>;
|
|
42790
|
+
}> | React.ComponentType<BaseProps>;
|
|
42791
42791
|
|
|
42792
42792
|
type BuilderContextProps = {
|
|
42793
42793
|
state: BuilderState | SectionData;
|
|
@@ -55188,9 +55188,22 @@ declare const useI18n: () => {
|
|
|
55188
55188
|
t: (string: string, params: Record<string, string>) => string;
|
|
55189
55189
|
};
|
|
55190
55190
|
|
|
55191
|
+
type StickyStoreDevice = Record<NameDevices, boolean>;
|
|
55192
|
+
type StickyStoreElementValue = {
|
|
55193
|
+
current: HTMLDivElement | null;
|
|
55194
|
+
d: StickyStoreDevice;
|
|
55195
|
+
};
|
|
55196
|
+
type StickyStoreElementMap = Map<string, StickyStoreElementValue>;
|
|
55197
|
+
|
|
55191
55198
|
type StickyStore = {
|
|
55192
|
-
|
|
55193
|
-
|
|
55199
|
+
elementMap: StickyStoreElementMap;
|
|
55200
|
+
setElement: (params: {
|
|
55201
|
+
id: string;
|
|
55202
|
+
element: HTMLDivElement | null;
|
|
55203
|
+
deviceVisibility?: StickyStoreDevice;
|
|
55204
|
+
}) => void;
|
|
55205
|
+
removeElement: (id: string) => void;
|
|
55206
|
+
getFirstVisibleElement: (currentDevice: NameDevices) => HTMLDivElement | null;
|
|
55194
55207
|
};
|
|
55195
55208
|
declare const useStickyStore: zustand.UseBoundStore<zustand.StoreApi<StickyStore>>;
|
|
55196
55209
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "19.0.0-staging.
|
|
3
|
+
"version": "19.0.0-staging.18",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@gem-sdk/adapter-shopify": "19.0.0-staging.8",
|
|
32
|
-
"@gem-sdk/styles": "19.0.0-staging.
|
|
32
|
+
"@gem-sdk/styles": "19.0.0-staging.14",
|
|
33
33
|
"@types/classnames": "^2.3.1"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|