@gem-sdk/core 1.8.22 → 1.8.27
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/constant.js +1 -0
- package/dist/cjs/contexts/CollectionContext.js +7 -2
- package/dist/cjs/helpers/compose-advance-style.js +7 -0
- package/dist/esm/components/constant.js +1 -0
- package/dist/esm/contexts/CollectionContext.js +7 -2
- package/dist/esm/helpers/compose-advance-style.js +7 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -5,8 +5,13 @@ var react = require('react');
|
|
|
5
5
|
var zustand = require('zustand');
|
|
6
6
|
|
|
7
7
|
const CollectionContext = /*#__PURE__*/ react.createContext(null);
|
|
8
|
-
const createCollectionProvider = (data)=>zustand.createStore(()=>({
|
|
9
|
-
...data
|
|
8
|
+
const createCollectionProvider = (data)=>zustand.createStore((set)=>({
|
|
9
|
+
...data,
|
|
10
|
+
changeCollectionStore: ({ collection })=>{
|
|
11
|
+
set({
|
|
12
|
+
collection: collection
|
|
13
|
+
});
|
|
14
|
+
}
|
|
10
15
|
}));
|
|
11
16
|
const CollectionProvider = ({ collection , children })=>{
|
|
12
17
|
const store = react.useMemo(()=>{
|
|
@@ -139,6 +139,13 @@ function composeAdvanceStyle(data, tag) {
|
|
|
139
139
|
});
|
|
140
140
|
} else {
|
|
141
141
|
styles[`--${attr}`] = getAttrValue(attr, value, tag);
|
|
142
|
+
if (attr === 'hasBoxShadow' && data.boxShadow) {
|
|
143
|
+
Object.assign(styles, shadow.getStyleShadow({
|
|
144
|
+
value: data.boxShadow,
|
|
145
|
+
styleAppliedFor: 'box-shadow',
|
|
146
|
+
isEnableShadow: data.hasBoxShadow
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
142
149
|
}
|
|
143
150
|
});
|
|
144
151
|
return styles;
|
|
@@ -3,8 +3,13 @@ import { useMemo, useContext, createContext } from 'react';
|
|
|
3
3
|
import { useStore, createStore } from 'zustand';
|
|
4
4
|
|
|
5
5
|
const CollectionContext = /*#__PURE__*/ createContext(null);
|
|
6
|
-
const createCollectionProvider = (data)=>createStore(()=>({
|
|
7
|
-
...data
|
|
6
|
+
const createCollectionProvider = (data)=>createStore((set)=>({
|
|
7
|
+
...data,
|
|
8
|
+
changeCollectionStore: ({ collection })=>{
|
|
9
|
+
set({
|
|
10
|
+
collection: collection
|
|
11
|
+
});
|
|
12
|
+
}
|
|
8
13
|
}));
|
|
9
14
|
const CollectionProvider = ({ collection , children })=>{
|
|
10
15
|
const store = useMemo(()=>{
|
|
@@ -137,6 +137,13 @@ function composeAdvanceStyle(data, tag) {
|
|
|
137
137
|
});
|
|
138
138
|
} else {
|
|
139
139
|
styles[`--${attr}`] = getAttrValue(attr, value, tag);
|
|
140
|
+
if (attr === 'hasBoxShadow' && data.boxShadow) {
|
|
141
|
+
Object.assign(styles, getStyleShadow({
|
|
142
|
+
value: data.boxShadow,
|
|
143
|
+
styleAppliedFor: 'box-shadow',
|
|
144
|
+
isEnableShadow: data.hasBoxShadow
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
140
147
|
}
|
|
141
148
|
});
|
|
142
149
|
return styles;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7036,6 +7036,9 @@ type CollectionSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'updatedAt
|
|
|
7036
7036
|
|
|
7037
7037
|
type CollectionContextProps = {
|
|
7038
7038
|
collection?: CollectionSelectFragment;
|
|
7039
|
+
changeCollectionStore: (args: {
|
|
7040
|
+
collection?: CollectionSelectFragment;
|
|
7041
|
+
}) => void;
|
|
7039
7042
|
};
|
|
7040
7043
|
type CollectionProviderProps = Pick<CollectionContextProps, 'collection'> & {
|
|
7041
7044
|
initialVariantId?: string;
|