@vantageos/mosaic 0.4.0 → 0.5.0
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.
- package/CHANGELOG.md +39 -15
- package/README.md +114 -5
- package/dist/PipelineBoard-FucyGArR.d.cts +759 -0
- package/dist/PipelineBoard-FucyGArR.d.ts +759 -0
- package/dist/PipelineBoard.markdown-DIcvrS-2.d.cts +16 -0
- package/dist/PipelineBoard.markdown-DIcvrS-2.d.ts +16 -0
- package/dist/{StatusBadge.schema-1tOjB4Ir.d.cts → StatusBadge.schema-BEjSH2_4.d.cts} +2 -2
- package/dist/{StatusBadge.schema-1tOjB4Ir.d.ts → StatusBadge.schema-BEjSH2_4.d.ts} +2 -2
- package/dist/{Tabs.schema-BzcEyeq8.d.cts → Tabs.schema-Dqr6vwV3.d.cts} +2 -2
- package/dist/{Tabs.schema-BzcEyeq8.d.ts → Tabs.schema-Dqr6vwV3.d.ts} +2 -2
- package/dist/Timeline-Coo_3tA_.d.cts +114 -0
- package/dist/Timeline-Coo_3tA_.d.ts +114 -0
- package/dist/Timeline.markdown-C6UPDv1H.d.cts +4 -0
- package/dist/Timeline.markdown-C6UPDv1H.d.ts +4 -0
- package/dist/TransactionPreview-BzWDn8kE.d.cts +391 -0
- package/dist/TransactionPreview-BzWDn8kE.d.ts +391 -0
- package/dist/TransactionPreview.markdown-Dpb0VYgN.d.cts +7 -0
- package/dist/TransactionPreview.markdown-Dpb0VYgN.d.ts +7 -0
- package/dist/artifacts.cjs +186 -2
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.js +186 -2
- package/dist/artifacts.js.map +1 -1
- package/dist/confirmation.cjs +724 -2
- package/dist/confirmation.cjs.map +1 -1
- package/dist/confirmation.d.cts +2 -1
- package/dist/confirmation.d.ts +2 -1
- package/dist/confirmation.js +722 -4
- package/dist/confirmation.js.map +1 -1
- package/dist/display.cjs +1551 -203
- package/dist/display.cjs.map +1 -1
- package/dist/display.d.cts +6 -229
- package/dist/display.d.ts +6 -229
- package/dist/display.js +1535 -206
- package/dist/display.js.map +1 -1
- package/dist/forms.cjs +139 -46
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.d.cts +2 -2
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +139 -46
- package/dist/forms.js.map +1 -1
- package/dist/host.cjs +822 -0
- package/dist/host.cjs.map +1 -0
- package/dist/host.d.cts +287 -0
- package/dist/host.d.ts +287 -0
- package/dist/host.js +794 -0
- package/dist/host.js.map +1 -0
- package/dist/{index-CwXVgtGb.d.cts → index-BadRcCbm.d.cts} +28 -11
- package/dist/{index-CwXVgtGb.d.ts → index-BadRcCbm.d.ts} +28 -11
- package/dist/index.cjs +2198 -247
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -8
- package/dist/index.d.ts +42 -8
- package/dist/index.js +2163 -251
- package/dist/index.js.map +1 -1
- package/dist/input.d.cts +2 -2
- package/dist/input.d.ts +2 -2
- package/dist/media.cjs +186 -2
- package/dist/media.cjs.map +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/media.js +186 -2
- package/dist/media.js.map +1 -1
- package/dist/preact/artifacts.js +186 -2
- package/dist/preact/artifacts.js.map +1 -1
- package/dist/preact/confirmation.d.ts +321 -1
- package/dist/preact/confirmation.js +625 -4
- package/dist/preact/confirmation.js.map +1 -1
- package/dist/preact/display.d.ts +544 -47
- package/dist/preact/display.js +1190 -126
- package/dist/preact/display.js.map +1 -1
- package/dist/preact/forms.d.ts +32 -15
- package/dist/preact/forms.js +139 -46
- package/dist/preact/forms.js.map +1 -1
- package/dist/preact/host.d.ts +307 -0
- package/dist/preact/host.js +875 -0
- package/dist/preact/host.js.map +1 -0
- package/dist/preact/media.d.ts +37 -1
- package/dist/preact/media.js +423 -0
- package/dist/preact/media.js.map +1 -1
- package/dist/preact/progress.d.ts +92 -1
- package/dist/preact/progress.js +465 -3
- package/dist/preact/progress.js.map +1 -1
- package/dist/progress.cjs +521 -2
- package/dist/progress.cjs.map +1 -1
- package/dist/progress.d.cts +2 -1
- package/dist/progress.d.ts +2 -1
- package/dist/progress.js +518 -3
- package/dist/progress.js.map +1 -1
- package/dist/react/artifacts.cjs +186 -2
- package/dist/react/artifacts.cjs.map +1 -1
- package/dist/react/artifacts.js +186 -2
- package/dist/react/artifacts.js.map +1 -1
- package/dist/react/confirmation.cjs +626 -2
- package/dist/react/confirmation.cjs.map +1 -1
- package/dist/react/confirmation.d.cts +3 -3
- package/dist/react/confirmation.d.ts +3 -3
- package/dist/react/confirmation.js +625 -4
- package/dist/react/confirmation.js.map +1 -1
- package/dist/react/display.cjs +1076 -123
- package/dist/react/display.cjs.map +1 -1
- package/dist/react/display.d.cts +13 -27
- package/dist/react/display.d.ts +13 -27
- package/dist/react/display.js +1064 -126
- package/dist/react/display.js.map +1 -1
- package/dist/react/forms.cjs +139 -46
- package/dist/react/forms.cjs.map +1 -1
- package/dist/react/forms.d.cts +1 -1
- package/dist/react/forms.d.ts +1 -1
- package/dist/react/forms.js +139 -46
- package/dist/react/forms.js.map +1 -1
- package/dist/react/host.cjs +910 -0
- package/dist/react/host.cjs.map +1 -0
- package/dist/react/host.d.cts +24 -0
- package/dist/react/host.d.ts +24 -0
- package/dist/react/host.js +875 -0
- package/dist/react/host.js.map +1 -0
- package/dist/react/input.d.cts +1 -1
- package/dist/react/input.d.ts +1 -1
- package/dist/react/media.cjs +426 -0
- package/dist/react/media.cjs.map +1 -1
- package/dist/react/media.d.cts +19 -1
- package/dist/react/media.d.ts +19 -1
- package/dist/react/media.js +423 -0
- package/dist/react/media.js.map +1 -1
- package/dist/react/progress.cjs +467 -2
- package/dist/react/progress.cjs.map +1 -1
- package/dist/react/progress.d.cts +1 -1
- package/dist/react/progress.d.ts +1 -1
- package/dist/react/progress.js +465 -3
- package/dist/react/progress.js.map +1 -1
- package/dist/server/resource.cjs +151 -0
- package/dist/server/resource.cjs.map +1 -0
- package/dist/server/resource.d.cts +90 -0
- package/dist/server/resource.d.ts +90 -0
- package/dist/server/resource.js +147 -0
- package/dist/server/resource.js.map +1 -0
- package/dist/server.cjs +1100 -25
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +84 -5
- package/dist/server.d.ts +84 -5
- package/dist/server.js +1087 -27
- package/dist/server.js.map +1 -1
- package/package.json +250 -233
- package/registry.yaml +44 -2
- package/dist/Alert.schema-LPJE5gFP.d.cts +0 -71
- package/dist/Alert.schema-LPJE5gFP.d.ts +0 -71
- package/dist/ProgressBar.schema-CdVYx0Wq.d.cts +0 -22
- package/dist/ProgressBar.schema-CdVYx0Wq.d.ts +0 -22
- package/dist/{ConfirmDialog-B3CQQGmJ.d.cts → ConfirmDialog-BCtOcmHe.d.cts} +1 -1
- package/dist/{ConfirmDialog-B3CQQGmJ.d.ts → ConfirmDialog-BCtOcmHe.d.ts} +1 -1
package/dist/confirmation.cjs
CHANGED
|
@@ -99,7 +99,99 @@ var EN = {
|
|
|
99
99
|
"Select.search.placeholder": "Search\u2026",
|
|
100
100
|
"Select.empty": "No options available",
|
|
101
101
|
"Select.error.required": "Select an option",
|
|
102
|
-
"Select.error.invalidProps": "Select: invalid props"
|
|
102
|
+
"Select.error.invalidProps": "Select: invalid props",
|
|
103
|
+
"ModelContext.selection.one": "1 row selected",
|
|
104
|
+
"ModelContext.selection.many": "{n} rows selected",
|
|
105
|
+
"ModelContext.selection.none": "No rows selected",
|
|
106
|
+
"TableView.sort.by": "Sort by",
|
|
107
|
+
"TableView.select.row": "Select row",
|
|
108
|
+
"TableView.select.all": "Select all rows",
|
|
109
|
+
"TableView.loading": "Loading table",
|
|
110
|
+
"StatCard.title": "Statistic",
|
|
111
|
+
"StatCard.trend.up": "Up",
|
|
112
|
+
"StatCard.trend.down": "Down",
|
|
113
|
+
"StatCard.trend.flat": "Flat",
|
|
114
|
+
"StatCard.empty.message": "No statistic to display",
|
|
115
|
+
"StatCard.loading": "Loading statistic",
|
|
116
|
+
"StatCard.error.invalidProps": "StatCard: invalid props",
|
|
117
|
+
"BalanceCard.title": "Balance",
|
|
118
|
+
"BalanceCard.network": "Network",
|
|
119
|
+
"BalanceCard.testnet": "Testnet",
|
|
120
|
+
"BalanceCard.address": "Address",
|
|
121
|
+
"BalanceCard.contract": "Token contract",
|
|
122
|
+
"BalanceCard.value": "Value",
|
|
123
|
+
"BalanceCard.copy": "Copy address",
|
|
124
|
+
"BalanceCard.copied": "Address copied",
|
|
125
|
+
"BalanceCard.empty.message": "No balance to display",
|
|
126
|
+
"BalanceCard.loading": "Loading balance",
|
|
127
|
+
"BalanceCard.error.invalidProps": "BalanceCard: invalid props",
|
|
128
|
+
"Timeline.title": "Timeline",
|
|
129
|
+
"Timeline.status.done": "Done",
|
|
130
|
+
"Timeline.status.current": "In progress",
|
|
131
|
+
"Timeline.status.pending": "Pending",
|
|
132
|
+
"Timeline.status.blocked": "Blocked",
|
|
133
|
+
"Timeline.completed": "{n} completed",
|
|
134
|
+
"Timeline.more": "{n} more",
|
|
135
|
+
"Timeline.empty.message": "No steps to display",
|
|
136
|
+
"Timeline.loading": "Loading timeline",
|
|
137
|
+
"Timeline.error.invalidProps": "Timeline: invalid props",
|
|
138
|
+
"MessageFeed.title": "Messages",
|
|
139
|
+
"MessageFeed.unread": "Unread",
|
|
140
|
+
"MessageFeed.attachment": "Attachment",
|
|
141
|
+
"MessageFeed.showing": "Showing the latest {n} of {total}",
|
|
142
|
+
"MessageFeed.empty.message": "No messages",
|
|
143
|
+
"MessageFeed.loading": "Loading messages",
|
|
144
|
+
"MessageFeed.error.invalidProps": "MessageFeed: invalid props",
|
|
145
|
+
"PipelineBoard.title": "Pipeline",
|
|
146
|
+
"PipelineBoard.deals.one": "1 deal",
|
|
147
|
+
"PipelineBoard.deals.many": "{n} deals",
|
|
148
|
+
"PipelineBoard.total": "Total",
|
|
149
|
+
"PipelineBoard.stage.empty": "No deals",
|
|
150
|
+
"PipelineBoard.filter.label": "Show stages",
|
|
151
|
+
"PipelineBoard.summary.open": "Open full board",
|
|
152
|
+
"PipelineBoard.more": "{n} more stages",
|
|
153
|
+
"PipelineBoard.empty.message": "No pipeline to display",
|
|
154
|
+
"PipelineBoard.loading": "Loading pipeline",
|
|
155
|
+
"PipelineBoard.error.invalidProps": "PipelineBoard: invalid props",
|
|
156
|
+
"PipelineBoard.col.stage": "Stage",
|
|
157
|
+
"PipelineBoard.col.deals": "Deals",
|
|
158
|
+
"TransactionPreview.title": "Transaction preview",
|
|
159
|
+
"TransactionPreview.notice": "NOT SIGNED - preparation only",
|
|
160
|
+
"TransactionPreview.kind.transfer": "Transfer",
|
|
161
|
+
"TransactionPreview.kind.swap": "Swap",
|
|
162
|
+
"TransactionPreview.testnet": "Testnet",
|
|
163
|
+
"TransactionPreview.field.network": "Network",
|
|
164
|
+
"TransactionPreview.field.from": "From",
|
|
165
|
+
"TransactionPreview.field.to": "To",
|
|
166
|
+
"TransactionPreview.field.amount": "Amount",
|
|
167
|
+
"TransactionPreview.field.fee": "Network fee",
|
|
168
|
+
"TransactionPreview.field.sell": "Sell",
|
|
169
|
+
"TransactionPreview.field.buy": "Buy",
|
|
170
|
+
"TransactionPreview.field.minReceived": "Minimum received",
|
|
171
|
+
"TransactionPreview.field.route": "Route",
|
|
172
|
+
"TransactionPreview.field.priceImpact": "Price impact",
|
|
173
|
+
"TransactionPreview.field.expires": "Quote expires",
|
|
174
|
+
"TransactionPreview.priceImpact.high": "High price impact",
|
|
175
|
+
"TransactionPreview.simulation.success": "Simulation succeeded",
|
|
176
|
+
"TransactionPreview.simulation.failed": "Simulation failed",
|
|
177
|
+
"TransactionPreview.simulation.unavailable": "Simulation unavailable",
|
|
178
|
+
"TransactionPreview.warnings": "Warnings",
|
|
179
|
+
"TransactionPreview.handoff": "Open in wallet",
|
|
180
|
+
"TransactionPreview.empty.message": "No transaction to preview",
|
|
181
|
+
"TransactionPreview.loading": "Loading preview",
|
|
182
|
+
"TransactionPreview.error.invalidProps": "TransactionPreview: invalid props",
|
|
183
|
+
"ProgressBar.title": "Progress",
|
|
184
|
+
"ConfirmDialog.title": "Confirmation",
|
|
185
|
+
"ConfirmDialog.options": "Answers",
|
|
186
|
+
"TableView.title": "Data table",
|
|
187
|
+
"TableView.markdown.more": "{n} more rows",
|
|
188
|
+
"MarkdownRenderer.title": "Markdown content",
|
|
189
|
+
"TokenDisplayOnceModal.title": "Token (shown once)",
|
|
190
|
+
"StatusBadge.title": "Status",
|
|
191
|
+
"TokenDisplayOnceModal.notice.once": "The value is shown once, in the app view only.",
|
|
192
|
+
"TokenDisplayOnceModal.field.scope": "Scope",
|
|
193
|
+
"TokenDisplayOnceModal.field.expires": "Expires",
|
|
194
|
+
"TokenDisplayOnceModal.field.fingerprint": "Fingerprint"
|
|
103
195
|
};
|
|
104
196
|
var FR = {
|
|
105
197
|
// ─── Non-forms components ──────────────────────────────────────────────────
|
|
@@ -193,7 +285,99 @@ var FR = {
|
|
|
193
285
|
"Select.search.placeholder": "Rechercher\u2026",
|
|
194
286
|
"Select.empty": "Aucune option disponible",
|
|
195
287
|
"Select.error.required": "S\xE9lectionnez une option",
|
|
196
|
-
"Select.error.invalidProps": "Select : propri\xE9t\xE9s invalides"
|
|
288
|
+
"Select.error.invalidProps": "Select : propri\xE9t\xE9s invalides",
|
|
289
|
+
"ModelContext.selection.one": "1 ligne s\xE9lectionn\xE9e",
|
|
290
|
+
"ModelContext.selection.many": "{n} lignes s\xE9lectionn\xE9es",
|
|
291
|
+
"ModelContext.selection.none": "Aucune ligne s\xE9lectionn\xE9e",
|
|
292
|
+
"TableView.sort.by": "Trier par",
|
|
293
|
+
"TableView.select.row": "S\xE9lectionner la ligne",
|
|
294
|
+
"TableView.select.all": "Tout s\xE9lectionner",
|
|
295
|
+
"TableView.loading": "Chargement du tableau",
|
|
296
|
+
"StatCard.title": "Statistique",
|
|
297
|
+
"StatCard.trend.up": "En hausse",
|
|
298
|
+
"StatCard.trend.down": "En baisse",
|
|
299
|
+
"StatCard.trend.flat": "Stable",
|
|
300
|
+
"StatCard.empty.message": "Aucune statistique \xE0 afficher",
|
|
301
|
+
"StatCard.loading": "Chargement de la statistique",
|
|
302
|
+
"StatCard.error.invalidProps": "StatCard : propri\xE9t\xE9s invalides",
|
|
303
|
+
"BalanceCard.title": "Solde",
|
|
304
|
+
"BalanceCard.network": "R\xE9seau",
|
|
305
|
+
"BalanceCard.testnet": "R\xE9seau de test",
|
|
306
|
+
"BalanceCard.address": "Adresse",
|
|
307
|
+
"BalanceCard.contract": "Contrat du jeton",
|
|
308
|
+
"BalanceCard.value": "Valeur",
|
|
309
|
+
"BalanceCard.copy": "Copier l'adresse",
|
|
310
|
+
"BalanceCard.copied": "Adresse copi\xE9e",
|
|
311
|
+
"BalanceCard.empty.message": "Aucun solde \xE0 afficher",
|
|
312
|
+
"BalanceCard.loading": "Chargement du solde",
|
|
313
|
+
"BalanceCard.error.invalidProps": "BalanceCard : propri\xE9t\xE9s invalides",
|
|
314
|
+
"Timeline.title": "Chronologie",
|
|
315
|
+
"Timeline.status.done": "Termin\xE9",
|
|
316
|
+
"Timeline.status.current": "En cours",
|
|
317
|
+
"Timeline.status.pending": "\xC0 venir",
|
|
318
|
+
"Timeline.status.blocked": "Bloqu\xE9",
|
|
319
|
+
"Timeline.completed": "{n} termin\xE9(s)",
|
|
320
|
+
"Timeline.more": "{n} de plus",
|
|
321
|
+
"Timeline.empty.message": "Aucune \xE9tape \xE0 afficher",
|
|
322
|
+
"Timeline.loading": "Chargement de la chronologie",
|
|
323
|
+
"Timeline.error.invalidProps": "Timeline : propri\xE9t\xE9s invalides",
|
|
324
|
+
"MessageFeed.title": "Messages",
|
|
325
|
+
"MessageFeed.unread": "Non lu",
|
|
326
|
+
"MessageFeed.attachment": "Pi\xE8ce jointe",
|
|
327
|
+
"MessageFeed.showing": "Affichage des {n} derniers sur {total}",
|
|
328
|
+
"MessageFeed.empty.message": "Aucun message",
|
|
329
|
+
"MessageFeed.loading": "Chargement des messages",
|
|
330
|
+
"MessageFeed.error.invalidProps": "MessageFeed : propri\xE9t\xE9s invalides",
|
|
331
|
+
"PipelineBoard.title": "Pipeline",
|
|
332
|
+
"PipelineBoard.deals.one": "1 affaire",
|
|
333
|
+
"PipelineBoard.deals.many": "{n} affaires",
|
|
334
|
+
"PipelineBoard.total": "Total",
|
|
335
|
+
"PipelineBoard.stage.empty": "Aucune affaire",
|
|
336
|
+
"PipelineBoard.filter.label": "Afficher les \xE9tapes",
|
|
337
|
+
"PipelineBoard.summary.open": "Ouvrir le tableau complet",
|
|
338
|
+
"PipelineBoard.more": "{n} \xE9tapes de plus",
|
|
339
|
+
"PipelineBoard.empty.message": "Aucun pipeline \xE0 afficher",
|
|
340
|
+
"PipelineBoard.loading": "Chargement du pipeline",
|
|
341
|
+
"PipelineBoard.error.invalidProps": "PipelineBoard : propri\xE9t\xE9s invalides",
|
|
342
|
+
"PipelineBoard.col.stage": "\xC9tape",
|
|
343
|
+
"PipelineBoard.col.deals": "Affaires",
|
|
344
|
+
"TransactionPreview.title": "Aper\xE7u de transaction",
|
|
345
|
+
"TransactionPreview.notice": "NON SIGN\xC9 - pr\xE9paration uniquement",
|
|
346
|
+
"TransactionPreview.kind.transfer": "Transfert",
|
|
347
|
+
"TransactionPreview.kind.swap": "\xC9change",
|
|
348
|
+
"TransactionPreview.testnet": "R\xE9seau de test",
|
|
349
|
+
"TransactionPreview.field.network": "R\xE9seau",
|
|
350
|
+
"TransactionPreview.field.from": "De",
|
|
351
|
+
"TransactionPreview.field.to": "\xC0",
|
|
352
|
+
"TransactionPreview.field.amount": "Montant",
|
|
353
|
+
"TransactionPreview.field.fee": "Frais de r\xE9seau",
|
|
354
|
+
"TransactionPreview.field.sell": "Vendre",
|
|
355
|
+
"TransactionPreview.field.buy": "Acheter",
|
|
356
|
+
"TransactionPreview.field.minReceived": "Minimum re\xE7u",
|
|
357
|
+
"TransactionPreview.field.route": "Itin\xE9raire",
|
|
358
|
+
"TransactionPreview.field.priceImpact": "Impact sur le prix",
|
|
359
|
+
"TransactionPreview.field.expires": "Expiration du devis",
|
|
360
|
+
"TransactionPreview.priceImpact.high": "Impact sur le prix \xE9lev\xE9",
|
|
361
|
+
"TransactionPreview.simulation.success": "Simulation r\xE9ussie",
|
|
362
|
+
"TransactionPreview.simulation.failed": "Simulation \xE9chou\xE9e",
|
|
363
|
+
"TransactionPreview.simulation.unavailable": "Simulation indisponible",
|
|
364
|
+
"TransactionPreview.warnings": "Avertissements",
|
|
365
|
+
"TransactionPreview.handoff": "Ouvrir dans le portefeuille",
|
|
366
|
+
"TransactionPreview.empty.message": "Aucune transaction \xE0 pr\xE9visualiser",
|
|
367
|
+
"TransactionPreview.loading": "Chargement de l'aper\xE7u",
|
|
368
|
+
"TransactionPreview.error.invalidProps": "TransactionPreview : propri\xE9t\xE9s invalides",
|
|
369
|
+
"ProgressBar.title": "Progression",
|
|
370
|
+
"ConfirmDialog.title": "Confirmation",
|
|
371
|
+
"ConfirmDialog.options": "R\xE9ponses",
|
|
372
|
+
"TableView.title": "Tableau de donn\xE9es",
|
|
373
|
+
"TableView.markdown.more": "{n} lignes de plus",
|
|
374
|
+
"MarkdownRenderer.title": "Contenu Markdown",
|
|
375
|
+
"TokenDisplayOnceModal.title": "Jeton (affich\xE9 une fois)",
|
|
376
|
+
"StatusBadge.title": "Statut",
|
|
377
|
+
"TokenDisplayOnceModal.notice.once": "La valeur n'est affich\xE9e qu'une fois, dans la vue de l'application uniquement.",
|
|
378
|
+
"TokenDisplayOnceModal.field.scope": "Port\xE9e",
|
|
379
|
+
"TokenDisplayOnceModal.field.expires": "Expire le",
|
|
380
|
+
"TokenDisplayOnceModal.field.fingerprint": "Empreinte"
|
|
197
381
|
};
|
|
198
382
|
var TABLE = {
|
|
199
383
|
en: EN,
|
|
@@ -208,6 +392,11 @@ var TokenDisplayOnceModalPropsSchema = zod.z.object({
|
|
|
208
392
|
warningMessage: zod.z.string().min(1),
|
|
209
393
|
copyLabel: zod.z.string().min(1),
|
|
210
394
|
closeLabel: zod.z.string().min(1),
|
|
395
|
+
/** Non-secret metadata, shown in the view AND carried by the A-1 fallback. */
|
|
396
|
+
scope: zod.z.string().optional(),
|
|
397
|
+
expiresAt: zod.z.string().optional(),
|
|
398
|
+
/** Supplied by the issuer; NEVER derived from the secret. */
|
|
399
|
+
fingerprint: zod.z.string().optional(),
|
|
211
400
|
locale: zod.z.enum(["en", "fr"]).default("en")
|
|
212
401
|
});
|
|
213
402
|
function validateTokenDisplayOnceModalProps(raw) {
|
|
@@ -219,6 +408,9 @@ function TokenDisplayOnceModalInner({
|
|
|
219
408
|
warningMessage,
|
|
220
409
|
copyLabel,
|
|
221
410
|
closeLabel,
|
|
411
|
+
scope,
|
|
412
|
+
expiresAt,
|
|
413
|
+
fingerprint,
|
|
222
414
|
locale,
|
|
223
415
|
onClose
|
|
224
416
|
}) {
|
|
@@ -281,6 +473,29 @@ function TokenDisplayOnceModalInner({
|
|
|
281
473
|
children: warningMessage
|
|
282
474
|
}
|
|
283
475
|
),
|
|
476
|
+
scope || expiresAt || fingerprint ? /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "m-0 text-sm text-gray-700", children: [
|
|
477
|
+
scope ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
478
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "inline", children: [
|
|
479
|
+
t("TokenDisplayOnceModal.field.scope", locale),
|
|
480
|
+
": "
|
|
481
|
+
] }),
|
|
482
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 inline", children: scope })
|
|
483
|
+
] }) : null,
|
|
484
|
+
expiresAt ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
485
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "inline", children: [
|
|
486
|
+
t("TokenDisplayOnceModal.field.expires", locale),
|
|
487
|
+
": "
|
|
488
|
+
] }),
|
|
489
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 inline", children: expiresAt })
|
|
490
|
+
] }) : null,
|
|
491
|
+
fingerprint ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
492
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "inline", children: [
|
|
493
|
+
t("TokenDisplayOnceModal.field.fingerprint", locale),
|
|
494
|
+
": "
|
|
495
|
+
] }),
|
|
496
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 inline font-mono", children: fingerprint })
|
|
497
|
+
] }) : null
|
|
498
|
+
] }) : null,
|
|
284
499
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 bg-gray-50 border border-gray-200 rounded-md px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx("code", { className: "flex-1 text-sm font-mono text-gray-800 break-all select-all", children: secureToken }) }),
|
|
285
500
|
/* @__PURE__ */ jsxRuntime.jsx("output", { "aria-live": "polite", "aria-atomic": "true", className: "min-h-[1.25rem] block", children: copied && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-green-700 font-medium", children: t("TokenDisplayOnceModal.copied", locale) }) }),
|
|
286
501
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-3 mt-2", children: [
|
|
@@ -338,13 +553,520 @@ var AlertPropsSchema = zod.z.object({
|
|
|
338
553
|
function validateAlertProps(raw) {
|
|
339
554
|
return AlertPropsSchema.parse(raw);
|
|
340
555
|
}
|
|
556
|
+
var BadgePropsSchema = zod.z.object({
|
|
557
|
+
label: zod.z.string(),
|
|
558
|
+
variant: zod.z.enum(["default", "primary", "success", "warning", "danger", "info", "neutral"]).default("default"),
|
|
559
|
+
dot: zod.z.boolean().optional(),
|
|
560
|
+
count: zod.z.number().int().nonnegative().optional(),
|
|
561
|
+
locale: zod.z.enum(["en", "fr"]).default("en")
|
|
562
|
+
});
|
|
563
|
+
function validateBadgeProps(raw) {
|
|
564
|
+
return BadgePropsSchema.parse(raw);
|
|
565
|
+
}
|
|
566
|
+
var variantClasses = {
|
|
567
|
+
default: "bg-slate-100 text-slate-700 ring-1 ring-slate-200",
|
|
568
|
+
primary: "bg-indigo-100 text-indigo-800 ring-1 ring-indigo-300",
|
|
569
|
+
success: "bg-green-100 text-green-800 ring-1 ring-green-300",
|
|
570
|
+
warning: "bg-amber-100 text-amber-800 ring-1 ring-amber-300",
|
|
571
|
+
danger: "bg-red-100 text-red-800 ring-1 ring-red-300",
|
|
572
|
+
info: "bg-blue-100 text-blue-800 ring-1 ring-blue-300",
|
|
573
|
+
neutral: "bg-slate-100 text-slate-800 ring-1 ring-slate-300"
|
|
574
|
+
};
|
|
575
|
+
var dotClasses = {
|
|
576
|
+
default: "bg-slate-400",
|
|
577
|
+
primary: "bg-indigo-500",
|
|
578
|
+
success: "bg-green-500",
|
|
579
|
+
warning: "bg-amber-500",
|
|
580
|
+
danger: "bg-red-500",
|
|
581
|
+
info: "bg-blue-500",
|
|
582
|
+
neutral: "bg-slate-400"
|
|
583
|
+
};
|
|
584
|
+
function BadgeInner({ label, variant, dot, count, locale }) {
|
|
585
|
+
const ariaLabel = t("Badge.aria.label", locale);
|
|
586
|
+
const displayCount = count !== void 0 ? ` (${count})` : "";
|
|
587
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
588
|
+
"span",
|
|
589
|
+
{
|
|
590
|
+
"aria-label": `${ariaLabel}: ${label}${displayCount}`,
|
|
591
|
+
lang: locale,
|
|
592
|
+
className: `inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium ${variantClasses[variant]}`,
|
|
593
|
+
children: [
|
|
594
|
+
dot && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: `h-1.5 w-1.5 rounded-full ${dotClasses[variant]}` }),
|
|
595
|
+
label,
|
|
596
|
+
count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "font-semibold tabular-nums", children: count })
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
function Badge(raw) {
|
|
602
|
+
try {
|
|
603
|
+
const props = validateBadgeProps(raw);
|
|
604
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BadgeInner, { ...props });
|
|
605
|
+
} catch {
|
|
606
|
+
const locale = raw.locale === "fr" ? "fr" : "en";
|
|
607
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { role: "alert", children: t("Badge.error.invalidProps", locale) });
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// src/components/display/EmptyState.logic.ts
|
|
612
|
+
var ACTION_VARIANT_CLASSES = {
|
|
613
|
+
primary: "inline-flex items-center justify-center rounded-md bg-slate-900 px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-slate-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-900 disabled:pointer-events-none disabled:opacity-50",
|
|
614
|
+
secondary: "inline-flex items-center justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-400 disabled:pointer-events-none disabled:opacity-50"
|
|
615
|
+
};
|
|
616
|
+
var EmptyStatePropsSchema = zod.z.object({
|
|
617
|
+
title: zod.z.string().min(1),
|
|
618
|
+
description: zod.z.string().optional(),
|
|
619
|
+
action: zod.z.object({
|
|
620
|
+
label: zod.z.string().min(1),
|
|
621
|
+
variant: zod.z.enum(["primary", "secondary"]).default("primary")
|
|
622
|
+
}).optional(),
|
|
623
|
+
locale: zod.z.enum(["en", "fr"]).default("en")
|
|
624
|
+
});
|
|
625
|
+
function validateEmptyStateProps(raw) {
|
|
626
|
+
return EmptyStatePropsSchema.parse(raw);
|
|
627
|
+
}
|
|
628
|
+
function EmptyStateInner({
|
|
629
|
+
icon,
|
|
630
|
+
title,
|
|
631
|
+
description,
|
|
632
|
+
action,
|
|
633
|
+
locale: _locale
|
|
634
|
+
}) {
|
|
635
|
+
const variant = action?.variant ?? "primary";
|
|
636
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
637
|
+
"section",
|
|
638
|
+
{
|
|
639
|
+
"aria-label": title,
|
|
640
|
+
className: "flex flex-col items-center justify-center gap-4 px-6 py-12 text-center",
|
|
641
|
+
children: [
|
|
642
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "text-slate-400", children: icon }),
|
|
643
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-base font-semibold text-slate-900", children: title }),
|
|
644
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-sm text-sm leading-relaxed text-slate-500", children: description }),
|
|
645
|
+
action && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: action.onClick, className: ACTION_VARIANT_CLASSES[variant], children: action.label })
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
function EmptyState(raw) {
|
|
651
|
+
try {
|
|
652
|
+
const parsed = validateEmptyStateProps(raw);
|
|
653
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
654
|
+
EmptyStateInner,
|
|
655
|
+
{
|
|
656
|
+
...parsed,
|
|
657
|
+
icon: raw.icon,
|
|
658
|
+
action: parsed.action && raw.action?.onClick ? { ...parsed.action, onClick: raw.action.onClick } : void 0
|
|
659
|
+
}
|
|
660
|
+
);
|
|
661
|
+
} catch (err) {
|
|
662
|
+
console.error("[EmptyState] Invalid props \u2014 component will not render.", err);
|
|
663
|
+
const locale = raw.locale === "fr" ? "fr" : "en";
|
|
664
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { role: "alert", children: t("EmptyState.error.invalidProps", locale) });
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// src/components/display/Skeleton.logic.ts
|
|
669
|
+
function getAnimationClass(animation) {
|
|
670
|
+
switch (animation) {
|
|
671
|
+
case "pulse":
|
|
672
|
+
return "animate-pulse";
|
|
673
|
+
case "wave":
|
|
674
|
+
return "skeleton-wave";
|
|
675
|
+
case "none":
|
|
676
|
+
return "";
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
function getVariantClass(variant) {
|
|
680
|
+
switch (variant) {
|
|
681
|
+
case "rect":
|
|
682
|
+
return "rounded-md";
|
|
683
|
+
case "circle":
|
|
684
|
+
return "rounded-full";
|
|
685
|
+
case "text":
|
|
686
|
+
return "rounded";
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
var SKELETON_BG_CLASS = "bg-gray-200 dark:bg-gray-700";
|
|
690
|
+
function textLineKey(index) {
|
|
691
|
+
return `skeleton-line-${index}`;
|
|
692
|
+
}
|
|
693
|
+
function lastLineWidth(index, total, baseWidth) {
|
|
694
|
+
if (total > 1 && index === total - 1) {
|
|
695
|
+
return "75%";
|
|
696
|
+
}
|
|
697
|
+
return baseWidth;
|
|
698
|
+
}
|
|
699
|
+
var SkeletonPropsSchema = zod.z.object({
|
|
700
|
+
variant: zod.z.enum(["rect", "circle", "text"]).default("rect"),
|
|
701
|
+
width: zod.z.union([zod.z.string().min(1), zod.z.number().positive()]).optional(),
|
|
702
|
+
height: zod.z.union([zod.z.string().min(1), zod.z.number().positive()]).optional(),
|
|
703
|
+
count: zod.z.number().int().min(1).max(20).default(1),
|
|
704
|
+
animation: zod.z.enum(["pulse", "wave", "none"]).default("pulse"),
|
|
705
|
+
locale: zod.z.enum(["en", "fr"]).default("en")
|
|
706
|
+
});
|
|
707
|
+
function validateSkeletonProps(raw) {
|
|
708
|
+
return SkeletonPropsSchema.parse(raw);
|
|
709
|
+
}
|
|
710
|
+
function resolveSkeletonDimensions(variant, width, height) {
|
|
711
|
+
const toCss = (v, fallback) => {
|
|
712
|
+
if (v === void 0) return fallback;
|
|
713
|
+
if (typeof v === "number") return `${v}px`;
|
|
714
|
+
return v;
|
|
715
|
+
};
|
|
716
|
+
if (variant === "circle") {
|
|
717
|
+
const size = width !== void 0 ? toCss(width, "40px") : height !== void 0 ? toCss(height, "40px") : "40px";
|
|
718
|
+
return { widthCss: size, heightCss: size };
|
|
719
|
+
}
|
|
720
|
+
if (variant === "text") {
|
|
721
|
+
return {
|
|
722
|
+
widthCss: toCss(width, "100%"),
|
|
723
|
+
heightCss: toCss(height, "16px")
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
return {
|
|
727
|
+
widthCss: toCss(width, "100%"),
|
|
728
|
+
heightCss: toCss(height, "100px")
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
function SkeletonInner({ variant, width, height, count, animation, locale }) {
|
|
732
|
+
const { widthCss, heightCss } = resolveSkeletonDimensions(variant, width, height);
|
|
733
|
+
const animClass = getAnimationClass(animation);
|
|
734
|
+
const variantClass = getVariantClass(variant);
|
|
735
|
+
const ariaLabel = t("Skeleton.aria.label", locale);
|
|
736
|
+
const baseClass = `${SKELETON_BG_CLASS} ${variantClass} ${animClass}`.trim();
|
|
737
|
+
if (variant === "text") {
|
|
738
|
+
return (
|
|
739
|
+
// biome-ignore lint/a11y/useSemanticElements: role="status" is the correct ARIA pattern for loading indicators; <output> conveys form output semantics which is incorrect here
|
|
740
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { role: "status", "aria-label": ariaLabel, "aria-busy": "true", className: "flex flex-col gap-2", children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
741
|
+
"span",
|
|
742
|
+
{
|
|
743
|
+
className: `block ${baseClass}`,
|
|
744
|
+
style: {
|
|
745
|
+
width: lastLineWidth(i, count, widthCss),
|
|
746
|
+
height: heightCss
|
|
747
|
+
},
|
|
748
|
+
"aria-hidden": "true"
|
|
749
|
+
},
|
|
750
|
+
textLineKey(i)
|
|
751
|
+
)) })
|
|
752
|
+
);
|
|
753
|
+
}
|
|
754
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
755
|
+
"div",
|
|
756
|
+
{
|
|
757
|
+
role: "status",
|
|
758
|
+
"aria-label": ariaLabel,
|
|
759
|
+
"aria-busy": "true",
|
|
760
|
+
className: `block ${baseClass}`,
|
|
761
|
+
style: { width: widthCss, height: heightCss }
|
|
762
|
+
}
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
function Skeleton(raw) {
|
|
766
|
+
try {
|
|
767
|
+
const props = validateSkeletonProps(raw);
|
|
768
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SkeletonInner, { ...props });
|
|
769
|
+
} catch {
|
|
770
|
+
const locale = raw.locale === "fr" ? "fr" : "en";
|
|
771
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { role: "alert", className: "text-red-600 text-sm", children: t("Skeleton.error.invalidProps", locale) });
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// src/components/display/TableView.logic.ts
|
|
776
|
+
var DECIMAL = /^(-)?(\d+)(?:\.(\d+))?$/;
|
|
777
|
+
function parseDecimal(s) {
|
|
778
|
+
const m = DECIMAL.exec(s.trim());
|
|
779
|
+
if (!m) return void 0;
|
|
780
|
+
const int = (m[2] ?? "0").replace(/^0+(?=\d)/, "");
|
|
781
|
+
const frac = (m[3] ?? "").replace(/0+$/, "");
|
|
782
|
+
const zero = int === "0" && frac === "";
|
|
783
|
+
return { neg: m[1] === "-" && !zero, int, frac };
|
|
784
|
+
}
|
|
785
|
+
function compareDecimalStrings(a, b) {
|
|
786
|
+
const x = parseDecimal(a);
|
|
787
|
+
const y = parseDecimal(b);
|
|
788
|
+
if (!x || !y) return 0;
|
|
789
|
+
if (x.neg !== y.neg) return x.neg ? -1 : 1;
|
|
790
|
+
const sign = x.neg ? -1 : 1;
|
|
791
|
+
if (x.int.length !== y.int.length) return sign * (x.int.length < y.int.length ? -1 : 1);
|
|
792
|
+
if (x.int !== y.int) return sign * (x.int < y.int ? -1 : 1);
|
|
793
|
+
const len = Math.max(x.frac.length, y.frac.length);
|
|
794
|
+
const fx = x.frac.padEnd(len, "0");
|
|
795
|
+
const fy = y.frac.padEnd(len, "0");
|
|
796
|
+
if (fx === fy) return 0;
|
|
797
|
+
return sign * (fx < fy ? -1 : 1);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// src/components/shared/datetime.ts
|
|
801
|
+
function formatTimestamp(iso, locale, timeZone) {
|
|
802
|
+
const d = new Date(iso);
|
|
803
|
+
if (Number.isNaN(d.getTime())) return iso;
|
|
804
|
+
try {
|
|
805
|
+
return new Intl.DateTimeFormat(locale, {
|
|
806
|
+
dateStyle: "medium",
|
|
807
|
+
timeStyle: "short",
|
|
808
|
+
...timeZone ? { timeZone } : {}
|
|
809
|
+
}).format(d);
|
|
810
|
+
} catch {
|
|
811
|
+
return iso;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// src/components/shared/url.ts
|
|
816
|
+
function normalizeHttpUrl(value) {
|
|
817
|
+
if (typeof value !== "string") return void 0;
|
|
818
|
+
try {
|
|
819
|
+
const u = new URL(value);
|
|
820
|
+
return u.protocol === "https:" || u.protocol === "http:" ? u.href : void 0;
|
|
821
|
+
} catch {
|
|
822
|
+
return void 0;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
var AmountSchema = zod.z.object({
|
|
826
|
+
/** Decimal STRING (never a float). */
|
|
827
|
+
value: zod.z.string().min(1),
|
|
828
|
+
symbol: zod.z.string().min(1)
|
|
829
|
+
});
|
|
830
|
+
var QuoteSchema = zod.z.object({
|
|
831
|
+
sell: AmountSchema,
|
|
832
|
+
buy: AmountSchema,
|
|
833
|
+
minReceived: AmountSchema.optional(),
|
|
834
|
+
route: zod.z.array(zod.z.string().min(1)).optional(),
|
|
835
|
+
/** Percent as a decimal string, e.g. "0.42". */
|
|
836
|
+
priceImpact: zod.z.string().optional()
|
|
837
|
+
});
|
|
838
|
+
var TransactionPreviewPropsSchema = zod.z.object({
|
|
839
|
+
kind: zod.z.enum(["transfer", "swap"]).default("transfer"),
|
|
840
|
+
network: zod.z.string().optional(),
|
|
841
|
+
testnet: zod.z.boolean().default(false),
|
|
842
|
+
from: zod.z.string().optional(),
|
|
843
|
+
to: zod.z.string().optional(),
|
|
844
|
+
amount: AmountSchema.optional(),
|
|
845
|
+
fee: AmountSchema.optional(),
|
|
846
|
+
quote: QuoteSchema.optional(),
|
|
847
|
+
simulation: zod.z.object({
|
|
848
|
+
status: zod.z.enum(["success", "failed", "unavailable"]),
|
|
849
|
+
message: zod.z.string().optional()
|
|
850
|
+
}).optional(),
|
|
851
|
+
warnings: zod.z.array(zod.z.string()).default([]),
|
|
852
|
+
/** ISO 8601 expiry of the quote. */
|
|
853
|
+
expiresAt: zod.z.string().optional(),
|
|
854
|
+
/** Wallet link-out. Only http(s) urls are ever rendered. */
|
|
855
|
+
handoff: zod.z.object({ url: zod.z.string().min(1) }).optional(),
|
|
856
|
+
timeZone: zod.z.string().optional(),
|
|
857
|
+
loading: zod.z.boolean().default(false),
|
|
858
|
+
locale: zod.z.enum(["en", "fr"]).default("en")
|
|
859
|
+
});
|
|
860
|
+
function validateTransactionPreviewProps(raw) {
|
|
861
|
+
return TransactionPreviewPropsSchema.parse(raw);
|
|
862
|
+
}
|
|
863
|
+
function hasPreviewContent(p) {
|
|
864
|
+
return Boolean(p.from || p.to || p.amount || p.quote || p.fee);
|
|
865
|
+
}
|
|
866
|
+
var amountText = (a) => `${a.value} ${a.symbol}`;
|
|
867
|
+
function Row({ label, children }) {
|
|
868
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 py-1 sm:flex-row sm:gap-3", children: [
|
|
869
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-36 shrink-0 text-sm text-slate-500", children: label }),
|
|
870
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 min-w-0 break-all text-sm text-slate-900", children })
|
|
871
|
+
] });
|
|
872
|
+
}
|
|
873
|
+
function TransactionPreview(raw = {}) {
|
|
874
|
+
const parsed = TransactionPreviewPropsSchema.safeParse(raw);
|
|
875
|
+
const locale = raw?.locale === "fr" ? "fr" : "en";
|
|
876
|
+
if (!parsed.success) {
|
|
877
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", children: t("TransactionPreview.error.invalidProps", locale) });
|
|
878
|
+
}
|
|
879
|
+
const p = parsed.data;
|
|
880
|
+
if (p.loading) {
|
|
881
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-busy": "true", "aria-label": t("TransactionPreview.loading", p.locale), children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { variant: "text", count: 6, locale: p.locale }) });
|
|
882
|
+
}
|
|
883
|
+
if (!hasPreviewContent(p)) {
|
|
884
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { title: t("TransactionPreview.empty.message", p.locale), locale: p.locale });
|
|
885
|
+
}
|
|
886
|
+
const highImpact = p.quote?.priceImpact !== void 0 && compareDecimalStrings(p.quote.priceImpact, "1") >= 0;
|
|
887
|
+
const handoff = normalizeHttpUrl(p.handoff?.url);
|
|
888
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
889
|
+
"section",
|
|
890
|
+
{
|
|
891
|
+
"aria-label": t("TransactionPreview.title", p.locale),
|
|
892
|
+
lang: p.locale,
|
|
893
|
+
className: "flex flex-col gap-3 rounded-lg border border-slate-200 bg-white p-4",
|
|
894
|
+
children: [
|
|
895
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex flex-wrap items-center gap-2", children: [
|
|
896
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-slate-900", children: t(`TransactionPreview.kind.${p.kind}`, p.locale) }),
|
|
897
|
+
p.testnet ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
898
|
+
Badge,
|
|
899
|
+
{
|
|
900
|
+
label: t("TransactionPreview.testnet", p.locale),
|
|
901
|
+
variant: "warning",
|
|
902
|
+
locale: p.locale
|
|
903
|
+
}
|
|
904
|
+
) : null
|
|
905
|
+
] }),
|
|
906
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
907
|
+
"p",
|
|
908
|
+
{
|
|
909
|
+
role: "note",
|
|
910
|
+
className: "m-0 rounded bg-amber-50 px-3 py-2 text-sm font-semibold text-amber-900",
|
|
911
|
+
children: t("TransactionPreview.notice", p.locale)
|
|
912
|
+
}
|
|
913
|
+
),
|
|
914
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "m-0", children: [
|
|
915
|
+
p.network ? /* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.network", p.locale), children: p.network }) : null,
|
|
916
|
+
p.from ? /* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.from", p.locale), children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: p.from }) }) : null,
|
|
917
|
+
p.to ? /* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.to", p.locale), children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: p.to }) }) : null,
|
|
918
|
+
p.amount ? /* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.amount", p.locale), children: amountText(p.amount) }) : null,
|
|
919
|
+
p.quote ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
920
|
+
/* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.sell", p.locale), children: amountText(p.quote.sell) }),
|
|
921
|
+
/* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.buy", p.locale), children: amountText(p.quote.buy) }),
|
|
922
|
+
p.quote.minReceived ? /* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.minReceived", p.locale), children: amountText(p.quote.minReceived) }) : null,
|
|
923
|
+
p.quote.route ? /* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.route", p.locale), children: p.quote.route.join(" > ") }) : null,
|
|
924
|
+
p.quote.priceImpact !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs(Row, { label: t("TransactionPreview.field.priceImpact", p.locale), children: [
|
|
925
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: `${p.quote.priceImpact}%` }),
|
|
926
|
+
highImpact ? /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "ml-2 text-red-700", children: t("TransactionPreview.priceImpact.high", p.locale) }) : null
|
|
927
|
+
] }) : null
|
|
928
|
+
] }) : null,
|
|
929
|
+
p.fee ? /* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.fee", p.locale), children: amountText(p.fee) }) : null,
|
|
930
|
+
p.expiresAt ? /* @__PURE__ */ jsxRuntime.jsx(Row, { label: t("TransactionPreview.field.expires", p.locale), children: formatTimestamp(p.expiresAt, p.locale, p.timeZone) }) : null
|
|
931
|
+
] }),
|
|
932
|
+
p.simulation ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm", children: [
|
|
933
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { className: p.simulation.status === "failed" ? "text-red-700" : "text-slate-800", children: t(`TransactionPreview.simulation.${p.simulation.status}`, p.locale) }),
|
|
934
|
+
p.simulation.message ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-slate-600", children: p.simulation.message }) : null
|
|
935
|
+
] }) : null,
|
|
936
|
+
p.warnings.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm", children: [
|
|
937
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-amber-800", children: t("TransactionPreview.warnings", p.locale) }),
|
|
938
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "m-0 pl-5", children: p.warnings.map((w) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: w }, w)) })
|
|
939
|
+
] }) : null,
|
|
940
|
+
handoff ? raw.onHandoff ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
941
|
+
"button",
|
|
942
|
+
{
|
|
943
|
+
type: "button",
|
|
944
|
+
onClick: () => raw.onHandoff?.(handoff),
|
|
945
|
+
className: "self-start rounded border border-slate-300 px-3 py-1 text-sm hover:bg-slate-50",
|
|
946
|
+
children: t("TransactionPreview.handoff", p.locale)
|
|
947
|
+
}
|
|
948
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
949
|
+
"a",
|
|
950
|
+
{
|
|
951
|
+
href: handoff,
|
|
952
|
+
rel: "noopener noreferrer",
|
|
953
|
+
target: "_blank",
|
|
954
|
+
className: "self-start text-sm text-blue-700 underline",
|
|
955
|
+
children: t("TransactionPreview.handoff", p.locale)
|
|
956
|
+
}
|
|
957
|
+
) : null
|
|
958
|
+
]
|
|
959
|
+
}
|
|
960
|
+
);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
// src/components/shared/markdown.ts
|
|
964
|
+
var SPECIAL = /([\\`*_[\]()<>&!|~])/g;
|
|
965
|
+
var BREAKS = /* @__PURE__ */ new Set([10, 11, 12, 13, 133, 8232, 8233]);
|
|
966
|
+
function flatten(text) {
|
|
967
|
+
let out = "";
|
|
968
|
+
let gap = false;
|
|
969
|
+
for (const c of text) {
|
|
970
|
+
const n = c.codePointAt(0) ?? 0;
|
|
971
|
+
if (BREAKS.has(n)) {
|
|
972
|
+
gap = true;
|
|
973
|
+
continue;
|
|
974
|
+
}
|
|
975
|
+
if (n < 32 && n !== 9) continue;
|
|
976
|
+
if (n === 127) continue;
|
|
977
|
+
if (gap) out += " ";
|
|
978
|
+
gap = false;
|
|
979
|
+
out += c;
|
|
980
|
+
}
|
|
981
|
+
return gap ? `${out} ` : out;
|
|
982
|
+
}
|
|
983
|
+
function mdEscape(text) {
|
|
984
|
+
const flat = flatten(text).replace(SPECIAL, "\\$1").replace(/\b(https?|ftp):\/\//gi, "$1:\\/\\/").replace(/\bwww\./gi, (m) => `${m.slice(0, 3)}\\.`);
|
|
985
|
+
return flat.replace(/^(\s*)([#>+-])/, "$1\\$2").replace(/^(\s*\d+)([.)])(?=\s|$)/, "$1\\$2");
|
|
986
|
+
}
|
|
987
|
+
function mdUrl(href) {
|
|
988
|
+
return href.replace(
|
|
989
|
+
/[()[\]\\<>`\s]/g,
|
|
990
|
+
(c) => `%${c.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`
|
|
991
|
+
);
|
|
992
|
+
}
|
|
993
|
+
function mdTable(headers, rows) {
|
|
994
|
+
const line = (cells) => `| ${cells.join(" | ")} |`;
|
|
995
|
+
return [line(headers), line(headers.map(() => "---")), ...rows.map(line)].join("\n");
|
|
996
|
+
}
|
|
997
|
+
function mdHeading(text, level = 1) {
|
|
998
|
+
return `${"#".repeat(level)} ${text}`;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
// src/components/confirmation/TransactionPreview.markdown.ts
|
|
1002
|
+
var amt = (a) => `${a.value} ${a.symbol}`;
|
|
1003
|
+
function transactionPreviewToMarkdown(props, locale = "en") {
|
|
1004
|
+
const title = mdHeading(t("TransactionPreview.title", locale));
|
|
1005
|
+
const notice = `**${t("TransactionPreview.notice", locale)}**`;
|
|
1006
|
+
const parsed = TransactionPreviewPropsSchema.safeParse(props);
|
|
1007
|
+
if (!parsed.success || !hasPreviewContent(parsed.data)) {
|
|
1008
|
+
return `${title}
|
|
1009
|
+
|
|
1010
|
+
${notice}
|
|
1011
|
+
|
|
1012
|
+
${t("TransactionPreview.empty.message", locale)}
|
|
1013
|
+
`;
|
|
1014
|
+
}
|
|
1015
|
+
const p = parsed.data;
|
|
1016
|
+
const rows = [];
|
|
1017
|
+
const add = (key, value) => {
|
|
1018
|
+
if (value) rows.push([t(key, locale), mdEscape(value)]);
|
|
1019
|
+
};
|
|
1020
|
+
add(
|
|
1021
|
+
"TransactionPreview.field.network",
|
|
1022
|
+
[p.network, p.testnet ? t("TransactionPreview.testnet", locale) : ""].filter(Boolean).join(", ")
|
|
1023
|
+
);
|
|
1024
|
+
add("TransactionPreview.field.from", p.from);
|
|
1025
|
+
add("TransactionPreview.field.to", p.to);
|
|
1026
|
+
if (p.amount) add("TransactionPreview.field.amount", amt(p.amount));
|
|
1027
|
+
if (p.quote) {
|
|
1028
|
+
add("TransactionPreview.field.sell", amt(p.quote.sell));
|
|
1029
|
+
add("TransactionPreview.field.buy", amt(p.quote.buy));
|
|
1030
|
+
if (p.quote.minReceived) add("TransactionPreview.field.minReceived", amt(p.quote.minReceived));
|
|
1031
|
+
if (p.quote.route) add("TransactionPreview.field.route", p.quote.route.join(" \u2192 "));
|
|
1032
|
+
if (p.quote.priceImpact) add("TransactionPreview.field.priceImpact", `${p.quote.priceImpact}%`);
|
|
1033
|
+
}
|
|
1034
|
+
if (p.fee) add("TransactionPreview.field.fee", amt(p.fee));
|
|
1035
|
+
if (p.expiresAt) {
|
|
1036
|
+
add("TransactionPreview.field.expires", formatTimestamp(p.expiresAt, locale, p.timeZone));
|
|
1037
|
+
}
|
|
1038
|
+
const sections = [
|
|
1039
|
+
`${title}
|
|
1040
|
+
|
|
1041
|
+
${notice}`,
|
|
1042
|
+
mdTable([t(`TransactionPreview.kind.${p.kind}`, locale), ""], rows)
|
|
1043
|
+
];
|
|
1044
|
+
if (p.simulation) {
|
|
1045
|
+
const msg = p.simulation.message ? ` - ${mdEscape(p.simulation.message)}` : "";
|
|
1046
|
+
sections.push(`${t(`TransactionPreview.simulation.${p.simulation.status}`, locale)}${msg}`);
|
|
1047
|
+
}
|
|
1048
|
+
if (p.warnings.length > 0) {
|
|
1049
|
+
sections.push(
|
|
1050
|
+
`${t("TransactionPreview.warnings", locale)}:
|
|
1051
|
+
${p.warnings.map((w) => `- ${mdEscape(w)}`).join("\n")}`
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
const handoff = normalizeHttpUrl(p.handoff?.url);
|
|
1055
|
+
if (handoff) sections.push(`${t("TransactionPreview.handoff", locale)}: <${mdUrl(handoff)}>`);
|
|
1056
|
+
return `${sections.join("\n\n")}
|
|
1057
|
+
`;
|
|
1058
|
+
}
|
|
341
1059
|
|
|
342
1060
|
exports.AlertPropsSchema = AlertPropsSchema;
|
|
343
1061
|
exports.ToastPropsSchema = ToastPropsSchema;
|
|
344
1062
|
exports.TokenDisplayOnceModal = TokenDisplayOnceModal;
|
|
345
1063
|
exports.TokenDisplayOnceModalPropsSchema = TokenDisplayOnceModalPropsSchema;
|
|
1064
|
+
exports.TransactionPreview = TransactionPreview;
|
|
1065
|
+
exports.TransactionPreviewPropsSchema = TransactionPreviewPropsSchema;
|
|
1066
|
+
exports.transactionPreviewToMarkdown = transactionPreviewToMarkdown;
|
|
346
1067
|
exports.validateAlertProps = validateAlertProps;
|
|
347
1068
|
exports.validateToastProps = validateToastProps;
|
|
348
1069
|
exports.validateTokenDisplayOnceModalProps = validateTokenDisplayOnceModalProps;
|
|
1070
|
+
exports.validateTransactionPreviewProps = validateTransactionPreviewProps;
|
|
349
1071
|
//# sourceMappingURL=confirmation.cjs.map
|
|
350
1072
|
//# sourceMappingURL=confirmation.cjs.map
|