@burdenoff/microfe-store 2026.608.1 → 2026.614.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.
Files changed (94) hide show
  1. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +24 -0
  2. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -0
  3. package/dist/node_modules/@apollo/client/errors/utils.js +16 -0
  4. package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -0
  5. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +52 -0
  6. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -0
  7. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +41 -0
  8. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -0
  9. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +34 -0
  10. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -0
  11. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +6 -0
  12. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -0
  13. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +16 -0
  14. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -0
  15. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +19 -0
  16. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -0
  17. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +21 -0
  18. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -0
  19. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +17 -0
  20. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -0
  21. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +9 -0
  22. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -0
  23. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +9 -0
  24. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -0
  25. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +8 -0
  26. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -0
  27. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +9 -0
  28. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -0
  29. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +10 -0
  30. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -0
  31. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +8 -0
  32. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -0
  33. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +10 -0
  34. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -0
  35. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +23 -0
  36. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -0
  37. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +10 -0
  38. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -0
  39. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +57 -0
  40. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -0
  41. package/dist/node_modules/@apollo/client/version.js +6 -0
  42. package/dist/node_modules/@apollo/client/version.js.map +1 -0
  43. package/dist/node_modules/@wry/caches/lib/weak.js +67 -0
  44. package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -0
  45. package/dist/node_modules/@wry/trie/lib/index.js +53 -0
  46. package/dist/node_modules/@wry/trie/lib/index.js.map +1 -0
  47. package/dist/node_modules/graphql-ws/dist/client.js +272 -0
  48. package/dist/node_modules/graphql-ws/dist/client.js.map +1 -0
  49. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +62 -0
  50. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -0
  51. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +21 -0
  52. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -0
  53. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +78 -0
  54. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -0
  55. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +117 -0
  56. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -0
  57. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +93 -0
  58. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -0
  59. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +12 -0
  60. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -0
  61. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +9 -0
  62. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -0
  63. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +16 -0
  64. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -0
  65. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +8 -0
  66. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -0
  67. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +13 -0
  68. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -0
  69. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +11 -0
  70. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -0
  71. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +11 -0
  72. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -0
  73. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +22 -0
  74. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -0
  75. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +8 -0
  76. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -0
  77. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +8 -0
  78. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -0
  79. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +6 -0
  80. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -0
  81. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +13 -0
  82. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -0
  83. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +14 -0
  84. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -0
  85. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js +52 -0
  86. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +1 -0
  87. package/dist/pages/CartPage.js +1 -2
  88. package/dist/pages/CartPage.js.map +1 -1
  89. package/dist/pages/ProductDetailPage.js +247 -225
  90. package/dist/pages/ProductDetailPage.js.map +1 -1
  91. package/dist/pages/PublisherSubmitPage.js +36 -36
  92. package/dist/providers/StoreProvider.js +68 -37
  93. package/dist/providers/StoreProvider.js.map +1 -1
  94. package/package.json +2 -1
@@ -1,7 +1,7 @@
1
1
  import { CreateProductForPublisherDocument as e } from "../generated/global-operations.js";
2
2
  import { useMemo as t, useState as n } from "react";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { useApolloClient as a } from "@apollo/client/react";
3
+ import { useApolloClient as r } from "@apollo/client/react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  //#region src/pages/PublisherSubmitPage.tsx
6
6
  var o = JSON.stringify({
7
7
  schemaVersion: "1.0.0",
@@ -14,7 +14,7 @@ var o = JSON.stringify({
14
14
  permissions: ["workspace:read"],
15
15
  dependencies: { integrations: [] }
16
16
  }, null, 2), s = () => {
17
- let s = a(), [c, l] = n(""), [u, d] = n(""), [f, p] = n(""), [m, h] = n("APP"), [g, _] = n("0"), [v, y] = n(o), [b, x] = n(!1), [S, C] = n(null), [w, T] = n(null), E = t(() => {
17
+ let s = r(), [c, l] = n(""), [u, d] = n(""), [f, p] = n(""), [m, h] = n("APP"), [g, _] = n("0"), [v, y] = n(o), [b, x] = n(!1), [S, C] = n(null), [w, T] = n(null), E = t(() => {
18
18
  try {
19
19
  return {
20
20
  value: JSON.parse(v),
@@ -27,18 +27,18 @@ var o = JSON.stringify({
27
27
  };
28
28
  }
29
29
  }, [v]);
30
- return /* @__PURE__ */ i("main", {
30
+ return /* @__PURE__ */ a("main", {
31
31
  className: "mx-auto max-w-4xl p-6",
32
- children: [/* @__PURE__ */ i("header", {
32
+ children: [/* @__PURE__ */ a("header", {
33
33
  className: "mb-6",
34
- children: [/* @__PURE__ */ r("h1", {
34
+ children: [/* @__PURE__ */ i("h1", {
35
35
  className: "text-2xl font-semibold text-text-primary",
36
36
  children: "Submit Product"
37
- }), /* @__PURE__ */ r("p", {
37
+ }), /* @__PURE__ */ i("p", {
38
38
  className: "mt-1 text-sm text-text-muted",
39
39
  children: "Create a store product with manifest JSON (raw mode)."
40
40
  })]
41
- }), /* @__PURE__ */ i("form", {
41
+ }), /* @__PURE__ */ a("form", {
42
42
  onSubmit: async (t) => {
43
43
  if (t.preventDefault(), C(null), T(null), !c.trim()) {
44
44
  C("Product name is required.");
@@ -85,15 +85,15 @@ var o = JSON.stringify({
85
85
  className: "space-y-4",
86
86
  "aria-label": "Submit Product",
87
87
  children: [
88
- /* @__PURE__ */ i("div", {
88
+ /* @__PURE__ */ a("div", {
89
89
  className: "grid gap-4 md:grid-cols-2",
90
90
  children: [
91
- /* @__PURE__ */ i("label", {
91
+ /* @__PURE__ */ a("label", {
92
92
  className: "space-y-1",
93
- children: [/* @__PURE__ */ r("span", {
93
+ children: [/* @__PURE__ */ i("span", {
94
94
  className: "text-sm text-text-secondary",
95
95
  children: "Product Name"
96
- }), /* @__PURE__ */ r("input", {
96
+ }), /* @__PURE__ */ i("input", {
97
97
  "aria-label": "Product Name",
98
98
  value: c,
99
99
  onChange: (e) => l(e.target.value),
@@ -103,12 +103,12 @@ var o = JSON.stringify({
103
103
  placeholder: "Acme Automation"
104
104
  })]
105
105
  }),
106
- /* @__PURE__ */ i("label", {
106
+ /* @__PURE__ */ a("label", {
107
107
  className: "space-y-1",
108
- children: [/* @__PURE__ */ r("span", {
108
+ children: [/* @__PURE__ */ i("span", {
109
109
  className: "text-sm text-text-secondary",
110
110
  children: "Slug"
111
- }), /* @__PURE__ */ r("input", {
111
+ }), /* @__PURE__ */ i("input", {
112
112
  "aria-label": "Slug",
113
113
  value: u,
114
114
  onChange: (e) => d(e.target.value),
@@ -118,46 +118,46 @@ var o = JSON.stringify({
118
118
  placeholder: "acme-automation"
119
119
  })]
120
120
  }),
121
- /* @__PURE__ */ i("label", {
121
+ /* @__PURE__ */ a("label", {
122
122
  className: "space-y-1",
123
- children: [/* @__PURE__ */ r("span", {
123
+ children: [/* @__PURE__ */ i("span", {
124
124
  className: "text-sm text-text-secondary",
125
125
  children: "Type"
126
- }), /* @__PURE__ */ i("select", {
126
+ }), /* @__PURE__ */ a("select", {
127
127
  "aria-label": "Product type",
128
128
  value: m,
129
129
  onChange: (e) => h(e.target.value),
130
130
  className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary",
131
131
  children: [
132
- /* @__PURE__ */ r("option", {
132
+ /* @__PURE__ */ i("option", {
133
133
  value: "APP",
134
134
  children: "APP"
135
135
  }),
136
- /* @__PURE__ */ r("option", {
136
+ /* @__PURE__ */ i("option", {
137
137
  value: "AGENT",
138
138
  children: "AGENT"
139
139
  }),
140
- /* @__PURE__ */ r("option", {
140
+ /* @__PURE__ */ i("option", {
141
141
  value: "NODE",
142
142
  children: "NODE"
143
143
  }),
144
- /* @__PURE__ */ r("option", {
144
+ /* @__PURE__ */ i("option", {
145
145
  value: "WIDGET",
146
146
  children: "WIDGET"
147
147
  }),
148
- /* @__PURE__ */ r("option", {
148
+ /* @__PURE__ */ i("option", {
149
149
  value: "WORKFLOW",
150
150
  children: "WORKFLOW"
151
151
  })
152
152
  ]
153
153
  })]
154
154
  }),
155
- /* @__PURE__ */ i("label", {
155
+ /* @__PURE__ */ a("label", {
156
156
  className: "space-y-1",
157
- children: [/* @__PURE__ */ r("span", {
157
+ children: [/* @__PURE__ */ i("span", {
158
158
  className: "text-sm text-text-secondary",
159
159
  children: "Price"
160
- }), /* @__PURE__ */ r("input", {
160
+ }), /* @__PURE__ */ i("input", {
161
161
  type: "number",
162
162
  "aria-label": "Price",
163
163
  min: "0",
@@ -169,12 +169,12 @@ var o = JSON.stringify({
169
169
  })
170
170
  ]
171
171
  }),
172
- /* @__PURE__ */ i("label", {
172
+ /* @__PURE__ */ a("label", {
173
173
  className: "block space-y-1",
174
- children: [/* @__PURE__ */ r("span", {
174
+ children: [/* @__PURE__ */ i("span", {
175
175
  className: "text-sm text-text-secondary",
176
176
  children: "Description"
177
- }), /* @__PURE__ */ r("textarea", {
177
+ }), /* @__PURE__ */ i("textarea", {
178
178
  "aria-label": "Description",
179
179
  value: f,
180
180
  onChange: (e) => p(e.target.value),
@@ -182,14 +182,14 @@ var o = JSON.stringify({
182
182
  className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary"
183
183
  })]
184
184
  }),
185
- /* @__PURE__ */ i("label", {
185
+ /* @__PURE__ */ a("label", {
186
186
  className: "block space-y-1",
187
187
  children: [
188
- /* @__PURE__ */ r("span", {
188
+ /* @__PURE__ */ i("span", {
189
189
  className: "text-sm text-text-secondary",
190
190
  children: "Manifest (JSON)"
191
191
  }),
192
- /* @__PURE__ */ r("textarea", {
192
+ /* @__PURE__ */ i("textarea", {
193
193
  "aria-label": "Manifest JSON",
194
194
  value: v,
195
195
  onChange: (e) => y(e.target.value),
@@ -198,23 +198,23 @@ var o = JSON.stringify({
198
198
  "aria-required": "true",
199
199
  className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 font-mono text-xs text-text-primary"
200
200
  }),
201
- E.error && /* @__PURE__ */ r("p", {
201
+ E.error && /* @__PURE__ */ i("p", {
202
202
  className: "text-xs text-status-error-text",
203
203
  children: E.error
204
204
  })
205
205
  ]
206
206
  }),
207
- S && /* @__PURE__ */ r("p", {
207
+ S && /* @__PURE__ */ i("p", {
208
208
  role: "alert",
209
209
  className: "rounded-md bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
210
210
  children: S
211
211
  }),
212
- w && /* @__PURE__ */ r("p", {
212
+ w && /* @__PURE__ */ i("p", {
213
213
  role: "status",
214
214
  className: "rounded-md bg-status-success-bg-subtle px-3 py-2 text-sm text-status-success-text",
215
215
  children: w
216
216
  }),
217
- /* @__PURE__ */ r("button", {
217
+ /* @__PURE__ */ i("button", {
218
218
  type: "submit",
219
219
  disabled: b,
220
220
  className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-60",
@@ -1,51 +1,82 @@
1
- import { createContext as e, use as t, useMemo as n } from "react";
2
- import { PermissionProvider as r } from "@burdenoff/fe-libs/shared/providers/shell";
3
- import { jsx as i } from "react/jsx-runtime";
1
+ import { getMainDefinition as e } from "../node_modules/@apollo/client/utilities/internal/getMainDefinition.js";
2
+ import { GraphQLWsLink as t } from "../node_modules/@apollo/client/link/subscriptions/index.js";
3
+ import { createClient as n } from "../node_modules/graphql-ws/dist/client.js";
4
+ import { createContext as r, use as i, useMemo as a } from "react";
5
+ import { ApolloClient as o, InMemoryCache as s, createHttpLink as c, from as l, split as u } from "@apollo/client/core";
6
+ import { ApolloProvider as d } from "@apollo/client/react";
7
+ import { setContext as f } from "@apollo/client/link/context";
8
+ import { PermissionProvider as p } from "@burdenoff/fe-libs/shared/providers/shell";
9
+ import { jsx as m } from "react/jsx-runtime";
4
10
  //#region src/providers/StoreProvider.tsx
5
- var a = {}, o = e(null), s = ({ children: e, basePath: t = "/", apiGatewayUrl: s, authToken: c, features: l = a, user: u, currentUser: d, productId: f, productName: p, defaultCompatibleWith: m, ...h }) => {
6
- let g = n(() => ({
7
- ...h,
8
- basePath: t,
9
- apiGatewayUrl: s || "",
10
- authToken: c,
11
- user: u || d,
12
- currentUser: d || u,
13
- productId: f,
14
- productName: p,
15
- defaultCompatibleWith: m,
11
+ function h(e) {
12
+ return e.replace(/^https/, "wss").replace(/^http/, "ws");
13
+ }
14
+ var g = {}, _ = r(null), v = ({ children: r, basePath: i = "/", apiGatewayUrl: v, authToken: y, features: b = g, user: x, currentUser: S, productId: C, productName: w, defaultCompatibleWith: T, ...E }) => {
15
+ let D = a(() => ({
16
+ ...E,
17
+ basePath: i,
18
+ apiGatewayUrl: v || "",
19
+ authToken: y,
20
+ user: x || S,
21
+ currentUser: S || x,
22
+ productId: C,
23
+ productName: w,
24
+ defaultCompatibleWith: T,
16
25
  features: {
17
- enablePhysicalProducts: l?.enablePhysicalProducts ?? !0,
18
- enablePublisherPortal: l?.enablePublisherPortal ?? !0,
19
- enableReviews: l?.enableReviews ?? !0,
20
- enableSubscriptions: l?.enableSubscriptions ?? !0
26
+ enablePhysicalProducts: b?.enablePhysicalProducts ?? !0,
27
+ enablePublisherPortal: b?.enablePublisherPortal ?? !0,
28
+ enableReviews: b?.enableReviews ?? !0,
29
+ enableSubscriptions: b?.enableSubscriptions ?? !0
21
30
  }
22
31
  }), [
23
- h,
24
- t,
25
- s,
26
- c,
27
- u,
28
- d,
29
- f,
30
- p,
31
- m,
32
- l
32
+ E,
33
+ i,
34
+ v,
35
+ y,
36
+ x,
37
+ S,
38
+ C,
39
+ w,
40
+ T,
41
+ b
33
42
  ]);
34
- return /* @__PURE__ */ i(o.Provider, {
35
- value: g,
36
- children: /* @__PURE__ */ i(r, {
37
- scopeId: g.organizationId ?? null,
38
- gateway: "global",
39
- children: e
43
+ return /* @__PURE__ */ m(d, {
44
+ client: a(() => {
45
+ let r = c({ uri: v || "/global/graphql" }), i = f((e, t) => ({ headers: {
46
+ ...t.headers,
47
+ ...y ? { authorization: `Bearer ${y}` } : {}
48
+ } }));
49
+ return new o({
50
+ link: u(({ query: t }) => {
51
+ let n = e(t);
52
+ return n.kind === "OperationDefinition" && n.operation === "subscription";
53
+ }, new t(n({
54
+ url: h(v || "ws://localhost:4000/global/graphql"),
55
+ connectionParams: y ? { authorization: `Bearer ${y}` } : {}
56
+ })), l([i, r])),
57
+ cache: new s(),
58
+ defaultOptions: {
59
+ watchQuery: { fetchPolicy: "cache-and-network" },
60
+ query: { fetchPolicy: "cache-first" }
61
+ }
62
+ });
63
+ }, [v, y]),
64
+ children: /* @__PURE__ */ m(_.Provider, {
65
+ value: D,
66
+ children: /* @__PURE__ */ m(p, {
67
+ scopeId: D.organizationId ?? null,
68
+ gateway: "global",
69
+ children: r
70
+ })
40
71
  })
41
72
  });
42
73
  };
43
- function c() {
44
- let e = t(o);
74
+ function y() {
75
+ let e = i(_);
45
76
  if (!e) throw Error("useStore must be used within StoreProvider");
46
77
  return e;
47
78
  }
48
79
  //#endregion
49
- export { s as StoreProvider, c as useStore };
80
+ export { v as StoreProvider, y as useStore };
50
81
 
51
82
  //# sourceMappingURL=StoreProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StoreProvider.js","names":[],"sources":["../../src/providers/StoreProvider.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { createContext, use, useMemo } from 'react';\nimport { PermissionProvider } from '@burdenoff/fe-libs/shared/providers/shell';\nimport type { StoreRootProps, User } from '../types';\n\nconst EMPTY_FEATURES: StoreRootProps['features'] = {};\n\n/**\n * Store context value\n */\ninterface StoreContextValue extends Omit<StoreRootProps, 'children'> {\n basePath: string;\n apiGatewayUrl: string;\n authToken?: string;\n user?: User;\n productId?: string;\n productName?: string;\n defaultCompatibleWith?: string;\n features: {\n enablePhysicalProducts: boolean;\n enablePublisherPortal: boolean;\n enableReviews: boolean;\n enableSubscriptions: boolean;\n };\n}\n\n/**\n * Store context\n */\nconst StoreContext = createContext<StoreContextValue | null>(null);\n\n/**\n * Props for StoreProvider\n */\ninterface StoreProviderProps extends StoreRootProps {\n children: ReactNode;\n}\n\n/**\n * StoreProvider component\n *\n * Provides store context to all child components.\n */\nexport const StoreProvider: FC<StoreProviderProps> = ({\n children,\n basePath = '/',\n apiGatewayUrl,\n authToken,\n features = EMPTY_FEATURES,\n user,\n currentUser,\n productId,\n productName,\n defaultCompatibleWith,\n ...props\n}) => {\n const value = useMemo<StoreContextValue>(\n () => ({\n ...props,\n basePath,\n apiGatewayUrl: apiGatewayUrl || '',\n authToken,\n user: user || currentUser,\n currentUser: currentUser || user,\n productId,\n productName,\n defaultCompatibleWith,\n features: {\n enablePhysicalProducts: features?.enablePhysicalProducts ?? true,\n enablePublisherPortal: features?.enablePublisherPortal ?? true,\n enableReviews: features?.enableReviews ?? true,\n enableSubscriptions: features?.enableSubscriptions ?? true,\n },\n }),\n [\n props,\n basePath,\n apiGatewayUrl,\n authToken,\n user,\n currentUser,\n productId,\n productName,\n defaultCompatibleWith,\n features,\n ]\n );\n\n return (\n <StoreContext.Provider value={value}>\n <PermissionProvider scopeId={value.organizationId ?? null} gateway=\"global\">\n {children}\n </PermissionProvider>\n </StoreContext.Provider>\n );\n};\n\n/**\n * Hook to use store context\n */\nexport function useStore(): StoreContextValue {\n const context = use(StoreContext);\n\n if (!context) {\n throw new Error('useStore must be used within StoreProvider');\n }\n\n return context;\n}\n"],"mappings":";;;;AAKA,IAAM,IAA6C,EAAE,EAwB/C,IAAe,EAAwC,KAAK,EAcrD,KAAyC,EACpD,aACA,cAAW,KACX,kBACA,cACA,cAAW,GACX,SACA,gBACA,cACA,gBACA,0BACA,GAAG,QACC;CACJ,IAAM,IAAQ,SACL;EACL,GAAG;EACH;EACA,eAAe,KAAiB;EAChC;EACA,MAAM,KAAQ;EACd,aAAa,KAAe;EAC5B;EACA;EACA;EACA,UAAU;GACR,wBAAwB,GAAU,0BAA0B;GAC5D,uBAAuB,GAAU,yBAAyB;GAC1D,eAAe,GAAU,iBAAiB;GAC1C,qBAAqB,GAAU,uBAAuB;GACvD;EACF,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAa,UAAd;EAA8B;YAC5B,kBAAC,GAAD;GAAoB,SAAS,EAAM,kBAAkB;GAAM,SAAQ;GAChE;GACkB,CAAA;EACC,CAAA;;AAO5B,SAAgB,IAA8B;CAC5C,IAAM,IAAU,EAAI,EAAa;AAEjC,KAAI,CAAC,EACH,OAAU,MAAM,6CAA6C;AAG/D,QAAO"}
1
+ {"version":3,"file":"StoreProvider.js","names":[],"sources":["../../src/providers/StoreProvider.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { createContext, use, useMemo } from 'react';\nimport { ApolloClient, InMemoryCache, createHttpLink, from, split } from '@apollo/client/core';\nimport { ApolloProvider } from '@apollo/client/react';\nimport { setContext } from '@apollo/client/link/context';\nimport { GraphQLWsLink } from '@apollo/client/link/subscriptions';\nimport { getMainDefinition } from '@apollo/client/utilities';\nimport { createClient as createWsClient } from 'graphql-ws';\nimport { PermissionProvider } from '@burdenoff/fe-libs/shared/providers/shell';\nimport type { StoreRootProps, User } from '../types';\n\nfunction toWsUrl(httpUrl: string): string {\n return httpUrl.replace(/^https/, 'wss').replace(/^http/, 'ws');\n}\n\nconst EMPTY_FEATURES: StoreRootProps['features'] = {};\n\n/**\n * Store context value\n */\ninterface StoreContextValue extends Omit<StoreRootProps, 'children'> {\n basePath: string;\n apiGatewayUrl: string;\n authToken?: string;\n user?: User;\n productId?: string;\n productName?: string;\n defaultCompatibleWith?: string;\n features: {\n enablePhysicalProducts: boolean;\n enablePublisherPortal: boolean;\n enableReviews: boolean;\n enableSubscriptions: boolean;\n };\n}\n\n/**\n * Store context\n */\nconst StoreContext = createContext<StoreContextValue | null>(null);\n\n/**\n * Props for StoreProvider\n */\ninterface StoreProviderProps extends StoreRootProps {\n children: ReactNode;\n}\n\n/**\n * StoreProvider component\n *\n * Provides store context to all child components.\n */\nexport const StoreProvider: FC<StoreProviderProps> = ({\n children,\n basePath = '/',\n apiGatewayUrl,\n authToken,\n features = EMPTY_FEATURES,\n user,\n currentUser,\n productId,\n productName,\n defaultCompatibleWith,\n ...props\n}) => {\n const value = useMemo<StoreContextValue>(\n () => ({\n ...props,\n basePath,\n apiGatewayUrl: apiGatewayUrl || '',\n authToken,\n user: user || currentUser,\n currentUser: currentUser || user,\n productId,\n productName,\n defaultCompatibleWith,\n features: {\n enablePhysicalProducts: features?.enablePhysicalProducts ?? true,\n enablePublisherPortal: features?.enablePublisherPortal ?? true,\n enableReviews: features?.enableReviews ?? true,\n enableSubscriptions: features?.enableSubscriptions ?? true,\n },\n }),\n [\n props,\n basePath,\n apiGatewayUrl,\n authToken,\n user,\n currentUser,\n productId,\n productName,\n defaultCompatibleWith,\n features,\n ]\n );\n\n const storeApolloClient = useMemo(() => {\n const httpLink = createHttpLink({ uri: apiGatewayUrl || '/global/graphql' });\n\n const authLink = setContext((_, prevContext) => ({\n headers: {\n ...(prevContext.headers as Record<string, string> | undefined),\n ...(authToken ? { authorization: `Bearer ${authToken}` } : {}),\n },\n }));\n\n const wsLink = new GraphQLWsLink(\n createWsClient({\n url: toWsUrl(apiGatewayUrl || 'ws://localhost:4000/global/graphql'),\n connectionParams: authToken ? { authorization: `Bearer ${authToken}` } : {},\n })\n );\n\n const splitLink = split(\n ({ query }) => {\n const definition = getMainDefinition(query);\n return definition.kind === 'OperationDefinition' && definition.operation === 'subscription';\n },\n wsLink,\n from([authLink, httpLink])\n );\n\n return new ApolloClient({\n link: splitLink,\n cache: new InMemoryCache(),\n defaultOptions: {\n watchQuery: { fetchPolicy: 'cache-and-network' },\n query: { fetchPolicy: 'cache-first' },\n },\n });\n }, [apiGatewayUrl, authToken]);\n\n return (\n <ApolloProvider client={storeApolloClient}>\n <StoreContext.Provider value={value}>\n <PermissionProvider scopeId={value.organizationId ?? null} gateway=\"global\">\n {children}\n </PermissionProvider>\n </StoreContext.Provider>\n </ApolloProvider>\n );\n};\n\n/**\n * Hook to use store context\n */\nexport function useStore(): StoreContextValue {\n const context = use(StoreContext);\n\n if (!context) {\n throw new Error('useStore must be used within StoreProvider');\n }\n\n return context;\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAS,EAAQ,GAAyB;AACxC,QAAO,EAAQ,QAAQ,UAAU,MAAM,CAAC,QAAQ,SAAS,KAAK;;AAGhE,IAAM,IAA6C,EAAE,EAwB/C,IAAe,EAAwC,KAAK,EAcrD,KAAyC,EACpD,aACA,cAAW,KACX,kBACA,cACA,cAAW,GACX,SACA,gBACA,cACA,gBACA,0BACA,GAAG,QACC;CACJ,IAAM,IAAQ,SACL;EACL,GAAG;EACH;EACA,eAAe,KAAiB;EAChC;EACA,MAAM,KAAQ;EACd,aAAa,KAAe;EAC5B;EACA;EACA;EACA,UAAU;GACR,wBAAwB,GAAU,0BAA0B;GAC5D,uBAAuB,GAAU,yBAAyB;GAC1D,eAAe,GAAU,iBAAiB;GAC1C,qBAAqB,GAAU,uBAAuB;GACvD;EACF,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAsCD,QACE,kBAAC,GAAD;EAAgB,QArCQ,QAAc;GACtC,IAAM,IAAW,EAAe,EAAE,KAAK,KAAiB,mBAAmB,CAAC,EAEtE,IAAW,GAAY,GAAG,OAAiB,EAC/C,SAAS;IACP,GAAI,EAAY;IAChB,GAAI,IAAY,EAAE,eAAe,UAAU,KAAa,GAAG,EAAE;IAC9D,EACF,EAAE;AAkBH,UAAO,IAAI,EAAa;IACtB,MAVgB,GACf,EAAE,eAAY;KACb,IAAM,IAAa,EAAkB,EAAM;AAC3C,YAAO,EAAW,SAAS,yBAAyB,EAAW,cAAc;OAVlE,IAAI,EACjB,EAAe;KACb,KAAK,EAAQ,KAAiB,qCAAqC;KACnE,kBAAkB,IAAY,EAAE,eAAe,UAAU,KAAa,GAAG,EAAE;KAC5E,CAAC,CACH,EAQC,EAAK,CAAC,GAAU,EAAS,CAAC,CAC3B;IAIC,OAAO,IAAI,GAAe;IAC1B,gBAAgB;KACd,YAAY,EAAE,aAAa,qBAAqB;KAChD,OAAO,EAAE,aAAa,eAAe;KACtC;IACF,CAAC;KACD,CAAC,GAAe,EAAU,CAAC;YAI1B,kBAAC,EAAa,UAAd;GAA8B;aAC5B,kBAAC,GAAD;IAAoB,SAAS,EAAM,kBAAkB;IAAM,SAAQ;IAChE;IACkB,CAAA;GACC,CAAA;EACT,CAAA;;AAOrB,SAAgB,IAA8B;CAC5C,IAAM,IAAU,EAAI,EAAa;AAEjC,KAAI,CAAC,EACH,OAAU,MAAM,6CAA6C;AAG/D,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-store",
3
- "version": "2026.608.1",
3
+ "version": "2026.614.1",
4
4
  "description": "Store microfrontend for Burdenoff products",
5
5
  "type": "module",
6
6
  "files": [
@@ -44,6 +44,7 @@
44
44
  "@tanstack/react-query": "^5.90.16",
45
45
  "clsx": "^2.1.1",
46
46
  "graphql": "^16.10.0",
47
+ "graphql-ws": "^6.0.8",
47
48
  "lucide-react": "^0.468.0",
48
49
  "react": "^19.0.0",
49
50
  "react-dom": "^19.0.0",