@enyxs/wikex-components 0.11.18 → 0.11.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enyxs/wikex-components",
3
- "version": "0.11.18",
3
+ "version": "0.11.20",
4
4
  "description": "Reusable CMS blocks, including the original Wikex Commodity UI.",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
package/README.md DELETED
@@ -1,146 +0,0 @@
1
- # @enyxs/wikex-components
2
-
3
- Reusable Material UI blocks with CMS metadata and inline-edit support.
4
-
5
- ## Included blocks
6
-
7
- - `hero-banner`
8
- - `feature-grid`
9
- - `image-text`
10
- - `call-to-action`
11
- - `announcement-bar`
12
- - `metrics-strip`
13
- - `testimonial-grid`
14
- - `faq-section`
15
- - `pricing-plans`
16
- - `logo-cloud`
17
- - `site-header` (Minimal UI)
18
- - `centered-header` (Minimal UI)
19
- - `utility-header` (Minimal UI)
20
- - `site-footer` (Minimal UI)
21
- - `compact-footer` (Minimal UI)
22
- - `newsletter-footer` (Minimal UI)
23
- - `social-footer` (Minimal UI)
24
- - `download-section` (Wikex)
25
- - Bộ section Wikex Commodity cho landing, giới thiệu, chính sách, khiếu nại,
26
- thông tin, thông báo MXV, sản phẩm, biểu phí và coming-soon
27
-
28
- Các block Wikex Commodity thuộc category `wikex`, cho phép admin hiển thị riêng
29
- thư viện component của website hàng hóa.
30
-
31
- Package cũng export `wikexCommodityPageTemplates` và `wikexCommodityRoutes` từ
32
- entry `@enyxs/wikex-components/page-templates`. Đây là nguồn route/template dùng
33
- chung giữa frontend và CMS, không kéo Material UI vào code chỉ cần metadata route.
34
-
35
- Wikex download assets are stored in `src/wikex/assets/download-section/`. Replace the placeholder
36
- files there, then update `src/wikex/download-assets.ts` if the filenames or formats change.
37
-
38
- ## Install
39
-
40
- Before publishing to an npm registry, consume the versioned GitLab package:
41
-
42
- ```bash
43
- npm install git+ssh://git@gitlab.com/tamenyxs/wikex-components.git#v0.8.1
44
- ```
45
-
46
- ## Use with a CMS registry
47
-
48
- ```ts
49
- import { wikexCmsBlocks } from "@enyxs/wikex-components";
50
-
51
- export const cmsCodeBlocks = [...wikexCmsBlocks];
52
- ```
53
-
54
- The package has React, Material UI and Emotion as peer dependencies, so the host app owns their versions.
55
-
56
- ## Release
57
-
58
- ```bash
59
- npm run check
60
- npm run build
61
- git tag v0.8.1
62
- git push origin main --tags
63
- ```
64
-
65
-
66
- ### Editable fees and margin table
67
-
68
- `commodity-fees` supports editing every data cell and column title in CMS preview,
69
- adding/removing rows and columns with confirmation dialogs, and selecting multiple tags per row with MUI Select.
70
- Search ignores Vietnamese accents and searches commodity names/codes. Tag and
71
- search filters are combined before pagination (25 rows per page by default; selectable 5/10/25/50/100/all). Adding a row
72
- clears filters and opens its page. Deleting all rows keeps the table empty.
73
-
74
- CMS stores the table as JSON strings in `vi.feesTable` and `en.feesTable`, so the
75
- existing page save/publish flow persists it without separate database tables.
76
- Old pages retain their original sample table until edited. Visitors only get
77
- search, tag filters and pagination, with no editing controls.
78
-
79
- For another app, import `FeesTable` and `FeesTableData` from
80
- `@enyxs/wikex-components`. Pass controlled `value`, `onChange`, and `editable`.
81
- The component supplies its table theme; provide the package's existing icon
82
- assets for pagination, as with other Wikex components. Run `npm run test:fees`
83
- for data/search/pagination regression checks.
84
-
85
- Create tags from the toolbar dialog; unassigned tags persist in the table catalog.
86
- Editor textareas automatically fit their text. Header actions share an aligned row.
87
-
88
-
89
- ## Product UI and shared controls
90
-
91
- Import product UI from `@enyxs/wikex-components/products` and standalone
92
- `ProductCard`, `Pagination`, `Breadcrumb` (with their prop types) from
93
- `@enyxs/wikex-components/ui`. These are client entries; the product UI supplies
94
- its own styled-components theme. Standalone controls use the host's Wikex theme.
95
- Icons and the default product placeholder are bundled into the package.
96
-
97
- ```tsx
98
- import { ProductListing, ProductDetailView, ProductListingSkeleton } from '@enyxs/wikex-components/products';
99
-
100
- <ProductListing products={items} />
101
- <ProductDetailView product={detail} related={items} listingHref="/san-pham/" />
102
- <ProductListingSkeleton language="vi" />
103
- ```
104
-
105
- Each list item supplies `href`; the host owns the API, categories, publication
106
- rules, SEO and route generation. The detail view accepts introduction, contract
107
- specifications, quality tables (including per-table columns, units, conditions
108
- and source notes). Pass `language="en"`, `homeHref`, or `placeholderImage` to
109
- customize navigation, labels and fallback imagery. Product listing renders and
110
- paginates the supplied public list; category selection belongs to the host menu; no API is called by this UI.
111
- Existing CMS demo blocks remain available through the root entry.
112
-
113
- Run `npm run check`, `npm run build`, and `npm run test:products` before packaging.
114
- ESM and CommonJS builds preserve client directives and matching styled-components
115
- IDs for server rendering and hydration.
116
-
117
- ## Fees management UI and shared validation
118
-
119
- Import `FeesManager` and its prop types from `@enyxs/wikex-components/fees`.
120
- This controlled screen includes the table selector, language selector, save
121
- button, notices, row/column counts and the responsive management layout. Supply
122
- `entries`, `selectedId`, `language`, `table`, `dirtyKeys` (`id:language`),
123
- `canWrite`, `saving` and the selection/change/save callbacks. The host owns API
124
- calls, authentication, draft state and navigation warnings. The host may pass
125
- `statusChipVariant` if its MUI theme supports additional Chip variants.
126
-
127
- Import pure types, `validateFeesTable`, `defaultFeesTable`, `parseFeesTable`,
128
- filtering, pagination and ordering helpers from
129
- `@enyxs/wikex-components/fees/model`. This entry has no React or CMS dependency
130
- and can run on a backend. Strict validation throws for invalid table data;
131
- `parseFeesTable` retains public rendering's legacy fallback behavior.
132
-
133
- ## Consultation forms and management
134
-
135
- The original landing registration renderer accepts `onConsultationSubmit`, an
136
- async callback receiving `ConsultationSubmission` exported from the root entry.
137
- It preserves the existing form style, uses MUI selects and shows accessible
138
- success/error notices. While sending, fields are disabled; failures retain the
139
- values and submission ID for idempotent retries. Success clears all fields.
140
- Editable CMS previews do not submit live requests. The host owns the endpoint,
141
- validation, authentication and storage. The separate partnership form is unchanged.
142
-
143
- Use `ConsultationManager` from `@enyxs/wikex-components/consultations` for the
144
- controlled admin table, filters, pagination, detail/status/notes dialog and delete
145
- confirmation. Supply data, permissions and API callbacks. Pure models and labels
146
- are exported from `@enyxs/wikex-components/consultations/model`.