@shopify/shop-minis-react 0.0.0-snapshot.20251219133751 → 0.0.0-snapshot.20251219160956
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,10 +1,11 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
import { useLocation as
|
|
1
|
+
import { useEffect as e } from "react";
|
|
2
|
+
import { useLocation as a } from "../shop-minis-react/node_modules/.pnpm/react-router@7.7.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-router/dist/development/chunk-EF7DTUVF.js";
|
|
3
3
|
import { useOnNavigateBack as r } from "../hooks/events/useOnNavigateBack.js";
|
|
4
|
+
import { useNavigateWithTransition as s } from "../hooks/navigation/useNavigateWithTransition.js";
|
|
4
5
|
import { useShopActions as h } from "./useShopActions.js";
|
|
5
6
|
function u() {
|
|
6
|
-
const t =
|
|
7
|
-
return
|
|
7
|
+
const t = a(), i = s(), { reportNavigationState: o } = h();
|
|
8
|
+
return e(() => {
|
|
8
9
|
const n = {
|
|
9
10
|
location: {
|
|
10
11
|
pathname: t.pathname,
|
|
@@ -18,7 +19,7 @@ function u() {
|
|
|
18
19
|
};
|
|
19
20
|
o(n);
|
|
20
21
|
}, [t, o]), r(() => {
|
|
21
|
-
|
|
22
|
+
i(-1);
|
|
22
23
|
}), null;
|
|
23
24
|
}
|
|
24
25
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-manager.js","sources":["../../src/internal/navigation-manager.tsx"],"sourcesContent":["import {useEffect} from 'react'\n\nimport {useLocation
|
|
1
|
+
{"version":3,"file":"navigation-manager.js","sources":["../../src/internal/navigation-manager.tsx"],"sourcesContent":["import {useEffect} from 'react'\n\nimport {useLocation} from 'react-router'\n\nimport {useOnNavigateBack} from '../hooks/events/useOnNavigateBack'\nimport {useNavigateWithTransition} from '../hooks/navigation/useNavigateWithTransition'\n\nimport {useShopActions} from './useShopActions'\n\nexport function NavigationManager() {\n const location = useLocation()\n const navigate = useNavigateWithTransition()\n const {reportNavigationState} = useShopActions()\n\n // Report navigation state on location changes\n useEffect(() => {\n const navigationState = {\n location: {\n pathname: location.pathname,\n search: location.search,\n hash: location.hash,\n key: location.key,\n state: location.state,\n },\n historyLength: typeof window === 'undefined' ? 0 : window.history.length,\n historyIndex:\n typeof window === 'undefined' || !window.history.state?.idx\n ? null\n : window.history.state.idx,\n }\n\n reportNavigationState(navigationState)\n }, [location, reportNavigationState])\n\n // Handle native back button press\n useOnNavigateBack(() => {\n navigate(-1)\n })\n\n return null\n}\n"],"names":["NavigationManager","location","useLocation","navigate","useNavigateWithTransition","reportNavigationState","useShopActions","useEffect","navigationState","useOnNavigateBack"],"mappings":";;;;;AASO,SAASA,IAAoB;AAClC,QAAMC,IAAWC,EAAY,GACvBC,IAAWC,EAA0B,GACrC,EAAC,uBAAAC,EAAqB,IAAIC,EAAe;AAG/C,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAkB;AAAA,MACtB,UAAU;AAAA,QACR,UAAUP,EAAS;AAAA,QACnB,QAAQA,EAAS;AAAA,QACjB,MAAMA,EAAS;AAAA,QACf,KAAKA,EAAS;AAAA,QACd,OAAOA,EAAS;AAAA,MAClB;AAAA,MACA,eAAe,OAAO,SAAW,MAAc,IAAI,OAAO,QAAQ;AAAA,MAClE,cACE,OAAO,SAAW,OAAe,CAAC,OAAO,QAAQ,OAAO,MACpD,OACA,OAAO,QAAQ,MAAM;AAAA,IAC7B;AAEA,IAAAI,EAAsBG,CAAe;AAAA,EAAA,GACpC,CAACP,GAAUI,CAAqB,CAAC,GAGpCI,EAAkB,MAAM;AACtB,IAAAN,EAAS,EAAE;AAAA,EAAA,CACZ,GAEM;AACT;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/shop-minis-react",
|
|
3
3
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
4
|
-
"version": "0.0.0-snapshot.
|
|
4
|
+
"version": "0.0.0-snapshot.20251219160956",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typescript": ">=5.0.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@shopify/shop-minis-platform": "0.0.0-snapshot.
|
|
49
|
+
"@shopify/shop-minis-platform": "0.0.0-snapshot.20251219160956",
|
|
50
50
|
"@tailwindcss/vite": "4.1.8",
|
|
51
51
|
"@tanstack/react-query": "5.86.0",
|
|
52
52
|
"@types/color": "3.0.6",
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {useEffect} from 'react'
|
|
2
2
|
|
|
3
|
-
import {useLocation
|
|
3
|
+
import {useLocation} from 'react-router'
|
|
4
4
|
|
|
5
5
|
import {useOnNavigateBack} from '../hooks/events/useOnNavigateBack'
|
|
6
|
+
import {useNavigateWithTransition} from '../hooks/navigation/useNavigateWithTransition'
|
|
6
7
|
|
|
7
8
|
import {useShopActions} from './useShopActions'
|
|
8
9
|
|
|
9
10
|
export function NavigationManager() {
|
|
10
11
|
const location = useLocation()
|
|
11
|
-
const navigate =
|
|
12
|
+
const navigate = useNavigateWithTransition()
|
|
12
13
|
const {reportNavigationState} = useShopActions()
|
|
13
14
|
|
|
14
15
|
// Report navigation state on location changes
|