@unifold/connect-svelte 0.1.68-beta.0 → 0.1.68-beta.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as UnifoldProvider } from "./lib/UnifoldProvider.svelte";
2
- export { getUnifold } from "./lib/context.js";
3
- export type { UnifoldContext } from "./lib/context.js";
4
- export type { DepositConfig, DepositResult, DepositError, DepositInitialScreen, DepositMethod, UnifoldConfig, UnifoldConnectProviderConfig, } from "@unifold/ui-web";
1
+ export { default as UnifoldProvider } from './lib/UnifoldProvider.svelte';
2
+ export { getUnifold } from './lib/context.js';
3
+ export type { UnifoldContext } from './lib/context.js';
4
+ export type { DepositConfig, DepositResult, DepositError, DepositInitialScreen, DepositMethod, UnifoldConfig, UnifoldConnectProviderConfig, } from '@unifold/ui-web';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as UnifoldProvider } from "./lib/UnifoldProvider.svelte";
2
- export { getUnifold } from "./lib/context.js";
1
+ export { default as UnifoldProvider } from './lib/UnifoldProvider.svelte';
2
+ export { getUnifold } from './lib/context.js';
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import { onMount, onDestroy, setContext } from "svelte";
3
- import { UNIFOLD_CONTEXT_KEY, type UnifoldContext } from "./context.js";
4
- import type { UnifoldConfig, UnifoldInstance } from "@unifold/ui-web";
2
+ import { onMount, onDestroy, setContext } from 'svelte';
3
+ import { UNIFOLD_CONTEXT_KEY, type UnifoldContext } from './context.js';
4
+ import type { UnifoldConfig, UnifoldInstance } from '@unifold/ui-web';
5
5
 
6
6
  export let publishableKey: string;
7
7
  export let config: UnifoldConfig | undefined = undefined;
@@ -19,7 +19,7 @@
19
19
  readyPromise.catch(() => {});
20
20
 
21
21
  const destroyedBeforeInitError = new Error(
22
- "UnifoldProvider was destroyed before initialization completed"
22
+ 'UnifoldProvider was destroyed before initialization completed',
23
23
  );
24
24
 
25
25
  const abortIfDestroyed = (): boolean => {
@@ -32,7 +32,7 @@
32
32
  beginDeposit: async (depositConfig) => {
33
33
  await readyPromise;
34
34
  if (destroyed || !unifold) {
35
- throw new Error("UnifoldProvider has been destroyed");
35
+ throw new Error('UnifoldProvider has been destroyed');
36
36
  }
37
37
  return unifold.beginDeposit(depositConfig);
38
38
  },
@@ -49,7 +49,7 @@
49
49
  if (abortIfDestroyed()) return;
50
50
 
51
51
  try {
52
- const { createUnifold } = await import("@unifold/ui-web");
52
+ const { createUnifold } = await import('@unifold/ui-web');
53
53
  if (abortIfDestroyed()) return;
54
54
 
55
55
  const instance = await createUnifold(publishableKey, config);
@@ -64,7 +64,7 @@
64
64
  resolveReady();
65
65
  } catch (err) {
66
66
  if (destroyed) return;
67
- console.error("[UnifoldProvider] Failed to initialize:", err);
67
+ console.error('[UnifoldProvider] Failed to initialize:', err);
68
68
  rejectReady(err);
69
69
  }
70
70
  });
@@ -1,4 +1,4 @@
1
- import type { UnifoldConfig } from "@unifold/ui-web";
1
+ import type { UnifoldConfig } from '@unifold/ui-web';
2
2
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
3
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
4
  $$bindings?: Bindings;
@@ -1,4 +1,4 @@
1
- import type { DepositConfig, DepositResult, DepositError } from "@unifold/ui-web";
1
+ import type { DepositConfig, DepositResult, DepositError } from '@unifold/ui-web';
2
2
  export declare const UNIFOLD_CONTEXT_KEY: unique symbol;
3
3
  export interface UnifoldContext {
4
4
  beginDeposit: (config: DepositConfig) => Promise<DepositResult>;
@@ -1,9 +1,9 @@
1
- import { getContext } from "svelte";
2
- export const UNIFOLD_CONTEXT_KEY = Symbol("unifold");
1
+ import { getContext } from 'svelte';
2
+ export const UNIFOLD_CONTEXT_KEY = Symbol('unifold');
3
3
  export function getUnifold() {
4
4
  const ctx = getContext(UNIFOLD_CONTEXT_KEY);
5
5
  if (!ctx) {
6
- throw new Error("getUnifold() must be called inside a component wrapped by <UnifoldProvider>");
6
+ throw new Error('getUnifold() must be called inside a component wrapped by <UnifoldProvider>');
7
7
  }
8
8
  return ctx;
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/connect-svelte",
3
- "version": "0.1.68-beta.0",
3
+ "version": "0.1.68-beta.1",
4
4
  "type": "module",
5
5
  "description": "Unifold Connect for Svelte - Native Svelte SDK for the Unifold deposit widget",
6
6
  "exports": {
@@ -16,15 +16,23 @@
16
16
  "dist"
17
17
  ],
18
18
  "dependencies": {
19
- "@unifold/ui-web": "0.1.68-beta.0"
19
+ "@unifold/ui-web": "0.1.68-beta.1"
20
20
  },
21
21
  "peerDependencies": {
22
- "svelte": "^4.0.0 || ^5.0.0"
22
+ "svelte": "^4.0.0 || ^5.0.0",
23
+ "@stripe/crypto": ">=1.1.0"
24
+ },
25
+ "peerDependenciesMeta": {
26
+ "@stripe/crypto": {
27
+ "optional": true
28
+ }
23
29
  },
24
30
  "devDependencies": {
25
31
  "@sveltejs/kit": "^2.0.0",
26
32
  "@sveltejs/package": "^2.5.7",
27
33
  "@sveltejs/vite-plugin-svelte": "^4.0.0",
34
+ "prettier": "^3.2.5",
35
+ "prettier-plugin-svelte": "^3.2.6",
28
36
  "svelte": "^5.0.0",
29
37
  "svelte-check": "^4.0.0",
30
38
  "typescript": "^5.0.0"
@@ -41,6 +49,8 @@
41
49
  "scripts": {
42
50
  "build": "svelte-package -i src",
43
51
  "dev": "svelte-package -i src --watch",
52
+ "format": "prettier --write \"src/**/*.{ts,svelte}\"",
53
+ "format:check": "prettier --check \"src/**/*.{ts,svelte}\"",
44
54
  "type-check": "svelte-check --tsconfig ./tsconfig.json",
45
55
  "clean": "rm -rf dist"
46
56
  }