@eifi1/ui-kit 0.43.0 → 0.44.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 +5 -5
- package/dist/billing/provider-page.d.ts +9 -0
- package/dist/billing/provider-page.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/i18n/german.js +2 -2
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/locales/en.js +3 -3
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/fr.js +2 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/it.js +1 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/tour/tour-catalogue-labels.js +2 -2
- package/dist/tour/tour-catalogue-labels.js.map +1 -1
- package/dist/tour/tour-info.d.ts +2 -2
- package/dist/tour/tour-info.js.map +1 -1
- package/dist/tour/tour.d.ts +38 -2
- package/dist/tour/tour.js +40 -3
- package/dist/tour/tour.js.map +1 -1
- package/dist/tour/use-tour-progress.d.ts +66 -11
- package/dist/tour/use-tour-progress.js +44 -14
- package/dist/tour/use-tour-progress.js.map +1 -1
- package/dist/tour.d.ts +1 -1
- package/dist/tour.js +2 -1
- package/dist/tour.js.map +1 -1
- package/package.json +1 -1
- package/src/billing/provider-page.ts +9 -0
- package/src/i18n/german.ts +2 -2
- package/src/i18n/locales/en.ts +1 -1
- package/src/i18n/locales/fr.ts +2 -2
- package/src/i18n/locales/it.ts +1 -1
- package/src/tour/tour-catalogue-labels.ts +2 -2
- package/src/tour/tour-info.ts +2 -2
- package/src/tour/tour.tsx +84 -3
- package/src/tour/use-tour-progress.ts +124 -23
- package/src/tour.ts +2 -1
package/README.md
CHANGED
|
@@ -556,19 +556,19 @@ columns, strings and permissions (see the note at the top of `src/feedback/feedb
|
|
|
556
556
|
|
|
557
557
|
<!-- BEGIN GENERATED: exports — node scripts/gen-export-inventory.mjs -->
|
|
558
558
|
|
|
559
|
-
**
|
|
559
|
+
**2081 names from 341 modules** — 959 values and 1122 types. _Italic_ is a type-only export.
|
|
560
560
|
|
|
561
561
|
Generated from `dist/index.d.ts` by `node scripts/gen-export-inventory.mjs`; the count
|
|
562
562
|
is pinned by `src/__tests__/public-surface.test.ts`. Do not edit between the markers.
|
|
563
563
|
|
|
564
564
|
| Entry point | Names |
|
|
565
565
|
|---|---|
|
|
566
|
-
| `@eifi1/ui-kit` |
|
|
566
|
+
| `@eifi1/ui-kit` | 2081 |
|
|
567
567
|
| `@eifi1/ui-kit/chart` | 92 |
|
|
568
568
|
| `@eifi1/ui-kit/shell` | 110 |
|
|
569
569
|
| `@eifi1/ui-kit/data-table` | 51 |
|
|
570
570
|
| `@eifi1/ui-kit/wizard` | 24 |
|
|
571
|
-
| `@eifi1/ui-kit/tour` |
|
|
571
|
+
| `@eifi1/ui-kit/tour` | 33 |
|
|
572
572
|
| `@eifi1/ui-kit/feedback` | 205 |
|
|
573
573
|
| `@eifi1/ui-kit/search` | 23 |
|
|
574
574
|
| `@eifi1/ui-kit/dates` | 22 |
|
|
@@ -899,10 +899,10 @@ re-slicing of it, never a second API.
|
|
|
899
899
|
|
|
900
900
|
| Module | Exports |
|
|
901
901
|
|---|---|
|
|
902
|
-
| `tour/tour` | `DEFAULT_TOUR_LABELS`, `TourProvider`, `useTour`, `useTourOptional`, _`TourLabels`_, _`TourPlacement`_, _`TourStep`_ |
|
|
902
|
+
| `tour/tour` | `DEFAULT_TOUR_LABELS`, `TourProvider`, `useTour`, `useTourOptional`, _`TourCompletion`_, _`TourLabels`_, _`TourPlacement`_, _`TourStep`_ |
|
|
903
903
|
| `tour/tour-catalogue` | `DEFAULT_TOUR_CATALOGUE_LABELS`, `TourCatalogue`, `TourCatalogueCard`, _`TourCatalogueCardProps`_, _`TourCatalogueLabels`_, _`TourCatalogueProps`_ |
|
|
904
904
|
| `tour/tour-info` | `doneCount`, `earnedPoints`, `isTourDone`, `isTourNew`, `isTourReset`, _`TourCompletions`_, _`TourGroup`_, _`TourInfo`_, _`TourUpdate`_ |
|
|
905
|
-
| `tour/use-tour-progress` | `resetTourProgress`, `useTourProgress`, _`TourProgress`_, _`UseTourProgressOptions`_ |
|
|
905
|
+
| `tour/use-tour-progress` | `completeTour`, `resetTourProgress`, `useTourProgress`, _`TourProgress`_, _`UseTourProgressOptions`_ |
|
|
906
906
|
| `tour/use-tour-url-sync` | `useTourCatalogueUrlState`, `useTourUrlSync`, _`TourCatalogueFilter`_, _`TourStateFilter`_, _`UseTourUrlSyncOptions`_ |
|
|
907
907
|
|
|
908
908
|
### search
|
|
@@ -36,5 +36,14 @@ export interface OpenProviderPageOptions {
|
|
|
36
36
|
* />
|
|
37
37
|
*
|
|
38
38
|
* Resolves with the way it went.
|
|
39
|
+
*
|
|
40
|
+
* **The test seam is `options.window`** (docs/tours-harmonization.md §9.5, kk 7): an app's
|
|
41
|
+
* test passes a stub with `open` (returning a fake tab, or `null` for a blocked pop-up)
|
|
42
|
+
* and `location.assign`, instead of patching the global `window`:
|
|
43
|
+
*
|
|
44
|
+
* const tab = { opener: {}, closed: false, location: { href: "" }, close: vi.fn() };
|
|
45
|
+
* const win = { open: vi.fn(() => tab), location: { assign: vi.fn() } } as unknown as Window;
|
|
46
|
+
* await openProviderPage(async () => "https://pay.example/portal", { window: win });
|
|
47
|
+
* expect(tab.location.href).toBe("https://pay.example/portal");
|
|
39
48
|
*/
|
|
40
49
|
export declare function openProviderPage(fetchUrl: () => Promise<string>, options?: OpenProviderPageOptions): Promise<ProviderPageWay>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/billing/provider-page.ts"],"sourcesContent":["/**\n * The provider's hosted portal in a NEW TAB (0.43, docs/billing-harmonization.md §17):\n * \"Payment and invoices\", the portal's \"Cancel subscription\" and the payment-failed\n * banner's \"Update payment method\" open at the provider while the app stays open where\n * it was. kastlan's `usePortal` (feat/kit-0.42, `72c3177`) is the reference.\n *\n * The checkout is NOT one of them (§17.4): it stays in the same tab, since the page waits\n * for the payer's return (`useCheckoutProcessing`).\n */\n\n/** How the page went: in a tab of its own, or — the browser refused one — in this one. */\nexport type ProviderPageWay = \"new-tab\" | \"same-tab\";\n\nexport interface OpenProviderPageOptions {\n /** The window to open from and to fall back to. Default the global `window` (a test's\n * or an iframe's own). */\n window?: Window;\n}\n\n/**\n * Opens the provider's page in a new tab, from INSIDE the click: call it in the click\n * handler itself, before any `await` — a `window.open` after one is blocked as a pop-up.\n *\n * 1. opens `about:blank` synchronously and sets its `opener` to `null`, so the provider's\n * page cannot reach back into the app;\n * 2. awaits `fetchUrl` — the app's `POST /billing/portal` with its target, answering the\n * `url` (the kit sends no request);\n * 3. points the tab at the URL;\n * 4. on a refusal closes the tab again and rethrows, so the app shows its error;\n * 5. where the browser refused the tab (a pop-up blocker), or it was closed while the\n * URL was on its way, the app's own page goes there instead.\n *\n * <SubscriptionActions\n * onPortal={(target) => {\n * openProviderPage(() => api.billingPortal({ target }).then((r) => r.url)).catch(showError);\n * }}\n * providerName=\"Paddle\"\n * appName=\"Kastlan\"\n * />\n *\n * Resolves with the way it went.\n */\nexport async function openProviderPage(\n fetchUrl: () => Promise<string>,\n options: OpenProviderPageOptions = {},\n): Promise<ProviderPageWay> {\n const win = options.window ?? window;\n let tab: Window | null;\n try {\n tab = win.open(\"about:blank\", \"_blank\");\n } catch {\n tab = null;\n }\n if (tab) {\n try {\n // The provider's page must not reach back into the app.\n tab.opener = null;\n } catch {\n /* a browser that guards `opener`: the tab is still ours to point */\n }\n }\n let url: string;\n try {\n url = await fetchUrl();\n } catch (error) {\n tab?.close();\n throw error;\n }\n if (tab && !tab.closed) {\n tab.location.href = url;\n return \"new-tab\";\n }\n win.location.assign(url);\n return \"same-tab\";\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/billing/provider-page.ts"],"sourcesContent":["/**\n * The provider's hosted portal in a NEW TAB (0.43, docs/billing-harmonization.md §17):\n * \"Payment and invoices\", the portal's \"Cancel subscription\" and the payment-failed\n * banner's \"Update payment method\" open at the provider while the app stays open where\n * it was. kastlan's `usePortal` (feat/kit-0.42, `72c3177`) is the reference.\n *\n * The checkout is NOT one of them (§17.4): it stays in the same tab, since the page waits\n * for the payer's return (`useCheckoutProcessing`).\n */\n\n/** How the page went: in a tab of its own, or — the browser refused one — in this one. */\nexport type ProviderPageWay = \"new-tab\" | \"same-tab\";\n\nexport interface OpenProviderPageOptions {\n /** The window to open from and to fall back to. Default the global `window` (a test's\n * or an iframe's own). */\n window?: Window;\n}\n\n/**\n * Opens the provider's page in a new tab, from INSIDE the click: call it in the click\n * handler itself, before any `await` — a `window.open` after one is blocked as a pop-up.\n *\n * 1. opens `about:blank` synchronously and sets its `opener` to `null`, so the provider's\n * page cannot reach back into the app;\n * 2. awaits `fetchUrl` — the app's `POST /billing/portal` with its target, answering the\n * `url` (the kit sends no request);\n * 3. points the tab at the URL;\n * 4. on a refusal closes the tab again and rethrows, so the app shows its error;\n * 5. where the browser refused the tab (a pop-up blocker), or it was closed while the\n * URL was on its way, the app's own page goes there instead.\n *\n * <SubscriptionActions\n * onPortal={(target) => {\n * openProviderPage(() => api.billingPortal({ target }).then((r) => r.url)).catch(showError);\n * }}\n * providerName=\"Paddle\"\n * appName=\"Kastlan\"\n * />\n *\n * Resolves with the way it went.\n *\n * **The test seam is `options.window`** (docs/tours-harmonization.md §9.5, kk 7): an app's\n * test passes a stub with `open` (returning a fake tab, or `null` for a blocked pop-up)\n * and `location.assign`, instead of patching the global `window`:\n *\n * const tab = { opener: {}, closed: false, location: { href: \"\" }, close: vi.fn() };\n * const win = { open: vi.fn(() => tab), location: { assign: vi.fn() } } as unknown as Window;\n * await openProviderPage(async () => \"https://pay.example/portal\", { window: win });\n * expect(tab.location.href).toBe(\"https://pay.example/portal\");\n */\nexport async function openProviderPage(\n fetchUrl: () => Promise<string>,\n options: OpenProviderPageOptions = {},\n): Promise<ProviderPageWay> {\n const win = options.window ?? window;\n let tab: Window | null;\n try {\n tab = win.open(\"about:blank\", \"_blank\");\n } catch {\n tab = null;\n }\n if (tab) {\n try {\n // The provider's page must not reach back into the app.\n tab.opener = null;\n } catch {\n /* a browser that guards `opener`: the tab is still ours to point */\n }\n }\n let url: string;\n try {\n url = await fetchUrl();\n } catch (error) {\n tab?.close();\n throw error;\n }\n if (tab && !tab.closed) {\n tab.location.href = url;\n return \"new-tab\";\n }\n win.location.assign(url);\n return \"same-tab\";\n}\n"],"mappings":";AAmDA,eAAsB,iBACpB,UACA,UAAmC,CAAC,GACV;AAC1B,QAAM,MAAM,QAAQ,UAAU;AAC9B,MAAI;AACJ,MAAI;AACF,UAAM,IAAI,KAAK,eAAe,QAAQ;AAAA,EACxC,QAAQ;AACN,UAAM;AAAA,EACR;AACA,MAAI,KAAK;AACP,QAAI;AAEF,UAAI,SAAS;AAAA,IACf,QAAQ;AAAA,IAER;AAAA,EACF;AACA,MAAI;AACJ,MAAI;AACF,UAAM,MAAM,SAAS;AAAA,EACvB,SAAS,OAAO;AACd,SAAK,MAAM;AACX,UAAM;AAAA,EACR;AACA,MAAI,OAAO,CAAC,IAAI,QAAQ;AACtB,QAAI,SAAS,OAAO;AACpB,WAAO;AAAA,EACT;AACA,MAAI,SAAS,OAAO,GAAG;AACvB,SAAO;AACT;","names":[]}
|
package/dist/eslint/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const roleUtilities = {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
const VERSION = true ? "0.
|
|
50
|
+
const VERSION = true ? "0.44.0" : "0.0.0-source";
|
|
51
51
|
const recommended = {
|
|
52
52
|
name: "@eifi1/ui-kit/recommended",
|
|
53
53
|
// Not the tests, as check:tokens skips the kit's: a test names the old class to assert it
|
package/dist/i18n/german.js
CHANGED
|
@@ -594,12 +594,12 @@ function germanLabels(numberLocale) {
|
|
|
594
594
|
stateDone: (count) => `Abgeschlossen (${n(count)})`,
|
|
595
595
|
showing: (shown, total) => `${n(shown)} von ${n(total)} Touren`,
|
|
596
596
|
noMatches: "Keine Tour passt",
|
|
597
|
-
noMatchesHint: "
|
|
597
|
+
noMatchesHint: "Anderes Wort versuchen oder Filter zur\xFCcksetzen.",
|
|
598
598
|
clearFilters: "Filter zur\xFCcksetzen",
|
|
599
599
|
badgeNew: "Neu",
|
|
600
600
|
badgeUpdated: "Aktualisiert",
|
|
601
601
|
resetOn: (date, reason) => reason ? `Zur\xFCckgesetzt am ${date}: ${reason}` : `Zur\xFCckgesetzt am ${date}`,
|
|
602
|
-
points: (count) => `+${n(count)} Pkt
|
|
602
|
+
points: (count) => `+${n(count)} Pkt`,
|
|
603
603
|
steps: (count) => count === 1 ? `${n(count)} Schritt` : `${n(count)} Schritte`,
|
|
604
604
|
duration: (minutes) => `Etwa ${n(minutes)} Min.`,
|
|
605
605
|
completedOn: (date) => `Abgeschlossen am ${date}`,
|