@voyantjs/promotions-ui 0.105.2 → 0.106.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.
@@ -0,0 +1,23 @@
1
+ import { type AdminExtension, type NavItem } from "@voyantjs/admin";
2
+ export { PromotionDialog, type PromotionDialogProps } from "../promotion-dialog.js";
3
+ export { loadPromotionsPage, type PromotionDialogRenderProps, PromotionsPage, type PromotionsPageProps, } from "../promotions-page.js";
4
+ export interface CreatePromotionsAdminExtensionOptions {
5
+ /** Localized nav/page labels. Defaults are the English operator nav labels. */
6
+ labels?: {
7
+ promotions?: string;
8
+ };
9
+ /** Nav icon — icon choice stays with the host (e.g. lucide `Tag`). */
10
+ icon?: NavItem["icon"];
11
+ /** Nav ordering past the host's base items. Default 50. */
12
+ order?: number;
13
+ /** Mount path inside the admin workspace. Default `/promotions`. */
14
+ path?: string;
15
+ }
16
+ /**
17
+ * The promotions admin contribution — nav entry plus the full route
18
+ * implementation (page component, loader, SSR mode), per the packaged-admin
19
+ * RFC Phase 2 (`@voyantjs/<domain>-ui/admin` convention). Hosts register the
20
+ * extension for navigation and mount the route fields on their router.
21
+ */
22
+ export declare function createPromotionsAdminExtension(options?: CreatePromotionsAdminExtensionOptions): AdminExtension;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/admin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAA;AAIxB,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACnF,OAAO,EACL,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,qCAAqC;IACpD,+EAA+E;IAC/E,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,sEAAsE;IACtE,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IACtB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,GAAE,qCAA0C,GAClD,cAAc,CA2BhB"}
@@ -0,0 +1,36 @@
1
+ import { defineAdminExtension, } from "@voyantjs/admin";
2
+ import { loadPromotionsPage, PromotionsPage } from "../promotions-page.js";
3
+ export { PromotionDialog } from "../promotion-dialog.js";
4
+ export { loadPromotionsPage, PromotionsPage, } from "../promotions-page.js";
5
+ /**
6
+ * The promotions admin contribution — nav entry plus the full route
7
+ * implementation (page component, loader, SSR mode), per the packaged-admin
8
+ * RFC Phase 2 (`@voyantjs/<domain>-ui/admin` convention). Hosts register the
9
+ * extension for navigation and mount the route fields on their router.
10
+ */
11
+ export function createPromotionsAdminExtension(options = {}) {
12
+ const { labels = {}, icon, order = 50, path = "/promotions" } = options;
13
+ const { promotions = "Promotions" } = labels;
14
+ return defineAdminExtension({
15
+ id: "promotions",
16
+ navigation: [
17
+ {
18
+ order,
19
+ items: [{ id: "promotions", title: promotions, url: path, icon }],
20
+ },
21
+ ],
22
+ routes: [
23
+ {
24
+ id: "promotions-index",
25
+ path,
26
+ title: promotions,
27
+ ssr: "data-only",
28
+ component: PromotionsPage,
29
+ loader: ({ queryClient, runtime }) => loadPromotionsPage(queryClient, {
30
+ baseUrl: runtime.baseUrl,
31
+ fetcher: runtime.fetcher,
32
+ }),
33
+ },
34
+ ],
35
+ });
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/promotions-ui",
3
- "version": "0.105.2",
3
+ "version": "0.106.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,6 +34,11 @@
34
34
  "types": "./dist/*.d.ts",
35
35
  "import": "./dist/*.js",
36
36
  "default": "./dist/*.js"
37
+ },
38
+ "./admin": {
39
+ "types": "./dist/admin/index.d.ts",
40
+ "import": "./dist/admin/index.js",
41
+ "default": "./dist/admin/index.js"
37
42
  }
38
43
  },
39
44
  "peerDependencies": {
@@ -41,8 +46,9 @@
41
46
  "react": "^19.0.0",
42
47
  "react-dom": "^19.0.0",
43
48
  "zod": "^4.3.6",
44
- "@voyantjs/promotions-react": "^0.105.2",
45
- "@voyantjs/ui": "^0.105.1"
49
+ "@voyantjs/admin": "^0.106.0",
50
+ "@voyantjs/promotions-react": "^0.106.0",
51
+ "@voyantjs/ui": "^0.106.0"
46
52
  },
47
53
  "dependencies": {
48
54
  "@voyantjs/i18n": "^0.106.0"
@@ -57,9 +63,10 @@
57
63
  "typescript": "^6.0.2",
58
64
  "vitest": "^4.1.2",
59
65
  "zod": "^4.3.6",
66
+ "@voyantjs/admin": "^0.106.0",
60
67
  "@voyantjs/i18n": "^0.106.0",
61
- "@voyantjs/promotions-react": "^0.105.2",
62
- "@voyantjs/ui": "^0.105.1",
68
+ "@voyantjs/promotions-react": "^0.106.0",
69
+ "@voyantjs/ui": "^0.106.0",
63
70
  "@voyantjs/voyant-typescript-config": "^0.1.0"
64
71
  },
65
72
  "files": [