@eifi1/ui-kit 0.32.2 → 0.33.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/README.md +16 -8
- package/dist/account/delete-account-setting.d.ts +10 -10
- package/dist/account/delete-account-setting.js +2 -1
- package/dist/account/delete-account-setting.js.map +1 -1
- package/dist/account/email-change-setting.d.ts +5 -0
- package/dist/account/email-change-setting.js +4 -3
- package/dist/account/email-change-setting.js.map +1 -1
- package/dist/account/sessions-setting.d.ts +4 -0
- package/dist/account/sessions-setting.js +3 -2
- package/dist/account/sessions-setting.js.map +1 -1
- package/dist/admin/admin-action-confirm.d.ts +10 -10
- package/dist/admin/admin-action-confirm.js.map +1 -1
- package/dist/admin/invitations-panel.d.ts +10 -10
- package/dist/admin/invitations-panel.js +4 -3
- package/dist/admin/invitations-panel.js.map +1 -1
- package/dist/admin/plan-change.d.ts +100 -0
- package/dist/admin/plan-change.js +208 -0
- package/dist/admin/plan-change.js.map +1 -0
- package/dist/admin/reviewer-scope-editor.d.ts +10 -10
- package/dist/admin/reviewer-scope-editor.js.map +1 -1
- package/dist/admin/role-select.d.ts +7 -7
- package/dist/admin/role-select.js.map +1 -1
- package/dist/admin/transfer-ownership-dialog.d.ts +10 -10
- package/dist/admin/user-roster.d.ts +7 -7
- package/dist/admin/user-roster.js +2 -2
- package/dist/admin/user-roster.js.map +1 -1
- package/dist/auth/auth-errors.d.ts +13 -2
- package/dist/auth/auth-errors.js +5 -1
- package/dist/auth/auth-errors.js.map +1 -1
- package/dist/auth/complete-name-dialog.d.ts +4 -1
- package/dist/auth/complete-name-dialog.js +2 -1
- package/dist/auth/complete-name-dialog.js.map +1 -1
- package/dist/auth/register-form.d.ts +10 -10
- package/dist/billing/billing-banner.d.ts +13 -11
- package/dist/billing/billing-banner.js.map +1 -1
- package/dist/billing/billing-labels.d.ts +10 -10
- package/dist/billing/billing-labels.js +10 -1
- package/dist/billing/billing-labels.js.map +1 -1
- package/dist/billing/billing-lock.d.ts +39 -12
- package/dist/billing/billing-lock.js +9 -3
- package/dist/billing/billing-lock.js.map +1 -1
- package/dist/billing/billing-overview.d.ts +154 -0
- package/dist/billing/billing-overview.js +2 -0
- package/dist/billing/billing-overview.js.map +1 -0
- package/dist/billing/billing-standing.d.ts +10 -10
- package/dist/billing/checkout-processing.d.ts +217 -0
- package/dist/billing/checkout-processing.js +198 -0
- package/dist/billing/checkout-processing.js.map +1 -0
- package/dist/billing/checkout-return.d.ts +51 -0
- package/dist/billing/checkout-return.js +43 -0
- package/dist/billing/checkout-return.js.map +1 -0
- package/dist/billing/pay-page.d.ts +210 -0
- package/dist/billing/pay-page.js +113 -0
- package/dist/billing/pay-page.js.map +1 -0
- package/dist/billing/plan-card.d.ts +10 -10
- package/dist/billing/plan-limit-notice.d.ts +10 -10
- package/dist/billing/plan-limit-toast.d.ts +143 -0
- package/dist/billing/plan-limit-toast.js +40 -0
- package/dist/billing/plan-limit-toast.js.map +1 -0
- package/dist/billing/subscription-actions.d.ts +38 -15
- package/dist/billing/subscription-actions.js +9 -2
- package/dist/billing/subscription-actions.js.map +1 -1
- package/dist/billing/subscription-status-chip.d.ts +9 -9
- package/dist/bin/eifi1-pay-page.mjs +166 -0
- package/dist/chart.d.ts +10 -10
- package/dist/components/account-chips.d.ts +6 -1
- package/dist/components/account-settings.d.ts +4 -1
- package/dist/components/account-settings.js +2 -1
- package/dist/components/account-settings.js.map +1 -1
- package/dist/components/amount-input.d.ts +10 -10
- package/dist/components/autocomplete.d.ts +2 -1
- package/dist/components/autocomplete.js +3 -1
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/button-group.d.ts +10 -10
- package/dist/components/button-group.js +1 -1
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/calculator.d.ts +10 -10
- package/dist/components/calculator.js +3 -3
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/checkbox-group.d.ts +2 -1
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/checkbox.d.ts +2 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/chip.d.ts +2 -1
- package/dist/components/chip.js +19 -17
- package/dist/components/chip.js.map +1 -1
- package/dist/components/choice-card.d.ts +3 -1
- package/dist/components/choice-card.js +1 -1
- package/dist/components/choice-card.js.map +1 -1
- package/dist/components/combobox.d.ts +4 -3
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/confirm-dialog.d.ts +10 -10
- package/dist/components/confirm-dialog.js +6 -3
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/copy-button.d.ts +11 -11
- package/dist/components/country-select.d.ts +2 -1
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/danger-confirm.d.ts +10 -10
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-cells.d.ts +12 -1
- package/dist/components/data-table-filter-popover.d.ts +12 -1
- package/dist/components/data-table-filters.d.ts +12 -1
- package/dist/components/data-table-labels.d.ts +12 -1
- package/dist/components/data-table-pagination.d.ts +12 -1
- package/dist/components/data-table.d.ts +12 -1
- package/dist/components/data-table.js +3 -3
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +6 -4
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/entity-combobox.d.ts +3 -2
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/facing-pair.d.ts +10 -10
- package/dist/components/field-parts.d.ts +32 -4
- package/dist/components/field-parts.js +54 -19
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/file-button.d.ts +10 -10
- package/dist/components/file-button.js +3 -2
- package/dist/components/file-button.js.map +1 -1
- package/dist/components/file-dropzone.d.ts +11 -11
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/floating-panel.js +5 -5
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/form-actions.d.ts +9 -9
- package/dist/components/form-actions.js +3 -3
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/iban-input.d.ts +10 -10
- package/dist/components/inline-edit-field.d.ts +2 -1
- package/dist/components/inline-edit-field.js +6 -6
- package/dist/components/inline-edit-field.js.map +1 -1
- package/dist/components/language-select.d.ts +10 -10
- package/dist/components/legal-page.d.ts +10 -10
- package/dist/components/legal.d.ts +10 -10
- package/dist/components/list.d.ts +2 -1
- package/dist/components/list.js +4 -5
- package/dist/components/list.js.map +1 -1
- package/dist/components/money-field.d.ts +10 -10
- package/dist/components/month-picker.js +54 -44
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.d.ts +3 -2
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/number-field.d.ts +10 -10
- package/dist/components/number-input.d.ts +10 -10
- package/dist/components/numpad-sheet.d.ts +10 -10
- package/dist/components/numpad-sheet.js +2 -2
- package/dist/components/numpad-sheet.js.map +1 -1
- package/dist/components/phone-input.d.ts +10 -10
- package/dist/components/row-actions.d.ts +5 -5
- package/dist/components/row-actions.js +130 -32
- package/dist/components/row-actions.js.map +1 -1
- package/dist/components/series-chart.d.ts +10 -10
- package/dist/components/settings-fields.d.ts +10 -10
- package/dist/components/share-card.d.ts +7 -7
- package/dist/components/share-card.js +26 -10
- package/dist/components/share-card.js.map +1 -1
- package/dist/components/status-dot.d.ts +1 -0
- package/dist/components/status-dot.js +2 -2
- package/dist/components/status-dot.js.map +1 -1
- package/dist/components/swatch-picker.d.ts +2 -1
- package/dist/components/swatch-picker.js.map +1 -1
- package/dist/components/swipeable-row.d.ts +88 -17
- package/dist/components/swipeable-row.js +46 -9
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/switch.d.ts +2 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.d.ts +2 -1
- package/dist/components/table.js +6 -0
- package/dist/components/table.js.map +1 -1
- package/dist/components/text-link.d.ts +9 -9
- package/dist/components/time-input.d.ts +10 -10
- package/dist/components/toggle-group.d.ts +2 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/translation-review-editor.d.ts +4 -0
- package/dist/components/translation-review-editor.js +4 -3
- package/dist/components/translation-review-editor.js.map +1 -1
- package/dist/components/translation-review-parts.d.ts +1 -0
- package/dist/components/translation-review.d.ts +1 -0
- package/dist/components/translation-review.js +15 -18
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/ui.d.ts +9 -9
- package/dist/components/ui.js +47 -27
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-table-state.d.ts +12 -1
- package/dist/components/user-avatar.d.ts +1 -0
- package/dist/components/write-lock.d.ts +101 -13
- package/dist/components/write-lock.js +37 -13
- package/dist/components/write-lock.js.map +1 -1
- package/dist/{data-table-labels-kpAAVi6g.d.ts → data-table-labels-BJ5JE_X2.d.ts} +17 -0
- package/dist/data-table.d.ts +12 -1
- package/dist/{delete-account-setting-Dy4kJgUm.d.ts → delete-account-setting-DiPX4Vue.d.ts} +355 -41
- package/dist/feedback/feedback-attachment.d.ts +10 -10
- package/dist/feedback/feedback-attachment.js +7 -7
- package/dist/feedback/feedback-attachment.js.map +1 -1
- package/dist/feedback/feedback-context.d.ts +10 -10
- package/dist/feedback/feedback-crash.d.ts +10 -10
- package/dist/feedback/feedback-dialog.d.ts +10 -10
- package/dist/feedback/feedback-inbox.d.ts +9 -9
- package/dist/feedback/feedback-inbox.js +7 -3
- package/dist/feedback/feedback-inbox.js.map +1 -1
- package/dist/feedback/feedback-labels.d.ts +10 -10
- package/dist/feedback/feedback-menu.d.ts +3 -3
- package/dist/feedback/feedback-record.d.ts +10 -10
- package/dist/feedback/feedback-row-detail.d.ts +10 -10
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-status-undo.d.ts +10 -10
- package/dist/feedback/feedback-submit.d.ts +10 -10
- package/dist/feedback/feedback-swipe.d.ts +10 -10
- package/dist/feedback/feedback-swipe.js +3 -6
- package/dist/feedback/feedback-swipe.js.map +1 -1
- package/dist/feedback/feedback-table.d.ts +10 -10
- package/dist/feedback/feedback-table.js.map +1 -1
- package/dist/feedback/feedback-thread.d.ts +10 -10
- package/dist/feedback.d.ts +10 -10
- package/dist/hooks/use-file-drop.d.ts +10 -10
- package/dist/i18n/defaults.d.ts +10 -10
- package/dist/i18n/defaults.js +2 -0
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.d.ts +10 -10
- package/dist/i18n/german.js +34 -1
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +4 -4
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/languages.d.ts +10 -10
- package/dist/i18n/locales/de-CH.d.ts +10 -10
- package/dist/i18n/locales/en.d.ts +10 -10
- package/dist/i18n/locales/es.d.ts +10 -10
- package/dist/i18n/locales/es.js +34 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +10 -10
- package/dist/i18n/locales/fr.js +35 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +10 -10
- package/dist/i18n/locales/hu.js +36 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +10 -10
- package/dist/i18n/locales/it.js +34 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +10 -10
- package/dist/i18n/locales/zh.js +34 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.d.ts +10 -10
- package/dist/i18n/review.js +8 -1
- package/dist/i18n/review.js.map +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.js +40 -2
- package/dist/index.js.map +1 -1
- package/dist/landing/landing-actions.d.ts +10 -10
- package/dist/landing/landing-sections.d.ts +10 -10
- package/dist/landing/public-header.d.ts +10 -10
- package/dist/landing/routing.d.ts +10 -10
- package/dist/pay/.well-known/apple-developer-merchantid-domain-association +1 -0
- package/dist/pay/index.html +30 -0
- package/dist/pay/pay.css +126 -0
- package/dist/pay/pay.js +198 -0
- package/dist/rhf/fields.d.ts +10 -10
- package/dist/rhf/form.d.ts +10 -10
- package/dist/rhf.d.ts +10 -10
- package/dist/settings/settings-section.d.ts +10 -10
- package/dist/shell/app-shell.d.ts +9 -9
- package/dist/shell/top-bar-brand.d.ts +10 -10
- package/dist/shell/topbar-action-menu.d.ts +1 -0
- package/dist/shell.d.ts +10 -10
- package/dist/testing/css-variables.d.ts +74 -0
- package/dist/testing/css-variables.generated.d.ts +7 -0
- package/dist/testing/css-variables.generated.js +8 -0
- package/dist/testing/css-variables.generated.js.map +1 -0
- package/dist/testing/css-variables.js +93 -0
- package/dist/testing/css-variables.js.map +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +12 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/theme/contrast-tokens.d.ts +44 -1
- package/dist/theme/contrast-tokens.js +21 -0
- package/dist/theme/contrast-tokens.js.map +1 -1
- package/dist/theme/contrast.d.ts +2 -2
- package/dist/theme/palette-derive.js +60 -11
- package/dist/theme/palette-derive.js.map +1 -1
- package/dist/theme/palette-presets.js +45 -43
- package/dist/theme/palette-presets.js.map +1 -1
- package/dist/wizard/stepper-nav.d.ts +11 -11
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard.d.ts +10 -10
- package/package.json +10 -2
- package/src/account/delete-account-setting.tsx +6 -1
- package/src/account/email-change-setting.tsx +9 -3
- package/src/account/sessions-setting.tsx +7 -2
- package/src/admin/admin-action-confirm.tsx +2 -1
- package/src/admin/invitations-panel.tsx +9 -3
- package/src/admin/plan-change.tsx +459 -0
- package/src/admin/reviewer-scope-editor.tsx +2 -1
- package/src/admin/role-select.tsx +2 -1
- package/src/admin/user-roster.tsx +5 -3
- package/src/auth/auth-errors.ts +25 -2
- package/src/auth/complete-name-dialog.tsx +6 -2
- package/src/billing/billing-banner.tsx +3 -1
- package/src/billing/billing-labels.ts +45 -0
- package/src/billing/billing-lock.ts +36 -3
- package/src/billing/billing-overview.ts +58 -0
- package/src/billing/checkout-processing.ts +391 -0
- package/src/billing/checkout-return.ts +90 -0
- package/src/billing/pay-page.ts +242 -0
- package/src/billing/plan-limit-toast.tsx +91 -0
- package/src/billing/subscription-actions.tsx +41 -8
- package/src/components/account-settings.tsx +6 -2
- package/src/components/autocomplete.tsx +5 -2
- package/src/components/button-group.tsx +4 -1
- package/src/components/calculator.tsx +10 -6
- package/src/components/checkbox-group.tsx +2 -2
- package/src/components/checkbox.tsx +2 -1
- package/src/components/chip.tsx +37 -32
- package/src/components/choice-card.tsx +4 -2
- package/src/components/combobox.tsx +4 -4
- package/src/components/confirm-dialog.tsx +13 -6
- package/src/components/country-select.tsx +2 -2
- package/src/components/danger-confirm.tsx +2 -2
- package/src/components/data-table.tsx +20 -9
- package/src/components/date-picker.tsx +10 -7
- package/src/components/entity-combobox.tsx +3 -3
- package/src/components/field-parts.tsx +61 -14
- package/src/components/file-button.tsx +5 -4
- package/src/components/file-dropzone.tsx +2 -2
- package/src/components/floating-panel.tsx +7 -5
- package/src/components/form-actions.tsx +12 -5
- package/src/components/inline-edit-field.tsx +13 -13
- package/src/components/list.tsx +10 -9
- package/src/components/month-picker.tsx +8 -2
- package/src/components/multi-entity-combobox.tsx +3 -3
- package/src/components/numpad-sheet.tsx +8 -4
- package/src/components/row-actions.tsx +208 -58
- package/src/components/share-card.tsx +67 -13
- package/src/components/status-dot.tsx +7 -7
- package/src/components/swatch-picker.tsx +2 -2
- package/src/components/swipeable-row.tsx +138 -27
- package/src/components/switch.tsx +2 -1
- package/src/components/table.tsx +8 -1
- package/src/components/toggle-group.tsx +5 -3
- package/src/components/translation-review-editor.tsx +8 -3
- package/src/components/translation-review.tsx +18 -22
- package/src/components/ui.tsx +92 -43
- package/src/components/write-lock.tsx +150 -24
- package/src/feedback/feedback-attachment.tsx +13 -9
- package/src/feedback/feedback-inbox.tsx +10 -6
- package/src/feedback/feedback-row-detail.tsx +3 -2
- package/src/feedback/feedback-swipe.tsx +6 -11
- package/src/feedback/feedback-table.tsx +2 -1
- package/src/i18n/defaults.ts +2 -0
- package/src/i18n/german.ts +38 -0
- package/src/i18n/kit-labels.tsx +4 -0
- package/src/i18n/locales/es.ts +34 -0
- package/src/i18n/locales/fr.ts +39 -0
- package/src/i18n/locales/hu.ts +37 -0
- package/src/i18n/locales/it.ts +35 -0
- package/src/i18n/locales/zh.ts +33 -0
- package/src/i18n/review.ts +7 -0
- package/src/index.ts +48 -4
- package/src/testing/css-variables.generated.ts +112 -0
- package/src/testing/css-variables.ts +191 -0
- package/src/testing/index.ts +13 -0
- package/src/theme/contrast-tokens.ts +53 -2
- package/src/theme/palette-derive.ts +87 -10
- package/src/theme/palette-presets.ts +45 -43
- package/src/wizard/stepper-nav.tsx +2 -1
- package/tokens.css +306 -46
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/billing/plan-limit-toast.tsx"],"sourcesContent":["import { useCallback } from \"react\";\n\nimport { useKitLocale } from \"../i18n/kit-labels\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { documentNavigation } from \"../lib/document-navigation\";\nimport { formatNumber } from \"../lib/format\";\nimport { toast } from \"../components/toast\";\nimport type { ToastAction, ToastId } from \"../components/toast\";\nimport { useBillingLabels } from \"./billing-labels\";\nimport type { BillingLabels } from \"./billing-labels\";\nimport type { PlanLimitRefusal } from \"./plan-limit\";\nimport { planLimitMailto } from \"./plan-limit-notice\";\n\nexport interface PlanLimitToastOptions {\n /** `upgrade`: plans are bought — \"Choose a plan\". `contact`: the operator grants them\n * by hand — \"Ask for more\", a mail to support. */\n mode: \"upgrade\" | \"contact\";\n /** `upgrade`: the app's navigation to its subscription page (the kit has no router).\n * Left out, the toast has no action. */\n onChoosePlan?: () => void;\n /** `contact`: support@ the app's domain, opened as `planLimitMailto(email,\n * contactSubject(name))`. Left out, the toast has no action. */\n email?: string;\n /** The app's word per dimension: `{ budgets: \"Budgets\", scans: \"Scans this month\" }`.\n * A dimension without one is named by its key. */\n dimensionLabels?: Readonly<Record<string, string>>;\n /** How a figure is written — kastlan's storage limit is bytes. Default: a number in\n * the kit's locale. */\n formatValue?: (dimension: string, value: number) => string;\n /** Prop > `<UiKitProvider labels={{ billing }}>` > English. */\n labels?: LabelOverride<BillingLabels>;\n}\n\n/**\n * `PlanLimitNotice`'s words as a toast (docs/billing-harmonization.md §14.11), for a\n * refused create with no room for the notice — a row's button, a share target: \"Plan\n * limit reached\", what to do, the figure when the refusal has one (\"Budgets: 3 of 3\"),\n * and the mode's action.\n *\n * const showLimit = usePlanLimitToast({\n * mode: \"upgrade\",\n * onChoosePlan: () => navigate(\"/settings/subscription\"),\n * dimensionLabels: { budgets: t(\"billing.dim_budgets\") },\n * });\n * catch (err) { const hit = isPlanLimit(err); if (hit) showLimit(hit); }\n *\n * One toast per dimension: its id is `plan-limit:<dimension>`, so a repeat replaces it\n * in place instead of stacking a second (keksdose's own hook stacked). Called with no\n * hit, it says the words without a figure, under `plan-limit`. No `limit` in the\n * refusal, no figure line; keksdose's legacy `plan_budget_limit` reads as `budgets`\n * (`isPlanLimit`, §12.16). Returns the toast's id.\n */\nexport function usePlanLimitToast(options: PlanLimitToastOptions): (hit?: PlanLimitRefusal) => ToastId {\n const { mode, onChoosePlan, email, dimensionLabels, formatValue, labels: labelsProp } = options;\n const labels = useBillingLabels(labelsProp);\n const locale = useKitLocale();\n return useCallback(\n (hit?: PlanLimitRefusal) => {\n const dimension = hit?.dimension ?? \"\";\n const name = dimensionLabels?.[dimension] ?? dimension;\n const figure = (value: number) =>\n formatValue ? formatValue(dimension, value) : formatNumber(value, { locale });\n // A body without `used` was refused for being AT the limit (PlanLimitNotice's rule).\n const usage =\n hit?.limit !== undefined\n ? labels.limitUsageLine(name, figure(hit.used ?? hit.limit), figure(hit.limit))\n : undefined;\n const action: ToastAction | undefined =\n mode === \"upgrade\"\n ? onChoosePlan && { label: labels.choosePlan, onClick: () => onChoosePlan() }\n : email\n ? {\n label: labels.askForMore,\n // A mailto: hands the address to the reader's mail client; the page stays.\n onClick: () => documentNavigation.replace(planLimitMailto(email, labels.contactSubject(name))),\n }\n : undefined;\n return toast.warning(labels.limitReached, {\n id: dimension ? `plan-limit:${dimension}` : \"plan-limit\",\n description: (\n <span data-plan-limit-mode={mode} data-dimension={dimension || undefined}>\n <span className=\"block\">{mode === \"upgrade\" ? labels.limitUpgrade : labels.limitContact}</span>\n {usage !== undefined && <span className=\"block tabular-nums\">{usage}</span>}\n </span>\n ),\n action,\n });\n },\n [mode, onChoosePlan, email, dimensionLabels, formatValue, labels, locale],\n );\n}\n"],"mappings":";AAgFU,SACE,KADF;AAhFV,SAAS,mBAAmB;AAE5B,SAAS,oBAAoB;AAE7B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AAEtB,SAAS,wBAAwB;AAGjC,SAAS,uBAAuB;AAyCzB,SAAS,kBAAkB,SAAqE;AACrG,QAAM,EAAE,MAAM,cAAc,OAAO,iBAAiB,aAAa,QAAQ,WAAW,IAAI;AACxF,QAAM,SAAS,iBAAiB,UAAU;AAC1C,QAAM,SAAS,aAAa;AAC5B,SAAO;AAAA,IACL,CAAC,QAA2B;AAC1B,YAAM,YAAY,KAAK,aAAa;AACpC,YAAM,OAAO,kBAAkB,SAAS,KAAK;AAC7C,YAAM,SAAS,CAAC,UACd,cAAc,YAAY,WAAW,KAAK,IAAI,aAAa,OAAO,EAAE,OAAO,CAAC;AAE9E,YAAM,QACJ,KAAK,UAAU,SACX,OAAO,eAAe,MAAM,OAAO,IAAI,QAAQ,IAAI,KAAK,GAAG,OAAO,IAAI,KAAK,CAAC,IAC5E;AACN,YAAM,SACJ,SAAS,YACL,gBAAgB,EAAE,OAAO,OAAO,YAAY,SAAS,MAAM,aAAa,EAAE,IAC1E,QACE;AAAA,QACE,OAAO,OAAO;AAAA;AAAA,QAEd,SAAS,MAAM,mBAAmB,QAAQ,gBAAgB,OAAO,OAAO,eAAe,IAAI,CAAC,CAAC;AAAA,MAC/F,IACA;AACR,aAAO,MAAM,QAAQ,OAAO,cAAc;AAAA,QACxC,IAAI,YAAY,cAAc,SAAS,KAAK;AAAA,QAC5C,aACE,qBAAC,UAAK,wBAAsB,MAAM,kBAAgB,aAAa,QAC7D;AAAA,8BAAC,UAAK,WAAU,SAAS,mBAAS,YAAY,OAAO,eAAe,OAAO,cAAa;AAAA,UACvF,UAAU,UAAa,oBAAC,UAAK,WAAU,sBAAsB,iBAAM;AAAA,WACtE;AAAA,QAEF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,CAAC,MAAM,cAAc,OAAO,iBAAiB,aAAa,QAAQ,MAAM;AAAA,EAC1E;AACF;","names":[]}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { e5 as LabelOverride, bH as BillingLabels } from '../delete-account-setting-DiPX4Vue.js';
|
|
4
|
+
import { PortalTarget } from './billing-overview.js';
|
|
4
5
|
import '../components/tooltip.js';
|
|
5
6
|
import '../hooks/use-anchored-rect.js';
|
|
6
7
|
import '../lib/clipping.js';
|
|
7
|
-
import '../data-table-labels-
|
|
8
|
+
import '../data-table-labels-BJ5JE_X2.js';
|
|
8
9
|
import '../components/data-table-sort.js';
|
|
9
10
|
import '../components/swipeable-row.js';
|
|
11
|
+
import '../components/status-dot.js';
|
|
12
|
+
import '../components/progress-bar.js';
|
|
13
|
+
import '../components/signed-amount.js';
|
|
14
|
+
import '../components/stat-tile.js';
|
|
15
|
+
import '../components/chip.js';
|
|
16
|
+
import 'lucide-react';
|
|
17
|
+
import '../components/field-parts.js';
|
|
18
|
+
import '../components/write-lock.js';
|
|
10
19
|
import '../components/mini-calendar.js';
|
|
11
20
|
import '../components/calendar-heatmap.js';
|
|
12
21
|
import '../components/popover.js';
|
|
13
22
|
import '../hooks/use-breakpoint.js';
|
|
14
|
-
import '../components/chip.js';
|
|
15
|
-
import 'lucide-react';
|
|
16
|
-
import '../components/field-parts.js';
|
|
17
23
|
import '../components/field-sync.js';
|
|
18
24
|
import '../wizard/types.js';
|
|
19
25
|
import '../tour/tour.js';
|
|
@@ -25,7 +31,6 @@ import '../components/page-contents.js';
|
|
|
25
31
|
import '../components/series-chart-labels.js';
|
|
26
32
|
import '../components/pie-chart-labels.js';
|
|
27
33
|
import '../components/sparkline.js';
|
|
28
|
-
import '../components/stat-tile.js';
|
|
29
34
|
import '../components/signature-pad.js';
|
|
30
35
|
import '../components/password-strength.js';
|
|
31
36
|
import '../components/swatch-picker.js';
|
|
@@ -37,9 +42,6 @@ import '../hooks/use-search-param-state.js';
|
|
|
37
42
|
import '../components/measured-grid.js';
|
|
38
43
|
import '../components/user-avatar.js';
|
|
39
44
|
import '../lib/person-name.js';
|
|
40
|
-
import '../components/status-dot.js';
|
|
41
|
-
import '../components/progress-bar.js';
|
|
42
|
-
import '../components/signed-amount.js';
|
|
43
45
|
import '../shell/topbar-action-menu.js';
|
|
44
46
|
import '../components/menu-item.js';
|
|
45
47
|
import '../components/floating-panel.js';
|
|
@@ -55,7 +57,6 @@ import '../components/error-boundary.js';
|
|
|
55
57
|
import '../components/authed-image.js';
|
|
56
58
|
import '../components/image-grid.js';
|
|
57
59
|
import '../components/lightbox.js';
|
|
58
|
-
import '../components/write-lock.js';
|
|
59
60
|
import '../auth/sign-in-form.js';
|
|
60
61
|
import '../landing/access.js';
|
|
61
62
|
import '../landing/landing-labels.js';
|
|
@@ -99,18 +100,36 @@ import '../components/column-mapper.js';
|
|
|
99
100
|
import '../lib/column-mapping.js';
|
|
100
101
|
import '../lib/table-text.js';
|
|
101
102
|
import '../components/focus-ring.js';
|
|
103
|
+
import './plan-price.js';
|
|
102
104
|
|
|
103
105
|
interface SubscriptionActionsProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
104
106
|
/** "Payment and invoices", as a link — or {@link onManage}. Without either, none. */
|
|
105
107
|
manageHref?: string;
|
|
106
|
-
/** "Payment and invoices", as the app's call: `POST /billing/portal
|
|
107
|
-
* `url` (§4). The kit sends no
|
|
108
|
+
/** "Payment and invoices", as the app's call: `POST /billing/portal` with
|
|
109
|
+
* `{target: "overview"}`, then off to its `url` (§4, §14.5). The kit sends no
|
|
110
|
+
* request. */
|
|
108
111
|
onManage?: () => void;
|
|
109
112
|
/** "Cancel subscription", as a link — or {@link onCancel}. Without either, none. */
|
|
110
113
|
cancelHref?: string;
|
|
111
|
-
/** "Cancel subscription", as the app's call
|
|
112
|
-
* provider's cancel and withdrawal functions
|
|
114
|
+
/** "Cancel subscription", as the app's call: the portal again, with `{target:
|
|
115
|
+
* "cancel"}` — its cancel link, where the provider's cancel and withdrawal functions
|
|
116
|
+
* are (§12.26, §14.5). Not the overview. */
|
|
113
117
|
onCancel?: () => void;
|
|
118
|
+
/**
|
|
119
|
+
* Both, as one call that says where to ({@link PortalTarget}, the body of
|
|
120
|
+
* `POST /billing/portal`): `"overview"` for "Payment and invoices",
|
|
121
|
+
* `"cancel"` for "Cancel subscription" — so the target can't be mixed up (kastlan's
|
|
122
|
+
* cancel opened the overview). {@link onManage} and {@link onCancel} win over it.
|
|
123
|
+
*/
|
|
124
|
+
onPortal?: (target: PortalTarget) => void;
|
|
125
|
+
/**
|
|
126
|
+
* The overview's `at_provider` (§14.5): whether the payer has reached the provider.
|
|
127
|
+
* `false`: no customer there yet, so nothing to open — a caption (`notAtProvider`)
|
|
128
|
+
* stands in place of both actions. `true`: both show, WHATEVER the status or source —
|
|
129
|
+
* a payer who bought under a grant keeps the way to the invoices and to "Cancel"
|
|
130
|
+
* (§12.26). Default true (0.32's behaviour).
|
|
131
|
+
*/
|
|
132
|
+
atProvider?: boolean;
|
|
114
133
|
/** Which of the two is under way: its spinner, no second press. */
|
|
115
134
|
pending?: "manage" | "cancel" | null;
|
|
116
135
|
/** Prop > `<UiKitProvider labels={{ billing }}>` > English. */
|
|
@@ -127,7 +146,11 @@ interface SubscriptionActionsProps extends Omit<ComponentPropsWithoutRef<"div">,
|
|
|
127
146
|
*
|
|
128
147
|
* Neither takes the write lock: a read-only payer must be able to pay, leave or cancel
|
|
129
148
|
* (§3.3).
|
|
149
|
+
*
|
|
150
|
+
* Before the payer has reached the provider (`atProvider={false}`, a trial without a
|
|
151
|
+
* card, a beta) there is no portal to open: the part says so in a caption instead of
|
|
152
|
+
* offering two buttons that could only end in `409 billing_not_at_provider`.
|
|
130
153
|
*/
|
|
131
|
-
declare function SubscriptionActions({ manageHref, onManage, cancelHref, onCancel, pending, labels: labelsProp, className, ...rest }: SubscriptionActionsProps): react.JSX.Element | null;
|
|
154
|
+
declare function SubscriptionActions({ manageHref, onManage, cancelHref, onCancel, onPortal, atProvider, pending, labels: labelsProp, className, ...rest }: SubscriptionActionsProps): react.JSX.Element | null;
|
|
132
155
|
|
|
133
156
|
export { SubscriptionActions, type SubscriptionActionsProps };
|
|
@@ -8,14 +8,21 @@ function SubscriptionActions({
|
|
|
8
8
|
onManage,
|
|
9
9
|
cancelHref,
|
|
10
10
|
onCancel,
|
|
11
|
+
onPortal,
|
|
12
|
+
atProvider = true,
|
|
11
13
|
pending,
|
|
12
14
|
labels: labelsProp,
|
|
13
15
|
className,
|
|
14
16
|
...rest
|
|
15
17
|
}) {
|
|
16
18
|
const labels = useBillingLabels(labelsProp);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
if (!atProvider) {
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { ...rest, "data-at-provider": "false", className: cn("text-sm text-[var(--text-muted)]", className), children: /* @__PURE__ */ jsx("p", { children: labels.notAtProvider }) });
|
|
21
|
+
}
|
|
22
|
+
const manageCall = onManage ?? (onPortal ? () => onPortal("overview") : void 0);
|
|
23
|
+
const cancelCall = onCancel ?? (onPortal ? () => onPortal("cancel") : void 0);
|
|
24
|
+
const manage = manageHref !== void 0 ? /* @__PURE__ */ jsx(Button, { href: manageHref, variant: "secondary", children: labels.manage }) : manageCall !== void 0 ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "secondary", onClick: manageCall, pending: pending === "manage", children: labels.manage }) : null;
|
|
25
|
+
const cancel = cancelHref !== void 0 ? /* @__PURE__ */ jsx(Button, { href: cancelHref, variant: "link", tone: "danger", children: labels.cancel }) : cancelCall !== void 0 ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "link", tone: "danger", onClick: cancelCall, pending: pending === "cancel", children: labels.cancel }) : null;
|
|
19
26
|
if (!manage && !cancel) return null;
|
|
20
27
|
return /* @__PURE__ */ jsxs("div", { ...rest, className: cn("flex flex-wrap items-center gap-x-4 gap-y-2", className), children: [
|
|
21
28
|
manage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/billing/subscription-actions.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\n\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"../components/ui\";\nimport { useBillingLabels } from \"./billing-labels\";\nimport type { BillingLabels } from \"./billing-labels\";\n\nexport interface SubscriptionActionsProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** \"Payment and invoices\", as a link — or {@link onManage}. Without either, none. */\n manageHref?: string;\n /** \"Payment and invoices\", as the app's call: `POST /billing/portal`, then off to its
|
|
1
|
+
{"version":3,"sources":["../../src/billing/subscription-actions.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\n\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"../components/ui\";\nimport { useBillingLabels } from \"./billing-labels\";\nimport type { BillingLabels } from \"./billing-labels\";\nimport type { PortalTarget } from \"./billing-overview\";\n\nexport interface SubscriptionActionsProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** \"Payment and invoices\", as a link — or {@link onManage}. Without either, none. */\n manageHref?: string;\n /** \"Payment and invoices\", as the app's call: `POST /billing/portal` with\n * `{target: \"overview\"}`, then off to its `url` (§4, §14.5). The kit sends no\n * request. */\n onManage?: () => void;\n /** \"Cancel subscription\", as a link — or {@link onCancel}. Without either, none. */\n cancelHref?: string;\n /** \"Cancel subscription\", as the app's call: the portal again, with `{target:\n * \"cancel\"}` — its cancel link, where the provider's cancel and withdrawal functions\n * are (§12.26, §14.5). Not the overview. */\n onCancel?: () => void;\n /**\n * Both, as one call that says where to ({@link PortalTarget}, the body of\n * `POST /billing/portal`): `\"overview\"` for \"Payment and invoices\",\n * `\"cancel\"` for \"Cancel subscription\" — so the target can't be mixed up (kastlan's\n * cancel opened the overview). {@link onManage} and {@link onCancel} win over it.\n */\n onPortal?: (target: PortalTarget) => void;\n /**\n * The overview's `at_provider` (§14.5): whether the payer has reached the provider.\n * `false`: no customer there yet, so nothing to open — a caption (`notAtProvider`)\n * stands in place of both actions. `true`: both show, WHATEVER the status or source —\n * a payer who bought under a grant keeps the way to the invoices and to \"Cancel\"\n * (§12.26). Default true (0.32's behaviour).\n */\n atProvider?: boolean;\n /** Which of the two is under way: its spinner, no second press. */\n pending?: \"manage\" | \"cancel\" | null;\n /** Prop > `<UiKitProvider labels={{ billing }}>` > English. */\n labels?: LabelOverride<BillingLabels>;\n}\n\n/**\n * The two ways to the provider's hosted portal on the subscription page\n * (docs/billing-harmonization.md §2.8, §7, §12.26): \"Payment and invoices\" — the payment\n * method and the invoices live there, never in the app — and a VISIBLE \"Cancel\n * subscription\". Consumer law wants the second in plain sight: Germany's cancellation\n * button (§312k BGB) and the EU withdrawal function (Directive (EU) 2023/2673, from\n * 19 June 2026) are in the portal, and the app's page must not hide the way there behind\n * \"manage\".\n *\n * Neither takes the write lock: a read-only payer must be able to pay, leave or cancel\n * (§3.3).\n *\n * Before the payer has reached the provider (`atProvider={false}`, a trial without a\n * card, a beta) there is no portal to open: the part says so in a caption instead of\n * offering two buttons that could only end in `409 billing_not_at_provider`.\n */\nexport function SubscriptionActions({\n manageHref,\n onManage,\n cancelHref,\n onCancel,\n onPortal,\n atProvider = true,\n pending,\n labels: labelsProp,\n className,\n ...rest\n}: SubscriptionActionsProps) {\n const labels = useBillingLabels(labelsProp);\n if (!atProvider) {\n return (\n <div {...rest} data-at-provider=\"false\" className={cn(\"text-sm text-[var(--text-muted)]\", className)}>\n <p>{labels.notAtProvider}</p>\n </div>\n );\n }\n const manageCall = onManage ?? (onPortal ? () => onPortal(\"overview\") : undefined);\n const cancelCall = onCancel ?? (onPortal ? () => onPortal(\"cancel\") : undefined);\n const manage =\n manageHref !== undefined ? (\n <Button href={manageHref} variant=\"secondary\">\n {labels.manage}\n </Button>\n ) : manageCall !== undefined ? (\n <Button type=\"button\" variant=\"secondary\" onClick={manageCall} pending={pending === \"manage\"}>\n {labels.manage}\n </Button>\n ) : null;\n const cancel =\n cancelHref !== undefined ? (\n <Button href={cancelHref} variant=\"link\" tone=\"danger\">\n {labels.cancel}\n </Button>\n ) : cancelCall !== undefined ? (\n <Button type=\"button\" variant=\"link\" tone=\"danger\" onClick={cancelCall} pending={pending === \"cancel\"}>\n {labels.cancel}\n </Button>\n ) : null;\n if (!manage && !cancel) return null;\n return (\n <div {...rest} className={cn(\"flex flex-wrap items-center gap-x-4 gap-y-2\", className)}>\n {manage}\n {cancel}\n </div>\n );\n}\n"],"mappings":";AA2EQ,cA4BJ,YA5BI;AAxER,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAsD1B,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAA6B;AAC3B,QAAM,SAAS,iBAAiB,UAAU;AAC1C,MAAI,CAAC,YAAY;AACf,WACE,oBAAC,SAAK,GAAG,MAAM,oBAAiB,SAAQ,WAAW,GAAG,oCAAoC,SAAS,GACjG,8BAAC,OAAG,iBAAO,eAAc,GAC3B;AAAA,EAEJ;AACA,QAAM,aAAa,aAAa,WAAW,MAAM,SAAS,UAAU,IAAI;AACxE,QAAM,aAAa,aAAa,WAAW,MAAM,SAAS,QAAQ,IAAI;AACtE,QAAM,SACJ,eAAe,SACb,oBAAC,UAAO,MAAM,YAAY,SAAQ,aAC/B,iBAAO,QACV,IACE,eAAe,SACjB,oBAAC,UAAO,MAAK,UAAS,SAAQ,aAAY,SAAS,YAAY,SAAS,YAAY,UACjF,iBAAO,QACV,IACE;AACN,QAAM,SACJ,eAAe,SACb,oBAAC,UAAO,MAAM,YAAY,SAAQ,QAAO,MAAK,UAC3C,iBAAO,QACV,IACE,eAAe,SACjB,oBAAC,UAAO,MAAK,UAAS,SAAQ,QAAO,MAAK,UAAS,SAAS,YAAY,SAAS,YAAY,UAC1F,iBAAO,QACV,IACE;AACN,MAAI,CAAC,UAAU,CAAC,OAAQ,QAAO;AAC/B,SACE,qBAAC,SAAK,GAAG,MAAM,WAAW,GAAG,+CAA+C,SAAS,GAClF;AAAA;AAAA,IACA;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { fn as SubscriptionStatus, e5 as LabelOverride, bH as BillingLabels } from '../delete-account-setting-DiPX4Vue.js';
|
|
4
4
|
import { ChipTone, ChipSize, ChipVariant, ChipShape } from '../components/chip.js';
|
|
5
5
|
import '../components/tooltip.js';
|
|
6
6
|
import '../hooks/use-anchored-rect.js';
|
|
7
7
|
import '../lib/clipping.js';
|
|
8
|
-
import '../data-table-labels-
|
|
8
|
+
import '../data-table-labels-BJ5JE_X2.js';
|
|
9
9
|
import '../components/data-table-sort.js';
|
|
10
10
|
import '../components/swipeable-row.js';
|
|
11
|
+
import '../components/status-dot.js';
|
|
12
|
+
import '../components/progress-bar.js';
|
|
13
|
+
import '../components/signed-amount.js';
|
|
14
|
+
import '../components/stat-tile.js';
|
|
15
|
+
import 'lucide-react';
|
|
16
|
+
import '../components/field-parts.js';
|
|
17
|
+
import '../components/write-lock.js';
|
|
11
18
|
import '../components/mini-calendar.js';
|
|
12
19
|
import '../components/calendar-heatmap.js';
|
|
13
20
|
import '../components/popover.js';
|
|
@@ -23,7 +30,6 @@ import '../components/page-contents.js';
|
|
|
23
30
|
import '../components/series-chart-labels.js';
|
|
24
31
|
import '../components/pie-chart-labels.js';
|
|
25
32
|
import '../components/sparkline.js';
|
|
26
|
-
import '../components/stat-tile.js';
|
|
27
33
|
import '../components/signature-pad.js';
|
|
28
34
|
import '../components/password-strength.js';
|
|
29
35
|
import '../components/swatch-picker.js';
|
|
@@ -33,13 +39,8 @@ import '../components/dialog-frame.js';
|
|
|
33
39
|
import '../components/modal.js';
|
|
34
40
|
import '../hooks/use-search-param-state.js';
|
|
35
41
|
import '../components/measured-grid.js';
|
|
36
|
-
import 'lucide-react';
|
|
37
42
|
import '../components/user-avatar.js';
|
|
38
43
|
import '../lib/person-name.js';
|
|
39
|
-
import '../components/status-dot.js';
|
|
40
|
-
import '../components/progress-bar.js';
|
|
41
|
-
import '../components/signed-amount.js';
|
|
42
|
-
import '../components/field-parts.js';
|
|
43
44
|
import '../shell/topbar-action-menu.js';
|
|
44
45
|
import '../components/menu-item.js';
|
|
45
46
|
import '../components/floating-panel.js';
|
|
@@ -55,7 +56,6 @@ import '../components/error-boundary.js';
|
|
|
55
56
|
import '../components/authed-image.js';
|
|
56
57
|
import '../components/image-grid.js';
|
|
57
58
|
import '../components/lightbox.js';
|
|
58
|
-
import '../components/write-lock.js';
|
|
59
59
|
import '../auth/sign-in-form.js';
|
|
60
60
|
import '../landing/access.js';
|
|
61
61
|
import '../landing/landing-labels.js';
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// pay-page/bin.ts
|
|
4
|
+
import process from "process";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
|
|
7
|
+
// pay-page/cli.ts
|
|
8
|
+
import { copyFileSync, existsSync, mkdirSync, writeFileSync } from "fs";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { parseArgs } from "util";
|
|
11
|
+
|
|
12
|
+
// src/billing/pay-page.ts
|
|
13
|
+
var PAY_CONFIG_FILE = "pay-config.json";
|
|
14
|
+
var TOKEN_PREFIX = { sandbox: "test_", live: "live_" };
|
|
15
|
+
function isPageUrl(value) {
|
|
16
|
+
if (typeof value !== "string") return false;
|
|
17
|
+
let url;
|
|
18
|
+
try {
|
|
19
|
+
url = new URL(value);
|
|
20
|
+
} catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (url.protocol === "https:") return true;
|
|
24
|
+
return url.protocol === "http:" && ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
|
|
25
|
+
}
|
|
26
|
+
function payPageConfigProblems(config) {
|
|
27
|
+
if (typeof config !== "object" || config === null) return ["the configuration is not an object"];
|
|
28
|
+
const c = config;
|
|
29
|
+
const problems = [];
|
|
30
|
+
const { token, environment } = c;
|
|
31
|
+
if (environment !== null && environment !== void 0 && environment !== "sandbox" && environment !== "live") {
|
|
32
|
+
problems.push(`environment must be "sandbox" or "live", not ${JSON.stringify(environment)}`);
|
|
33
|
+
}
|
|
34
|
+
if (token !== null && token !== void 0) {
|
|
35
|
+
if (typeof token !== "string" || token === "") {
|
|
36
|
+
problems.push("token must be Paddle's client-side token, or null while billing is off");
|
|
37
|
+
} else if (environment !== "sandbox" && environment !== "live") {
|
|
38
|
+
problems.push("a token needs its environment: sandbox or live");
|
|
39
|
+
} else if (!token.startsWith(TOKEN_PREFIX[environment]) || token.length === TOKEN_PREFIX[environment].length) {
|
|
40
|
+
const other = environment === "sandbox" ? "live" : "sandbox";
|
|
41
|
+
problems.push(
|
|
42
|
+
token.startsWith(TOKEN_PREFIX[other]) ? `the token is a ${other} token (${TOKEN_PREFIX[other]}\u2026), but the environment is ${environment}` : `a ${environment} token starts with ${TOKEN_PREFIX[environment]}`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for (const key of ["returnUrl", "termsUrl", "privacyUrl"]) {
|
|
47
|
+
if (!isPageUrl(c[key])) problems.push(`${key} must be an https:// URL (http:// for localhost only)`);
|
|
48
|
+
}
|
|
49
|
+
if (typeof c.appName !== "string" || c.appName.trim() === "") problems.push("appName is missing");
|
|
50
|
+
return problems;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// pay-page/cli.ts
|
|
54
|
+
var PAY_PAGE_FILES = [
|
|
55
|
+
"index.html",
|
|
56
|
+
"pay.js",
|
|
57
|
+
"pay.css",
|
|
58
|
+
".well-known/apple-developer-merchantid-domain-association"
|
|
59
|
+
];
|
|
60
|
+
var PayPageError = class extends Error {
|
|
61
|
+
problems;
|
|
62
|
+
constructor(problems) {
|
|
63
|
+
super(`eifi1-pay-page: ${problems.join("; ")}`);
|
|
64
|
+
this.name = "PayPageError";
|
|
65
|
+
this.problems = problems;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var given = (value) => {
|
|
69
|
+
const trimmed = (value ?? "").trim();
|
|
70
|
+
return trimmed === "" ? null : trimmed;
|
|
71
|
+
};
|
|
72
|
+
function payPageConfig(options) {
|
|
73
|
+
const config = {
|
|
74
|
+
token: given(options.token),
|
|
75
|
+
environment: given(options.environment),
|
|
76
|
+
returnUrl: (options.returnUrl ?? "").trim(),
|
|
77
|
+
appName: (options.appName ?? "").trim(),
|
|
78
|
+
termsUrl: (options.termsUrl ?? "").trim(),
|
|
79
|
+
privacyUrl: (options.privacyUrl ?? "").trim()
|
|
80
|
+
};
|
|
81
|
+
return { config, problems: payPageConfigProblems(config) };
|
|
82
|
+
}
|
|
83
|
+
function writePayPage(options, bundleDir) {
|
|
84
|
+
const { config, problems } = payPageConfig(options);
|
|
85
|
+
const out = (options.out ?? "").trim();
|
|
86
|
+
if (out === "") problems.unshift("--out is missing: the directory to write the page into");
|
|
87
|
+
const missing = PAY_PAGE_FILES.filter((file) => !existsSync(join(bundleDir, file)));
|
|
88
|
+
if (missing.length > 0) {
|
|
89
|
+
problems.push(`the kit's pay page is incomplete in ${bundleDir} (missing ${missing.join(", ")})`);
|
|
90
|
+
}
|
|
91
|
+
if (problems.length > 0) throw new PayPageError(problems);
|
|
92
|
+
for (const file of PAY_PAGE_FILES) {
|
|
93
|
+
const target = join(out, file);
|
|
94
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
95
|
+
copyFileSync(join(bundleDir, file), target);
|
|
96
|
+
}
|
|
97
|
+
writeFileSync(join(out, PAY_CONFIG_FILE), `${JSON.stringify(config, null, 2)}
|
|
98
|
+
`);
|
|
99
|
+
return config;
|
|
100
|
+
}
|
|
101
|
+
var USAGE = `Usage: eifi1-pay-page --out <dir> [--token <test_\u2026|live_\u2026> --environment <sandbox|live>]
|
|
102
|
+
--return-url <https://\u2026> --app-name <name> --terms-url <https://\u2026> --privacy-url <https://\u2026>
|
|
103
|
+
|
|
104
|
+
Copies @eifi1/ui-kit's pay page into <dir> and writes its ${PAY_CONFIG_FILE}.
|
|
105
|
+
Without a token (billing off) the page says there is nothing to pay.`;
|
|
106
|
+
function runPayPageCli(argv, io) {
|
|
107
|
+
let values;
|
|
108
|
+
try {
|
|
109
|
+
({ values } = parseArgs({
|
|
110
|
+
args: [...argv],
|
|
111
|
+
strict: true,
|
|
112
|
+
allowPositionals: false,
|
|
113
|
+
options: {
|
|
114
|
+
out: { type: "string" },
|
|
115
|
+
token: { type: "string" },
|
|
116
|
+
environment: { type: "string" },
|
|
117
|
+
"return-url": { type: "string" },
|
|
118
|
+
"app-name": { type: "string" },
|
|
119
|
+
"terms-url": { type: "string" },
|
|
120
|
+
"privacy-url": { type: "string" },
|
|
121
|
+
help: { type: "boolean", short: "h" }
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
} catch (err) {
|
|
125
|
+
io.error(`eifi1-pay-page: ${err.message}
|
|
126
|
+
|
|
127
|
+
${USAGE}`);
|
|
128
|
+
return 2;
|
|
129
|
+
}
|
|
130
|
+
if (values.help) {
|
|
131
|
+
io.log(USAGE);
|
|
132
|
+
return 0;
|
|
133
|
+
}
|
|
134
|
+
const text = (key) => typeof values[key] === "string" ? values[key] : "";
|
|
135
|
+
try {
|
|
136
|
+
const config = writePayPage(
|
|
137
|
+
{
|
|
138
|
+
out: text("out"),
|
|
139
|
+
token: text("token"),
|
|
140
|
+
environment: text("environment"),
|
|
141
|
+
returnUrl: text("return-url"),
|
|
142
|
+
appName: text("app-name"),
|
|
143
|
+
termsUrl: text("terms-url"),
|
|
144
|
+
privacyUrl: text("privacy-url")
|
|
145
|
+
},
|
|
146
|
+
io.bundleDir
|
|
147
|
+
);
|
|
148
|
+
io.log(
|
|
149
|
+
`eifi1-pay-page: wrote the pay page to ${text("out").trim()} ` + (config.token ? `(${config.environment})` : "(no token: billing off, the page says there is nothing to pay)")
|
|
150
|
+
);
|
|
151
|
+
return 0;
|
|
152
|
+
} catch (err) {
|
|
153
|
+
if (err instanceof PayPageError) {
|
|
154
|
+
io.error(["eifi1-pay-page: refused \u2014", ...err.problems.map((p) => ` - ${p}`)].join("\n"));
|
|
155
|
+
return 1;
|
|
156
|
+
}
|
|
157
|
+
throw err;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// pay-page/bin.ts
|
|
162
|
+
process.exitCode = runPayPageCli(process.argv.slice(2), {
|
|
163
|
+
bundleDir: fileURLToPath(new URL("../pay/", import.meta.url)),
|
|
164
|
+
log: (message) => console.log(message),
|
|
165
|
+
error: (message) => console.error(message)
|
|
166
|
+
});
|
package/dist/chart.d.ts
CHANGED
|
@@ -14,20 +14,25 @@ export { TimeTickUnit } from './components/series-chart-ticks.js';
|
|
|
14
14
|
import 'recharts';
|
|
15
15
|
import 'react';
|
|
16
16
|
import './lib/direction.js';
|
|
17
|
-
import './delete-account-setting-
|
|
17
|
+
import './delete-account-setting-DiPX4Vue.js';
|
|
18
18
|
import './components/tooltip.js';
|
|
19
19
|
import './hooks/use-anchored-rect.js';
|
|
20
20
|
import './lib/clipping.js';
|
|
21
|
-
import './data-table-labels-
|
|
21
|
+
import './data-table-labels-BJ5JE_X2.js';
|
|
22
22
|
import './components/data-table-sort.js';
|
|
23
23
|
import './components/swipeable-row.js';
|
|
24
|
+
import './components/status-dot.js';
|
|
25
|
+
import './components/progress-bar.js';
|
|
26
|
+
import './components/signed-amount.js';
|
|
27
|
+
import './components/stat-tile.js';
|
|
28
|
+
import './components/chip.js';
|
|
29
|
+
import 'lucide-react';
|
|
30
|
+
import './components/field-parts.js';
|
|
31
|
+
import './components/write-lock.js';
|
|
24
32
|
import './components/mini-calendar.js';
|
|
25
33
|
import './components/calendar-heatmap.js';
|
|
26
34
|
import './components/popover.js';
|
|
27
35
|
import './hooks/use-breakpoint.js';
|
|
28
|
-
import './components/chip.js';
|
|
29
|
-
import 'lucide-react';
|
|
30
|
-
import './components/field-parts.js';
|
|
31
36
|
import './components/field-sync.js';
|
|
32
37
|
import './wizard/types.js';
|
|
33
38
|
import './tour/tour.js';
|
|
@@ -37,7 +42,6 @@ import './search/search-index.js';
|
|
|
37
42
|
import './components/month-picker.js';
|
|
38
43
|
import './components/page-contents.js';
|
|
39
44
|
import './components/sparkline.js';
|
|
40
|
-
import './components/stat-tile.js';
|
|
41
45
|
import './components/signature-pad.js';
|
|
42
46
|
import './components/password-strength.js';
|
|
43
47
|
import './components/swatch-picker.js';
|
|
@@ -49,9 +53,6 @@ import './hooks/use-search-param-state.js';
|
|
|
49
53
|
import './components/measured-grid.js';
|
|
50
54
|
import './components/user-avatar.js';
|
|
51
55
|
import './lib/person-name.js';
|
|
52
|
-
import './components/status-dot.js';
|
|
53
|
-
import './components/progress-bar.js';
|
|
54
|
-
import './components/signed-amount.js';
|
|
55
56
|
import './shell/topbar-action-menu.js';
|
|
56
57
|
import './components/menu-item.js';
|
|
57
58
|
import './components/floating-panel.js';
|
|
@@ -67,7 +68,6 @@ import './components/error-boundary.js';
|
|
|
67
68
|
import './components/authed-image.js';
|
|
68
69
|
import './components/image-grid.js';
|
|
69
70
|
import './components/lightbox.js';
|
|
70
|
-
import './components/write-lock.js';
|
|
71
71
|
import './auth/sign-in-form.js';
|
|
72
72
|
import './landing/access.js';
|
|
73
73
|
import './landing/landing-labels.js';
|
|
@@ -3,13 +3,18 @@ import { ReactElement, ReactNode } from 'react';
|
|
|
3
3
|
import { LucideIcon } from 'lucide-react';
|
|
4
4
|
import { DateInput, FormatDateStyle, FormatRelativeTimeOptions } from '../lib/format.js';
|
|
5
5
|
import { ChipTone, ChipSize, ChipVariant, ChipShape } from './chip.js';
|
|
6
|
-
import { d as DataTableColumn } from '../data-table-labels-
|
|
6
|
+
import { d as DataTableColumn } from '../data-table-labels-BJ5JE_X2.js';
|
|
7
7
|
import './field-parts.js';
|
|
8
8
|
import './tooltip.js';
|
|
9
9
|
import '../hooks/use-anchored-rect.js';
|
|
10
10
|
import '../lib/clipping.js';
|
|
11
|
+
import './write-lock.js';
|
|
11
12
|
import './data-table-sort.js';
|
|
12
13
|
import './swipeable-row.js';
|
|
14
|
+
import './status-dot.js';
|
|
15
|
+
import './progress-bar.js';
|
|
16
|
+
import './signed-amount.js';
|
|
17
|
+
import './stat-tile.js';
|
|
13
18
|
|
|
14
19
|
/**
|
|
15
20
|
* The parts an admin roster repeats (0.18.0) — and only those.
|
|
@@ -79,7 +79,10 @@ type ProfileSettingProps = ProfileSettingDisplayNameProps | ProfileSettingNamesP
|
|
|
79
79
|
*
|
|
80
80
|
* The two-field form owns its drafts, starting from the saved names and following them
|
|
81
81
|
* when they change; Save waits for a change, holds — saying why — while a name is
|
|
82
|
-
* blank, and is a `commit` (a {@link WriteLockProvider} locks it, keksdose's demo)
|
|
82
|
+
* blank, and is a `commit` (a {@link WriteLockProvider} locks it, keksdose's demo) —
|
|
83
|
+
* every lock but a lapsed plan's (`COMMIT_EXCEPT_BILLING`, 0.33): a profile is the
|
|
84
|
+
* account's own settings, which billing never locks (docs/billing-harmonization.md §3.3,
|
|
85
|
+
* §12.36).
|
|
83
86
|
*/
|
|
84
87
|
declare function ProfileSetting(props: ProfileSettingProps): react.JSX.Element;
|
|
85
88
|
/**
|
|
@@ -17,6 +17,7 @@ import { useKitLabelOverrides, useKitLabels } from "../i18n/kit-labels.js";
|
|
|
17
17
|
import { Chip } from "./chip.js";
|
|
18
18
|
import { useAccountSettingsLabels } from "./account-settings-labels.js";
|
|
19
19
|
import { SettingsCardTitle } from "../settings/settings-heading.js";
|
|
20
|
+
import { COMMIT_EXCEPT_BILLING } from "./write-lock.js";
|
|
20
21
|
import { DEFAULT_ACCOUNT_SETTINGS_LABELS } from "./account-settings-labels.js";
|
|
21
22
|
function ProfileSetting(props) {
|
|
22
23
|
const { name, email, role, memberSince, labels: labelsProp, id } = props;
|
|
@@ -154,7 +155,7 @@ function PersonNameFields({
|
|
|
154
155
|
Button,
|
|
155
156
|
{
|
|
156
157
|
type: "submit",
|
|
157
|
-
commit:
|
|
158
|
+
commit: COMMIT_EXCEPT_BILLING,
|
|
158
159
|
pending: busy,
|
|
159
160
|
disabled: valid && !dirty,
|
|
160
161
|
disabledReason: valid ? void 0 : labels.nameRequired,
|