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

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 (81) hide show
  1. package/dist/{api-DstdB1oU.js → api-Axu2IRHZ.js} +1 -1
  2. package/dist/{api-CPZcLXHT.cjs → api-D0-Cl9bN.cjs} +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.mdx → actions.md} +0 -7
  16. package/dist/docs/{api-keys.mdx → api-keys.md} +0 -7
  17. package/dist/docs/{conditions.mdx → conditions.md} +0 -7
  18. package/dist/docs/{experiences.mdx → experiences.md} +0 -7
  19. package/dist/docs/{features.mdx → features.md} +0 -7
  20. package/dist/docs/{fields.mdx → fields.md} +0 -7
  21. package/dist/docs/flow-builder/{overview.mdx → overview.md} +0 -7
  22. package/dist/docs/pickedql/data-sources.md +2 -49
  23. package/dist/docs/pickedql/dimensions.md +0 -20
  24. package/dist/docs/pickedql/examples.md +1 -1
  25. package/dist/docs/pickedql/filtering.md +0 -22
  26. package/dist/docs/pickedql/index.md +1 -2
  27. package/dist/docs/pickedql/schema.md +1 -34
  28. package/dist/docs/pickedql/virtual-functions.md +4 -4
  29. package/dist/docs/{projects.mdx → projects.md} +0 -7
  30. package/dist/docs/{reports.mdx → reports.md} +0 -7
  31. package/dist/docs/{steps.mdx → steps.md} +0 -7
  32. package/dist/docs/{workspaces.mdx → workspaces.md} +0 -8
  33. package/dist/esm/form/index.js +5 -11
  34. package/dist/esm/index.js +166 -292
  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 +19 -21
  38. package/dist/esm/plugins/history-browser-storage/index.js +15 -17
  39. package/dist/esm/plugins/responses-browser-storage/index.js +19 -21
  40. package/dist/esm/plugins/responses-indexeddb/index.js +35 -37
  41. package/dist/esm/plugins/single-page-app/index.js +28 -14
  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-CNIhapU2.js +136 -0
  46. package/dist/experience-CTEBY-it.cjs +1 -0
  47. package/dist/experience-instance-B0tFPMAU.js +396 -0
  48. package/dist/experience-instance-BN0RZG1b.cjs +1 -0
  49. package/dist/nodes-2fst8XKi.js +101 -0
  50. package/dist/nodes-DBK4N9YY.cjs +1 -0
  51. package/dist/rules-logic-D7dL30U1.js +263 -0
  52. package/dist/rules-logic-DJhGFqhC.cjs +1 -0
  53. package/dist/types/entities/action/action.d.ts +4 -30
  54. package/dist/types/entities/action/action.d.ts.map +1 -1
  55. package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -4
  56. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  57. package/dist/types/entities/framework/framework.d.ts +2 -0
  58. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  59. package/dist/types/entities/response/response-validation.d.ts.map +1 -1
  60. package/dist/types/form/create-field-evaluator.d.ts.map +1 -1
  61. package/dist/types/picked.d.ts +1 -3
  62. package/dist/types/picked.d.ts.map +1 -1
  63. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  64. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  65. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  66. package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
  67. package/dist/types/plugins/single-page-app/plugin.d.ts +15 -4
  68. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  69. package/package.json +1 -1
  70. package/dist/experience-instance-DC2gKwA6.cjs +0 -1
  71. package/dist/experience-instance-DJaNc5Ob.js +0 -486
  72. package/dist/object-C82v79xc.js +0 -25
  73. package/dist/object-CUJOjanb.cjs +0 -1
  74. package/dist/rules-logic-BTIxfrJJ.js +0 -240
  75. package/dist/rules-logic-DNLOv90w.cjs +0 -1
  76. /package/dist/{id-Bv44ilEo.cjs → id-Cg7fVl1O.cjs} +0 -0
  77. /package/dist/{id-CRqy981z.js → id-n2yrHvNo.js} +0 -0
  78. /package/dist/{logger-6z_gb4rA.js → logger-C44jSdYl.js} +0 -0
  79. /package/dist/{logger-fbvQC40v.cjs → logger-CJUj90QX.cjs} +0 -0
  80. /package/dist/{supports-0XIfd4-R.js → supports-B_trw6lj.js} +0 -0
  81. /package/dist/{supports-Dsjg-82e.cjs → supports-CKSVYpQx.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 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
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
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,5 +32,4 @@ 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
36
35
 
@@ -83,36 +83,6 @@ 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
- ```
116
86
 
117
87
  ## `features`
118
88
 
@@ -147,10 +117,7 @@ Aggregated step-transition edges for sankey / funnel charts. Parameters are supp
147
117
  | `num_nodes_after_start` | Integer | | Forward window from start: keep steps where `seq_pos < start_seq + N` (card 4129 semantics). |
148
118
  | `num_nodes_before_target` | Integer | | Backward window from target: keep steps where `seq_pos >= target_seq - N` (card 2740 semantics). Requires `targeting_step`. |
149
119
  | `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`. |
153
120
 
154
- When both window params are set, both predicates apply (intersection). Date filters combine via `AND` with the other params.
121
+ When both window params are set, both predicates apply (intersection).
155
122
 
156
123
  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
- | `all_purchase_users()` | Users who completed a purchase |
24
+ | `total_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
- | `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 |
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 |
30
30
 
31
31
  ## Conversion rates
32
32
 
@@ -2,17 +2,10 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
- import { Screenshot } from '../../components/Screenshot'
6
-
7
5
  # Projects
8
6
 
9
7
  A project represents one website or app you want to instrument with Picked. Each project has its own set of experiences, entities, and configuration.
10
8
 
11
- <Screenshot
12
- route="/{orgSlug}"
13
- alt="The organization home page on the Picked dashboard, listing the projects in an organization"
14
- />
15
-
16
9
  ## Create a project
17
10
 
18
11
  You need an organization first. If you don't have one, create it when you sign up.
@@ -2,17 +2,10 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
- import { Screenshot } from '../../components/Screenshot'
6
-
7
5
  # Reports
8
6
 
9
7
  Reports show analytics data for your project. Track how visitors interact with your experiences and features.
10
8
 
11
- <Screenshot
12
- route="/{orgSlug}/{projectId}/reports"
13
- alt="The reports list for a project on the Picked dashboard"
14
- />
15
-
16
9
  ## View report data
17
10
 
18
11
  Open a report to see its analytics. Data updates as new visitor interactions are recorded.
@@ -2,17 +2,10 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
- import { Screenshot } from '../../components/Screenshot'
6
-
7
5
  # Steps
8
6
 
9
7
  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.
10
8
 
11
- <Screenshot
12
- route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/steps"
13
- alt="The steps list for a workspace on the Picked dashboard"
14
- />
15
-
16
9
  ## Create a step
17
10
 
18
11
  1. Open your project.
@@ -2,18 +2,10 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
- import { Screenshot } from '../../components/Screenshot'
6
-
7
5
  # Workspaces
8
6
 
9
7
  A workspace is a version of your project's configuration. Use workspaces to stage changes, preview them, and publish when ready.
10
8
 
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
-
17
9
  ## How workspaces work
18
10
 
19
11
  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-BTIxfrJJ.js";
1
+ import { t as e } from "../../rules-logic-D7dL30U1.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,16 +70,10 @@ 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 }) => {
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
- })
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
+ } }))
83
77
  });
84
78
  return o({
85
79
  clock: c.doneData,