@propeller-commerce/propeller-v2-react-ui 0.20.0 → 0.21.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,24 @@
1
+ export * from '@propeller-commerce/propeller-v2-core-ui';
2
+
3
+ /**
4
+ * useMenu (React) — Category tree fetch with depth-configurable recursive GraphQL query.
5
+ *
6
+ * Responsibilities:
7
+ * - Dynamic recursive GraphQL category query (depth-configurable, default 3)
8
+ * - localStorage cache with 12h TTL, user-specific cache key
9
+ * - Maps LocalizedString arrays to flat name/slug strings per language
10
+ */
11
+
12
+ /** A flattened category node in the menu tree. */
13
+ interface MenuCategory {
14
+ /** Category id. */
15
+ categoryId: number;
16
+ /** Category name resolved for the active language. */
17
+ name: string;
18
+ /** Category URL slug. */
19
+ slug: string;
20
+ /** Nested child categories (hidden ones filtered out). */
21
+ children: MenuCategory[];
22
+ }
23
+
24
+ export type { MenuCategory };
@@ -0,0 +1,24 @@
1
+ export * from '@propeller-commerce/propeller-v2-core-ui';
2
+
3
+ /**
4
+ * useMenu (React) — Category tree fetch with depth-configurable recursive GraphQL query.
5
+ *
6
+ * Responsibilities:
7
+ * - Dynamic recursive GraphQL category query (depth-configurable, default 3)
8
+ * - localStorage cache with 12h TTL, user-specific cache key
9
+ * - Maps LocalizedString arrays to flat name/slug strings per language
10
+ */
11
+
12
+ /** A flattened category node in the menu tree. */
13
+ interface MenuCategory {
14
+ /** Category id. */
15
+ categoryId: number;
16
+ /** Category name resolved for the active language. */
17
+ name: string;
18
+ /** Category URL slug. */
19
+ slug: string;
20
+ /** Nested child categories (hidden ones filtered out). */
21
+ children: MenuCategory[];
22
+ }
23
+
24
+ export type { MenuCategory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propeller-commerce/propeller-v2-react-ui",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/propeller-commerce/propeller-v2-react-ui.git"
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "scripts": {
45
45
  "prepare": "npm run build",
46
- "build": "tsup && npm run build:css",
46
+ "build": "npm run clean && tsup && npm run build:css",
47
47
  "build:js": "tsup",
48
48
  "build:css": "tailwindcss -i ./src/styles.css -o ./dist/styles.css --minify",
49
49
  "dev": "tsup --watch",
@@ -53,7 +53,7 @@
53
53
  "test:coverage": "vitest run --coverage",
54
54
  "storybook": "npm run build:css && storybook dev -p 6006",
55
55
  "build-storybook": "npm run build:css && storybook build",
56
- "clean": "powershell -Command \"Remove-Item -Recurse -Force dist -ErrorAction SilentlyContinue\""
56
+ "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""
57
57
  },
58
58
  "peerDependencies": {
59
59
  "@propeller-commerce/propeller-sdk-v2": "*",