create-flowdular 0.4.0 → 0.4.1
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/agent-template/.ai/references/catalog/module.json +1 -1
- package/agent-template/.ai/references/catalog/package.json +2 -2
- package/agent-template/.ai/references/catalog/spec/module.yaml +1 -1
- package/agent-template/.ai/references/catalog/src/client/CatalogItemForm.tsrx +4 -4
- package/agent-template/.ai/references/catalog/src/client/CatalogView.tsrx +28 -27
- package/agent-template/.ai/references/catalog.provenance.json +8 -8
- package/package.json +1 -1
- package/template/default/modules/example/package.json +1 -1
- package/template/default/package.json +1 -1
- package/template/default/platform/package.json +1 -1
- package/template/default/platform/scripts/dev.mjs +16 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowdular/module-catalog",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"octane": "0.1.51",
|
|
18
18
|
"segment-state": "0.2.0",
|
|
19
|
-
"@flowdular/sdk": "0.
|
|
19
|
+
"@flowdular/sdk": "0.4.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@tsrx/typescript-plugin": "0.3.120",
|
|
@@ -48,7 +48,7 @@ export function CatalogItemForm(props: CatalogItemFormProps) @{
|
|
|
48
48
|
value={name}
|
|
49
49
|
onInput={(event) => setName(event.currentTarget.value)}
|
|
50
50
|
minlength={2}
|
|
51
|
-
|
|
51
|
+
maxLength={160}
|
|
52
52
|
autoFocus
|
|
53
53
|
required
|
|
54
54
|
/>
|
|
@@ -60,7 +60,7 @@ export function CatalogItemForm(props: CatalogItemFormProps) @{
|
|
|
60
60
|
value={sku}
|
|
61
61
|
onInput={(event) => setSku(event.currentTarget.value)}
|
|
62
62
|
disabled={props.item !== null}
|
|
63
|
-
|
|
63
|
+
maxLength={64}
|
|
64
64
|
required
|
|
65
65
|
/>
|
|
66
66
|
</FormField>
|
|
@@ -85,7 +85,7 @@ export function CatalogItemForm(props: CatalogItemFormProps) @{
|
|
|
85
85
|
name="unit"
|
|
86
86
|
value={unit}
|
|
87
87
|
onInput={(event) => setUnit(event.currentTarget.value)}
|
|
88
|
-
|
|
88
|
+
maxLength={24}
|
|
89
89
|
required
|
|
90
90
|
/>
|
|
91
91
|
</FormField>
|
|
@@ -114,7 +114,7 @@ export function CatalogItemForm(props: CatalogItemFormProps) @{
|
|
|
114
114
|
value={currency}
|
|
115
115
|
onInput={(event) => setCurrency(event.currentTarget.value)}
|
|
116
116
|
minlength={3}
|
|
117
|
-
|
|
117
|
+
maxLength={3}
|
|
118
118
|
required
|
|
119
119
|
/>
|
|
120
120
|
</FormField>
|
|
@@ -2,6 +2,11 @@ import { useEffect, useMemo } from 'octane';
|
|
|
2
2
|
import {
|
|
3
3
|
Alert,
|
|
4
4
|
Button,
|
|
5
|
+
CellCode,
|
|
6
|
+
CellNumber,
|
|
7
|
+
CellStack,
|
|
8
|
+
CellTag,
|
|
9
|
+
CellTime,
|
|
5
10
|
ConfirmDialog,
|
|
6
11
|
Drawer,
|
|
7
12
|
EmptyState,
|
|
@@ -13,7 +18,6 @@ import {
|
|
|
13
18
|
SearchField,
|
|
14
19
|
Select,
|
|
15
20
|
TableCard,
|
|
16
|
-
Tag,
|
|
17
21
|
ToastHost,
|
|
18
22
|
toasts,
|
|
19
23
|
type TableColumn,
|
|
@@ -91,63 +95,60 @@ function price(minor: number, currency: string): string {
|
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
function updatedAt(value: number): string {
|
|
95
|
-
return new Intl.DateTimeFormat(activeLocale(), {
|
|
96
|
-
dateStyle: 'medium',
|
|
97
|
-
timeStyle: 'short',
|
|
98
|
-
}).format(new Date(value));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
98
|
function columns(): readonly TableColumn<CatalogItem>[] {
|
|
102
99
|
return [
|
|
103
100
|
{
|
|
104
101
|
key: 'name',
|
|
105
102
|
header: t('catalog.table.column.name'),
|
|
106
|
-
width: '
|
|
103
|
+
width: 'auto',
|
|
107
104
|
value: (item) => item.name,
|
|
108
|
-
cell: (item) => <
|
|
109
|
-
<b>{item.name}</b>
|
|
110
|
-
<small>{item.unit}</small>
|
|
111
|
-
</span>,
|
|
105
|
+
cell: (item) => <CellStack primary={item.name} secondary={item.unit} />,
|
|
112
106
|
},
|
|
113
107
|
{
|
|
114
108
|
key: 'sku',
|
|
115
109
|
header: t('catalog.table.column.sku'),
|
|
116
|
-
width: '
|
|
110
|
+
width: '160px',
|
|
111
|
+
priority: 2,
|
|
117
112
|
value: (item) => item.sku,
|
|
118
|
-
cell: (item) => <
|
|
113
|
+
cell: (item) => <CellCode value={item.sku} />,
|
|
119
114
|
},
|
|
120
115
|
{
|
|
121
116
|
key: 'kind',
|
|
122
117
|
header: t('catalog.table.column.kind'),
|
|
123
|
-
width: '
|
|
118
|
+
width: '130px',
|
|
119
|
+
priority: 2,
|
|
124
120
|
cell: (item) =>
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
<CellTag
|
|
122
|
+
tone={item.kind === 'product' ? 'info' : 'neutral'}
|
|
123
|
+
label={t('catalog.kind.' + item.kind)}
|
|
124
|
+
/>,
|
|
128
125
|
},
|
|
129
126
|
{
|
|
130
127
|
key: 'price',
|
|
131
128
|
header: t('catalog.table.column.price'),
|
|
132
|
-
width: '
|
|
129
|
+
width: '140px',
|
|
133
130
|
numeric: true,
|
|
134
|
-
cell: (item) =>
|
|
131
|
+
cell: (item) =>
|
|
132
|
+
<CellNumber value={price(item.basePriceMinor, item.currency)} />,
|
|
135
133
|
},
|
|
136
134
|
{
|
|
137
135
|
key: 'updatedAt',
|
|
138
136
|
header: t('catalog.table.column.updated'),
|
|
139
|
-
width: '
|
|
137
|
+
width: '170px',
|
|
138
|
+
priority: 2,
|
|
140
139
|
value: (item) => item.updatedAt,
|
|
141
|
-
cell: (item) =>
|
|
140
|
+
cell: (item) => <CellTime value={item.updatedAt} />,
|
|
142
141
|
},
|
|
143
142
|
{
|
|
144
143
|
key: 'status',
|
|
145
144
|
header: t('catalog.table.column.status'),
|
|
146
|
-
width: '
|
|
145
|
+
width: '130px',
|
|
147
146
|
cell: (item) =>
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
<CellTag
|
|
148
|
+
tone={item.status === 'active' ? 'success' : 'neutral'}
|
|
149
|
+
dot
|
|
150
|
+
label={t('catalog.status.' + item.status)}
|
|
151
|
+
/>,
|
|
151
152
|
},
|
|
152
153
|
];
|
|
153
154
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "catalog.core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"repository": "Flowdular/official-modules",
|
|
5
|
-
"sourceCommit": "
|
|
6
|
-
"artifactSha256": "
|
|
5
|
+
"sourceCommit": "f38a67718c5a29aba5b5d37c0504430a3c7f565b",
|
|
6
|
+
"artifactSha256": "149808831d620ac0ebc50abb6b0fb2caef6bec66b5d7821c752ec811e5d9219f",
|
|
7
7
|
"files": {
|
|
8
8
|
"LICENSE": "155d722071bad9d0d832482e06fd5a47f7034389cb63aabcb39f4282aa3499fc",
|
|
9
9
|
"migrations/0001_catalog_core.down.sql": "0962a1edf0bde959cd4facccf77bd5b634d6cc25f125a0c79a61770c8871093f",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"migrations/0005_catalog_list_indexes.down.sql": "3dd547d738e75513abef502afc4bf9b51851ec9405b6b719c6134b897c5b1776",
|
|
18
18
|
"migrations/0005_catalog_list_indexes.up.sql": "dc3ece30b93fba0c91be58f772d1ae421cfbba49439e8c72a06aead6720f5db5",
|
|
19
19
|
"migrations/README.md": "2a15fd001713c2552a3c82b186246aa5fec136f43143cc2d9aa15bd491a09d41",
|
|
20
|
-
"module.json": "
|
|
21
|
-
"package.json": "
|
|
22
|
-
"spec/module.yaml": "
|
|
20
|
+
"module.json": "d2a98b70d60a433e1b3b6547352781048d562b996e3ee961f519d61ee1b623b9",
|
|
21
|
+
"package.json": "c23a99016f974d183189a05e4cfc4929788a46ae1ad65c623d66513e0880cdbd",
|
|
22
|
+
"spec/module.yaml": "992953d002574e83374c21e1ee7bef1d451c04b0180892856838d7c67404ce66",
|
|
23
23
|
"src/acl/permissions.ts": "3375521a5a229736ffac5a948140ec347dc7a7e4fba80e778c0baaf9e0622590",
|
|
24
24
|
"src/agent/tools.ts": "3403db7954906dc2c79227ba0420b5cb4bfb57063b7cfc285e6e556f16be9266",
|
|
25
25
|
"src/api/endpoints.ts": "205ef36d058f246f99b77336e7246a23aaca611c696a1f6f09758f66e8a93a29",
|
|
26
26
|
"src/api/list-cursor.ts": "dcb763edc0128a3aac95e9ca3c5158611a7f2c6a4c71484438c89b7f4d79bb0d",
|
|
27
27
|
"src/client/CatalogHistoryDrawer.tsrx": "6cdba5249be81e70da703cb34c1a2210943ce5e5fb596ee77cf7952e2acf3ee3",
|
|
28
|
-
"src/client/CatalogItemForm.tsrx": "
|
|
29
|
-
"src/client/CatalogView.tsrx": "
|
|
28
|
+
"src/client/CatalogItemForm.tsrx": "d621ac2a513635a5e38ee44726c07926bf035ec5e0dddca487c462cc7913d040",
|
|
29
|
+
"src/client/CatalogView.tsrx": "2c3e49bb1e54b58d636de0ddbb6ece429acf6aeadb6a0515ab52fca3baabec21",
|
|
30
30
|
"src/client/api.ts": "eaa55af81d26aa0190d19b3102c363c1ee25b2bdc05436446ac95dcde62aea75",
|
|
31
31
|
"src/client/contribution.tsrx": "6cbf79e6188bdf24b9cec4a06ae621e03efd5d0c76ad72b28828eee9155ab893",
|
|
32
32
|
"src/client/index.ts": "03eb0664cdafccb66cb25f2e1b07e6959c2dfa9bdbfffc3e7edf9b535ba4949a",
|
package/package.json
CHANGED
|
@@ -10,6 +10,14 @@ import {
|
|
|
10
10
|
} from '@flowdular/sdk/dev-console';
|
|
11
11
|
|
|
12
12
|
const appRoot = resolve(fileURLToPath(new URL('..', import.meta.url)));
|
|
13
|
+
/* `pnpm dev -- --port 4396 --host 0.0.0.0` overrides vite.config.ts, so a
|
|
14
|
+
second application runs beside the first one. */
|
|
15
|
+
const flag = (name) => {
|
|
16
|
+
const index = process.argv.indexOf(name);
|
|
17
|
+
return index === -1 ? undefined : process.argv[index + 1];
|
|
18
|
+
};
|
|
19
|
+
const port = Number(flag('--port'));
|
|
20
|
+
const host = flag('--host');
|
|
13
21
|
const verbose =
|
|
14
22
|
process.argv.includes('--verbose') ||
|
|
15
23
|
process.argv.includes('-v') ||
|
|
@@ -24,6 +32,11 @@ try {
|
|
|
24
32
|
configFile: resolve(appRoot, 'vite.config.ts'),
|
|
25
33
|
customLogger: createOctaneLogger(verbose, color),
|
|
26
34
|
clearScreen: false,
|
|
35
|
+
...(Number.isInteger(port) && port > 0
|
|
36
|
+
? { server: { port, strictPort: true, ...(host ? { host } : {}) } }
|
|
37
|
+
: host
|
|
38
|
+
? { server: { host } }
|
|
39
|
+
: {}),
|
|
27
40
|
});
|
|
28
41
|
await server.listen();
|
|
29
42
|
} catch (error) {
|
|
@@ -37,7 +50,9 @@ printReady({
|
|
|
37
50
|
lines: [
|
|
38
51
|
[
|
|
39
52
|
'local',
|
|
40
|
-
server.resolvedUrls?.local?.[0] ??
|
|
53
|
+
server.resolvedUrls?.local?.[0] ??
|
|
54
|
+
server.resolvedUrls?.network?.[0] ??
|
|
55
|
+
'the address vite.config.ts sets',
|
|
41
56
|
'info',
|
|
42
57
|
],
|
|
43
58
|
['diagnostics', verbose ? 'verbose' : 'quiet · use --verbose', 'muted'],
|