@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/milaboratories.ui-examples.model",
3
- "version": "1.1.20",
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.59"
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.14"
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' },