@tailorkit/react 0.1.0-beta.26 → 0.1.0-beta.27

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/index.js CHANGED
@@ -193,8 +193,7 @@ function SlotRenderer(options) {
193
193
  import {
194
194
  createTailorKitClientConfig,
195
195
  createComponentRegistry,
196
- createTailorKitStore,
197
- createTailorKitFetchClient
196
+ createTailorKitStore
198
197
  } from "@tailorkit/client-core";
199
198
  import { createElement as createElement2, useEffect as useEffect4, useMemo as useMemo8 } from "react";
200
199
 
@@ -276,37 +275,26 @@ function createReactTailorKitClient(options) {
276
275
  };
277
276
  });
278
277
  const clientConfig = createTailorKitClientConfig({ ...options, components: wrappedComponents });
279
- const subjectClients = /* @__PURE__ */ new Map();
280
- subjectClients.set(void 0, clientConfig.fetchClient);
281
278
  const client = {
282
279
  ...clientConfig,
283
- Provider: function TailorKitProvider({ children, apps, subjectId }) {
284
- const store = useMemo8(() => {
285
- let fetchClient = subjectClients.get(subjectId);
286
- if (!fetchClient) {
287
- fetchClient = createTailorKitFetchClient({ ...options });
288
- fetchClient.endpoints.setSubject(subjectId);
289
- subjectClients.set(subjectId, fetchClient);
290
- }
291
- return createTailorKitStore({
280
+ Provider: function TailorKitProvider({ children, apps }) {
281
+ const store = useMemo8(
282
+ () => createTailorKitStore({
292
283
  baseUrl: client.baseUrl,
293
284
  contract: client.contract,
294
285
  tools: client.tools,
295
286
  apps,
296
- client: fetchClient,
287
+ client: clientConfig.fetchClient,
297
288
  assetsBaseUrl: client.assetsBaseUrl
298
- });
299
- }, [subjectId]);
289
+ }),
290
+ []
291
+ );
300
292
  useEffect4(() => {
301
293
  store.setProvidedApps(apps);
302
294
  }, [store, apps]);
303
295
  useEffect4(() => () => store.previews.dispose(), [store]);
304
296
  const context = useMemo8(() => ({ store, client }), [store]);
305
- return createElement2(
306
- TailorkitContext.Provider,
307
- { value: context, key: subjectId ?? "installation" },
308
- children
309
- );
297
+ return createElement2(TailorkitContext.Provider, { value: context }, children);
310
298
  },
311
299
  RenderSlot: Object.assign(
312
300
  function ClientRenderSlot(props) {
@@ -11,8 +11,6 @@ import type { RenderSlotComponent } from "./components/render-slot";
11
11
  export type { TailorKitApp } from "@tailorkit/client-core";
12
12
  export interface TailorKitProviderProps {
13
13
  apps?: TailorKitApp[];
14
- /** Cache partition for the authenticated product principal. */
15
- subjectId?: string;
16
14
  children?: ReactNode;
17
15
  }
18
16
  export interface TailorKitInstance<TViews extends Record<string, ViewDefinition> = Record<string, ViewDefinition>, TSlots extends SlotDefinitions = SlotDefinitions, TScopeNames extends string = string> extends TailorKitClientConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailorkit/react",
3
- "version": "0.1.0-beta.26",
3
+ "version": "0.1.0-beta.27",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,11 +24,11 @@
24
24
  "@floating-ui/react-dom": "^2.1.9",
25
25
  "@nanostores/react": "2.0.1",
26
26
  "@standard-schema/spec": "^1.1.0",
27
- "@tailorkit/app": "0.1.0-beta.26",
28
- "@tailorkit/client-core": "0.1.0-beta.26",
29
- "@tailorkit/client-platform": "0.1.0-beta.26",
30
- "@tailorkit/core": "0.1.0-beta.26",
31
- "@tailorkit/sandbox": "0.1.0-beta.26",
27
+ "@tailorkit/app": "0.1.0-beta.27",
28
+ "@tailorkit/client-core": "0.1.0-beta.27",
29
+ "@tailorkit/client-platform": "0.1.0-beta.27",
30
+ "@tailorkit/core": "0.1.0-beta.27",
31
+ "@tailorkit/sandbox": "0.1.0-beta.27",
32
32
  "nanostores": "1.5.4"
33
33
  },
34
34
  "devDependencies": {