@modelnex/sdk 0.5.23 → 0.5.24

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
@@ -4464,6 +4464,9 @@ function useTourPlayback({
4464
4464
 
4465
4465
  // src/hooks/useExperiencePlaybackController.ts
4466
4466
  var EXPERIENCE_PRIORITY = ["onboarding", "tour"];
4467
+ function shouldClearDraftPreviewOnPromptDismiss(prompt) {
4468
+ return Boolean(prompt?.options?.reviewMode);
4469
+ }
4467
4470
  function shouldDiscoverDraftPreview({
4468
4471
  disabled,
4469
4472
  hasPendingPrompt,
@@ -4558,6 +4561,9 @@ function useExperiencePlaybackController({
4558
4561
  if (experienceType && prompt.experienceType !== experienceType) return;
4559
4562
  setPendingPrompt(null);
4560
4563
  pendingPromptRef.current = null;
4564
+ if (shouldClearDraftPreviewOnPromptDismiss(prompt)) {
4565
+ clearActiveDraftPreview(prompt.experienceType);
4566
+ }
4561
4567
  if (!userProfile?.userId) return;
4562
4568
  void markTourDismissed(
4563
4569
  serverUrl,
package/dist/index.mjs CHANGED
@@ -4254,6 +4254,9 @@ function useTourPlayback({
4254
4254
 
4255
4255
  // src/hooks/useExperiencePlaybackController.ts
4256
4256
  var EXPERIENCE_PRIORITY = ["onboarding", "tour"];
4257
+ function shouldClearDraftPreviewOnPromptDismiss(prompt) {
4258
+ return Boolean(prompt?.options?.reviewMode);
4259
+ }
4257
4260
  function shouldDiscoverDraftPreview({
4258
4261
  disabled,
4259
4262
  hasPendingPrompt,
@@ -4348,6 +4351,9 @@ function useExperiencePlaybackController({
4348
4351
  if (experienceType && prompt.experienceType !== experienceType) return;
4349
4352
  setPendingPrompt(null);
4350
4353
  pendingPromptRef.current = null;
4354
+ if (shouldClearDraftPreviewOnPromptDismiss(prompt)) {
4355
+ clearActiveDraftPreview(prompt.experienceType);
4356
+ }
4351
4357
  if (!userProfile?.userId) return;
4352
4358
  void markTourDismissed(
4353
4359
  serverUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelnex/sdk",
3
- "version": "0.5.23",
3
+ "version": "0.5.24",
4
4
  "description": "React SDK for natural language control of web apps via AI agents",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -20,15 +20,6 @@
20
20
  "dist",
21
21
  "README.md"
22
22
  ],
23
- "scripts": {
24
- "prepublishOnly": "npm run build",
25
- "build": "npm exec -- tsup src/index.ts --format cjs,esm --dts",
26
- "dev": "npm exec -- tsup src/index.ts --format cjs,esm --watch --dts",
27
- "lint": "eslint src/",
28
- "test": "npm run build && node --test tests/*.test.js",
29
- "test:ci": "npm run test && npm run test:unit",
30
- "test:unit": "node --import tsx --test tests/*.test.ts"
31
- },
32
23
  "peerDependencies": {
33
24
  "react": ">=17.0.0",
34
25
  "react-dom": ">=17.0.0",
@@ -67,5 +58,13 @@
67
58
  "bugs": {
68
59
  "url": "https://github.com/sharunaraksha/modelnex-sdk/issues"
69
60
  },
70
- "homepage": "https://github.com/sharunaraksha/modelnex-sdk#readme"
71
- }
61
+ "homepage": "https://github.com/sharunaraksha/modelnex-sdk#readme",
62
+ "scripts": {
63
+ "build": "npm exec -- tsup src/index.ts --format cjs,esm --dts",
64
+ "dev": "npm exec -- tsup src/index.ts --format cjs,esm --watch --dts",
65
+ "lint": "eslint src/",
66
+ "test": "npm run build && node --test tests/*.test.js",
67
+ "test:ci": "npm run test && npm run test:unit",
68
+ "test:unit": "node --import tsx --test tests/*.test.ts"
69
+ }
70
+ }