@picked/svelte 0.0.1-dev.1780458499348 → 0.0.1-dev.1780464669265

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.
@@ -7,7 +7,7 @@
7
7
  * re-renders reactively.
8
8
  */
9
9
  import type { ExperienceStore, ExperienceTarget } from '@picked/client'
10
- import { evaluateConditionMemo, hashRule } from '@picked/client/server'
10
+ import { evaluateConditionMemo, hashRule, ruleReferencesAction } from '@picked/client/server'
11
11
  import { getPicked, useUnit } from '../hooks'
12
12
  import ExperienceHost from './ExperienceHost.svelte'
13
13
 
@@ -54,10 +54,11 @@
54
54
  }
55
55
 
56
56
  /**
57
- * Maps an experience to a slot candidate, or null when it does not target this slot.
57
+ * Maps an experience to a slot candidate, or null when it does not target this slot, uses the
58
+ * deferred `replace` placement, or carries an action-referencing condition.
58
59
  *
59
60
  * @param {ExperienceStore} experience - The experience to inspect.
60
- * @returns {Candidate | null} The candidate, or null when the experience does not target this slot.
61
+ * @returns {Candidate | null} The candidate, or null when the experience is not an eligible slot match.
61
62
  * @example
62
63
  * toCandidate(experienceStore)
63
64
  */
@@ -70,6 +71,20 @@
70
71
  return null
71
72
  }
72
73
 
74
+ // `replace` is deferred (first-wins semantics are not implemented yet), so skip it rather than
75
+ // letting it fall through and render appended-last.
76
+ if (target.placement === 'replace') {
77
+ return null
78
+ }
79
+
80
+ // Action-referencing conditions are never cached (their side effect must re-run), so they can
81
+ // never resolve through the synchronous `peek` the slot path relies on. Slots do not support
82
+ // action-gated conditions in v1; excluding them also stops the selection effect from re-firing
83
+ // the action on every render.
84
+ if (ruleReferencesAction(config.decisionLogic)) {
85
+ return null
86
+ }
87
+
73
88
  return {
74
89
  experience,
75
90
  placement: target.placement,
@@ -40,7 +40,10 @@
40
40
  // content arrives pre-registered via the snapshot.
41
41
  $effect(() => {
42
42
  if ($ready) {
43
- void experience.prepareExperienceContentFx()
43
+ // Content fetch failures (e.g. a 404 when the content endpoint is unavailable) are already
44
+ // swallowed inside the effect; the explicit catch guarantees no unhandled rejection even if
45
+ // that contract changes, so a missing/erroring content endpoint never breaks rendering.
46
+ experience.prepareExperienceContentFx().catch(() => undefined)
44
47
  }
45
48
  })
46
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/svelte",
3
- "version": "0.0.1-dev.1780458499348",
3
+ "version": "0.0.1-dev.1780464669265",
4
4
  "dependencies": {
5
5
  "d3": "^7.9.0"
6
6
  },
@@ -106,7 +106,7 @@
106
106
  },
107
107
  "module": "./dist/index.js",
108
108
  "peerDependencies": {
109
- "@picked/client": "0.0.1-dev.1780458499348",
109
+ "@picked/client": "0.0.1-dev.1780464669265",
110
110
  "effector": "^23.3.0",
111
111
  "svelte": "^5.46.4"
112
112
  },