@enyxs/wikex-components 0.11.22 → 0.11.23
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 +17 -0
- package/dist/chrome-model-BZjSLS8a.d.mts +74 -0
- package/dist/chrome-model-CAlcJpU4.d.ts +74 -0
- package/dist/chrome-model.d.mts +3 -0
- package/dist/chrome-model.d.ts +3 -0
- package/dist/chrome-model.js +1165 -0
- package/dist/chrome-model.js.map +1 -0
- package/dist/chrome-model.mjs +1138 -0
- package/dist/chrome-model.mjs.map +1 -0
- package/dist/index.d.mts +5 -70
- package/dist/index.d.ts +5 -70
- package/dist/index.js +10949 -10895
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10943 -10890
- package/dist/index.mjs.map +1 -1
- package/dist/manifest.json +512 -67
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -144,3 +144,20 @@ Use `ConsultationManager` from `@enyxs/wikex-components/consultations` for the
|
|
|
144
144
|
controlled admin table, filters, pagination, detail/status/notes dialog and delete
|
|
145
145
|
confirmation. Supply data, permissions and API callbacks. Pure models and labels
|
|
146
146
|
are exported from `@enyxs/wikex-components/consultations/model`.
|
|
147
|
+
|
|
148
|
+
## Editable Wikex header and footer lists
|
|
149
|
+
|
|
150
|
+
`commodity-header` defines `vi.header.menuItems` and `en.header.menuItems`.
|
|
151
|
+
Each item has `label`, `href`, and a `children` list with its own `label`/`href` items.
|
|
152
|
+
|
|
153
|
+
`commodity-footer` defines these lists in both languages:
|
|
154
|
+
`footer.aboutLinks`, `footer.productLinks`, `footer.guideLinks`,
|
|
155
|
+
`footer.supportLinks`, `footer.contacts`, `footer.socials`, and `footer.downloads`.
|
|
156
|
+
Contact, social, and download items include an `icon`; downloads also have `prefix`.
|
|
157
|
+
Lists and nested lists use JSON strings, following the existing CMS field contract.
|
|
158
|
+
An explicit `[]` removes a list's items.
|
|
159
|
+
|
|
160
|
+
Hosts can import `migrateWikexChromeContent` from
|
|
161
|
+
`@enyxs/wikex-components/chrome/model` before merging defaults or saving content.
|
|
162
|
+
It migrates legacy labels, links, text formatting, and removed items into the lists;
|
|
163
|
+
renderers also apply this migration for older saved pages.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ConsultationSubmission } from './consultation-model.mjs';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
|
|
4
|
+
type CmsFieldType = "text" | "textarea" | "richText" | "image" | "link" | "number" | "select" | "list";
|
|
5
|
+
type CmsListItemField = {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
type: "text" | "textarea" | "richText" | "link" | "image" | "list";
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
itemFields?: CmsListItemField[];
|
|
12
|
+
};
|
|
13
|
+
type CmsFieldDefinition = {
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
type: CmsFieldType;
|
|
17
|
+
group?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
helperText?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
options?: Array<{
|
|
22
|
+
value: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}>;
|
|
25
|
+
hidden?: boolean;
|
|
26
|
+
itemFields?: CmsListItemField[];
|
|
27
|
+
};
|
|
28
|
+
type CmsComponentCategory = "minimal-ui" | "wikex" | "estate";
|
|
29
|
+
type CmsComponentPlacement = "header" | "content" | "footer";
|
|
30
|
+
type CmsComponentDefinition = {
|
|
31
|
+
kind: "cms-component";
|
|
32
|
+
category: CmsComponentCategory;
|
|
33
|
+
placement?: CmsComponentPlacement;
|
|
34
|
+
hidden?: boolean;
|
|
35
|
+
type: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
icon: string;
|
|
39
|
+
fields: CmsFieldDefinition[];
|
|
40
|
+
defaults: Record<string, string | number>;
|
|
41
|
+
};
|
|
42
|
+
type CmsRendererProps = {
|
|
43
|
+
onConsultationSubmit?: (data: ConsultationSubmission) => Promise<void>;
|
|
44
|
+
content: Record<string, string | number>;
|
|
45
|
+
editable?: boolean;
|
|
46
|
+
readOnlyFields?: string[];
|
|
47
|
+
onChange?: (field: string, value: string) => void;
|
|
48
|
+
onSelectText?: (target: CmsTextTarget) => void;
|
|
49
|
+
selectedTextField?: string;
|
|
50
|
+
onImageRequest?: (field: string, listItem?: {
|
|
51
|
+
index: number;
|
|
52
|
+
key: string;
|
|
53
|
+
}) => void;
|
|
54
|
+
onAddListItem?: () => void;
|
|
55
|
+
};
|
|
56
|
+
type CmsTextTarget = {
|
|
57
|
+
field: string;
|
|
58
|
+
listField?: string;
|
|
59
|
+
itemIndex?: number;
|
|
60
|
+
itemKey?: string;
|
|
61
|
+
nestedListField?: string;
|
|
62
|
+
nestedItemIndex?: number;
|
|
63
|
+
nestedItemKey?: string;
|
|
64
|
+
currentColor?: string;
|
|
65
|
+
};
|
|
66
|
+
type CmsBlock = {
|
|
67
|
+
definition: CmsComponentDefinition;
|
|
68
|
+
Renderer: ComponentType<CmsRendererProps>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type Content = CmsRendererProps['content'];
|
|
72
|
+
declare function migrateWikexChromeContent(type: string, content: Content): Content;
|
|
73
|
+
|
|
74
|
+
export { type CmsBlock as C, type CmsRendererProps as a, type CmsTextTarget as b, type CmsComponentDefinition as c, type CmsComponentCategory as d, type CmsComponentPlacement as e, type CmsFieldDefinition as f, type CmsFieldType as g, type CmsListItemField as h, migrateWikexChromeContent as m };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ConsultationSubmission } from './consultation-model.js';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
|
|
4
|
+
type CmsFieldType = "text" | "textarea" | "richText" | "image" | "link" | "number" | "select" | "list";
|
|
5
|
+
type CmsListItemField = {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
type: "text" | "textarea" | "richText" | "link" | "image" | "list";
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
itemFields?: CmsListItemField[];
|
|
12
|
+
};
|
|
13
|
+
type CmsFieldDefinition = {
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
type: CmsFieldType;
|
|
17
|
+
group?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
helperText?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
options?: Array<{
|
|
22
|
+
value: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}>;
|
|
25
|
+
hidden?: boolean;
|
|
26
|
+
itemFields?: CmsListItemField[];
|
|
27
|
+
};
|
|
28
|
+
type CmsComponentCategory = "minimal-ui" | "wikex" | "estate";
|
|
29
|
+
type CmsComponentPlacement = "header" | "content" | "footer";
|
|
30
|
+
type CmsComponentDefinition = {
|
|
31
|
+
kind: "cms-component";
|
|
32
|
+
category: CmsComponentCategory;
|
|
33
|
+
placement?: CmsComponentPlacement;
|
|
34
|
+
hidden?: boolean;
|
|
35
|
+
type: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
icon: string;
|
|
39
|
+
fields: CmsFieldDefinition[];
|
|
40
|
+
defaults: Record<string, string | number>;
|
|
41
|
+
};
|
|
42
|
+
type CmsRendererProps = {
|
|
43
|
+
onConsultationSubmit?: (data: ConsultationSubmission) => Promise<void>;
|
|
44
|
+
content: Record<string, string | number>;
|
|
45
|
+
editable?: boolean;
|
|
46
|
+
readOnlyFields?: string[];
|
|
47
|
+
onChange?: (field: string, value: string) => void;
|
|
48
|
+
onSelectText?: (target: CmsTextTarget) => void;
|
|
49
|
+
selectedTextField?: string;
|
|
50
|
+
onImageRequest?: (field: string, listItem?: {
|
|
51
|
+
index: number;
|
|
52
|
+
key: string;
|
|
53
|
+
}) => void;
|
|
54
|
+
onAddListItem?: () => void;
|
|
55
|
+
};
|
|
56
|
+
type CmsTextTarget = {
|
|
57
|
+
field: string;
|
|
58
|
+
listField?: string;
|
|
59
|
+
itemIndex?: number;
|
|
60
|
+
itemKey?: string;
|
|
61
|
+
nestedListField?: string;
|
|
62
|
+
nestedItemIndex?: number;
|
|
63
|
+
nestedItemKey?: string;
|
|
64
|
+
currentColor?: string;
|
|
65
|
+
};
|
|
66
|
+
type CmsBlock = {
|
|
67
|
+
definition: CmsComponentDefinition;
|
|
68
|
+
Renderer: ComponentType<CmsRendererProps>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type Content = CmsRendererProps['content'];
|
|
72
|
+
declare function migrateWikexChromeContent(type: string, content: Content): Content;
|
|
73
|
+
|
|
74
|
+
export { type CmsBlock as C, type CmsRendererProps as a, type CmsTextTarget as b, type CmsComponentDefinition as c, type CmsComponentCategory as d, type CmsComponentPlacement as e, type CmsFieldDefinition as f, type CmsFieldType as g, type CmsListItemField as h, migrateWikexChromeContent as m };
|