@superleapai/flow-ui 2.6.21 → 2.6.22

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/index.d.ts CHANGED
@@ -29,13 +29,13 @@ declare module "@superleapai/flow-ui" {
29
29
  // CRM BRIDGE TYPES
30
30
  // ============================================================================
31
31
 
32
- /** Configuration passed to Superleap.connect() */
32
+ /** Configuration passed to SuperLeap.connect() */
33
33
  export interface ConnectOptions {
34
34
  /** Unique identifier for this flow/form (must match CRM-side registration) */
35
35
  flowId: string;
36
36
  /** Expected CRM origin for validation (e.g., "https://app.superleap.com"). Optional for RN. */
37
37
  crmOrigin?: string;
38
- /** Whether to auto-call Superleap.init() with the SDK config from the CRM. Default: true */
38
+ /** Whether to auto-call SuperLeap.init() with the SDK config from the CRM. Default: true */
39
39
  autoInit?: boolean;
40
40
  /** Handshake timeout in milliseconds. Default: 5000 */
41
41
  timeout?: number;
@@ -61,13 +61,13 @@ declare module "@superleapai/flow-ui" {
61
61
 
62
62
  /** Configuration received from the CRM */
63
63
  export interface CRMConfig {
64
- /** SDK configuration for Superleap.init() */
64
+ /** SDK configuration for SuperLeap.init() */
65
65
  sdkConfig?: SuperLeapConfig;
66
66
  /** Any additional configuration */
67
67
  [key: string]: any;
68
68
  }
69
69
 
70
- /** Result of a successful Superleap.connect() call */
70
+ /** Result of a successful SuperLeap.connect() call */
71
71
  export interface ConnectResult {
72
72
  /** Context data from the CRM */
73
73
  context: CRMContext;
@@ -75,10 +75,10 @@ declare module "@superleapai/flow-ui" {
75
75
  config: CRMConfig;
76
76
  }
77
77
 
78
- /** Unsubscribe function returned by Superleap.on() */
78
+ /** Unsubscribe function returned by SuperLeap.on() */
79
79
  export type EventUnsubscribe = () => void;
80
80
 
81
- export interface Superleap {
81
+ export interface SuperLeap {
82
82
  // SDK Methods (from superleapClient.js)
83
83
  init(config?: SuperLeapConfig): void;
84
84
  getSdk(): any;
@@ -166,7 +166,7 @@ declare module "@superleapai/flow-ui" {
166
166
  off(event: string, callback: (payload: any) => void): void;
167
167
  }
168
168
 
169
- export const Superleap: Superleap;
169
+ export const SuperLeap: SuperLeap;
170
170
 
171
171
  // ============================================================================
172
172
  // STATE MANAGEMENT
@@ -687,6 +687,6 @@ declare module "@superleapai/flow-ui" {
687
687
  declare global {
688
688
  interface Window {
689
689
  FlowUI: FlowUI;
690
- Superleap: Superleap;
690
+ SuperLeap: SuperLeap;
691
691
  }
692
692
  }
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Superleap-Flow Library Entry Point
2
+ * SuperLeap-Flow Library Entry Point
3
3
  * @superleapai/flow-ui
4
4
  *
5
- * Single-file bundle that includes Superleap SDK and all components.
6
- * Only FlowUI and Superleap are exposed to global scope.
5
+ * Single-file bundle that includes SuperLeap SDK and all components.
6
+ * Only FlowUI and SuperLeap are exposed to global scope.
7
7
  *
8
8
  * Usage:
9
9
  *
@@ -11,7 +11,7 @@
11
11
  * <script src="path/to/superleap-flow/index.js"></script>
12
12
  * <script>
13
13
  * // Connect to CRM (inside an iframe)
14
- * const { context, config } = await Superleap.connect({
14
+ * const { context, config } = await SuperLeap.connect({
15
15
  * flowId: 'my-flow'
16
16
  * });
17
17
  * // SDK is auto-initialized, context has orgId/userId/etc.
@@ -20,15 +20,15 @@
20
20
  * FlowUI.initState({ name: '' });
21
21
  *
22
22
  * // CRM actions
23
- * Superleap.toast('Saved!', 'success');
24
- * Superleap.closeForm();
23
+ * SuperLeap.toast('Saved!', 'success');
24
+ * SuperLeap.closeForm();
25
25
  * </script>
26
26
  *
27
27
  * ES Module:
28
- * import { FlowUI, Superleap } from '@superleapai/flow-ui';
28
+ * import { FlowUI, SuperLeap } from '@superleapai/flow-ui';
29
29
  *
30
30
  * CommonJS:
31
- * const { FlowUI, Superleap } = require('@superleapai/flow-ui');
31
+ * const { FlowUI, SuperLeap } = require('@superleapai/flow-ui');
32
32
  */
33
33
 
34
34
  (function (global) {
@@ -41,13 +41,13 @@
41
41
 
42
42
  // In Node.js/CommonJS environment, load all modules
43
43
  if (isNode && !isBrowser) {
44
- // Note: In Node.js, Superleap SDK should be installed separately via npm
44
+ // Note: In Node.js, SuperLeap SDK should be installed separately via npm
45
45
  // npm install superleap-sdk
46
46
  try {
47
47
  global.createSuperLeapSDK = require("superleap-sdk");
48
48
  } catch (e) {
49
49
  console.warn(
50
- "[Superleap-Flow] Superleap SDK not found. Install with: npm install superleap-sdk",
50
+ "[SuperLeap-Flow] SuperLeap SDK not found. Install with: npm install superleap-sdk",
51
51
  );
52
52
  }
53
53
 
@@ -97,10 +97,10 @@
97
97
  require("./components/tabs.js");
98
98
  require("./components/steps.js");
99
99
 
100
- // Export FlowUI and Superleap from global scope
100
+ // Export FlowUI and SuperLeap from global scope
101
101
  if (typeof global !== "undefined" && global.FlowUI) {
102
- // Create Superleap export
103
- const Superleap = global.superleapClient
102
+ // Create SuperLeap export
103
+ const SuperLeap = global.superleapClient
104
104
  ? {
105
105
  init: global.superleapClient.init,
106
106
  getSdk: global.superleapClient.getSdk,
@@ -111,11 +111,11 @@
111
111
 
112
112
  module.exports = {
113
113
  FlowUI: global.FlowUI,
114
- Superleap: Superleap,
114
+ SuperLeap: SuperLeap,
115
115
  };
116
116
  } else if (typeof window !== "undefined" && window.FlowUI) {
117
- // Create Superleap export
118
- const Superleap = window.superleapClient
117
+ // Create SuperLeap export
118
+ const SuperLeap = window.superleapClient
119
119
  ? {
120
120
  init: window.superleapClient.init,
121
121
  getSdk: window.superleapClient.getSdk,
@@ -126,7 +126,7 @@
126
126
 
127
127
  module.exports = {
128
128
  FlowUI: window.FlowUI,
129
- Superleap: Superleap,
129
+ SuperLeap: SuperLeap,
130
130
  };
131
131
  }
132
132
  } else if (isBrowser) {
@@ -182,7 +182,7 @@
182
182
  _components[name] = window[name];
183
183
 
184
184
  // Clean up global scope - remove all component globals
185
- // Only FlowUI and Superleap will remain
185
+ // Only FlowUI and SuperLeap will remain
186
186
  delete window[name];
187
187
  }
188
188
  });
@@ -194,11 +194,11 @@
194
194
  };
195
195
  }
196
196
 
197
- // Expose Superleap from captured superleapClient (must use _components - superleapClient was already deleted from window)
197
+ // Expose SuperLeap from captured superleapClient (must use _components - superleapClient was already deleted from window)
198
198
  // Note: crm.js has already extended superleapClient with bridge methods (connect, toast, etc.)
199
199
  const client = _components["superleapClient"];
200
200
  if (client) {
201
- window.Superleap = {
201
+ window.SuperLeap = {
202
202
  // SDK methods (from superleapClient.js)
203
203
  init: client.init.bind(client),
204
204
  getSdk: client.getSdk.bind(client),
@@ -246,12 +246,12 @@
246
246
  var event = new CustomEvent("superleap-flow:ready", {
247
247
  detail: {
248
248
  FlowUI: window.FlowUI,
249
- Superleap: window.Superleap,
249
+ SuperLeap: window.SuperLeap,
250
250
  components: _components,
251
251
  },
252
252
  });
253
253
  document.dispatchEvent(event);
254
- console.log("[Superleap-Flow] Library ready - v__VERSION__");
254
+ console.log("[SuperLeap-Flow] Library ready - v__VERSION__");
255
255
  }
256
256
  }
257
257
 
@@ -263,24 +263,24 @@
263
263
  if (
264
264
  isInIframe &&
265
265
  bridgeId &&
266
- window.Superleap &&
267
- window.Superleap.connect
266
+ window.SuperLeap &&
267
+ window.SuperLeap.connect
268
268
  ) {
269
269
  // Auto-connect to CRM — defer ready event until connected
270
270
  function doAutoConnect() {
271
- window.Superleap.connect({ bridgeId: bridgeId })
271
+ window.SuperLeap.connect({ bridgeId: bridgeId })
272
272
  .then(function () {
273
273
  // Expose SDK as a direct global so users can write sdkInstance.getModel() directly
274
274
  if (
275
- window.Superleap &&
276
- typeof window.Superleap.getSdk === "function"
275
+ window.SuperLeap &&
276
+ typeof window.SuperLeap.getSdk === "function"
277
277
  ) {
278
- window.sdkInstance = window.Superleap.getSdk();
278
+ window.sdkInstance = window.SuperLeap.getSdk();
279
279
  }
280
280
  dispatchReady();
281
281
  })
282
282
  .catch(function (err) {
283
- console.error("[Superleap-Flow] Auto-connect failed:", err);
283
+ console.error("[SuperLeap-Flow] Auto-connect failed:", err);
284
284
  // Still dispatch ready so user code can handle the error
285
285
  dispatchReady();
286
286
  });
@@ -293,7 +293,7 @@
293
293
  setTimeout(doAutoConnect, 0);
294
294
  }
295
295
  } else {
296
- // Standalone mode — user must call Superleap.init(config) manually
296
+ // Standalone mode — user must call SuperLeap.init(config) manually
297
297
  // Dispatch ready immediately (no connection needed)
298
298
  if (document.readyState === "loading") {
299
299
  document.addEventListener("DOMContentLoaded", dispatchReady);
@@ -307,7 +307,7 @@
307
307
  if (typeof window !== "undefined" && window.FlowUI) {
308
308
  if (typeof exports !== "undefined") {
309
309
  exports.FlowUI = window.FlowUI;
310
- exports.Superleap = window.Superleap;
310
+ exports.SuperLeap = window.SuperLeap;
311
311
  }
312
312
  }
313
313
 
@@ -318,6 +318,6 @@
318
318
  typeof exports !== "undefined"
319
319
  ) {
320
320
  exports.FlowUI = global.FlowUI;
321
- exports.Superleap = global.Superleap;
321
+ exports.SuperLeap = global.SuperLeap;
322
322
  }
323
323
  })(typeof window !== "undefined" ? window : this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superleapai/flow-ui",
3
- "version": "2.6.21",
3
+ "version": "2.6.22",
4
4
  "description": "A reusable design system for building multi-step forms with comprehensive UI components. Single file, clean globals, SDK included. Only FlowUI and SuperLeap exposed.",
5
5
  "main": "dist/superleap-flow.min.js",
6
6
  "types": "index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "notifications",
51
51
  "superleap"
52
52
  ],
53
- "author": "Superleap",
53
+ "author": "SuperLeap",
54
54
  "license": "MIT",
55
55
  "repository": {
56
56
  "type": "git",