@billgangcom/theme-lib 1.123.0 → 1.123.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/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +32 -32
- package/package.json +1 -1
package/dist/builder.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./builder-BNQD7fm1.cjs"),m=require("./ticket-C5g3kw8c.cjs"),n=require("react"),v=require("./charge-DcKd_es2.cjs"),_=require("./ui-components-jkqz3-Kc.cjs"),e=require("@phosphor-icons/react"),Q=({children:r,shopDomain:u,shopId:d,shopPassword:h,shopLogo:g})=>{const{setShopDomain:x,setShopId:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./builder-BNQD7fm1.cjs"),m=require("./ticket-C5g3kw8c.cjs"),n=require("react"),v=require("./charge-DcKd_es2.cjs"),_=require("./ui-components-jkqz3-Kc.cjs"),e=require("@phosphor-icons/react"),Q=({children:r,shopDomain:u,shopId:d,shopPassword:h,shopLogo:g})=>{const{setShopDomain:x,setShopId:j,setShopPassword:P,setShopTerms:p,setShopPrivacyPolicy:l,setShopRefundPolicy:f,setShopLogo:y}=i.useStorefrontStore();return n.useLayoutEffect(()=>{const s=async()=>{const{data:a}=await v.fetchTerms();p(a)},S=async()=>{const{data:a}=await v.fetchPrivacyPolicy();l(a)},A=async()=>{const{data:a}=await v.fetchRefundPolicy();f(a)};x(u),j(d),h&&P(h),g&&y(g),s(),S(),A()},[u,d,h]),t.jsx(t.Fragment,{children:r})},X="_wrapper_1xuz3_18",D={wrapper:X};function J(){_.registerIcons({X:e.XIcon,Plus:e.PlusIcon,Minus:e.MinusIcon,Check:e.CheckIcon,Clock:e.ClockIcon,Info:e.InfoIcon,Copy:e.CopyIcon,Trash:e.TrashIcon,Sliders:e.SlidersIcon,Image:e.ImageIcon,List:e.ListIcon,Handbag:e.HandbagIcon,Bag:e.BagIcon,Eye:e.EyeIcon,Crown:e.CrownIcon,ArrowUp:e.ArrowUpIcon,ArrowDown:e.ArrowDownIcon,Confetti:e.ConfettiIcon,ArrowLeft:e.ArrowLeftIcon,ArrowRight:e.ArrowRightIcon,ArrowLineUpRight:e.ArrowLineUpRightIcon,ArrowUpRight:e.ArrowUpRightIcon,ArrowUUpLeft:e.ArrowUUpLeftIcon,ArrowUUpRight:e.ArrowUUpRightIcon,CaretRight:e.CaretRightIcon,CaretDown:e.CaretDownIcon,CaretUp:e.CaretUpIcon,CaretLeft:e.CaretLeftIcon,MagnifyingGlass:e.MagnifyingGlassIcon,MagnifyingGlassMinus:e.MagnifyingGlassMinusIcon,ArrowLineDown:e.ArrowLineDownIcon,Selection:e.SelectionIcon,CloudArrowUpIcon:e.CloudArrowUpIcon,ArrowsHorizontal:e.ArrowsHorizontalIcon,ArrowsVertical:e.ArrowsVerticalIcon,CheckCircle:e.CheckCircleIcon,XCircle:e.XCircleIcon,Star:e.StarIcon,Fire:e.FireIcon,Lightning:e.LightningIcon,AlignCenterHorizontal:e.AlignCenterHorizontalIcon,File:e.FileIcon,FileText:e.FileTextIcon,BookOpen:e.BookOpenIcon,DownloadSimple:e.DownloadSimpleIcon,DiscordLogo:e.DiscordLogoIcon,TelegramLogo:e.TelegramLogoIcon,SignOut:e.SignOutIcon,Wallet:e.WalletIcon,PaperPlaneRight:e.PaperPlaneRightIcon,ChatsTeardrop:e.ChatsTeardropIcon,DotsSixVertical:e.DotsSixVerticalIcon,Share:e.ShareIcon,Shield:e.ShieldIcon,ShieldCheck:e.ShieldCheckIcon,FileCloud:e.FileCloudIcon,Lock:e.LockIcon,Heart:e.HeartIcon,User:e.UserIcon,Calendar:e.CalendarIcon,Smiley:e.SmileyIcon,Globe:e.GlobeIcon,House:e.HouseIcon,HouseSimple:e.HouseSimpleIcon,CurrencyCircleDollar:e.CurrencyCircleDollarIcon,Medal:e.MedalIcon,CalendarCheck:e.CalendarCheckIcon,Question:e.QuestionIcon,Warning:e.WarningIcon,WarningDiamond:e.WarningDiamondIcon,TreeStructure:e.TreeStructureIcon,Palette:e.PaletteIcon,Gear:e.GearIcon,PaintBrushBroad:e.PaintBrushBroadIcon,TextAa:e.TextAaIcon,TextB:e.TextBIcon,TextH:e.TextHIcon,CornersOut:e.CornersOutIcon,ArrowSquareIn:e.ArrowSquareInIcon,Textbox:e.TextboxIcon,SquaresFour:e.SquaresFourIcon,SealQuestion:e.SealQuestionIcon,ChatCentered:e.ChatCenteredIcon,Ticket:e.TicketIcon,UserCircleGear:e.UserCircleGearIcon,Desktop:e.DesktopIcon,DeviceTabletCamera:e.DeviceTabletCameraIcon,DeviceMobileCamera:e.DeviceMobileCameraIcon,Cards:e.CardsIcon,PushPin:e.PushPinIcon,TextAlignLeft:e.TextAlignLeftIcon,TextAlignRight:e.TextAlignRightIcon,TextAlignCenter:e.TextAlignCenterIcon,AlignLeft:e.AlignLeftIcon,AlignRight:e.AlignRightIcon,AlignTop:e.AlignTopIcon,AlignBottom:e.AlignBottomIcon,TextItalic:e.TextItalicIcon,TextStrikethrough:e.TextStrikethroughIcon,TextUnderline:e.TextUnderlineIcon})}const $=n.lazy(()=>Promise.resolve().then(()=>require("./builder-BNQD7fm1.cjs")).then(r=>r.index).then(r=>({default:r.BuilderPage}))),K=n.lazy(()=>Promise.resolve().then(()=>require("./index-BnMpELp_.cjs")).then(r=>({default:r.ErrorPage}))),Y=n.lazy(()=>Promise.resolve().then(()=>require("./index-BYdRgPyI.cjs")).then(r=>({default:r.ActivePage}))),Z=n.lazy(()=>Promise.resolve().then(()=>require("./validation-Be-6h5-8.cjs")).then(r=>({default:r.ValidationPage}))),ee=n.lazy(()=>Promise.resolve().then(()=>require("./index-DoklSmf4.cjs")).then(r=>({default:r.WrapperPage}))),te=n.lazy(()=>Promise.resolve().then(()=>require("./index-Dyg2ZZW6.cjs")).then(r=>({default:r.RouterErrorPage}))),c=n.lazy(()=>Promise.resolve().then(()=>require("./index-BtqOzf1F.cjs")).then(r=>({default:r.DynamicErrorPage}))),re=n.lazy(()=>Promise.resolve().then(()=>require("./checkout-BQwNBpVW.cjs")).then(r=>({default:r.Checkout}))),ne=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.index$1).then(r=>({default:r.ChargePage}))),oe=n.lazy(()=>Promise.resolve().then(()=>require("./ticket-C5g3kw8c.cjs")).then(r=>r.index).then(r=>({default:r.TicketItem}))),se=n.lazy(()=>Promise.resolve().then(()=>require("./subscription-5ytxlwXp.cjs")).then(r=>r.index).then(r=>({default:r.Subscription}))),ce=n.lazy(()=>Promise.resolve().then(()=>require("./top-up-CrbYB293.cjs")).then(r=>({default:r.TopUpBalance}))),ie=n.lazy(()=>Promise.resolve().then(()=>require("./order-B0gf5VEi.cjs")).then(r=>r.index).then(r=>({default:r.OrderPage}))),ae=n.lazy(()=>Promise.resolve().then(()=>require("./index-DozNvPOR.cjs")).then(r=>({default:r.TermsPage}))),le=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.index).then(r=>({default:r.CustomerDashboard}))),U=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.recapcha).then(r=>({default:r.ReCaptchaProvider}))),ue=()=>null,o=({children:r})=>t.jsx(n.Suspense,{fallback:t.jsx(ue,{}),children:r}),B=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderAnnouncement}))),L=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderFooter}))),R=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderHeader}))),de=r=>{var q;const{blocks:u,settings:d,header:h,footer:g,announcement:x,routes:j=[],shopLogo:P,apiURLs:p,isAntistock:l=!1}=r,[f,y]=n.useState(null),{general:s,setIsAntistock:S}=i.useGeneralStore(),{setApiUrls:A}=i.useApiStore(),a=((q=s==null?void 0:s.info)==null?void 0:q.customerAccountSettings)??"OPTIONAL",z=a==="DISABLED",{setBlocks:H,setSourceBlocks:F,setHeader:O,setFooter:M,setAnnouncement:G,setSettings:W}=i.useBlocksStore(),{themeSettings:C}=i.useThemeSettingsStore(),{settings:T,setSettings:V}=i.useSettingsStore(),w=i.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"":window.location.hostname,N=localStorage.getItem("shopPassword"),b=localStorage.getItem("shopId")||"";return n.useEffect(()=>{S(l)},[l,S]),n.useEffect(()=>{!b&&(s!=null&&s.info.id)&&localStorage.setItem("shopId",s==null?void 0:s.info.id)},[s]),n.useEffect(()=>{!w&&!l&&localStorage.setItem("fakeDomain","drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io")},[w]),n.useEffect(()=>{if(C&&T){const I=m.generateDynamicStyles(C,T);m.loadCustomFonts(),m.setupDynamicFonts(C),m.injectStylesToDOM(I)}},[C,JSON.stringify(T),window.location.hostname]),n.useEffect(()=>{const k=new d().blockSettings;V(k)},[]),n.useEffect(()=>{J()},[]),n.useLayoutEffect(()=>{const I={};Object.keys(u).map(E=>{I[E]=u[E]}),F(I),H(I),O(h),M(g),G(x),W(d),p&&A(p);const k=i.createBrowserRouter([{element:t.jsx(Q,{shopDomain:w,shopId:b,shopPassword:N||void 0,shopLogo:P,children:t.jsx(U,{children:t.jsx(ee,{children:t.jsx(i.Outlet,{})})})}),errorElement:t.jsx(o,{children:t.jsx(te,{})}),children:[{path:"/admin/builder/*",element:t.jsx(o,{children:t.jsx(Y,{children:t.jsx($,{blocks:u,settings:d,header:h,footer:g,announcement:x})})}),errorElement:t.jsx(o,{children:t.jsx(K,{})})},...j,{path:"/checkout",element:t.jsx(o,{children:t.jsx(re,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Checkout",!0)},{path:"/top-up",element:t.jsx(o,{children:t.jsx(ce,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Top Up Balance",!0)},{path:"/charges/:id",element:t.jsx(o,{children:t.jsx(ne,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Charges",!0)},{path:"/orders/:id/:accessToken?",element:t.jsx(o,{children:t.jsx(ie,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Orders",!0)},{path:"/subscriptions/:id/:accessToken?",element:t.jsx(o,{children:t.jsx(se,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Subscriptions",!0)},...z?[]:[{path:l?"/account":"/customer-dash",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(B,{}),t.jsx(R,{}),t.jsx("div",{style:{flex:"1 1 auto"},children:t.jsx(le,{})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title=l?"Account":"Customer Dashboard",!0)}],{path:"/validation",element:t.jsx(o,{children:t.jsx(Z,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Validation",!0)},{path:"/ticket/:id/:accessToken",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(R,{}),t.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:t.jsx(U,{children:t.jsx(oe,{})})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Ticket",!0)},{path:"/terms",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(B,{}),t.jsx(R,{}),t.jsx("div",{style:{flex:1,width:"100%"},children:t.jsx(ae,{})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Terms of Service",!0)},{path:"*",element:t.jsx(m.DynamicRouteWrapper,{}),errorElement:t.jsx(o,{children:t.jsx(c,{})})}]}]);y(k)},[s,a]),t.jsx(n.Suspense,{fallback:null,children:f&&t.jsx(i.RouterProvider,{router:f})})};exports.App=de;
|
package/dist/builder.es.js
CHANGED
|
@@ -14,25 +14,25 @@ const oo = ({
|
|
|
14
14
|
}) => {
|
|
15
15
|
const {
|
|
16
16
|
setShopDomain: m,
|
|
17
|
-
setShopId:
|
|
18
|
-
setShopPassword:
|
|
17
|
+
setShopId: S,
|
|
18
|
+
setShopPassword: C,
|
|
19
19
|
setShopTerms: I,
|
|
20
|
-
setShopPrivacyPolicy:
|
|
20
|
+
setShopPrivacyPolicy: i,
|
|
21
21
|
setShopRefundPolicy: p,
|
|
22
|
-
setShopLogo:
|
|
22
|
+
setShopLogo: y
|
|
23
23
|
} = V();
|
|
24
24
|
return o.useLayoutEffect(() => {
|
|
25
25
|
const r = async () => {
|
|
26
|
-
const { data:
|
|
27
|
-
I(
|
|
26
|
+
const { data: a } = await ae();
|
|
27
|
+
I(a);
|
|
28
28
|
}, g = async () => {
|
|
29
|
-
const { data:
|
|
30
|
-
a
|
|
31
|
-
},
|
|
32
|
-
const { data:
|
|
33
|
-
p(
|
|
29
|
+
const { data: a } = await ie();
|
|
30
|
+
i(a);
|
|
31
|
+
}, A = async () => {
|
|
32
|
+
const { data: a } = await se();
|
|
33
|
+
p(a);
|
|
34
34
|
};
|
|
35
|
-
m(s),
|
|
35
|
+
m(s), S(l), d && C(d), u && y(u), r(), g(), A();
|
|
36
36
|
}, [s, l, d]), /* @__PURE__ */ e(j, { children: t });
|
|
37
37
|
}, no = "_wrapper_1xuz3_18", D = {
|
|
38
38
|
wrapper: no
|
|
@@ -205,30 +205,30 @@ const co = o.lazy(
|
|
|
205
205
|
header: d,
|
|
206
206
|
footer: u,
|
|
207
207
|
announcement: m,
|
|
208
|
-
routes:
|
|
209
|
-
shopLogo:
|
|
208
|
+
routes: S = [],
|
|
209
|
+
shopLogo: C,
|
|
210
210
|
apiURLs: I,
|
|
211
|
-
isAntistock:
|
|
212
|
-
} = t, [p,
|
|
211
|
+
isAntistock: i = !1
|
|
212
|
+
} = t, [p, y] = o.useState(null), { general: r, setIsAntistock: g } = N(), { setApiUrls: A } = q(), a = ((b = r == null ? void 0 : r.info) == null ? void 0 : b.customerAccountSettings) ?? "OPTIONAL", z = a === "DISABLED", {
|
|
213
213
|
setBlocks: v,
|
|
214
214
|
setSourceBlocks: H,
|
|
215
215
|
setHeader: F,
|
|
216
216
|
setFooter: O,
|
|
217
217
|
setAnnouncement: M,
|
|
218
218
|
setSettings: G
|
|
219
|
-
} = Q(), { themeSettings: f } = X(), { settings:
|
|
219
|
+
} = Q(), { themeSettings: f } = X(), { settings: w, setSettings: W } = J(), T = K ? localStorage.getItem("fakeDomain") || "" : window.location.hostname, _ = localStorage.getItem("shopPassword"), x = localStorage.getItem("shopId") || "";
|
|
220
220
|
return o.useEffect(() => {
|
|
221
|
-
g(
|
|
222
|
-
}, [
|
|
221
|
+
g(i);
|
|
222
|
+
}, [i, g]), o.useEffect(() => {
|
|
223
223
|
!x && (r != null && r.info.id) && localStorage.setItem("shopId", r == null ? void 0 : r.info.id);
|
|
224
224
|
}, [r]), o.useEffect(() => {
|
|
225
|
-
!
|
|
226
|
-
}, [
|
|
227
|
-
if (f &&
|
|
228
|
-
const h = ee(f,
|
|
225
|
+
!T && !i && localStorage.setItem("fakeDomain", "drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io");
|
|
226
|
+
}, [T]), o.useEffect(() => {
|
|
227
|
+
if (f && w) {
|
|
228
|
+
const h = ee(f, w);
|
|
229
229
|
te(), oe(f), ne(h);
|
|
230
230
|
}
|
|
231
|
-
}, [f, JSON.stringify(
|
|
231
|
+
}, [f, JSON.stringify(w), window.location.hostname]), o.useEffect(() => {
|
|
232
232
|
const k = new l().blockSettings;
|
|
233
233
|
W(k);
|
|
234
234
|
}, []), o.useEffect(() => {
|
|
@@ -237,16 +237,16 @@ const co = o.lazy(
|
|
|
237
237
|
const h = {};
|
|
238
238
|
Object.keys(s).map((E) => {
|
|
239
239
|
h[E] = s[E];
|
|
240
|
-
}), H(h), v(h), F(d), O(u), M(m), G(l), I &&
|
|
240
|
+
}), H(h), v(h), F(d), O(u), M(m), G(l), I && A(I);
|
|
241
241
|
const k = $([
|
|
242
242
|
{
|
|
243
243
|
element: /* @__PURE__ */ e(
|
|
244
244
|
oo,
|
|
245
245
|
{
|
|
246
|
-
shopDomain:
|
|
246
|
+
shopDomain: T,
|
|
247
247
|
shopId: x,
|
|
248
248
|
shopPassword: _ || void 0,
|
|
249
|
-
shopLogo:
|
|
249
|
+
shopLogo: C,
|
|
250
250
|
children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(lo, { children: /* @__PURE__ */ e(Y, {}) }) })
|
|
251
251
|
}
|
|
252
252
|
),
|
|
@@ -266,7 +266,7 @@ const co = o.lazy(
|
|
|
266
266
|
) }) }),
|
|
267
267
|
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(ao, {}) })
|
|
268
268
|
},
|
|
269
|
-
...
|
|
269
|
+
...S,
|
|
270
270
|
{
|
|
271
271
|
path: "/checkout",
|
|
272
272
|
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(uo, {}) }),
|
|
@@ -299,7 +299,7 @@ const co = o.lazy(
|
|
|
299
299
|
},
|
|
300
300
|
...z ? [] : [
|
|
301
301
|
{
|
|
302
|
-
path:
|
|
302
|
+
path: i ? "/account" : "/customer-dash",
|
|
303
303
|
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ P("div", { className: D.wrapper, children: [
|
|
304
304
|
/* @__PURE__ */ e(U, {}),
|
|
305
305
|
/* @__PURE__ */ e(R, {}),
|
|
@@ -315,7 +315,7 @@ const co = o.lazy(
|
|
|
315
315
|
/* @__PURE__ */ e(L, {})
|
|
316
316
|
] }) }),
|
|
317
317
|
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, {}) }),
|
|
318
|
-
loader: () => (document.title =
|
|
318
|
+
loader: () => (document.title = i ? "Account" : "Customer Dashboard", !0)
|
|
319
319
|
}
|
|
320
320
|
],
|
|
321
321
|
{
|
|
@@ -372,8 +372,8 @@ const co = o.lazy(
|
|
|
372
372
|
]
|
|
373
373
|
}
|
|
374
374
|
]);
|
|
375
|
-
|
|
376
|
-
}, [r,
|
|
375
|
+
y(k);
|
|
376
|
+
}, [r, a]), /* @__PURE__ */ e(o.Suspense, { fallback: null, children: p && /* @__PURE__ */ e(Z, { router: p }) });
|
|
377
377
|
};
|
|
378
378
|
export {
|
|
379
379
|
Ro as App
|