Skip to content

Commit dded70d

Browse files
del15881glo82145
andauthored
PWA-3450 : Commit for initial package after conversion from TypeScrip… (#4462)
* PWA-3450 : Commit for initial package after conversion from TypeScript to React * PWA-3459 : Commit to Add the Live Search Popover to New Package * Fix Store Details not found Error on Private window and Safari Browser * Adding Eventing Dependencies and Replacing window mse with React mse initalisation * Adding Eventing Changes , Added new Queries, Hooks, Wrappers to trigger tp2 events * Adding Results Modifier Files to fix issues with Product Images and Product Item Urls * Adding Additional Data For Context to store * Usig custom context to make use of utils with dynamic urls * Wrapping Main Loader component in the context * Removing Protocol from the Product Images * Adding Changes to Fix Product Images and Url issues in Popover and Search Results Page * Fixing Issue with Sortable Dropdown options, Extra argument was removed * Fixing Issues with Live search Loading/Shimmer Affect * Fixing issues during Live search rendering on Mobile View * Adding Search Icon to the SearchBar * Fix Console Warnings for duplicate keys * Adding IDs to Fragments to Fix duplicate key issues * Removing unwanted console logs * Adding baseUrl, baseUrlwithoutProtocol as valid keys for fixing console warnings * Fix Add to Cart button font size * Revert the Changes as we are now making css as global instead of modules * Fix font stylings * Turn off CSS modules for applying global css styles * Fix the SearchBar Icon padding for focused input * Fix Font size on Add to Cart button * Fixing Product Item hover bugs and Mobile responsive padding issues * PWA-3470: Fixing the Broken Error Screen , replacing with the 'Search returned no results' message instead. * PWA-3479: Worked to fix the Selected Filters on PLP and SRLP * PWA-3484 : Fix to Add Status indicator below search bar * Remove unwanted commented code * Hide Swatches from Mobile Screens * Fix Swatch Selection Image Update Logic * Code butification after running prettier command * Fix Prettier Bugs * Fix the dependencies to Use latest versions and updated packages available * Fix Prettier Issues * Fixes for Lint and Prettier Issues, Deleted file getPageType.js, its functionality is replaced by new file usePageTypeFromUrl.js * Fix Issues with Price Filter * Fixing redundant import statements * PWA-3301-livesearch * PWA-3301-livesearch --------- Co-authored-by: glo82145 <glo82145@adobe.com>
1 parent 0efe211 commit dded70d

File tree

202 files changed

+13674
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+13674
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@magento/venia-pwa-live-search",
3+
"version": "1.0.0",
4+
"description": "Live Search PWA Studio extension.",
5+
"main": "src/index.jsx",
6+
"scripts": {
7+
"clean": " "
8+
},
9+
"repository": "https://github.com/github:magento/pwa-studio",
10+
"license": "MIT",
11+
"dependencies": {
12+
"@adobe/magento-storefront-event-collector": "^1.13.0",
13+
"@adobe/magento-storefront-events-sdk": "^1.13.0",
14+
"@magento/pwa-buildpack": "~11.5.3",
15+
"@magento/storefront-search-as-you-type": "~1.0.4",
16+
"@magento/venia-ui": "~11.5.0",
17+
"currency-symbol-map": "^5.1.0"
18+
},
19+
"peerDependencies": {
20+
"react": "^17.0.2"
21+
},
22+
"pwa-studio": {
23+
"targets": {
24+
"intercept": "src/targets/intercept"
25+
}
26+
}
27+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
plugins: [require('tailwindcss/nesting')]
3+
};
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
/*
2+
Copyright 2024 Adobe
3+
All Rights Reserved.
4+
5+
NOTICE: Adobe permits you to use, modify, and distribute this file in
6+
accordance with the terms of the Adobe license agreement accompanying
7+
it.
8+
*/
9+
10+
const Facet = `
11+
fragment Facet on Aggregation {
12+
title
13+
attribute
14+
buckets {
15+
title
16+
__typename
17+
... on CategoryView {
18+
name
19+
count
20+
path
21+
}
22+
... on ScalarBucket {
23+
count
24+
}
25+
... on RangeBucket {
26+
from
27+
to
28+
count
29+
}
30+
... on StatsBucket {
31+
min
32+
max
33+
}
34+
}
35+
}
36+
`;
37+
38+
const ProductView = `
39+
fragment ProductView on ProductSearchItem {
40+
productView {
41+
id
42+
__typename
43+
sku
44+
name
45+
inStock
46+
url
47+
urlKey
48+
images {
49+
label
50+
url
51+
roles
52+
}
53+
... on ComplexProductView {
54+
priceRange {
55+
maximum {
56+
final {
57+
amount {
58+
value
59+
currency
60+
}
61+
}
62+
regular {
63+
amount {
64+
value
65+
currency
66+
}
67+
}
68+
}
69+
minimum {
70+
final {
71+
amount {
72+
value
73+
currency
74+
}
75+
}
76+
regular {
77+
amount {
78+
value
79+
currency
80+
}
81+
}
82+
}
83+
}
84+
options {
85+
id
86+
title
87+
values {
88+
title
89+
... on ProductViewOptionValueSwatch {
90+
id
91+
inStock
92+
type
93+
value
94+
}
95+
}
96+
}
97+
}
98+
... on SimpleProductView {
99+
price {
100+
final {
101+
amount {
102+
value
103+
currency
104+
}
105+
}
106+
regular {
107+
amount {
108+
value
109+
currency
110+
}
111+
}
112+
}
113+
}
114+
}
115+
highlights {
116+
attribute
117+
value
118+
matched_words
119+
}
120+
}
121+
`;
122+
123+
const Product = `
124+
fragment Product on ProductSearchItem {
125+
product {
126+
__typename
127+
sku
128+
description {
129+
html
130+
}
131+
short_description {
132+
html
133+
}
134+
name
135+
canonical_url
136+
small_image {
137+
url
138+
}
139+
image {
140+
url
141+
}
142+
thumbnail {
143+
url
144+
}
145+
price_range {
146+
minimum_price {
147+
fixed_product_taxes {
148+
amount {
149+
value
150+
currency
151+
}
152+
label
153+
}
154+
regular_price {
155+
value
156+
currency
157+
}
158+
final_price {
159+
value
160+
currency
161+
}
162+
discount {
163+
percent_off
164+
amount_off
165+
}
166+
}
167+
maximum_price {
168+
fixed_product_taxes {
169+
amount {
170+
value
171+
currency
172+
}
173+
label
174+
}
175+
regular_price {
176+
value
177+
currency
178+
}
179+
final_price {
180+
value
181+
currency
182+
}
183+
discount {
184+
percent_off
185+
amount_off
186+
}
187+
}
188+
}
189+
}
190+
}
191+
`;
192+
193+
export { Facet, ProductView, Product };
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
async function getGraphQL(
2+
query = '',
3+
variables = {},
4+
store = '',
5+
baseUrl = ''
6+
) {
7+
const graphqlEndpoint = baseUrl
8+
? `${baseUrl}/graphql`
9+
: `${window.origin}/graphql`;
10+
11+
const response = await fetch(graphqlEndpoint, {
12+
method: 'POST',
13+
headers: {
14+
'Content-Type': 'application/json',
15+
Store: store
16+
},
17+
body: JSON.stringify({
18+
query,
19+
variables
20+
})
21+
});
22+
23+
return response.json();
24+
}
25+
26+
export { getGraphQL };
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
const CREATE_EMPTY_CART = `
2+
mutation createEmptyCart($input: createEmptyCartInput) {
3+
createEmptyCart(input: $input)
4+
}
5+
`;
6+
7+
const ADD_TO_CART = `
8+
mutation addProductsToCart(
9+
$cartId: String!
10+
$cartItems: [CartItemInput!]!
11+
) {
12+
addProductsToCart(
13+
cartId: $cartId
14+
cartItems: $cartItems
15+
) {
16+
cart {
17+
items {
18+
product {
19+
name
20+
sku
21+
}
22+
quantity
23+
}
24+
}
25+
user_errors {
26+
code
27+
message
28+
}
29+
}
30+
}
31+
`;
32+
33+
const ADD_TO_WISHLIST = `
34+
mutation addProductsToWishlist(
35+
$wishlistId: ID!
36+
$wishlistItems: [WishlistItemInput!]!
37+
) {
38+
addProductsToWishlist(
39+
wishlistId: $wishlistId
40+
wishlistItems: $wishlistItems
41+
) {
42+
wishlist {
43+
id
44+
name
45+
items_count
46+
items_v2 {
47+
items {
48+
id
49+
product {
50+
uid
51+
name
52+
sku
53+
}
54+
}
55+
}
56+
}
57+
}
58+
}
59+
`;
60+
61+
const REMOVE_FROM_WISHLIST = `
62+
mutation removeProductsFromWishlist (
63+
$wishlistId: ID!
64+
$wishlistItemsIds: [ID!]!
65+
) {
66+
removeProductsFromWishlist(
67+
wishlistId: $wishlistId
68+
wishlistItemsIds: $wishlistItemsIds
69+
) {
70+
wishlist {
71+
id
72+
name
73+
items_count
74+
items_v2 {
75+
items {
76+
id
77+
product {
78+
uid
79+
name
80+
sku
81+
}
82+
}
83+
}
84+
}
85+
}
86+
}
87+
`;
88+
89+
export {
90+
CREATE_EMPTY_CART,
91+
ADD_TO_CART,
92+
ADD_TO_WISHLIST,
93+
REMOVE_FROM_WISHLIST
94+
};

0 commit comments

Comments
 (0)