@hexclave/shared 1.0.14 → 1.0.16

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 (122) hide show
  1. package/dist/apps/apps-config.d.ts +6 -0
  2. package/dist/apps/apps-config.js +6 -0
  3. package/dist/apps/apps-config.js.map +1 -1
  4. package/dist/config/schema.d.ts +107 -107
  5. package/dist/config-authoring.d.ts.map +1 -1
  6. package/dist/config-authoring.js.map +1 -1
  7. package/dist/config-authoring.test.js +1 -1
  8. package/dist/config-authoring.test.js.map +1 -1
  9. package/dist/config-rendering.d.ts +2 -2
  10. package/dist/config-rendering.js +16 -0
  11. package/dist/config-rendering.js.map +1 -1
  12. package/dist/esm/apps/apps-config.d.ts +6 -0
  13. package/dist/esm/apps/apps-config.js +6 -0
  14. package/dist/esm/apps/apps-config.js.map +1 -1
  15. package/dist/esm/config/schema.d.ts +107 -107
  16. package/dist/esm/config-authoring.d.ts.map +1 -1
  17. package/dist/esm/config-authoring.js.map +1 -1
  18. package/dist/esm/config-authoring.test.js +1 -1
  19. package/dist/esm/config-authoring.test.js.map +1 -1
  20. package/dist/esm/config-rendering.d.ts +2 -2
  21. package/dist/esm/config-rendering.js +16 -2
  22. package/dist/esm/config-rendering.js.map +1 -1
  23. package/dist/esm/hexclave-config-file.d.ts +24 -1
  24. package/dist/esm/hexclave-config-file.d.ts.map +1 -1
  25. package/dist/esm/hexclave-config-file.js +69 -2
  26. package/dist/esm/hexclave-config-file.js.map +1 -1
  27. package/dist/esm/interface/admin-interface.d.ts +19 -1
  28. package/dist/esm/interface/admin-interface.d.ts.map +1 -1
  29. package/dist/esm/interface/admin-interface.js +14 -0
  30. package/dist/esm/interface/admin-interface.js.map +1 -1
  31. package/dist/esm/interface/admin-metrics.d.ts +115 -21
  32. package/dist/esm/interface/admin-metrics.d.ts.map +1 -1
  33. package/dist/esm/interface/admin-metrics.js +61 -1
  34. package/dist/esm/interface/admin-metrics.js.map +1 -1
  35. package/dist/esm/interface/conversations.d.ts +42 -42
  36. package/dist/esm/interface/crud/current-user.d.ts +15 -15
  37. package/dist/esm/interface/crud/email-outbox.d.ts +220 -220
  38. package/dist/esm/interface/crud/invoices.d.ts +2 -2
  39. package/dist/esm/interface/crud/products.d.ts +17 -17
  40. package/dist/esm/interface/crud/products.d.ts.map +1 -1
  41. package/dist/esm/interface/crud/project-api-keys.d.ts +4 -4
  42. package/dist/esm/interface/crud/projects.d.ts +59 -59
  43. package/dist/esm/interface/crud/team-member-profiles.d.ts +26 -26
  44. package/dist/esm/interface/crud/transactions.d.ts +15 -15
  45. package/dist/esm/interface/crud/transactions.d.ts.map +1 -1
  46. package/dist/esm/interface/crud/users.d.ts +18 -18
  47. package/dist/esm/interface/webhooks.d.ts +4 -4
  48. package/dist/esm/known-errors.d.ts +5 -5
  49. package/dist/esm/schema-fields.d.ts +8 -8
  50. package/dist/esm/sessions.d.ts +7 -7
  51. package/dist/esm/utils/analytics-clickmap-overlay.d.ts +18 -0
  52. package/dist/esm/utils/analytics-clickmap-overlay.d.ts.map +1 -0
  53. package/dist/esm/utils/analytics-clickmap-overlay.js +19 -0
  54. package/dist/esm/utils/analytics-clickmap-overlay.js.map +1 -0
  55. package/dist/esm/utils/dev-tool.d.ts +31 -0
  56. package/dist/esm/utils/dev-tool.d.ts.map +1 -0
  57. package/dist/esm/utils/dev-tool.js +32 -0
  58. package/dist/esm/utils/dev-tool.js.map +1 -0
  59. package/dist/esm/utils/dom.d.ts +7 -1
  60. package/dist/esm/utils/dom.d.ts.map +1 -1
  61. package/dist/esm/utils/dom.js +20 -1
  62. package/dist/esm/utils/dom.js.map +1 -1
  63. package/dist/esm/utils/elements-chain.d.ts +38 -0
  64. package/dist/esm/utils/elements-chain.d.ts.map +1 -0
  65. package/dist/esm/utils/elements-chain.js +297 -0
  66. package/dist/esm/utils/elements-chain.js.map +1 -0
  67. package/dist/hexclave-config-file.d.ts +24 -1
  68. package/dist/hexclave-config-file.d.ts.map +1 -1
  69. package/dist/hexclave-config-file.js +71 -1
  70. package/dist/hexclave-config-file.js.map +1 -1
  71. package/dist/interface/admin-interface.d.ts +19 -1
  72. package/dist/interface/admin-interface.d.ts.map +1 -1
  73. package/dist/interface/admin-interface.js +14 -0
  74. package/dist/interface/admin-interface.js.map +1 -1
  75. package/dist/interface/admin-metrics.d.ts +115 -21
  76. package/dist/interface/admin-metrics.d.ts.map +1 -1
  77. package/dist/interface/admin-metrics.js +65 -0
  78. package/dist/interface/admin-metrics.js.map +1 -1
  79. package/dist/interface/conversations.d.ts +42 -42
  80. package/dist/interface/crud/current-user.d.ts +15 -15
  81. package/dist/interface/crud/email-outbox.d.ts +220 -220
  82. package/dist/interface/crud/invoices.d.ts +2 -2
  83. package/dist/interface/crud/products.d.ts +17 -17
  84. package/dist/interface/crud/products.d.ts.map +1 -1
  85. package/dist/interface/crud/project-api-keys.d.ts +4 -4
  86. package/dist/interface/crud/projects.d.ts +59 -59
  87. package/dist/interface/crud/team-member-profiles.d.ts +26 -26
  88. package/dist/interface/crud/transactions.d.ts +15 -15
  89. package/dist/interface/crud/transactions.d.ts.map +1 -1
  90. package/dist/interface/crud/users.d.ts +18 -18
  91. package/dist/interface/webhooks.d.ts +4 -4
  92. package/dist/known-errors.d.ts +5 -5
  93. package/dist/schema-fields.d.ts +8 -8
  94. package/dist/sessions.d.ts +7 -7
  95. package/dist/utils/analytics-clickmap-overlay.d.ts +18 -0
  96. package/dist/utils/analytics-clickmap-overlay.d.ts.map +1 -0
  97. package/dist/utils/analytics-clickmap-overlay.js +23 -0
  98. package/dist/utils/analytics-clickmap-overlay.js.map +1 -0
  99. package/dist/utils/dev-tool.d.ts +31 -0
  100. package/dist/utils/dev-tool.d.ts.map +1 -0
  101. package/dist/utils/dev-tool.js +37 -0
  102. package/dist/utils/dev-tool.js.map +1 -0
  103. package/dist/utils/dom.d.ts +7 -1
  104. package/dist/utils/dom.d.ts.map +1 -1
  105. package/dist/utils/dom.js +20 -0
  106. package/dist/utils/dom.js.map +1 -1
  107. package/dist/utils/elements-chain.d.ts +38 -0
  108. package/dist/utils/elements-chain.d.ts.map +1 -0
  109. package/dist/utils/elements-chain.js +304 -0
  110. package/dist/utils/elements-chain.js.map +1 -0
  111. package/package.json +1 -1
  112. package/src/apps/apps-config.ts +6 -0
  113. package/src/config-authoring.test.ts +1 -1
  114. package/src/config-authoring.ts +6 -6
  115. package/src/config-rendering.ts +24 -2
  116. package/src/hexclave-config-file.ts +90 -1
  117. package/src/interface/admin-interface.ts +43 -1
  118. package/src/interface/admin-metrics.ts +92 -4
  119. package/src/utils/analytics-clickmap-overlay.tsx +15 -0
  120. package/src/utils/dev-tool.tsx +30 -0
  121. package/src/utils/dom.tsx +42 -0
  122. package/src/utils/elements-chain.tsx +349 -0
@@ -6,7 +6,7 @@ import * as ______utils_dates0 from "../../utils/dates";
6
6
  declare const transactionEntrySchema: yup$1.MixedSchema<{
7
7
  type: "money_transfer";
8
8
  customer_id: string;
9
- customer_type: "team" | "user" | "custom";
9
+ customer_type: "user" | "team" | "custom";
10
10
  charged_amount: {
11
11
  USD?: string | undefined;
12
12
  EUR?: string | undefined;
@@ -26,7 +26,7 @@ declare const transactionEntrySchema: yup$1.MixedSchema<{
26
26
  item_id: string;
27
27
  customer_id: string;
28
28
  quantity: number;
29
- customer_type: "team" | "user" | "custom";
29
+ customer_type: "user" | "team" | "custom";
30
30
  adjusted_transaction_id: string | null;
31
31
  adjusted_entry_index: number | null;
32
32
  } | {
@@ -36,14 +36,15 @@ declare const transactionEntrySchema: yup$1.MixedSchema<{
36
36
  customer_id: string;
37
37
  product_id: string | null;
38
38
  quantity: number;
39
- customer_type: "team" | "user" | "custom";
39
+ customer_type: "user" | "team" | "custom";
40
40
  product: {
41
- free_trial?: ______utils_dates0.DayInterval | undefined;
42
41
  client_metadata?: {} | null | undefined;
43
42
  client_read_only_metadata?: {} | null | undefined;
44
43
  server_metadata?: {} | null | undefined;
44
+ free_trial?: ______utils_dates0.DayInterval | undefined;
45
+ display_name: string;
45
46
  server_only: boolean;
46
- customer_type: "team" | "user" | "custom";
47
+ customer_type: "user" | "team" | "custom";
47
48
  stackable: boolean;
48
49
  prices: Record<string, {
49
50
  USD?: string | undefined;
@@ -56,10 +57,9 @@ declare const transactionEntrySchema: yup$1.MixedSchema<{
56
57
  interval?: ______utils_dates0.DayInterval | undefined;
57
58
  free_trial?: ______utils_dates0.DayInterval | undefined;
58
59
  }>;
59
- display_name: string;
60
60
  included_items: Record<string, {
61
- repeat?: "never" | ______utils_dates0.DayInterval | undefined;
62
61
  quantity?: number | undefined;
62
+ repeat?: "never" | ______utils_dates0.DayInterval | undefined;
63
63
  expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
64
64
  }>;
65
65
  };
@@ -85,12 +85,12 @@ declare const transactionSchema: yup$1.ObjectSchema<{
85
85
  created_at_millis: number;
86
86
  effective_at_millis: number;
87
87
  type: "purchase" | "subscription-cancellation" | "subscription-renewal" | "manual-item-quantity-change" | "refund" | "chargeback" | "product-change" | null;
88
- customer_type: "team" | "user" | "custom";
88
+ customer_type: "user" | "team" | "custom";
89
89
  customer_id: string;
90
90
  entries: ({
91
91
  type: "money_transfer";
92
92
  customer_id: string;
93
- customer_type: "team" | "user" | "custom";
93
+ customer_type: "user" | "team" | "custom";
94
94
  charged_amount: {
95
95
  USD?: string | undefined;
96
96
  EUR?: string | undefined;
@@ -110,7 +110,7 @@ declare const transactionSchema: yup$1.ObjectSchema<{
110
110
  item_id: string;
111
111
  customer_id: string;
112
112
  quantity: number;
113
- customer_type: "team" | "user" | "custom";
113
+ customer_type: "user" | "team" | "custom";
114
114
  adjusted_transaction_id: string | null;
115
115
  adjusted_entry_index: number | null;
116
116
  } | {
@@ -120,14 +120,15 @@ declare const transactionSchema: yup$1.ObjectSchema<{
120
120
  customer_id: string;
121
121
  product_id: string | null;
122
122
  quantity: number;
123
- customer_type: "team" | "user" | "custom";
123
+ customer_type: "user" | "team" | "custom";
124
124
  product: {
125
- free_trial?: ______utils_dates0.DayInterval | undefined;
126
125
  client_metadata?: {} | null | undefined;
127
126
  client_read_only_metadata?: {} | null | undefined;
128
127
  server_metadata?: {} | null | undefined;
128
+ free_trial?: ______utils_dates0.DayInterval | undefined;
129
+ display_name: string;
129
130
  server_only: boolean;
130
- customer_type: "team" | "user" | "custom";
131
+ customer_type: "user" | "team" | "custom";
131
132
  stackable: boolean;
132
133
  prices: Record<string, {
133
134
  USD?: string | undefined;
@@ -140,10 +141,9 @@ declare const transactionSchema: yup$1.ObjectSchema<{
140
141
  interval?: ______utils_dates0.DayInterval | undefined;
141
142
  free_trial?: ______utils_dates0.DayInterval | undefined;
142
143
  }>;
143
- display_name: string;
144
144
  included_items: Record<string, {
145
- repeat?: "never" | ______utils_dates0.DayInterval | undefined;
146
145
  quantity?: number | undefined;
146
+ repeat?: "never" | ______utils_dates0.DayInterval | undefined;
147
147
  expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
148
148
  }>;
149
149
  };
@@ -1 +1 @@
1
- {"version":3,"file":"transactions.d.ts","names":[],"sources":["../../../../src/interface/crud/transactions.ts"],"mappings":";;;;;cAwFa,sBAAA,QAAsB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMxB,kBAAA,CAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEC,gBAAA,GAAmB,SAAA,QAAiB,sBAAA;AAAA,cAEnC,iBAAA;AAAA,KAUD,eAAA,WAA0B,iBAAA;AAAA,cAEzB,iBAAA,QAAiB,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAkBlB,kBAAA,CAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEA,WAAA,GAAc,SAAA,QAAiB,iBAAA"}
1
+ {"version":3,"file":"transactions.d.ts","names":[],"sources":["../../../../src/interface/crud/transactions.ts"],"mappings":";;;;;cAwFa,sBAAA,QAAsB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMxB,kBAAA,CAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEC,gBAAA,GAAmB,SAAA,QAAiB,sBAAA;AAAA,cAEnC,iBAAA;AAAA,KAUD,eAAA,WAA0B,iBAAA;AAAA,cAEzB,iBAAA,QAAiB,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAkBlB,kBAAA,CAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEA,WAAA,GAAc,SAAA,QAAiB,iBAAA"}
@@ -81,10 +81,10 @@ declare const usersCrudServerReadSchema: yup$1.ObjectSchema<{
81
81
  client_metadata?: {} | null | undefined;
82
82
  client_read_only_metadata?: {} | null | undefined;
83
83
  server_metadata?: {} | null | undefined;
84
- display_name: string;
85
84
  id: string;
86
- profile_image_url: string | null;
87
85
  created_at_millis: number;
86
+ display_name: string;
87
+ profile_image_url: string | null;
88
88
  } | null;
89
89
  selected_team_id: string | null;
90
90
  profile_image_url: string | null;
@@ -163,28 +163,28 @@ declare const usersCrudServerReadSchema: yup$1.ObjectSchema<{
163
163
  requires_totp_mfa: undefined;
164
164
  }, "">;
165
165
  declare const usersCrudServerCreateSchema: yup$1.ObjectSchema<{
166
- primary_email: string | null | undefined;
166
+ country_code: string | null | undefined;
167
167
  display_name: string | null | undefined;
168
+ primary_email: string | null | undefined;
169
+ profile_image_url: string | null | undefined;
170
+ is_anonymous: boolean | undefined;
168
171
  client_metadata: {} | null | undefined;
169
172
  client_read_only_metadata: {} | null | undefined;
170
173
  server_metadata: {} | null | undefined;
171
- is_anonymous: boolean | undefined;
172
- password: string | null | undefined;
173
174
  primary_email_verified: boolean | undefined;
174
175
  primary_email_auth_enabled: boolean | undefined;
175
- profile_image_url: string | null | undefined;
176
176
  otp_auth_enabled: boolean | undefined;
177
177
  passkey_auth_enabled: boolean | undefined;
178
178
  restricted_by_admin: boolean | undefined;
179
179
  restricted_by_admin_reason: string | null | undefined;
180
180
  restricted_by_admin_private_details: string | null | undefined;
181
- country_code: string | null | undefined;
182
181
  risk_scores: {
183
182
  sign_up: {
184
183
  bot: number;
185
184
  free_trial_abuse: number;
186
185
  };
187
186
  } | undefined;
187
+ password: string | null | undefined;
188
188
  password_hash: string | undefined;
189
189
  totp_secret_base64: string | null | undefined;
190
190
  } & {
@@ -234,10 +234,10 @@ declare const usersCrud: ______crud0.CrudSchemaFromOptions<{
234
234
  client_metadata?: {} | null | undefined;
235
235
  client_read_only_metadata?: {} | null | undefined;
236
236
  server_metadata?: {} | null | undefined;
237
- display_name: string;
238
237
  id: string;
239
- profile_image_url: string | null;
240
238
  created_at_millis: number;
239
+ display_name: string;
240
+ profile_image_url: string | null;
241
241
  } | null;
242
242
  selected_team_id: string | null;
243
243
  profile_image_url: string | null;
@@ -369,28 +369,28 @@ declare const usersCrud: ______crud0.CrudSchemaFromOptions<{
369
369
  };
370
370
  }, "">;
371
371
  serverCreateSchema: yup$1.ObjectSchema<{
372
- primary_email: string | null | undefined;
372
+ country_code: string | null | undefined;
373
373
  display_name: string | null | undefined;
374
+ primary_email: string | null | undefined;
375
+ profile_image_url: string | null | undefined;
376
+ is_anonymous: boolean | undefined;
374
377
  client_metadata: {} | null | undefined;
375
378
  client_read_only_metadata: {} | null | undefined;
376
379
  server_metadata: {} | null | undefined;
377
- is_anonymous: boolean | undefined;
378
- password: string | null | undefined;
379
380
  primary_email_verified: boolean | undefined;
380
381
  primary_email_auth_enabled: boolean | undefined;
381
- profile_image_url: string | null | undefined;
382
382
  otp_auth_enabled: boolean | undefined;
383
383
  passkey_auth_enabled: boolean | undefined;
384
384
  restricted_by_admin: boolean | undefined;
385
385
  restricted_by_admin_reason: string | null | undefined;
386
386
  restricted_by_admin_private_details: string | null | undefined;
387
- country_code: string | null | undefined;
388
387
  risk_scores: {
389
388
  sign_up: {
390
389
  bot: number;
391
390
  free_trial_abuse: number;
392
391
  };
393
392
  } | undefined;
393
+ password: string | null | undefined;
394
394
  password_hash: string | undefined;
395
395
  totp_secret_base64: string | null | undefined;
396
396
  } & {
@@ -468,10 +468,10 @@ declare const userCreatedWebhookEvent: WebhookEvent<yup$1.ObjectSchema<{
468
468
  client_metadata?: {} | null | undefined;
469
469
  client_read_only_metadata?: {} | null | undefined;
470
470
  server_metadata?: {} | null | undefined;
471
- display_name: string;
472
471
  id: string;
473
- profile_image_url: string | null;
474
472
  created_at_millis: number;
473
+ display_name: string;
474
+ profile_image_url: string | null;
475
475
  } | null;
476
476
  selected_team_id: string | null;
477
477
  profile_image_url: string | null;
@@ -559,10 +559,10 @@ declare const userUpdatedWebhookEvent: WebhookEvent<yup$1.ObjectSchema<{
559
559
  client_metadata?: {} | null | undefined;
560
560
  client_read_only_metadata?: {} | null | undefined;
561
561
  server_metadata?: {} | null | undefined;
562
- display_name: string;
563
562
  id: string;
564
- profile_image_url: string | null;
565
563
  created_at_millis: number;
564
+ display_name: string;
565
+ profile_image_url: string | null;
566
566
  } | null;
567
567
  selected_team_id: string | null;
568
568
  profile_image_url: string | null;
@@ -20,10 +20,10 @@ declare const webhookEvents: readonly [WebhookEvent<yup$1.ObjectSchema<{
20
20
  client_metadata?: {} | null | undefined;
21
21
  client_read_only_metadata?: {} | null | undefined;
22
22
  server_metadata?: {} | null | undefined;
23
- display_name: string;
24
23
  id: string;
25
- profile_image_url: string | null;
26
24
  created_at_millis: number;
25
+ display_name: string;
26
+ profile_image_url: string | null;
27
27
  } | null;
28
28
  selected_team_id: string | null;
29
29
  profile_image_url: string | null;
@@ -110,10 +110,10 @@ declare const webhookEvents: readonly [WebhookEvent<yup$1.ObjectSchema<{
110
110
  client_metadata?: {} | null | undefined;
111
111
  client_read_only_metadata?: {} | null | undefined;
112
112
  server_metadata?: {} | null | undefined;
113
- display_name: string;
114
113
  id: string;
115
- profile_image_url: string | null;
116
114
  created_at_millis: number;
115
+ display_name: string;
116
+ profile_image_url: string | null;
117
117
  } | null;
118
118
  selected_team_id: string | null;
119
119
  profile_image_url: string | null;
@@ -98,7 +98,7 @@ declare const KnownErrors: {
98
98
  };
99
99
  AccessTypeWithoutProjectId: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
100
100
  constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
101
- } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"ACCESS_TYPE_WITHOUT_PROJECT_ID">, [accessType: "client" | "server" | "admin"]> & {
101
+ } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"ACCESS_TYPE_WITHOUT_PROJECT_ID">, [accessType: "server" | "admin" | "client"]> & {
102
102
  errorCode: "ACCESS_TYPE_WITHOUT_PROJECT_ID";
103
103
  };
104
104
  AccessTypeRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
@@ -111,7 +111,7 @@ declare const KnownErrors: {
111
111
  };
112
112
  InsufficientAccessType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
113
113
  constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
114
- } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INSUFFICIENT_ACCESS_TYPE">, [actualAccessType: "client" | "server" | "admin", allowedAccessTypes: ("client" | "server" | "admin")[]]> & {
114
+ } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INSUFFICIENT_ACCESS_TYPE">, [actualAccessType: "server" | "admin" | "client", allowedAccessTypes: ("server" | "admin" | "client")[]]> & {
115
115
  errorCode: "INSUFFICIENT_ACCESS_TYPE";
116
116
  };
117
117
  InvalidPublishableClientKey: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
@@ -512,7 +512,7 @@ declare const KnownErrors: {
512
512
  ItemNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"ITEM_NOT_FOUND">, [itemId: string]> & {
513
513
  errorCode: "ITEM_NOT_FOUND";
514
514
  };
515
- ItemCustomerTypeDoesNotMatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"ITEM_CUSTOMER_TYPE_DOES_NOT_MATCH">, [itemId: string, customerId: string, itemCustomerType: "team" | "user" | "custom" | undefined, actualCustomerType: "team" | "user" | "custom"]> & {
515
+ ItemCustomerTypeDoesNotMatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"ITEM_CUSTOMER_TYPE_DOES_NOT_MATCH">, [itemId: string, customerId: string, itemCustomerType: "user" | "team" | "custom" | undefined, actualCustomerType: "user" | "team" | "custom"]> & {
516
516
  errorCode: "ITEM_CUSTOMER_TYPE_DOES_NOT_MATCH";
517
517
  };
518
518
  CustomerDoesNotExist: KnownErrorConstructor<KnownError & KnownErrorBrand<"CUSTOMER_DOES_NOT_EXIST">, [customerId: string]> & {
@@ -521,7 +521,7 @@ declare const KnownErrors: {
521
521
  ProductDoesNotExist: KnownErrorConstructor<KnownError & KnownErrorBrand<"PRODUCT_DOES_NOT_EXIST">, [productId: string, context: "item_exists" | "server_only" | null]> & {
522
522
  errorCode: "PRODUCT_DOES_NOT_EXIST";
523
523
  };
524
- ProductCustomerTypeDoesNotMatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH">, [productId: string | undefined, customerId: string, productCustomerType: "team" | "user" | "custom" | undefined, actualCustomerType: "team" | "user" | "custom"]> & {
524
+ ProductCustomerTypeDoesNotMatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH">, [productId: string | undefined, customerId: string, productCustomerType: "user" | "team" | "custom" | undefined, actualCustomerType: "user" | "team" | "custom"]> & {
525
525
  errorCode: "PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH";
526
526
  };
527
527
  ProductAlreadyGranted: KnownErrorConstructor<KnownError & KnownErrorBrand<"PRODUCT_ALREADY_GRANTED">, [productId: string, customerId: string]> & {
@@ -548,7 +548,7 @@ declare const KnownErrors: {
548
548
  StripeAccountInfoNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"STRIPE_ACCOUNT_INFO_NOT_FOUND">, []> & {
549
549
  errorCode: "STRIPE_ACCOUNT_INFO_NOT_FOUND";
550
550
  };
551
- DefaultPaymentMethodRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"DEFAULT_PAYMENT_METHOD_REQUIRED">, [customerType: "team" | "user", customerId: string]> & {
551
+ DefaultPaymentMethodRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"DEFAULT_PAYMENT_METHOD_REQUIRED">, [customerType: "user" | "team", customerId: string]> & {
552
552
  errorCode: "DEFAULT_PAYMENT_METHOD_REQUIRED";
553
553
  };
554
554
  NewPurchasesBlocked: KnownErrorConstructor<KnownError & KnownErrorBrand<"NEW_PURCHASES_BLOCKED">, []> & {
@@ -113,7 +113,7 @@ declare const moneyAmountSchema: (currency: Currency) => yup$1.StringSchema<stri
113
113
  */
114
114
  declare const strictEmailSchema: (message: string | undefined) => yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
115
115
  declare const emailSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
116
- declare const clientOrHigherAuthTypeSchema: yup$1.StringSchema<"client" | "server" | "admin", yup$1.AnyObject, undefined, "">;
116
+ declare const clientOrHigherAuthTypeSchema: yup$1.StringSchema<"server" | "admin" | "client", yup$1.AnyObject, undefined, "">;
117
117
  declare const serverOrHigherAuthTypeSchema: yup$1.StringSchema<"server" | "admin", yup$1.AnyObject, undefined, "">;
118
118
  declare const adminAuthTypeSchema: yup$1.StringSchema<"admin", yup$1.AnyObject, undefined, "">;
119
119
  declare const projectIdSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
@@ -140,7 +140,7 @@ declare const projectSignUpEnabledSchema: yup$1.BooleanSchema<boolean | undefine
140
140
  declare const projectCredentialEnabledSchema: yup$1.BooleanSchema<boolean | undefined, yup$1.AnyObject, undefined, "">;
141
141
  declare const oauthIdSchema: yup$1.StringSchema<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch" | undefined, yup$1.AnyObject, undefined, "">;
142
142
  declare const oauthEnabledSchema: yup$1.BooleanSchema<boolean | undefined, yup$1.AnyObject, undefined, "">;
143
- declare const oauthTypeSchema: yup$1.StringSchema<"standard" | "shared" | undefined, yup$1.AnyObject, undefined, "">;
143
+ declare const oauthTypeSchema: yup$1.StringSchema<"shared" | "standard" | undefined, yup$1.AnyObject, undefined, "">;
144
144
  declare const oauthClientIdSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
145
145
  declare const oauthClientSecretSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
146
146
  declare const oauthCustomCallbackUrlSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
@@ -149,7 +149,7 @@ declare const oauthMicrosoftTenantIdSchema: yup$1.StringSchema<string | undefine
149
149
  declare const oauthAppleBundleIdsSchema: yup$1.ArraySchema<string[] | undefined, yup$1.AnyObject, undefined, "">;
150
150
  declare const oauthAppleBundleIdSchema: yup$1.StringSchema<string, yup$1.AnyObject, undefined, "">;
151
151
  declare const oauthAccountMergeStrategySchema: yup$1.StringSchema<"link_method" | "raise_error" | "allow_duplicates" | undefined, yup$1.AnyObject, undefined, "">;
152
- declare const emailTypeSchema: yup$1.StringSchema<"standard" | "shared" | undefined, yup$1.AnyObject, undefined, "">;
152
+ declare const emailTypeSchema: yup$1.StringSchema<"shared" | "standard" | undefined, yup$1.AnyObject, undefined, "">;
153
153
  declare const emailSenderNameSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
154
154
  declare const emailHostSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
155
155
  declare const emailPortSchema: yup$1.NumberSchema<number | undefined, yup$1.AnyObject, undefined, "">;
@@ -172,7 +172,7 @@ declare const customDashboardsSchema: yup$1.MixedSchema<Record<string, {
172
172
  displayName: string;
173
173
  tsxSource: string;
174
174
  }>, yup$1.AnyObject, undefined, "">;
175
- declare const customerTypeSchema: yup$1.StringSchema<"team" | "user" | "custom" | undefined, yup$1.AnyObject, undefined, "">;
175
+ declare const customerTypeSchema: yup$1.StringSchema<"user" | "team" | "custom" | undefined, yup$1.AnyObject, undefined, "">;
176
176
  /**
177
177
  * Schema for a single product price. Each currency field (USD, EUR, etc.) is a decimal string
178
178
  * like `"9.99"` or `"1000"` — never cent integers. See `MoneyAmount` for the exact format.
@@ -216,7 +216,7 @@ declare const productSchema: yup$1.ObjectSchema<{
216
216
  displayName: string | undefined;
217
217
  productLineId: string | undefined;
218
218
  isAddOnTo: false | Record<string, true> | undefined;
219
- customerType: "team" | "user" | "custom";
219
+ customerType: "user" | "team" | "custom";
220
220
  freeTrial: DayInterval | undefined;
221
221
  serverOnly: boolean | undefined;
222
222
  stackable: boolean | undefined;
@@ -255,7 +255,7 @@ declare const productSchemaWithMetadata: yup$1.ObjectSchema<{
255
255
  displayName: string | undefined;
256
256
  productLineId: string | undefined;
257
257
  isAddOnTo: false | Record<string, true> | undefined;
258
- customerType: "team" | "user" | "custom";
258
+ customerType: "user" | "team" | "custom";
259
259
  freeTrial: DayInterval | undefined;
260
260
  serverOnly: boolean | undefined;
261
261
  stackable: boolean | undefined;
@@ -296,7 +296,7 @@ declare const productSchemaWithMetadata: yup$1.ObjectSchema<{
296
296
  }, "">;
297
297
  declare const inlineProductSchema: yup$1.ObjectSchema<{
298
298
  display_name: string;
299
- customer_type: "team" | "user" | "custom";
299
+ customer_type: "user" | "team" | "custom";
300
300
  free_trial: DayInterval | undefined;
301
301
  server_only: boolean;
302
302
  stackable: boolean;
@@ -312,8 +312,8 @@ declare const inlineProductSchema: yup$1.ObjectSchema<{
312
312
  free_trial?: DayInterval | undefined;
313
313
  }>;
314
314
  included_items: Record<string, {
315
- repeat?: "never" | DayInterval | undefined;
316
315
  quantity?: number | undefined;
316
+ repeat?: "never" | DayInterval | undefined;
317
317
  expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
318
318
  }>;
319
319
  client_metadata: {} | null | undefined;
@@ -9,24 +9,24 @@ declare class AccessToken {
9
9
  private constructor();
10
10
  get payload(): {
11
11
  exp?: number | undefined;
12
+ email: string | null;
12
13
  name: string | null;
13
14
  sub: string;
14
- project_id: string;
15
- refresh_token_id: string;
16
- email: string | null;
17
- restricted_reason: {
18
- type: "anonymous" | "email_not_verified" | "restricted_by_administrator";
19
- } | null;
20
- branch_id: string;
21
15
  iat: number;
22
16
  iss: string;
23
17
  aud: string;
18
+ project_id: string;
19
+ branch_id: string;
20
+ refresh_token_id: string;
24
21
  role: "authenticated";
25
22
  email_verified: boolean;
26
23
  selected_team_id: string | null;
27
24
  signed_up_at: number;
28
25
  is_anonymous: boolean;
29
26
  is_restricted: boolean;
27
+ restricted_reason: {
28
+ type: "anonymous" | "email_not_verified" | "restricted_by_administrator";
29
+ } | null;
30
30
  requires_totp_mfa: boolean;
31
31
  };
32
32
  get expiresAt(): Date;
@@ -0,0 +1,18 @@
1
+ //#region src/utils/analytics-clickmap-overlay.d.ts
2
+ /**
3
+ * Wire protocol for handing a clickmap overlay token from the dashboard to the
4
+ * in-page dev tool via `sessionStorage` + a window event.
5
+ *
6
+ * The token is a self-describing JWT: its payload already carries the
7
+ * `project_id` and `origin` it was minted for, so the reader derives both from
8
+ * the token itself and the writer only has to hand over a single value. The
9
+ * dashboard (writer) and the dev tool (reader) live in different packages but
10
+ * must agree on these exact names — this module is the single source of truth so
11
+ * they can never silently desync.
12
+ */
13
+ declare const CLICKMAP_OVERLAY_TOKEN_STORAGE_KEY = "hexclave-clickmap-token";
14
+ declare const CLICKMAP_OVERLAY_RESUME_STORAGE_KEY = "hexclave-clickmap-resume";
15
+ declare const CLICKMAP_OVERLAY_TOKEN_UPDATED_EVENT = "hexclave:clickmap-token-updated";
16
+ //#endregion
17
+ export { CLICKMAP_OVERLAY_RESUME_STORAGE_KEY, CLICKMAP_OVERLAY_TOKEN_STORAGE_KEY, CLICKMAP_OVERLAY_TOKEN_UPDATED_EVENT };
18
+ //# sourceMappingURL=analytics-clickmap-overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics-clickmap-overlay.d.ts","names":[],"sources":["../../../src/utils/analytics-clickmap-overlay.tsx"],"mappings":";;AAYA;;;;;AACA;;;;;cADa,kCAAA;AAAA,cACA,mCAAA;AAAA,cACA,oCAAA"}
@@ -0,0 +1,19 @@
1
+ //#region src/utils/analytics-clickmap-overlay.tsx
2
+ /**
3
+ * Wire protocol for handing a clickmap overlay token from the dashboard to the
4
+ * in-page dev tool via `sessionStorage` + a window event.
5
+ *
6
+ * The token is a self-describing JWT: its payload already carries the
7
+ * `project_id` and `origin` it was minted for, so the reader derives both from
8
+ * the token itself and the writer only has to hand over a single value. The
9
+ * dashboard (writer) and the dev tool (reader) live in different packages but
10
+ * must agree on these exact names — this module is the single source of truth so
11
+ * they can never silently desync.
12
+ */
13
+ const CLICKMAP_OVERLAY_TOKEN_STORAGE_KEY = "hexclave-clickmap-token";
14
+ const CLICKMAP_OVERLAY_RESUME_STORAGE_KEY = "hexclave-clickmap-resume";
15
+ const CLICKMAP_OVERLAY_TOKEN_UPDATED_EVENT = "hexclave:clickmap-token-updated";
16
+
17
+ //#endregion
18
+ export { CLICKMAP_OVERLAY_RESUME_STORAGE_KEY, CLICKMAP_OVERLAY_TOKEN_STORAGE_KEY, CLICKMAP_OVERLAY_TOKEN_UPDATED_EVENT };
19
+ //# sourceMappingURL=analytics-clickmap-overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics-clickmap-overlay.js","names":[],"sources":["../../../src/utils/analytics-clickmap-overlay.tsx"],"sourcesContent":["/**\n * Wire protocol for handing a clickmap overlay token from the dashboard to the\n * in-page dev tool via `sessionStorage` + a window event.\n *\n * The token is a self-describing JWT: its payload already carries the\n * `project_id` and `origin` it was minted for, so the reader derives both from\n * the token itself and the writer only has to hand over a single value. The\n * dashboard (writer) and the dev tool (reader) live in different packages but\n * must agree on these exact names — this module is the single source of truth so\n * they can never silently desync.\n */\n\nexport const CLICKMAP_OVERLAY_TOKEN_STORAGE_KEY = \"hexclave-clickmap-token\";\nexport const CLICKMAP_OVERLAY_RESUME_STORAGE_KEY = \"hexclave-clickmap-resume\";\nexport const CLICKMAP_OVERLAY_TOKEN_UPDATED_EVENT = \"hexclave:clickmap-token-updated\";\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,qCAAqC;AAClD,MAAa,sCAAsC;AACnD,MAAa,uCAAuC"}
@@ -0,0 +1,31 @@
1
+ //#region src/utils/dev-tool.d.ts
2
+ /**
3
+ * Shared identity of the Hexclave in-page dev tool / clickmap overlay.
4
+ *
5
+ * These constants are the single source of truth for "is this DOM / event /
6
+ * stored click part of the dev tool itself?". They are consumed across package
7
+ * boundaries:
8
+ * - the dev tool mounts its root element with {@link DEV_TOOL_ROOT_ID} and
9
+ * prefixes every generated class with {@link DEV_TOOL_CLASS_PREFIX};
10
+ * - the event tracker uses them to skip self-clicks at ingest;
11
+ * - the backend clickmap query uses them to filter dev-tool clicks out of
12
+ * aggregate clickmaps server-side.
13
+ *
14
+ * Keep them here so a rename can never silently desync the SQL filter from the
15
+ * actual DOM identity.
16
+ */
17
+ declare const DEV_TOOL_ROOT_ID = "__hexclave-dev-tool-root";
18
+ /**
19
+ * Root element id of the standalone clickmap overlay. The clickmap is an
20
+ * independent feature with its own mount (it must survive the dev tool being
21
+ * removed), so it gets its own root — but its self-clicks need the exact same
22
+ * ingest/query exclusions as the dev tool's.
23
+ */
24
+ declare const CLICKMAP_ROOT_ID = "__hexclave-clickmap-root";
25
+ /** Prefix applied to every class/generated id the dev tool renders. */
26
+ declare const DEV_TOOL_CLASS_PREFIX = "sdt-";
27
+ /** Legacy class marker still present on older dev-tool builds. */
28
+ declare const DEV_TOOL_LEGACY_CLASS = "stack-devtool";
29
+ //#endregion
30
+ export { CLICKMAP_ROOT_ID, DEV_TOOL_CLASS_PREFIX, DEV_TOOL_LEGACY_CLASS, DEV_TOOL_ROOT_ID };
31
+ //# sourceMappingURL=dev-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-tool.d.ts","names":[],"sources":["../../../src/utils/dev-tool.tsx"],"mappings":";;AAeA;;;;;AAQA;;;;;AAGA;;;;cAXa,gBAAA;AAcb;;;;;;AAAA,cANa,gBAAA;;cAGA,qBAAA;;cAGA,qBAAA"}
@@ -0,0 +1,32 @@
1
+ //#region src/utils/dev-tool.tsx
2
+ /**
3
+ * Shared identity of the Hexclave in-page dev tool / clickmap overlay.
4
+ *
5
+ * These constants are the single source of truth for "is this DOM / event /
6
+ * stored click part of the dev tool itself?". They are consumed across package
7
+ * boundaries:
8
+ * - the dev tool mounts its root element with {@link DEV_TOOL_ROOT_ID} and
9
+ * prefixes every generated class with {@link DEV_TOOL_CLASS_PREFIX};
10
+ * - the event tracker uses them to skip self-clicks at ingest;
11
+ * - the backend clickmap query uses them to filter dev-tool clicks out of
12
+ * aggregate clickmaps server-side.
13
+ *
14
+ * Keep them here so a rename can never silently desync the SQL filter from the
15
+ * actual DOM identity.
16
+ */
17
+ const DEV_TOOL_ROOT_ID = "__hexclave-dev-tool-root";
18
+ /**
19
+ * Root element id of the standalone clickmap overlay. The clickmap is an
20
+ * independent feature with its own mount (it must survive the dev tool being
21
+ * removed), so it gets its own root — but its self-clicks need the exact same
22
+ * ingest/query exclusions as the dev tool's.
23
+ */
24
+ const CLICKMAP_ROOT_ID = "__hexclave-clickmap-root";
25
+ /** Prefix applied to every class/generated id the dev tool renders. */
26
+ const DEV_TOOL_CLASS_PREFIX = "sdt-";
27
+ /** Legacy class marker still present on older dev-tool builds. */
28
+ const DEV_TOOL_LEGACY_CLASS = "stack-devtool";
29
+
30
+ //#endregion
31
+ export { CLICKMAP_ROOT_ID, DEV_TOOL_CLASS_PREFIX, DEV_TOOL_LEGACY_CLASS, DEV_TOOL_ROOT_ID };
32
+ //# sourceMappingURL=dev-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-tool.js","names":[],"sources":["../../../src/utils/dev-tool.tsx"],"sourcesContent":["/**\n * Shared identity of the Hexclave in-page dev tool / clickmap overlay.\n *\n * These constants are the single source of truth for \"is this DOM / event /\n * stored click part of the dev tool itself?\". They are consumed across package\n * boundaries:\n * - the dev tool mounts its root element with {@link DEV_TOOL_ROOT_ID} and\n * prefixes every generated class with {@link DEV_TOOL_CLASS_PREFIX};\n * - the event tracker uses them to skip self-clicks at ingest;\n * - the backend clickmap query uses them to filter dev-tool clicks out of\n * aggregate clickmaps server-side.\n *\n * Keep them here so a rename can never silently desync the SQL filter from the\n * actual DOM identity.\n */\nexport const DEV_TOOL_ROOT_ID = \"__hexclave-dev-tool-root\";\n\n/**\n * Root element id of the standalone clickmap overlay. The clickmap is an\n * independent feature with its own mount (it must survive the dev tool being\n * removed), so it gets its own root — but its self-clicks need the exact same\n * ingest/query exclusions as the dev tool's.\n */\nexport const CLICKMAP_ROOT_ID = \"__hexclave-clickmap-root\";\n\n/** Prefix applied to every class/generated id the dev tool renders. */\nexport const DEV_TOOL_CLASS_PREFIX = \"sdt-\";\n\n/** Legacy class marker still present on older dev-tool builds. */\nexport const DEV_TOOL_LEGACY_CLASS = \"stack-devtool\";\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAa,mBAAmB;;;;;;;AAQhC,MAAa,mBAAmB;;AAGhC,MAAa,wBAAwB;;AAGrC,MAAa,wBAAwB"}
@@ -1,5 +1,11 @@
1
1
  //#region src/utils/dom.d.ts
2
2
  declare function hasClickableParent(element: HTMLElement): boolean;
3
+ /**
4
+ * Escape a string so it is safe to use as a CSS identifier (id/class) inside a selector.
5
+ * Prefers the native `CSS.escape` when available, falling back to a conservative
6
+ * backslash-escape for non-DOM environments (SSR, tests, older runtimes).
7
+ */
8
+ declare function cssEscapeIdent(value: string): string;
3
9
  //#endregion
4
- export { hasClickableParent };
10
+ export { cssEscapeIdent, hasClickableParent };
5
11
  //# sourceMappingURL=dom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","names":[],"sources":["../../../src/utils/dom.tsx"],"mappings":";iBAAgB,kBAAA,CAAmB,OAAA,EAAS,WAAA"}
1
+ {"version":3,"file":"dom.d.ts","names":[],"sources":["../../../src/utils/dom.tsx"],"mappings":";iBAAgB,kBAAA,CAAmB,OAAA,EAAS,WAAA;AAA5C;;;;;AAAA,iBAagB,cAAA,CAAe,KAAA"}
@@ -5,7 +5,26 @@ function hasClickableParent(element) {
5
5
  if (parent.dataset.n2Clickable) return true;
6
6
  return hasClickableParent(element.parentElement);
7
7
  }
8
+ /**
9
+ * Escape a string so it is safe to use as a CSS identifier (id/class) inside a selector.
10
+ * Prefers the native `CSS.escape` when available, falling back to a conservative
11
+ * backslash-escape for non-DOM environments (SSR, tests, older runtimes).
12
+ */
13
+ function cssEscapeIdent(value) {
14
+ if (typeof CSS !== "undefined" && typeof CSS.escape === "function") return CSS.escape(value);
15
+ let escaped = "";
16
+ for (let i = 0; i < value.length; i += 1) {
17
+ const char = value.charAt(i);
18
+ const codeUnit = value.charCodeAt(i);
19
+ if (codeUnit === 0) escaped += "�";
20
+ else if (codeUnit >= 1 && codeUnit <= 31 || codeUnit === 127 || i === 0 && codeUnit >= 48 && codeUnit <= 57 || i === 1 && codeUnit >= 48 && codeUnit <= 57 && value.charCodeAt(0) === 45) escaped += `\\${codeUnit.toString(16)} `;
21
+ else if (i === 0 && codeUnit === 45 && value.length === 1) escaped += "\\-";
22
+ else if (codeUnit >= 128 || codeUnit === 45 || codeUnit === 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) escaped += char;
23
+ else escaped += `\\${char}`;
24
+ }
25
+ return escaped;
26
+ }
8
27
 
9
28
  //#endregion
10
- export { hasClickableParent };
29
+ export { cssEscapeIdent, hasClickableParent };
11
30
  //# sourceMappingURL=dom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.js","names":[],"sources":["../../../src/utils/dom.tsx"],"sourcesContent":["export function hasClickableParent(element: HTMLElement): boolean {\n const parent = element.parentElement;\n if (!parent) return false;\n if (parent.dataset.n2Clickable) return true;\n\n return hasClickableParent(element.parentElement);\n}\n"],"mappings":";AAAA,SAAgB,mBAAmB,SAA+B;CAChE,MAAM,SAAS,QAAQ;AACvB,KAAI,CAAC,OAAQ,QAAO;AACpB,KAAI,OAAO,QAAQ,YAAa,QAAO;AAEvC,QAAO,mBAAmB,QAAQ,cAAc"}
1
+ {"version":3,"file":"dom.js","names":[],"sources":["../../../src/utils/dom.tsx"],"sourcesContent":["export function hasClickableParent(element: HTMLElement): boolean {\n const parent = element.parentElement;\n if (!parent) return false;\n if (parent.dataset.n2Clickable) return true;\n\n return hasClickableParent(element.parentElement);\n}\n\n/**\n * Escape a string so it is safe to use as a CSS identifier (id/class) inside a selector.\n * Prefers the native `CSS.escape` when available, falling back to a conservative\n * backslash-escape for non-DOM environments (SSR, tests, older runtimes).\n */\nexport function cssEscapeIdent(value: string): string {\n if (typeof CSS !== \"undefined\" && typeof CSS.escape === \"function\") {\n return CSS.escape(value);\n }\n\n let escaped = \"\";\n for (let i = 0; i < value.length; i += 1) {\n const char = value.charAt(i);\n const codeUnit = value.charCodeAt(i);\n\n if (codeUnit === 0x0000) {\n escaped += \"\\uFFFD\";\n } else if (\n (codeUnit >= 0x0001 && codeUnit <= 0x001f) ||\n codeUnit === 0x007f ||\n (i === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n (i === 1 && codeUnit >= 0x0030 && codeUnit <= 0x0039 && value.charCodeAt(0) === 0x002d)\n ) {\n escaped += `\\\\${codeUnit.toString(16)} `;\n } else if (i === 0 && codeUnit === 0x002d && value.length === 1) {\n escaped += \"\\\\-\";\n } else if (\n codeUnit >= 0x0080 ||\n codeUnit === 0x002d ||\n codeUnit === 0x005f ||\n (codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n (codeUnit >= 0x0041 && codeUnit <= 0x005a) ||\n (codeUnit >= 0x0061 && codeUnit <= 0x007a)\n ) {\n escaped += char;\n } else {\n escaped += `\\\\${char}`;\n }\n }\n return escaped;\n}\n"],"mappings":";AAAA,SAAgB,mBAAmB,SAA+B;CAChE,MAAM,SAAS,QAAQ;AACvB,KAAI,CAAC,OAAQ,QAAO;AACpB,KAAI,OAAO,QAAQ,YAAa,QAAO;AAEvC,QAAO,mBAAmB,QAAQ,cAAc;;;;;;;AAQlD,SAAgB,eAAe,OAAuB;AACpD,KAAI,OAAO,QAAQ,eAAe,OAAO,IAAI,WAAW,WACtD,QAAO,IAAI,OAAO,MAAM;CAG1B,IAAI,UAAU;AACd,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxC,MAAM,OAAO,MAAM,OAAO,EAAE;EAC5B,MAAM,WAAW,MAAM,WAAW,EAAE;AAEpC,MAAI,aAAa,EACf,YAAW;WAEV,YAAY,KAAU,YAAY,MACnC,aAAa,OACZ,MAAM,KAAK,YAAY,MAAU,YAAY,MAC7C,MAAM,KAAK,YAAY,MAAU,YAAY,MAAU,MAAM,WAAW,EAAE,KAAK,GAEhF,YAAW,KAAK,SAAS,SAAS,GAAG,CAAC;WAC7B,MAAM,KAAK,aAAa,MAAU,MAAM,WAAW,EAC5D,YAAW;WAEX,YAAY,OACZ,aAAa,MACb,aAAa,MACZ,YAAY,MAAU,YAAY,MAClC,YAAY,MAAU,YAAY,MAClC,YAAY,MAAU,YAAY,IAEnC,YAAW;MAEX,YAAW,KAAK;;AAGpB,QAAO"}
@@ -0,0 +1,38 @@
1
+ //#region src/utils/elements-chain.d.ts
2
+ /**
3
+ * PostHog-style `elements_chain` format — the single owner of both halves of the
4
+ * contract. The event tracker {@link buildElementsChain serializes} a clicked
5
+ * element (and its ancestors) into a string; the clickmap overlay
6
+ * {@link parseElementsChain parses} that string back into structured segments so
7
+ * it can re-locate the element in a live DOM.
8
+ *
9
+ * Encode and decode MUST round-trip exactly, which is why they live together:
10
+ * the escaping applied here on the write side is reversed by the parser below,
11
+ * and a single round-trip test in `elements-chain.test.tsx` guards the pair.
12
+ *
13
+ * Segment shape (leaf-first, joined by `;`):
14
+ * tag.class1.class2:nth-child="2":nth-of-type="1":text="Save":attr__id="x":href="..."
15
+ */
16
+ type ElementsChainSegment = {
17
+ tag: string;
18
+ classes: string[];
19
+ attrs: Record<string, string>;
20
+ text: string | null;
21
+ nthChild: number | null;
22
+ nthOfType: number | null;
23
+ href: string | null;
24
+ };
25
+ declare const ELEMENTS_CHAIN_MAX_DEPTH = 8;
26
+ declare const ELEMENTS_CHAIN_TEXT_MAX = 80;
27
+ declare const ELEMENTS_CHAIN_ATTR_MAX = 200;
28
+ declare const ELEMENTS_CHAIN_ATTRS: readonly ["id", "data-testid", "data-test-id", "data-hexclave-id", "name", "type", "role", "aria-label", "placeholder", "title"];
29
+ /**
30
+ * Serialise a clicked element and up to {@link ELEMENTS_CHAIN_MAX_DEPTH}
31
+ * ancestors (leaf-first) into an `elements_chain` string.
32
+ */
33
+ declare function buildElementsChain(element: Element): string;
34
+ /** Parse an `elements_chain` string into structured, leaf-first segments. */
35
+ declare function parseElementsChain(chain: string): ElementsChainSegment[];
36
+ //#endregion
37
+ export { ELEMENTS_CHAIN_ATTRS, ELEMENTS_CHAIN_ATTR_MAX, ELEMENTS_CHAIN_MAX_DEPTH, ELEMENTS_CHAIN_TEXT_MAX, ElementsChainSegment, buildElementsChain, parseElementsChain };
38
+ //# sourceMappingURL=elements-chain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements-chain.d.ts","names":[],"sources":["../../../src/utils/elements-chain.tsx"],"mappings":";;AAeA;;;;;;;;;;;;;KAAY,oBAAA;EACV,GAAA;EACA,OAAA;EACA,KAAA,EAAO,MAAA;EACP,IAAA;EACA,QAAA;EACA,SAAA;EACA,IAAA;AAAA;AAAA,cAGW,wBAAA;AAAA,cACA,uBAAA;AAAA,cACA,uBAAA;AAAA,cAKA,oBAAA;;;;AAAb;iBAyFgB,kBAAA,CAAmB,OAAA,EAAS,OAAA;;iBA0K5B,kBAAA,CAAmB,KAAA,WAAgB,oBAAA"}