@milaboratories/milaboratories.ui-examples.model 1.1.20 → 1.1.22
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/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +13 -0
- package/dist/bundle.js +112 -99
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +3 -3
- package/src/index.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/milaboratories.ui-examples.model",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.22",
|
|
4
4
|
"description": "Block model",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"zod": "~3.23.8",
|
|
11
|
-
"@platforma-sdk/model": "1.22.
|
|
11
|
+
"@platforma-sdk/model": "1.22.97"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"typescript": "~5.5.4",
|
|
15
15
|
"vite": "^5.4.11",
|
|
16
16
|
"tsup": "~8.3.5",
|
|
17
|
-
"@platforma-sdk/block-tools": "2.5.
|
|
17
|
+
"@platforma-sdk/block-tools": "2.5.18"
|
|
18
18
|
},
|
|
19
19
|
"tsup": {
|
|
20
20
|
"entry": [
|
package/src/index.ts
CHANGED
|
@@ -37,6 +37,14 @@ export const platforma = BlockModel.create('Heavy')
|
|
|
37
37
|
|
|
38
38
|
.withUiState<UiState>({ dataTableState: undefined, dynamicSections: [] })
|
|
39
39
|
|
|
40
|
+
.argsValid((ctx) => {
|
|
41
|
+
if (ctx.args.numbers.length === 5) {
|
|
42
|
+
throw new Error('argsValid: test error');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return ctx.args.numbers.length > 0;
|
|
46
|
+
})
|
|
47
|
+
|
|
40
48
|
.output('numbers', (ctx) => ctx.outputs?.resolve('numbers')?.getDataAsJson<number[]>())
|
|
41
49
|
|
|
42
50
|
.output('pt', (ctx) => {
|
|
@@ -88,6 +96,14 @@ export const platforma = BlockModel.create('Heavy')
|
|
|
88
96
|
);
|
|
89
97
|
})
|
|
90
98
|
|
|
99
|
+
.title((ctx) => {
|
|
100
|
+
if (ctx.args.numbers.length === 5) {
|
|
101
|
+
throw new Error('block title: test error');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return 'Ui Examples';
|
|
105
|
+
})
|
|
106
|
+
|
|
91
107
|
.sections((ctx) => {
|
|
92
108
|
const dynamicSections = (ctx.uiState.dynamicSections ?? []).map((it) => ({
|
|
93
109
|
type: 'link' as const,
|
|
@@ -95,6 +111,10 @@ export const platforma = BlockModel.create('Heavy')
|
|
|
95
111
|
label: it.label,
|
|
96
112
|
}));
|
|
97
113
|
|
|
114
|
+
if (dynamicSections.some((it) => it.label === 'Error')) {
|
|
115
|
+
throw new Error('sections: test error');
|
|
116
|
+
}
|
|
117
|
+
|
|
98
118
|
return [
|
|
99
119
|
{ type: 'link', href: '/loaders', label: 'Loaders' },
|
|
100
120
|
{ type: 'link', href: '/', label: 'Icons/Masks' },
|