@picked/client 0.0.1-dev.1776837084253 → 0.0.1-dev.1777506629683

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.
Files changed (79) hide show
  1. package/dist/{api-CIC-Uysx.cjs → api-CPZcLXHT.cjs} +1 -1
  2. package/dist/{api-6oxKA__k.js → api-DstdB1oU.js} +1 -1
  3. package/dist/cjs/form/index.js +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/create-experience/index.js +1 -1
  6. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  7. package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
  8. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  9. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  10. package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
  11. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  12. package/dist/cjs/plugins/web-components/index.js +1 -1
  13. package/dist/cjs/plugins/window-object/index.js +1 -1
  14. package/dist/cjs/server/index.js +1 -1
  15. package/dist/docs/{actions.md → actions.mdx} +7 -0
  16. package/dist/docs/{api-keys.md → api-keys.mdx} +7 -0
  17. package/dist/docs/{conditions.md → conditions.mdx} +7 -0
  18. package/dist/docs/{experiences.md → experiences.mdx} +7 -0
  19. package/dist/docs/{features.md → features.mdx} +7 -0
  20. package/dist/docs/{fields.md → fields.mdx} +7 -0
  21. package/dist/docs/flow-builder/{overview.md → overview.mdx} +7 -0
  22. package/dist/docs/pickedql/data-sources.md +49 -2
  23. package/dist/docs/pickedql/dimensions.md +20 -0
  24. package/dist/docs/pickedql/examples.md +1 -1
  25. package/dist/docs/pickedql/filtering.md +22 -0
  26. package/dist/docs/pickedql/index.md +2 -1
  27. package/dist/docs/pickedql/schema.md +34 -1
  28. package/dist/docs/pickedql/virtual-functions.md +4 -4
  29. package/dist/docs/{projects.md → projects.mdx} +7 -0
  30. package/dist/docs/{reports.md → reports.mdx} +7 -0
  31. package/dist/docs/{steps.md → steps.mdx} +7 -0
  32. package/dist/docs/{workspaces.md → workspaces.mdx} +8 -0
  33. package/dist/esm/form/index.js +11 -5
  34. package/dist/esm/index.js +292 -166
  35. package/dist/esm/plugins/create-experience/index.js +1 -1
  36. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  37. package/dist/esm/plugins/experience-browser-storage/index.js +21 -19
  38. package/dist/esm/plugins/history-browser-storage/index.js +17 -15
  39. package/dist/esm/plugins/responses-browser-storage/index.js +21 -19
  40. package/dist/esm/plugins/responses-indexeddb/index.js +37 -35
  41. package/dist/esm/plugins/single-page-app/index.js +14 -28
  42. package/dist/esm/plugins/web-components/index.js +1 -1
  43. package/dist/esm/plugins/window-object/index.js +1 -1
  44. package/dist/esm/server/index.js +1 -1
  45. package/dist/experience-instance-DC2gKwA6.cjs +1 -0
  46. package/dist/experience-instance-DJaNc5Ob.js +486 -0
  47. package/dist/object-C82v79xc.js +25 -0
  48. package/dist/object-CUJOjanb.cjs +1 -0
  49. package/dist/rules-logic-BTIxfrJJ.js +240 -0
  50. package/dist/rules-logic-DNLOv90w.cjs +1 -0
  51. package/dist/types/entities/action/action.d.ts +30 -4
  52. package/dist/types/entities/action/action.d.ts.map +1 -1
  53. package/dist/types/entities/experience-instance/experience-instance.d.ts +4 -2
  54. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  55. package/dist/types/entities/response/response-validation.d.ts.map +1 -1
  56. package/dist/types/form/create-field-evaluator.d.ts.map +1 -1
  57. package/dist/types/picked.d.ts +3 -1
  58. package/dist/types/picked.d.ts.map +1 -1
  59. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  60. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  61. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  62. package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
  63. package/dist/types/plugins/single-page-app/plugin.d.ts +4 -15
  64. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  65. package/package.json +1 -1
  66. package/dist/experience-CNIhapU2.js +0 -136
  67. package/dist/experience-CTEBY-it.cjs +0 -1
  68. package/dist/experience-instance-Cu8oGGr9.cjs +0 -1
  69. package/dist/experience-instance-DIpWYaA6.js +0 -387
  70. package/dist/nodes-2fst8XKi.js +0 -101
  71. package/dist/nodes-DBK4N9YY.cjs +0 -1
  72. package/dist/rules-logic-D7dL30U1.js +0 -263
  73. package/dist/rules-logic-DJhGFqhC.cjs +0 -1
  74. /package/dist/{id-Cg7fVl1O.cjs → id-Bv44ilEo.cjs} +0 -0
  75. /package/dist/{id-n2yrHvNo.js → id-CRqy981z.js} +0 -0
  76. /package/dist/{logger-C44jSdYl.js → logger-6z_gb4rA.js} +0 -0
  77. /package/dist/{logger-CJUj90QX.cjs → logger-fbvQC40v.cjs} +0 -0
  78. /package/dist/{supports-B_trw6lj.js → supports-0XIfd4-R.js} +0 -0
  79. /package/dist/{supports-CKSVYpQx.cjs → supports-Dsjg-82e.cjs} +0 -0
@@ -22,7 +22,7 @@ PickedQL handles table mapping and dimension joins automatically. You write conc
22
22
  1. **Virtual table expansion**: Table names like `metrics` map to underlying data tables
23
23
  2. **Virtual function expansion**: Shorthand functions like `control_users()` expand to full aggregate expressions
24
24
  3. **Auto dimension joins**: References to dimension columns (like `device_category` or `country_code`) trigger automatic `LEFT JOIN` clauses — you never write joins yourself
25
- 4. **Tenant isolation**: Every query must include a `project_id` filter in the `WHERE` clause. PickedQL extracts it and verifies you have permission to access that project
25
+ 4. **Tenant isolation**: Every query must include a tenant filter in the `WHERE` clause — usually `project_id`, but `projects` uses `id` (the row's `id` IS the project id). PickedQL extracts the filter and verifies you have permission to access that project
26
26
  5. **SQL passthrough**: Standard SQL (including `CASE WHEN`, window functions, and subqueries) works alongside virtual functions
27
27
 
28
28
  ## Best practices
@@ -32,4 +32,5 @@ PickedQL handles table mapping and dimension joins automatically. You write conc
32
32
  - **Use `experience_journey` for sankey / funnel charts**: One line of SQL returns `source, target, users` — the 8-CTE scaffold (dedup, top-N path ranking, lagInFrame) is handled internally; pass parameters via `WHERE`
33
33
  - **Don't write JOINs**: PickedQL injects them automatically when you reference dimension columns
34
34
  - **Group by any dimension**: Add dimension columns to `SELECT` and `GROUP BY` freely — required joins are handled for you
35
+ - **Reference table metadata for free**: Use `step_title`, `experience_title`, `project_name` directly in `events` queries — PickedQL auto-joins the `steps`, `experiences`, and `projects` reference tables
35
36
 
@@ -83,6 +83,36 @@ These columns are joined automatically when referenced — no `JOIN` syntax need
83
83
  | `product_name` | dim_product | Product name |
84
84
  | `product_category` | dim_product | Product category |
85
85
  | `product_page` | dim_product | Product page |
86
+ | `step_title` | steps | Step title (joined on `project_id` + `experience_id` + `step_id`) |
87
+ | `experience_title` | experiences | Experience title (joined on `project_id` + `experience_id`) |
88
+ | `project_name` | projects | Project name |
89
+ | `project_timezone` | projects | Project timezone |
90
+
91
+ ## `steps`, `experiences`, `projects`
92
+
93
+ Reference tables describing your Picked configuration. Auto-joined onto `events` when their analyst-facing columns are referenced; require a per-table tenant filter when queried directly.
94
+
95
+ | Source | Real Columns | Analyst Columns (when referenced from `events`) | Tenant filter (when queried directly) |
96
+ |---|---|---|---|
97
+ | `steps` | `id`, `title`, `experience_id`, `project_id`, `organization_id` | `step_title` | `project_id = '…'` |
98
+ | `experiences` | `id`, `title`, `project_id`, `organization_id` | `experience_title` | `project_id = '…'` |
99
+ | `projects` | `id`, `name`, `timezone`, `organization_id` | `project_name`, `project_timezone` | `id = '<project_id>'` |
100
+
101
+ When queried directly, use the real column names:
102
+
103
+ ```sql
104
+ -- List all experiences for a project
105
+ SELECT id, title FROM experiences WHERE project_id = 'your-project-id'
106
+ ```
107
+
108
+ When referenced from `events`, use the prefixed analyst names — joins are injected automatically:
109
+
110
+ ```sql
111
+ SELECT experience_title, step_title, count(*)
112
+ FROM events
113
+ WHERE project_id = 'your-project-id'
114
+ GROUP BY experience_title, step_title
115
+ ```
86
116
 
87
117
  ## `features`
88
118
 
@@ -117,7 +147,10 @@ Aggregated step-transition edges for sankey / funnel charts. Parameters are supp
117
147
  | `num_nodes_after_start` | Integer | | Forward window from start: keep steps where `seq_pos < start_seq + N` (card 4129 semantics). |
118
148
  | `num_nodes_before_target` | Integer | | Backward window from target: keep steps where `seq_pos >= target_seq - N` (card 2740 semantics). Requires `targeting_step`. |
119
149
  | `top_n_path` | Integer | | Keep only the top-N most-walked paths by user count. Defaults to no limit. |
150
+ | `user_cohort_event` | String | | Restrict to users who have at least one `fact_events` row with this `event_type`. Implemented as `user_canonical_id IN (SELECT DISTINCT user_canonical_id FROM fact_events WHERE event_type = '…')`. |
151
+ | `client_local_date` | Date | | Date range filter, pushed into the underlying scan. Supports `=`, `<`, `<=`, `>`, `>=`, `BETWEEN`. |
152
+ | `event_timestamp` | DateTime64 | | Server-side timestamp filter. Same operators as `client_local_date`. |
120
153
 
121
- When both window params are set, both predicates apply (intersection).
154
+ When both window params are set, both predicates apply (intersection). Date filters combine via `AND` with the other params.
122
155
 
123
156
  See [data sources → experience_journey](./data-sources#experience_journey--sankey-ready-step-transitions) for usage examples.
@@ -21,12 +21,12 @@ Virtual functions are shorthand for aggregate expressions. They are **table-awar
21
21
 
22
22
  | Function | Description |
23
23
  |---|---|
24
- | `total_purchase_users()` | Users who completed a purchase |
24
+ | `all_purchase_users()` | Users who completed a purchase |
25
25
  | `control_purchase_users()` | Control users who purchased (`metrics` only) |
26
26
  | `variant_purchase_users()` | Variant users who purchased (`metrics` only) |
27
- | `total_purchase_sessions()` | Sessions with a purchase (`metrics` only) |
28
- | `total_purchase_orders()` | Unique order count (`metrics` only) |
29
- | `total_cart_add_users()` | Users who added to cart |
27
+ | `all_purchase_sessions()` | Sessions with a purchase (`metrics` only) |
28
+ | `all_purchase_orders()` | Unique order count (`metrics` only) |
29
+ | `all_cart_add_users()` | Users who added to cart |
30
30
 
31
31
  ## Conversion rates
32
32
 
@@ -2,10 +2,17 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
+ import { Screenshot } from '../../components/Screenshot'
6
+
5
7
  # Projects
6
8
 
7
9
  A project represents one website or app you want to instrument with Picked. Each project has its own set of experiences, entities, and configuration.
8
10
 
11
+ <Screenshot
12
+ route="/{orgSlug}"
13
+ alt="The organization home page on the Picked dashboard, listing the projects in an organization"
14
+ />
15
+
9
16
  ## Create a project
10
17
 
11
18
  You need an organization first. If you don't have one, create it when you sign up.
@@ -2,10 +2,17 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
+ import { Screenshot } from '../../components/Screenshot'
6
+
5
7
  # Reports
6
8
 
7
9
  Reports show analytics data for your project. Track how visitors interact with your experiences and features.
8
10
 
11
+ <Screenshot
12
+ route="/{orgSlug}/{projectId}/reports"
13
+ alt="The reports list for a project on the Picked dashboard"
14
+ />
15
+
9
16
  ## View report data
10
17
 
11
18
  Open a report to see its analytics. Data updates as new visitor interactions are recorded.
@@ -2,10 +2,17 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
+ import { Screenshot } from '../../components/Screenshot'
6
+
5
7
  # Steps
6
8
 
7
9
  A step is a visual screen or card shown to visitors during an experience. Each step holds one or more fields that collect data or display content.
8
10
 
11
+ <Screenshot
12
+ route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/steps"
13
+ alt="The steps list for a workspace on the Picked dashboard"
14
+ />
15
+
9
16
  ## Create a step
10
17
 
11
18
  1. Open your project.
@@ -2,10 +2,18 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
+ import { Screenshot } from '../../components/Screenshot'
6
+
5
7
  # Workspaces
6
8
 
7
9
  A workspace is a version of your project's configuration. Use workspaces to stage changes, preview them, and publish when ready.
8
10
 
11
+ <Screenshot
12
+ route="/{orgSlug}/{projectId}/workspaces"
13
+ alt="The workspaces list inside a project on the Picked dashboard"
14
+ hide={['[data-testid="workspace-row-relative-time"]']}
15
+ />
16
+
9
17
  ## How workspaces work
10
18
 
11
19
  Each project has a workspace that holds your experiences, features, and entity configurations. When you make changes in the dashboard — editing a flow, updating a feature, or modifying an entity — those changes exist in the workspace until you publish.
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../rules-logic-D7dL30U1.js";
1
+ import { t as e } from "../../rules-logic-BTIxfrJJ.js";
2
2
  import { attach as t, combine as n, createEffect as r, createEvent as i, createStore as a, sample as o, split as s } from "effector";
3
3
  //#region src/form/build-responses.ts
4
4
  function c(e, t, n) {
@@ -70,10 +70,16 @@ function m(e, n, i) {
70
70
  staged: i,
71
71
  committed: e.responses.getAllStore
72
72
  },
73
- effect: r(async ({ allFields: t, fieldKeys: n, staged: r, committed: i }) => await p(e, t.filter((e) => n.includes(e.key)), { responses: {
74
- ...i,
75
- ...r
76
- } }))
73
+ effect: r(async ({ allFields: t, fieldKeys: n, staged: r, committed: i }) => {
74
+ let a = new Map(t.map((e) => [e.key, e]));
75
+ return await p(e, n.flatMap((e) => {
76
+ let t = a.get(e);
77
+ return t ? [t] : [];
78
+ }), { responses: {
79
+ ...i,
80
+ ...r
81
+ } });
82
+ })
77
83
  });
78
84
  return o({
79
85
  clock: c.doneData,