droplinked-editor-configs 1.8.9 → 1.9.1
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/README.md +519 -64
- package/dist/apis/product/interface.d.ts +1 -0
- package/dist/droplinked-editor.es.js +17367 -16698
- package/dist/droplinked-editor.umd.js +73 -73
- package/package.json +2 -1
- package/src/Editor.tsx +3 -0
- package/src/apis/product/interface.ts +1 -0
- package/src/components/productGrid/components/ProductGrid/Slider/ProductImageSlider.tsx +10 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "droplinked-editor-configs",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/droplinked-editor.umd.js",
|
|
7
7
|
"module": "dist/droplinked-editor.es.js",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@emotion/react": "^11.10.5",
|
|
20
20
|
"@emotion/styled": "^11.10.5",
|
|
21
21
|
"@measured/puck": "^0.19.3",
|
|
22
|
+
"@measured/puck-plugin-emotion-cache": "^0.20.2",
|
|
22
23
|
"@radix-ui/react-accordion": "^1.2.1",
|
|
23
24
|
"@radix-ui/react-alert-dialog": "^1.1.2",
|
|
24
25
|
"@radix-ui/react-checkbox": "^1.1.2",
|
package/src/Editor.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import useAppStore from "lib/stores/app/appStore";
|
|
|
5
5
|
import { useEffect, useMemo } from "react";
|
|
6
6
|
import { QueryClient, QueryClientProvider } from "react-query";
|
|
7
7
|
import { EditorProps } from "types/editorProps";
|
|
8
|
+
import createEmotionCachePlugin from "@measured/puck-plugin-emotion-cache";
|
|
8
9
|
import "./index.css";
|
|
9
10
|
|
|
10
11
|
// Internal component that handles shop data fetching
|
|
@@ -29,6 +30,7 @@ function EditorContent({
|
|
|
29
30
|
token
|
|
30
31
|
}: EditorProps) {
|
|
31
32
|
const { get, loading } = useAppShop();
|
|
33
|
+
const chakraEmotionCache = createEmotionCachePlugin('chakra-pageEditor-cache') as any
|
|
32
34
|
|
|
33
35
|
useEffect(() => {
|
|
34
36
|
// Fetch shop data when shopName is provided and not already loading
|
|
@@ -61,6 +63,7 @@ function EditorContent({
|
|
|
61
63
|
overrides={overrides}
|
|
62
64
|
updateData={updateData}
|
|
63
65
|
token={token}
|
|
66
|
+
plugins={[chakraEmotionCache]}
|
|
64
67
|
>
|
|
65
68
|
{children}
|
|
66
69
|
</Puck>
|
|
@@ -15,10 +15,18 @@ interface Props {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export default function ProductImageSlider({ product, isHovered, isEditing }: Props) {
|
|
18
|
-
const { images, title, slug } = product
|
|
18
|
+
const { images, title, slug, defaultImageIndex } = product
|
|
19
19
|
const { navigate } = useCustomNavigate()
|
|
20
20
|
const [currentIndex, setCurrentIndex] = useState(0)
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
// Reorder images to show default image first
|
|
23
|
+
const orderedImages = [...images]
|
|
24
|
+
if (defaultImageIndex !== undefined && defaultImageIndex >= 0 && defaultImageIndex < images.length) {
|
|
25
|
+
const defaultImage = orderedImages[defaultImageIndex]
|
|
26
|
+
orderedImages.splice(defaultImageIndex, 1)
|
|
27
|
+
orderedImages.unshift(defaultImage)
|
|
28
|
+
}
|
|
29
|
+
const sliderImages = orderedImages.slice(0, 3)
|
|
22
30
|
|
|
23
31
|
const [sliderRef, instanceRef] = useKeenSlider<HTMLDivElement>({
|
|
24
32
|
loop: true,
|