@picked/svelte 0.0.64-next.2 → 0.0.64-next.4
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,
|
|
10
|
+
import { evaluateConditionMemo, hashRule, ruleReferencesActionDeep } from '@picked/client/server'
|
|
11
11
|
import { getPicked, useUnit } from '../hooks'
|
|
12
12
|
import ExperienceHost from './ExperienceHost.svelte'
|
|
13
13
|
|
|
@@ -45,6 +45,16 @@
|
|
|
45
45
|
|
|
46
46
|
const experiences = useUnit(client.experiences.listStore)
|
|
47
47
|
const conditionResults = useUnit(client.conditionResults.store)
|
|
48
|
+
const conditions = useUnit(client.conditions.listStore)
|
|
49
|
+
|
|
50
|
+
const conditionsByKey = $derived.by(() => {
|
|
51
|
+
const byKey: Parameters<typeof ruleReferencesActionDeep>[1] = {}
|
|
52
|
+
for (const condition of $conditions) {
|
|
53
|
+
byKey[condition.key] = condition
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return byKey
|
|
57
|
+
})
|
|
48
58
|
|
|
49
59
|
/**
|
|
50
60
|
* Returns the sort rank for a placement; unknown placements sort last.
|
|
@@ -80,8 +90,9 @@
|
|
|
80
90
|
// Action-referencing conditions are never cached (their side effect must re-run), so they can
|
|
81
91
|
// never resolve through the synchronous `peek` the slot path relies on. Slots do not support
|
|
82
92
|
// action-gated conditions in v1; excluding them also stops the selection effect from re-firing
|
|
83
|
-
// the action on every render.
|
|
84
|
-
|
|
93
|
+
// the action on every render. The deep check follows composed `conditions.<key>` references so a
|
|
94
|
+
// condition that reaches an action transitively is excluded too.
|
|
95
|
+
if (ruleReferencesActionDeep(config.decisionLogic, conditionsByKey)) {
|
|
85
96
|
return null
|
|
86
97
|
}
|
|
87
98
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/svelte",
|
|
3
|
-
"version": "0.0.64-next.
|
|
3
|
+
"version": "0.0.64-next.4",
|
|
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.64-next.
|
|
109
|
+
"@picked/client": "0.0.64-next.4",
|
|
110
110
|
"effector": "^23.3.0",
|
|
111
111
|
"svelte": "^5.46.4"
|
|
112
112
|
},
|