@bikdotai/bik-component-library 0.0.787-beta.5 → 0.0.788-beta.0
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/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/variantComponents.js +1 -1
- package/dist/cjs/editor/extensions/editorDropdown.styles.js +48 -0
- package/dist/cjs/editor/extensions/mention/MentionDropdown.js +1 -1
- package/dist/cjs/editor/extensions/slashCommand/SlashCommandMenu.js +1 -1
- package/dist/cjs/request-executor/executor.js +1 -1
- package/dist/cjs/src/editor/extensions/editorDropdown.styles.d.ts +11 -0
- package/dist/esm/components/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/variantComponents.js +1 -1
- package/dist/esm/editor/extensions/editorDropdown.styles.js +48 -0
- package/dist/esm/editor/extensions/mention/MentionDropdown.js +1 -1
- package/dist/esm/editor/extensions/slashCommand/SlashCommandMenu.js +1 -1
- package/dist/esm/request-executor/executor.js +1 -1
- package/dist/esm/src/editor/extensions/editorDropdown.styles.d.ts +11 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@hello-pangea/dnd"),r=require("../../assets/icons/arrow_left.svg.js"),s=require("react"),o=require("../../constants/Theme.js"),c=require("../icon-button/IconButton.js"),n=require("../TypographyStyle.js"),i=require("./emptyState.js"),a=require("./helpers/ProductHelper.js"),l=require("./style.js"),d=require("./utility.js"),u=require("./variantComponents.js");exports.RearrangeScreen=p=>{const{selectedCollections:j,selectedCollectionsDispatch:S,setScreen:h,rearrangeViewType:y,outOfStockAction:f,scrollContainerRef:x,storeId:q,fbStatusFetcher:C,appType:g}=p,[O,V]=s.useState(a.parseSelectedVariantsToArray(j));s.useEffect((()=>{V(a.parseSelectedVariantsToArray(j))}),[j]),s.useEffect((()=>{var e;null===(e=null==x?void 0:x.current)||void 0===e||e.scrollTo({top:0}),d.fetchFbStatusCollection(j,q,g,S,C,"update")}),[]);return e.jsxs(t.DragDropContext,Object.assign({onDragEnd:e=>{if(!e.destination)return;const t=O,[r]=t.splice(e.source.index,1);t.splice(e.destination.index,0,r),t.forEach(((e,t)=>{e.displayOrder=t})),V(t)}},{children:[e.jsxs(l.SelectedScreenHeader,{children:[e.jsx(c.IconButton,{Icon:r.default,width:16,height:16,color:o.COLORS.content.secondary,onClick:()=>{h("collections")}}),e.jsx(n.BodyCaption,Object.assign({color:o.COLORS.content.secondary},{children:"All Products"}))]}),Object.keys(j).length>0?"list"===y?e.jsx(u.VariantsList,{selectedVariants:O,setSelectedVariants:V,selectedCollectionsDispatch:S,outOfStockAction:f}):e.jsx(u.VariantsGrid,{selectedVariants:O,setSelectedVariants:V,selectedCollectionsDispatch:S}):e.jsx(i.EmptyState,{title:"No Products Selected",subtitle:"Selected products will appear here"})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@hello-pangea/dnd"),a=require("react"),s=require("../../constants/Theme.js"),t=require("./variant.js");exports.VariantsGrid=a=>{let{selectedVariants:s}=a;return e.jsx(r.Droppable,Object.assign({droppableId:"droppable-horizontal"},{children:a=>e.jsxs("div",Object.assign({},a.droppableProps,{ref:a.innerRef,style:{display:"flex"}},{children:[e.jsx(r.Droppable,Object.assign({droppableId:"droppable-vertical",direction:"horizontal"},{children:a=>e.jsxs("div",Object.assign({},a.droppableProps,{ref:a.innerRef,style:{display:"flex",flexWrap:"wrap",flexDirection:"row"}},{children:[s.map(((a,s)=>e.jsx(r.Draggable,Object.assign({draggableId:`${a.productId}-${a.variantId}`,index:s},{children:(r,s)=>e.jsxs("div",Object.assign({ref:r.innerRef},r.draggableProps,r.dragHandleProps,{children:[e.jsx(t.VariantCardGridView,{data:a}),r.placeholder]}))}),`${a.productId}-${a.variantId}`))),a.placeholder]}))})),a.placeholder]}))}))},exports.VariantsList=d=>{let{selectedVariants:i,setSelectedVariants:n,selectedCollectionsDispatch:l,outOfStockAction:o}=d;const[p,c]=a.useState(-1);function g(e){if(null==e?void 0:e.transform){const r=`translate(0px, ${e.transform.split(",").pop()}`;return Object.assign(Object.assign({},e),{transform:r})}return e}return e.jsx(r.Droppable,Object.assign({droppableId:"droppable-list"},{children:(a,d)=>e.jsxs("div",Object.assign({},a.droppableProps,{ref:a.innerRef,style:Object.assign({backgroundColor:s.COLORS.surface.subdued,padding:"0.05px",height:i.length<8?"550px":"100%",overflow:"auto"},a.droppableProps.style)},{children:[i.map(((a,d)=>e.jsx("div",Object.assign({style:{background:s.COLORS.surface.hovered,margin:"5px",boxShadow:d===p?"0px 4px 12px rgba(0, 0, 0, 0.12)":""},onMouseEnter:()=>c(d),onMouseLeave:()=>c(-1)},{children:e.jsx(r.Draggable,Object.assign({draggableId:`${a.productId}-${a.variantId}`,index:d},{children:(r,s)=>e.jsx("div",Object.assign({ref:r.innerRef},r.draggableProps,r.dragHandleProps,{style:g(Object.assign(Object.assign({},r.draggableProps.style),r.draggableSnapshot))},{children:e.jsx(t.VariantCardListView,{data:a,selectedCollectionsDispatch:l,onDelete:()=>{const e=i.slice();e[d].displayOrder=null,e.splice(d,1),n(e)},outOfStockAction:o},`${a.productId}-${a.variantId}`)}))}),`${a.productId}-${a.variantId}`)}),`${a.productId}-${a.variantId}`))),a.placeholder&&d.isDraggingOver?e.jsx("div",Object.assign({style:{background:s.COLORS.surface.hovered,margin:"5px"}},{children:a.placeholder})):null]}))}))};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../constants/Theme.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(e);const n=o.default.div`
|
|
2
|
+
background: ${r.COLORS.surface.standard};
|
|
3
|
+
border: 1px solid ${r.COLORS.stroke.primary};
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
6
|
+
padding: 4px;
|
|
7
|
+
min-width: 180px;
|
|
8
|
+
max-height: 260px;
|
|
9
|
+
overflow-y: auto;
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
color: ${r.COLORS.content.primary};
|
|
12
|
+
`,a=o.default.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
padding: 6px 10px;
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
color: ${r.COLORS.content.primary};
|
|
20
|
+
background: ${e=>{let{$isActive:t}=e;return t?r.COLORS.surface.hovered:"transparent"}};
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
background: ${r.COLORS.surface.hovered};
|
|
24
|
+
}
|
|
25
|
+
`,i=o.default.img`
|
|
26
|
+
width: 24px;
|
|
27
|
+
height: 24px;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
`,p=o.default.span`
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
color: ${r.COLORS.content.primary};
|
|
34
|
+
`,s=o.default.span`
|
|
35
|
+
width: 8px;
|
|
36
|
+
height: 8px;
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
background: ${e=>{let{$online:t}=e;return t?r.COLORS.content.positive:r.COLORS.content.placeholder}};
|
|
39
|
+
margin-left: auto;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
`,d=o.default.span`
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
color: ${r.COLORS.content.primary};
|
|
44
|
+
`,c=o.default.span`
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
color: ${r.COLORS.content.secondary};
|
|
47
|
+
margin-left: auto;
|
|
48
|
+
`;exports.DropdownContainer=n,exports.DropdownItem=a,exports.MentionAvatar=i,exports.MentionLabel=p,exports.MentionPresenceDot=s,exports.SlashDescription=c,exports.SlashLabel=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react");const t=n.forwardRef(((t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=require("../editorDropdown.styles.js");const t=n.forwardRef(((t,o)=>{let{items:i,query:s,command:l,renderItem:a,renderDropdown:d}=t;const[c,u]=n.useState(0),p=e=>{i[e]&&l(i[e])};return n.useImperativeHandle(o,(()=>({onKeyDown:e=>{let{event:n}=e;return"ArrowUp"===n.key?(u((e=>(e+i.length-1)%i.length)),!0):"ArrowDown"===n.key?(u((e=>(e+1)%i.length)),!0):"Enter"===n.key&&(p(c),!0)}}))),n.useEffect((()=>u(0)),[i]),i.length?d?e.jsx(e.Fragment,{children:d({items:i,query:s,activeIndex:c,onSelect:e=>l(e)})}):e.jsx(r.DropdownContainer,{children:i.map(((n,t)=>e.jsx(r.DropdownItem,Object.assign({$isActive:t===c,onClick:()=>p(t)},{children:a?a(n,t===c):e.jsxs(e.Fragment,{children:[n.avatarUrl&&e.jsx(r.MentionAvatar,{src:n.avatarUrl,alt:""}),e.jsx(r.MentionLabel,{children:n.label}),void 0!==n.isOnline&&e.jsx(r.MentionPresenceDot,{$online:n.isOnline})]})}),n.id)))}):null}));t.displayName="MentionDropdown",exports.MentionDropdown=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),n=require("../editorDropdown.styles.js");const t=r.forwardRef(((t,s)=>{let{items:i,query:o,command:l,renderItem:a,renderDropdown:d}=t;const[c,u]=r.useState(0),m=e=>{i[e]&&l(i[e])};return r.useImperativeHandle(s,(()=>({onKeyDown:e=>{let{event:r}=e;return"ArrowUp"===r.key?(u((e=>(e+i.length-1)%i.length)),!0):"ArrowDown"===r.key?(u((e=>(e+1)%i.length)),!0):"Enter"===r.key&&(m(c),!0)}}))),r.useEffect((()=>u(0)),[i]),i.length?d?e.jsx(e.Fragment,{children:d({items:i,query:o,activeIndex:c,onSelect:e=>l(e)})}):e.jsx(n.DropdownContainer,{children:i.map(((r,t)=>e.jsx(n.DropdownItem,Object.assign({$isActive:t===c,onClick:()=>m(t)},{children:a?a(r,t===c):e.jsxs(e.Fragment,{children:[e.jsx(n.SlashLabel,{children:r.label}),r.description&&e.jsx(n.SlashDescription,{children:r.description})]})}),r.id)))}):null}));t.displayName="SlashCommandMenu",exports.SlashCommandMenu=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_tslib.js"),t=require("../firebase/environment.js"),r=require("../firebase/firebaseUserFetcher.js");require("../firebase/lazyFirebaseApp.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_tslib.js"),t=require("../firebase/environment.js"),r=require("../firebase/firebaseUserFetcher.js");require("../firebase/lazyFirebaseApp.js");var o=require("../utils/logging/Logger.js");var s,n;exports.HTTPMethods=void 0,(s=exports.HTTPMethods||(exports.HTTPMethods={})).GET="GET",s.POST="POST",s.PUT="PUT",s.PATCH="PATCH",s.DELETE="DELETE",exports.HTTP_CODE=void 0,(n=exports.HTTP_CODE||(exports.HTTP_CODE={}))[n.OK=200]="OK",n[n.REQUEST_TIMOUT=408]="REQUEST_TIMOUT",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n[n.PARTIAL_SUCCESS=207]="PARTIAL_SUCCESS";class i{static fetch(r){var o;return e.__awaiter(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.apiMethod||(r.apiMethod=exports.HTTPMethods.GET),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.environment.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.environment.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());let e=r.apiPath;const s={method:r.apiMethod,headers:r.requestHeader,body:JSON.stringify(r.requestBody)};if(r.apiMethod===exports.HTTPMethods.GET){const t="string"==typeof s.body?JSON.parse(s.body):s.body;e=e+"?"+i.getQueryParamsFromJsonObj(t),delete s.body,null===(o=r.requestHeader)||void 0===o||delete o["Content-Length"]}return new Promise(((t,r)=>{try{t(fetch(e,s).then((e=>e.json())).then((e=>(null==e?void 0:e.error)&&(null==e?void 0:e.status)?e:{data:e,status:exports.HTTP_CODE.OK})).catch((e=>({error:e,status:exports.HTTP_CODE.INTERNAL_SERVER_ERROR}))))}catch(e){r({error:e,status:exports.HTTP_CODE.INTERNAL_SERVER_ERROR})}}))}))}static getData(r){return e.__awaiter(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.environment.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.environment.apiHeaders.callerServiceFunction;let e=r.apiPath;const o="string"==typeof r.requestBody?JSON.parse(r.requestBody):r.requestBody;e=o&&Object.keys(o).length?e+"?"+i.getQueryParamsFromJsonObj(o):e;const s={method:exports.HTTPMethods.GET,headers:r.requestHeader};return new Promise(((t,r)=>{try{t(fetch(e,s).then((e=>e.json())).then((e=>(null==e?void 0:e.error)&&(null==e?void 0:e.status)?e:{data:e,status:exports.HTTP_CODE.OK})).catch((e=>({error:e,status:exports.HTTP_CODE.INTERNAL_SERVER_ERROR}))))}catch(e){r({error:e,status:exports.HTTP_CODE.INTERNAL_SERVER_ERROR})}}))}))}static sendData(r){return e.__awaiter(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.environment.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.environment.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());const e=JSON.parse(localStorage.getItem("Bik/CurrentUser")||"{}");let s=Object.assign({},r.requestBody);if(!r.requestBody.storeId&&!r.skipStoreId){const t=null==e?void 0:e.storeId;s=Object.assign(Object.assign({},s),{storeId:t})}const n=JSON.stringify(s),i=r.apiPath,a={method:r.apiMethod||exports.HTTPMethods.POST,headers:r.requestHeader,body:n},d=r.abortController;if(d){const{signal:e}=d;a.signal=e}return new Promise((e=>{try{e(fetch(i,a).then((e=>(e.headers.get("content-type")||"").includes("text")?e.text():e.json())).then((e=>(null==e?void 0:e.error)?e:((null==e?void 0:e.status)&&"boolean"!=typeof e.status&&e.status,void 0!==(null==e?void 0:e.response)&&(null==e?void 0:e.status)?{data:e.response,status:e.status,error:e.error}:{data:e,status:exports.HTTP_CODE.OK}))).catch((e=>(o.Logger.errorLog(o.ERROR_TYPES.API_ERROR,e,i,a),{error:e,status:exports.HTTP_CODE.INTERNAL_SERVER_ERROR}))))}catch(t){o.Logger.errorLog(o.ERROR_TYPES.API_ERROR,t,i,a),e({error:t,status:exports.HTTP_CODE.INTERNAL_SERVER_ERROR})}}))}))}static getQueryParamsFromJsonObj(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}static stream(r,o,s,n){var i,a;return e.__awaiter(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.environment.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.environment.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());const d=JSON.parse(localStorage.getItem("Bik/CurrentUser")||"{}");let u=Object.assign({},r.requestBody);if(!r.requestBody.storeId&&!r.skipStoreId){const e=null==d?void 0:d.storeId;u=Object.assign(Object.assign({},u),{storeId:e})}const c=JSON.stringify(u),l=r.apiPath,p={method:r.apiMethod||exports.HTTPMethods.POST,headers:r.requestHeader,body:c};r.apiMethod===exports.HTTPMethods.GET&&(delete p.body,null===(i=r.requestHeader)||void 0===i||delete i["Content-Length"]);const T=r.abortController;if(T){const{signal:e}=T;p.signal=e}try{const t=yield fetch(l,p),r=t.headers.get("content-type")||"";if(!t.ok)try{const e=yield t.json();return void(s&&s(e))}catch(e){console.error("Error parsing error response:",e)}if(r.includes("application/json"))try{const e=yield t.json();return!1===e.success||e.errors?void(s&&s(e)):(o(JSON.stringify(e)),void(n&&n()))}catch(e){return void(s&&s(e))}const i=null===(a=t.body)||void 0===a?void 0:a.getReader(),d=new TextDecoder("utf-8");let u="";const c=t=>e.__awaiter(this,void 0,void 0,(function*(){const{done:e,value:r}=t;if(!e){if(r){u+=d.decode(r,{stream:!0});const e=u.split("\n\n");u=e.pop()||"";for(const t of e)if(t.startsWith("data:")){const e=t.slice(5).trim();o(e)}}return null==i?void 0:i.read().then(c)}n&&n()}));null==i||i.read().then(c).catch((e=>{e instanceof Error&&"AbortError"===e.name||s&&s(e)}))}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;s&&s(e)}}))}static addAuthorizationHeader(t){return e.__awaiter(this,void 0,void 0,(function*(){if(["generateOTP","verifyOTP","generateBikEmailOTP","verifyBikEmailOTP","shopifyApiFunctions-verifySession","shopifyApiFunctions-storeShopifyDetails","shopifyApiFunctions-onboardShopifyStore","publicApiFunctions-getWidgetAssets","generateManifestOTP","verifyManifestOTP","shopifyApiFunctions-installOnManifest"].find((e=>t.apiPath.includes(e))))return;const e=yield r.FirebaseUserFetcher.getCurrentUser();if(!e)return;const o=yield e.getIdToken();t.requestHeader=Object.assign(Object.assign({},t.requestHeader||{}),{Authorization:o})}))}}exports.RequestExecutor=i,exports.TRANSACTION_ENABLED_STORE_IDS=["7zHbtv7b14Tz7JkQmJkFoZKE9vr2","5NuKUz08mCSvVvlIG6OVNPcwlAo1","OS05tCfU4pbLvfrNxEZS3KZxdRy2","pebUaEOadCNAwFKqMl495ruFFBH2","2EVskMIT1VcOahGZrzLMrUQK2CN2"];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DropdownContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const DropdownItem: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
$isActive?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const MentionAvatar: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
6
|
+
export declare const MentionLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
7
|
+
export declare const MentionPresenceDot: import("styled-components").StyledComponent<"span", any, {
|
|
8
|
+
$online?: boolean | undefined;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const SlashLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
11
|
+
export declare const SlashDescription: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import{useState as
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{DragDropContext as o}from"@hello-pangea/dnd";import r from"../../assets/icons/arrow_left.svg.js";import{useState as s,useEffect as c}from"react";import{COLORS as i}from"../../constants/Theme.js";import{IconButton as n}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as a}from"./emptyState.js";import{parseSelectedVariantsToArray as p}from"./helpers/ProductHelper.js";import{SelectedScreenHeader as d}from"./style.js";import{fetchFbStatusCollection as m}from"./utility.js";import{VariantsList as f,VariantsGrid as u}from"./variantComponents.js";const h=h=>{const{selectedCollections:j,selectedCollectionsDispatch:y,setScreen:S,rearrangeViewType:g,outOfStockAction:C,scrollContainerRef:b,storeId:O,fbStatusFetcher:v,appType:T}=h,[V,k]=s(p(j));c((()=>{k(p(j))}),[j]),c((()=>{var t;null===(t=null==b?void 0:b.current)||void 0===t||t.scrollTo({top:0}),m(j,O,T,y,v,"update")}),[]);return t(o,Object.assign({onDragEnd:t=>{if(!t.destination)return;const e=V,[o]=e.splice(t.source.index,1);e.splice(t.destination.index,0,o),e.forEach(((t,e)=>{t.displayOrder=e})),k(e)}},{children:[t(d,{children:[e(n,{Icon:r,width:16,height:16,color:i.content.secondary,onClick:()=>{S("collections")}}),e(l,Object.assign({color:i.content.secondary},{children:"All Products"}))]}),Object.keys(j).length>0?"list"===g?e(f,{selectedVariants:V,setSelectedVariants:k,selectedCollectionsDispatch:y,outOfStockAction:C}):e(u,{selectedVariants:V,setSelectedVariants:k,selectedCollectionsDispatch:y}):e(a,{title:"No Products Selected",subtitle:"Selected products will appear here"})]}))};export{h as RearrangeScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Droppable as a,Draggable as t}from"@hello-pangea/dnd";import{useState as n}from"react";import{COLORS as d}from"../../constants/Theme.js";import{VariantCardListView as s,VariantCardGridView as i}from"./variant.js";const o=i=>{let{selectedVariants:o,setSelectedVariants:l,selectedCollectionsDispatch:c,outOfStockAction:p}=i;const[g,b]=n(-1);function f(e){if(null==e?void 0:e.transform){const r=`translate(0px, ${e.transform.split(",").pop()}`;return Object.assign(Object.assign({},e),{transform:r})}return e}return e(a,Object.assign({droppableId:"droppable-list"},{children:(a,n)=>r("div",Object.assign({},a.droppableProps,{ref:a.innerRef,style:Object.assign({backgroundColor:d.surface.subdued,padding:"0.05px",height:o.length<8?"550px":"100%",overflow:"auto"},a.droppableProps.style)},{children:[o.map(((r,a)=>e("div",Object.assign({style:{background:d.surface.hovered,margin:"5px",boxShadow:a===g?"0px 4px 12px rgba(0, 0, 0, 0.12)":""},onMouseEnter:()=>b(a),onMouseLeave:()=>b(-1)},{children:e(t,Object.assign({draggableId:`${r.productId}-${r.variantId}`,index:a},{children:(t,n)=>e("div",Object.assign({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{style:f(Object.assign(Object.assign({},t.draggableProps.style),t.draggableSnapshot))},{children:e(s,{data:r,selectedCollectionsDispatch:c,onDelete:()=>{const e=o.slice();e[a].displayOrder=null,e.splice(a,1),l(e)},outOfStockAction:p},`${r.productId}-${r.variantId}`)}))}),`${r.productId}-${r.variantId}`)}),`${r.productId}-${r.variantId}`))),a.placeholder&&n.isDraggingOver?e("div",Object.assign({style:{background:d.surface.hovered,margin:"5px"}},{children:a.placeholder})):null]}))}))},l=n=>{let{selectedVariants:d}=n;return e(a,Object.assign({droppableId:"droppable-horizontal"},{children:n=>r("div",Object.assign({},n.droppableProps,{ref:n.innerRef,style:{display:"flex"}},{children:[e(a,Object.assign({droppableId:"droppable-vertical",direction:"horizontal"},{children:a=>r("div",Object.assign({},a.droppableProps,{ref:a.innerRef,style:{display:"flex",flexWrap:"wrap",flexDirection:"row"}},{children:[d.map(((a,n)=>e(t,Object.assign({draggableId:`${a.productId}-${a.variantId}`,index:n},{children:(t,n)=>r("div",Object.assign({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{children:[e(i,{data:a}),t.placeholder]}))}),`${a.productId}-${a.variantId}`))),a.placeholder]}))})),n.placeholder]}))}))};export{l as VariantsGrid,o as VariantsList};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import r from"styled-components";import{COLORS as o}from"../../constants/Theme.js";const e=r.div`
|
|
2
|
+
background: ${o.surface.standard};
|
|
3
|
+
border: 1px solid ${o.stroke.primary};
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
6
|
+
padding: 4px;
|
|
7
|
+
min-width: 180px;
|
|
8
|
+
max-height: 260px;
|
|
9
|
+
overflow-y: auto;
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
color: ${o.content.primary};
|
|
12
|
+
`,t=r.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
padding: 6px 10px;
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
color: ${o.content.primary};
|
|
20
|
+
background: ${r=>{let{$isActive:e}=r;return e?o.surface.hovered:"transparent"}};
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
background: ${o.surface.hovered};
|
|
24
|
+
}
|
|
25
|
+
`,n=r.img`
|
|
26
|
+
width: 24px;
|
|
27
|
+
height: 24px;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
`,i=r.span`
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
color: ${o.content.primary};
|
|
34
|
+
`,a=r.span`
|
|
35
|
+
width: 8px;
|
|
36
|
+
height: 8px;
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
background: ${r=>{let{$online:e}=r;return e?o.content.positive:o.content.placeholder}};
|
|
39
|
+
margin-left: auto;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
`,p=r.span`
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
color: ${o.content.primary};
|
|
44
|
+
`,d=r.span`
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
color: ${o.content.secondary};
|
|
47
|
+
margin-left: auto;
|
|
48
|
+
`;export{e as DropdownContainer,t as DropdownItem,n as MentionAvatar,i as MentionLabel,a as MentionPresenceDot,d as SlashDescription,p as SlashLabel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import{forwardRef as t,useState as o,useImperativeHandle as i,useEffect as l}from"react";import{DropdownContainer as a,DropdownItem as c,MentionAvatar as d,MentionLabel as s,MentionPresenceDot as m}from"../editorDropdown.styles.js";const p=t(((t,p)=>{let{items:h,query:y,command:w,renderItem:u,renderDropdown:v}=t;const[g,D]=o(0),k=e=>{h[e]&&w(h[e])};return i(p,(()=>({onKeyDown:e=>{let{event:r}=e;return"ArrowUp"===r.key?(D((e=>(e+h.length-1)%h.length)),!0):"ArrowDown"===r.key?(D((e=>(e+1)%h.length)),!0):"Enter"===r.key&&(k(g),!0)}}))),l((()=>D(0)),[h]),h.length?v?e(r,{children:v({items:h,query:y,activeIndex:g,onSelect:e=>w(e)})}):e(a,{children:h.map(((t,o)=>e(c,Object.assign({$isActive:o===g,onClick:()=>k(o)},{children:u?u(t,o===g):n(r,{children:[t.avatarUrl&&e(d,{src:t.avatarUrl,alt:""}),e(s,{children:t.label}),void 0!==t.isOnline&&e(m,{$online:t.isOnline})]})}),t.id)))}):null}));p.displayName="MentionDropdown";export{p as MentionDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import{forwardRef as t,useState as o,useImperativeHandle as i,useEffect as l}from"react";import{DropdownContainer as c,DropdownItem as d,SlashLabel as m,SlashDescription as s}from"../editorDropdown.styles.js";const a=t(((t,a)=>{let{items:h,query:p,command:y,renderItem:u,renderDropdown:w}=t;const[g,k]=o(0),D=e=>{h[e]&&y(h[e])};return i(a,(()=>({onKeyDown:e=>{let{event:r}=e;return"ArrowUp"===r.key?(k((e=>(e+h.length-1)%h.length)),!0):"ArrowDown"===r.key?(k((e=>(e+1)%h.length)),!0):"Enter"===r.key&&(D(g),!0)}}))),l((()=>k(0)),[h]),h.length?w?e(r,{children:w({items:h,query:p,activeIndex:g,onSelect:e=>y(e)})}):e(c,{children:h.map(((t,o)=>e(d,Object.assign({$isActive:o===g,onClick:()=>D(o)},{children:u?u(t,o===g):n(r,{children:[e(m,{children:t.label}),t.description&&e(s,{children:t.description})]})}),t.id)))}):null}));a.displayName="SlashCommandMenu";export{a as SlashCommandMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../_virtual/_tslib.js";import{environment as t}from"../firebase/environment.js";import{FirebaseUserFetcher as r}from"../firebase/firebaseUserFetcher.js";import"../firebase/lazyFirebaseApp.js";import{Logger as o,ERROR_TYPES as s}from"../utils/logging/Logger.js";const i=["7zHbtv7b14Tz7JkQmJkFoZKE9vr2","5NuKUz08mCSvVvlIG6OVNPcwlAo1","OS05tCfU4pbLvfrNxEZS3KZxdRy2","pebUaEOadCNAwFKqMl495ruFFBH2","2EVskMIT1VcOahGZrzLMrUQK2CN2"];var n,a;!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE"}(n||(n={})),function(e){e[e.OK=200]="OK",e[e.REQUEST_TIMOUT=408]="REQUEST_TIMOUT",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.PARTIAL_SUCCESS=207]="PARTIAL_SUCCESS"}(a||(a={}));class d{static fetch(r){var o;return e(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.apiMethod||(r.apiMethod=n.GET),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());let e=r.apiPath;const s={method:r.apiMethod,headers:r.requestHeader,body:JSON.stringify(r.requestBody)};if(r.apiMethod===n.GET){const t="string"==typeof s.body?JSON.parse(s.body):s.body;e=e+"?"+d.getQueryParamsFromJsonObj(t),delete s.body,null===(o=r.requestHeader)||void 0===o||delete o["Content-Length"]}return new Promise(((t,r)=>{try{t(fetch(e,s).then((e=>e.json())).then((e=>(null==e?void 0:e.error)&&(null==e?void 0:e.status)?e:{data:e,status:a.OK})).catch((e=>({error:e,status:a.INTERNAL_SERVER_ERROR}))))}catch(e){r({error:e,status:a.INTERNAL_SERVER_ERROR})}}))}))}static getData(r){return e(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.apiHeaders.callerServiceFunction;let e=r.apiPath;const o="string"==typeof r.requestBody?JSON.parse(r.requestBody):r.requestBody;e=o&&Object.keys(o).length?e+"?"+d.getQueryParamsFromJsonObj(o):e;const s={method:n.GET,headers:r.requestHeader};return new Promise(((t,r)=>{try{t(fetch(e,s).then((e=>e.json())).then((e=>(null==e?void 0:e.error)&&(null==e?void 0:e.status)?e:{data:e,status:a.OK})).catch((e=>({error:e,status:a.INTERNAL_SERVER_ERROR}))))}catch(e){r({error:e,status:a.INTERNAL_SERVER_ERROR})}}))}))}static sendData(r){return e(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());const e=JSON.parse(localStorage.getItem("Bik/CurrentUser")||"{}");let i=Object.assign({},r.requestBody);if(!r.requestBody.storeId&&!r.skipStoreId){const t=null==e?void 0:e.storeId;i=Object.assign(Object.assign({},i),{storeId:t})}const d=JSON.stringify(i),u=r.apiPath,c={method:r.apiMethod||n.POST,headers:r.requestHeader,body:d},l=r.abortController;if(l){const{signal:e}=l;c.signal=e}return new Promise((e=>{try{e(fetch(u,c).then((e=>(e.headers.get("content-type")||"").includes("text")?e.text():e.json())).then((e=>(null==e?void 0:e.error)?e:((null==e?void 0:e.status)&&"boolean"!=typeof e.status&&e.status,void 0!==(null==e?void 0:e.response)&&(null==e?void 0:e.status)?{data:e.response,status:e.status,error:e.error}:{data:e,status:a.OK}))).catch((e=>(o.errorLog(s.API_ERROR,e,u,c),{error:e,status:a.INTERNAL_SERVER_ERROR}))))}catch(t){o.errorLog(s.API_ERROR,t,u,c),e({error:t,status:a.INTERNAL_SERVER_ERROR})}}))}))}static getQueryParamsFromJsonObj(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}static stream(r,o,s,i){var a,d;return e(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());const u=JSON.parse(localStorage.getItem("Bik/CurrentUser")||"{}");let c=Object.assign({},r.requestBody);if(!r.requestBody.storeId&&!r.skipStoreId){const e=null==u?void 0:u.storeId;c=Object.assign(Object.assign({},c),{storeId:e})}const l=JSON.stringify(c),y=r.apiPath,h={method:r.apiMethod||n.POST,headers:r.requestHeader,body:l};r.apiMethod===n.GET&&(delete h.body,null===(a=r.requestHeader)||void 0===a||delete a["Content-Length"]);const p=r.abortController;if(p){const{signal:e}=p;h.signal=e}try{const t=yield fetch(y,h),r=t.headers.get("content-type")||"";if(!t.ok)try{const e=yield t.json();return void(s&&s(e))}catch(e){console.error("Error parsing error response:",e)}if(r.includes("application/json"))try{const e=yield t.json();return!1===e.success||e.errors?void(s&&s(e)):(o(JSON.stringify(e)),void(i&&i()))}catch(e){return void(s&&s(e))}const n=null===(d=t.body)||void 0===d?void 0:d.getReader(),a=new TextDecoder("utf-8");let u="";const c=t=>e(this,void 0,void 0,(function*(){const{done:e,value:r}=t;if(!e){if(r){u+=a.decode(r,{stream:!0});const e=u.split("\n\n");u=e.pop()||"";for(const t of e)if(t.startsWith("data:")){const e=t.slice(5).trim();o(e)}}return null==n?void 0:n.read().then(c)}i&&i()}));null==n||n.read().then(c)}catch(e){s&&s(e)}}))}static addAuthorizationHeader(t){return e(this,void 0,void 0,(function*(){if(["generateOTP","verifyOTP","generateBikEmailOTP","verifyBikEmailOTP","shopifyApiFunctions-verifySession","shopifyApiFunctions-storeShopifyDetails","shopifyApiFunctions-onboardShopifyStore","publicApiFunctions-getWidgetAssets","generateManifestOTP","verifyManifestOTP","shopifyApiFunctions-installOnManifest"].find((e=>t.apiPath.includes(e))))return;const e=yield r.getCurrentUser();if(!e)return;const o=yield e.getIdToken();t.requestHeader=Object.assign(Object.assign({},t.requestHeader||{}),{Authorization:o})}))}}export{n as HTTPMethods,a as HTTP_CODE,d as RequestExecutor,i as TRANSACTION_ENABLED_STORE_IDS};
|
|
1
|
+
import{__awaiter as e}from"../_virtual/_tslib.js";import{environment as t}from"../firebase/environment.js";import{FirebaseUserFetcher as r}from"../firebase/firebaseUserFetcher.js";import"../firebase/lazyFirebaseApp.js";import{Logger as o,ERROR_TYPES as s}from"../utils/logging/Logger.js";const i=["7zHbtv7b14Tz7JkQmJkFoZKE9vr2","5NuKUz08mCSvVvlIG6OVNPcwlAo1","OS05tCfU4pbLvfrNxEZS3KZxdRy2","pebUaEOadCNAwFKqMl495ruFFBH2","2EVskMIT1VcOahGZrzLMrUQK2CN2"];var n,a;!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE"}(n||(n={})),function(e){e[e.OK=200]="OK",e[e.REQUEST_TIMOUT=408]="REQUEST_TIMOUT",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.PARTIAL_SUCCESS=207]="PARTIAL_SUCCESS"}(a||(a={}));class d{static fetch(r){var o;return e(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.apiMethod||(r.apiMethod=n.GET),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());let e=r.apiPath;const s={method:r.apiMethod,headers:r.requestHeader,body:JSON.stringify(r.requestBody)};if(r.apiMethod===n.GET){const t="string"==typeof s.body?JSON.parse(s.body):s.body;e=e+"?"+d.getQueryParamsFromJsonObj(t),delete s.body,null===(o=r.requestHeader)||void 0===o||delete o["Content-Length"]}return new Promise(((t,r)=>{try{t(fetch(e,s).then((e=>e.json())).then((e=>(null==e?void 0:e.error)&&(null==e?void 0:e.status)?e:{data:e,status:a.OK})).catch((e=>({error:e,status:a.INTERNAL_SERVER_ERROR}))))}catch(e){r({error:e,status:a.INTERNAL_SERVER_ERROR})}}))}))}static getData(r){return e(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.apiHeaders.callerServiceFunction;let e=r.apiPath;const o="string"==typeof r.requestBody?JSON.parse(r.requestBody):r.requestBody;e=o&&Object.keys(o).length?e+"?"+d.getQueryParamsFromJsonObj(o):e;const s={method:n.GET,headers:r.requestHeader};return new Promise(((t,r)=>{try{t(fetch(e,s).then((e=>e.json())).then((e=>(null==e?void 0:e.error)&&(null==e?void 0:e.status)?e:{data:e,status:a.OK})).catch((e=>({error:e,status:a.INTERNAL_SERVER_ERROR}))))}catch(e){r({error:e,status:a.INTERNAL_SERVER_ERROR})}}))}))}static sendData(r){return e(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());const e=JSON.parse(localStorage.getItem("Bik/CurrentUser")||"{}");let i=Object.assign({},r.requestBody);if(!r.requestBody.storeId&&!r.skipStoreId){const t=null==e?void 0:e.storeId;i=Object.assign(Object.assign({},i),{storeId:t})}const d=JSON.stringify(i),u=r.apiPath,c={method:r.apiMethod||n.POST,headers:r.requestHeader,body:d},l=r.abortController;if(l){const{signal:e}=l;c.signal=e}return new Promise((e=>{try{e(fetch(u,c).then((e=>(e.headers.get("content-type")||"").includes("text")?e.text():e.json())).then((e=>(null==e?void 0:e.error)?e:((null==e?void 0:e.status)&&"boolean"!=typeof e.status&&e.status,void 0!==(null==e?void 0:e.response)&&(null==e?void 0:e.status)?{data:e.response,status:e.status,error:e.error}:{data:e,status:a.OK}))).catch((e=>(o.errorLog(s.API_ERROR,e,u,c),{error:e,status:a.INTERNAL_SERVER_ERROR}))))}catch(t){o.errorLog(s.API_ERROR,t,u,c),e({error:t,status:a.INTERNAL_SERVER_ERROR})}}))}))}static getQueryParamsFromJsonObj(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}static stream(r,o,s,i){var a,d;return e(this,void 0,void 0,(function*(){yield this.addAuthorizationHeader(r),r.requestHeader||(r.requestHeader={}),r.requestBody||(r.requestBody={}),r.requestHeader["Content-Type"]="application/json",r.requestHeader.callerServiceName=t.apiHeaders.callerServiceName,r.requestHeader.callerServiceFunction=t.apiHeaders.callerServiceFunction,r.requestBody&&(r.requestHeader["Content-Length"]="object"==typeof r.requestBody?JSON.stringify(r.requestBody).length.toString():r.requestBody.length.toString());const u=JSON.parse(localStorage.getItem("Bik/CurrentUser")||"{}");let c=Object.assign({},r.requestBody);if(!r.requestBody.storeId&&!r.skipStoreId){const e=null==u?void 0:u.storeId;c=Object.assign(Object.assign({},c),{storeId:e})}const l=JSON.stringify(c),y=r.apiPath,h={method:r.apiMethod||n.POST,headers:r.requestHeader,body:l};r.apiMethod===n.GET&&(delete h.body,null===(a=r.requestHeader)||void 0===a||delete a["Content-Length"]);const p=r.abortController;if(p){const{signal:e}=p;h.signal=e}try{const t=yield fetch(y,h),r=t.headers.get("content-type")||"";if(!t.ok)try{const e=yield t.json();return void(s&&s(e))}catch(e){console.error("Error parsing error response:",e)}if(r.includes("application/json"))try{const e=yield t.json();return!1===e.success||e.errors?void(s&&s(e)):(o(JSON.stringify(e)),void(i&&i()))}catch(e){return void(s&&s(e))}const n=null===(d=t.body)||void 0===d?void 0:d.getReader(),a=new TextDecoder("utf-8");let u="";const c=t=>e(this,void 0,void 0,(function*(){const{done:e,value:r}=t;if(!e){if(r){u+=a.decode(r,{stream:!0});const e=u.split("\n\n");u=e.pop()||"";for(const t of e)if(t.startsWith("data:")){const e=t.slice(5).trim();o(e)}}return null==n?void 0:n.read().then(c)}i&&i()}));null==n||n.read().then(c).catch((e=>{e instanceof Error&&"AbortError"===e.name||s&&s(e)}))}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;s&&s(e)}}))}static addAuthorizationHeader(t){return e(this,void 0,void 0,(function*(){if(["generateOTP","verifyOTP","generateBikEmailOTP","verifyBikEmailOTP","shopifyApiFunctions-verifySession","shopifyApiFunctions-storeShopifyDetails","shopifyApiFunctions-onboardShopifyStore","publicApiFunctions-getWidgetAssets","generateManifestOTP","verifyManifestOTP","shopifyApiFunctions-installOnManifest"].find((e=>t.apiPath.includes(e))))return;const e=yield r.getCurrentUser();if(!e)return;const o=yield e.getIdToken();t.requestHeader=Object.assign(Object.assign({},t.requestHeader||{}),{Authorization:o})}))}}export{n as HTTPMethods,a as HTTP_CODE,d as RequestExecutor,i as TRANSACTION_ENABLED_STORE_IDS};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DropdownContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const DropdownItem: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
$isActive?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const MentionAvatar: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
6
|
+
export declare const MentionLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
7
|
+
export declare const MentionPresenceDot: import("styled-components").StyledComponent<"span", any, {
|
|
8
|
+
$online?: boolean | undefined;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const SlashLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
11
|
+
export declare const SlashDescription: import("styled-components").StyledComponent<"span", any, {}, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bikdotai/bik-component-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.788-beta.0",
|
|
4
4
|
"description": "Bik Component Library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"@amplitude/analytics-browser": "^2.9.3",
|
|
66
66
|
"@babel/runtime": "^7.20.7",
|
|
67
67
|
"@bikdotai/bik-models": "10.6.2-beta.9",
|
|
68
|
+
"@hello-pangea/dnd": "^18.0.1",
|
|
68
69
|
"@popperjs/core": "^2.11.7",
|
|
69
70
|
"@tippyjs/react": "^4.2.6",
|
|
70
71
|
"@tiptap/extension-character-count": "^3.22.5",
|
|
@@ -95,7 +96,6 @@
|
|
|
95
96
|
"idb-keyval": "^6.2.2",
|
|
96
97
|
"lodash": "^4.17.21",
|
|
97
98
|
"phone": "^3.1.37",
|
|
98
|
-
"react-beautiful-dnd": "^13.1.1",
|
|
99
99
|
"react-bootstrap": "^2.4.0",
|
|
100
100
|
"react-calendar": "^3.7.0",
|
|
101
101
|
"react-chartjs-2": "^4.3.1",
|