@simai-studio/view 1.1.0 → 1.2.0
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 +5 -5
- package/dist/package-receipt.json +310 -69
- package/dist/set.json +35 -2
- package/dist/smart/rule.js +94 -0
- package/dist/smart/rule.js.gz +0 -0
- package/dist/smart/view/component.json +1 -1
- package/dist/smart/view/component.json.gz +0 -0
- package/dist/smart/view/js/view.js +1 -1
- package/dist/smart/view/js/view.js.gz +0 -0
- package/dist/smart/view/js/view.min.js +1 -1
- package/dist/smart/view/js/view.min.js.gz +0 -0
- package/dist/smart/view/smart.manifest.json +1 -1
- package/dist/smart/view/smart.manifest.json.gz +0 -0
- package/dist/smart/view/static/default/open-record.html +1 -1
- package/dist/smart/view/static/default/open-record.html.gz +0 -0
- package/dist/smart/view/static/default/reference.html +1 -1
- package/dist/smart/view/static/default/reference.html.gz +0 -0
- package/dist/smart/view-flow/component.json +612 -0
- package/dist/smart/view-flow/component.json.gz +0 -0
- package/dist/smart/view-flow/css/view-flow.css +203 -0
- package/dist/smart/view-flow/css/view-flow.css.gz +0 -0
- package/dist/smart/view-flow/css/view-flow.min.css +2 -0
- package/dist/smart/view-flow/css/view-flow.min.css.gz +0 -0
- package/dist/smart/view-flow/examples.json +452 -0
- package/dist/smart/view-flow/examples.json.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.js +5858 -0
- package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.min.js +638 -0
- package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
- package/dist/smart/view-flow/lang/en.json +24 -0
- package/dist/smart/view-flow/lang/en.json.gz +0 -0
- package/dist/smart/view-flow/lang/ru.json +24 -0
- package/dist/smart/view-flow/lang/ru.json.gz +0 -0
- package/dist/smart/view-flow/probe.json +149 -0
- package/dist/smart/view-flow/probe.json.gz +0 -0
- package/dist/smart/view-flow/smart.manifest.json +478 -0
- package/dist/smart/view-flow/smart.manifest.json.gz +0 -0
- package/dist/smart/view-flow/static/default/answered.html +57 -0
- package/dist/smart/view-flow/static/default/answered.html.gz +0 -0
- package/dist/smart/view-flow/static/default/ask.html +146 -0
- package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
- package/dist/smart/view-flow/static/default/expired.html +16 -0
- package/dist/smart/view-flow/static/default/expired.html.gz +0 -0
- package/dist/smart/view-flow/static/default/groups.html +44 -0
- package/dist/smart/view-flow/static/default/groups.html.gz +0 -0
- package/dist/smart/view-flow/static/default/reference.html +72 -0
- package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
- package/dist/smart/view-flow/static/default/untitled.html +41 -0
- package/dist/smart/view-flow/static/default/untitled.html.gz +0 -0
- package/dist/smart/view-flow/static/sheets.json +443 -0
- package/dist/smart/view-flow/static/sheets.json.gz +0 -0
- package/dist/smart/view-flow/template/default.css +180 -0
- package/dist/smart/view-flow/template/default.css.gz +0 -0
- package/dist/smart/view-flow/template/default.js +136 -0
- package/dist/smart/view-flow/template/default.js.gz +0 -0
- package/dist/smart/view-properties/component.json +1 -1
- package/dist/smart/view-properties/component.json.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.js +59 -21
- package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.min.js +8 -6
- package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
- package/dist/smart/view-properties/smart.manifest.json +6 -2
- package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
- package/dist/smart/view-properties/template/default.js +1 -77
- package/dist/smart/view-properties/template/default.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.js +2 -0
- package/dist/smart/view-table/js/view-table.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.min.js +2 -0
- package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
- package/package.json +1 -1
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Flow block",
|
|
3
|
+
"runtime": {
|
|
4
|
+
"accept-text": "Send",
|
|
5
|
+
"accepted-text": "Sent",
|
|
6
|
+
"accepting-text": "Sending…",
|
|
7
|
+
"block-label": "Properties",
|
|
8
|
+
"cancel-text": "Cancel",
|
|
9
|
+
"decline-text": "Cancel",
|
|
10
|
+
"declined-text": "Cancelled",
|
|
11
|
+
"declining-text": "Cancelling…",
|
|
12
|
+
"empty-text": "not filled in",
|
|
13
|
+
"expired-text": "The time to answer has passed",
|
|
14
|
+
"invalid-text": "Fill in the marked fields",
|
|
15
|
+
"required-text": "Fill in this field",
|
|
16
|
+
"submit-text": "Send",
|
|
17
|
+
"until-text": "Answer by {time}"
|
|
18
|
+
},
|
|
19
|
+
"events": {
|
|
20
|
+
"expired": {
|
|
21
|
+
"label": "Expired"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Блок в потоке",
|
|
3
|
+
"runtime": {
|
|
4
|
+
"accept-text": "Отправить",
|
|
5
|
+
"accepted-text": "Отправлено",
|
|
6
|
+
"accepting-text": "Отправляем…",
|
|
7
|
+
"block-label": "Данные",
|
|
8
|
+
"cancel-text": "Отмена",
|
|
9
|
+
"decline-text": "Отмена",
|
|
10
|
+
"declined-text": "Отменено",
|
|
11
|
+
"declining-text": "Отменяем…",
|
|
12
|
+
"empty-text": "не заполнено",
|
|
13
|
+
"expired-text": "Время ответа истекло",
|
|
14
|
+
"invalid-text": "Заполните отмеченные поля",
|
|
15
|
+
"required-text": "Заполните поле",
|
|
16
|
+
"submit-text": "Отправить",
|
|
17
|
+
"until-text": "Ответить до {time}"
|
|
18
|
+
},
|
|
19
|
+
"events": {
|
|
20
|
+
"expired": {
|
|
21
|
+
"label": "Время истекло"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "sf-view-flow",
|
|
3
|
+
"probe": "sf-view-flow against component.json (standard simai.smart-component 1.4 §12, gate 20)",
|
|
4
|
+
"format": "stands/15-scenarios (A4 modal: a page, probes in steps); the runner is ui-source tests/browser/manifest-probes.browser.mjs, run for the package by scripts/run-manifest-probes.mjs",
|
|
5
|
+
"page": {
|
|
6
|
+
"lang": "ru",
|
|
7
|
+
"body": [
|
|
8
|
+
"<main>",
|
|
9
|
+
" <sf-view-flow id=\"b\" mode=\"edit\" heading=\"Новая командировка\" block-id=\"b1\" fields='[{\"key\": \"city\", \"label\": \"Город\", \"propertyType\": \"string\", \"width\": \"half\", \"required\": true, \"placeholder\": \"Куда\", \"value\": null}, {\"key\": \"from\", \"label\": \"Выезд\", \"propertyType\": \"date\", \"width\": \"half\", \"required\": true, \"value\": null}, {\"key\": \"nights\", \"label\": \"Ночей\", \"propertyType\": \"integer\", \"width\": \"half\", \"value\": 2}, {\"key\": \"goal\", \"label\": \"Цель поездки\", \"propertyType\": \"text\", \"width\": \"full\", \"placeholder\": \"Например, встреча с заказчиком\", \"value\": null}]'></sf-view-flow>",
|
|
10
|
+
" <sf-view-flow id=\"c\" mode=\"edit\" block-id=\"b2\" cancelable=\"false\" fields='[{\"key\": \"nights\", \"label\": \"Ночей\", \"propertyType\": \"integer\", \"width\": \"half\", \"value\": 2}]'></sf-view-flow>",
|
|
11
|
+
" <button id=\"page-send\" type=\"button\" data-sf-action=\"c.confirm\">Отправить</button>",
|
|
12
|
+
"</main>"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"probes": [
|
|
16
|
+
{
|
|
17
|
+
"id": "p1-required-stops-send",
|
|
18
|
+
"title": "Send with the required fields empty sends nothing: each says «Заполните поле», the status line «Заполните отмеченные поля», and the block stays open",
|
|
19
|
+
"covers": "actions.confirm refused invalid, required, accessibility.name heading",
|
|
20
|
+
"steps": [
|
|
21
|
+
{
|
|
22
|
+
"script": "(document.activeElement?.blur?.(), true)",
|
|
23
|
+
"wait": 60,
|
|
24
|
+
"check": "document.querySelector('#b section').getAttribute('aria-labelledby') === document.querySelector('#b [role=heading]').id"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"action": {
|
|
28
|
+
"name": "confirm"
|
|
29
|
+
},
|
|
30
|
+
"target": "#b",
|
|
31
|
+
"wait": 120,
|
|
32
|
+
"expect": {
|
|
33
|
+
"returns": {
|
|
34
|
+
"outcome": "refused",
|
|
35
|
+
"reason": "invalid"
|
|
36
|
+
},
|
|
37
|
+
"events": [
|
|
38
|
+
{
|
|
39
|
+
"name": "sf-view-flow-answer",
|
|
40
|
+
"count": 0
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"check": "document.querySelector('#b').state === 'open' && document.querySelectorAll('#b .sf-view-flow__error').length === 2 && document.querySelector('#b .sf-view-flow__status span').textContent.trim() === 'Заполните отмеченные поля'"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "p2-cancel",
|
|
50
|
+
"title": "Cancel answers {id, accepted: false}; the block is pending, then declined when the host settles it, and shows only «Отменено»",
|
|
51
|
+
"covers": "actions.cancel, events.answer, actions.settle",
|
|
52
|
+
"steps": [
|
|
53
|
+
{
|
|
54
|
+
"action": {
|
|
55
|
+
"name": "cancel"
|
|
56
|
+
},
|
|
57
|
+
"target": "#b",
|
|
58
|
+
"expect": {
|
|
59
|
+
"returns": {
|
|
60
|
+
"outcome": "applied"
|
|
61
|
+
},
|
|
62
|
+
"events": [
|
|
63
|
+
{
|
|
64
|
+
"name": "sf-view-flow-answer",
|
|
65
|
+
"count": 1,
|
|
66
|
+
"detail": {
|
|
67
|
+
"id": "b1",
|
|
68
|
+
"accepted": false
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"check": "document.querySelector('#b').state === 'pending'"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"action": {
|
|
77
|
+
"name": "settle",
|
|
78
|
+
"with": {
|
|
79
|
+
"result": {
|
|
80
|
+
"answer": "applied"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"target": "#b",
|
|
85
|
+
"wait": 120,
|
|
86
|
+
"expect": {
|
|
87
|
+
"returns": {
|
|
88
|
+
"outcome": "applied"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"check": "document.querySelector('#b').state === 'declined' && !document.querySelector('#b .sf-view-flow__groups') && document.querySelector('#b .sf-view-flow__status span').textContent.trim() === 'Отменено'"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "p3-page-trigger-send",
|
|
97
|
+
"title": "a page button data-sf-action=\"c.confirm\" sends the untitled block with its values; without Cancel there is one answer; the block is named «Данные»",
|
|
98
|
+
"covers": "actions.confirm (§8 page trigger), cancelable false, accessibility.name runtime.block-label",
|
|
99
|
+
"steps": [
|
|
100
|
+
{
|
|
101
|
+
"script": "(document.activeElement?.blur?.(), true)",
|
|
102
|
+
"wait": 60,
|
|
103
|
+
"check": "document.querySelectorAll('#c sf-button').length === 1 && document.querySelector('#c section').getAttribute('aria-label') === 'Данные'"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"user": "click:#page-send",
|
|
107
|
+
"expect": {
|
|
108
|
+
"events": [
|
|
109
|
+
{
|
|
110
|
+
"name": "sf-view-flow-answer",
|
|
111
|
+
"count": 1,
|
|
112
|
+
"detail": {
|
|
113
|
+
"id": "b2",
|
|
114
|
+
"accepted": true,
|
|
115
|
+
"values": {
|
|
116
|
+
"nights": 2
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"check": "document.querySelector('#c').state === 'pending'"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "p4-expired",
|
|
128
|
+
"title": "an open block past expires-at reads as expired, says sf-view-flow-expired once and offers no answer",
|
|
129
|
+
"covers": "events.expired (own verb)",
|
|
130
|
+
"steps": [
|
|
131
|
+
{
|
|
132
|
+
"script": "(document.querySelector('#c').state = 'open', document.querySelector('#c').setAttribute('expires-at', '2020-01-01T00:00:00Z'), true)",
|
|
133
|
+
"expect": {
|
|
134
|
+
"events": [
|
|
135
|
+
{
|
|
136
|
+
"name": "sf-view-flow-expired",
|
|
137
|
+
"count": 1,
|
|
138
|
+
"detail": {
|
|
139
|
+
"id": "b2"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"check": "document.querySelector('#c').shownState === 'expired' && document.querySelector('#c .sf-view-flow__actions').hidden"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 2,
|
|
3
|
+
"id": "smart.view-flow",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"title": "Flow block",
|
|
6
|
+
"summary": "A few properties as a block in a flow (a chat message, a feed, any stream): shows a record's fields, or asks for a few and sends them, then keeps the answer read-only. Fields are sf-view-properties' descriptors drawn by the Framework field renderers; a press is an event, the host answers with settle.",
|
|
7
|
+
"kind": "smart",
|
|
8
|
+
"reuse_mode": "whole",
|
|
9
|
+
"lifecycle": "experimental",
|
|
10
|
+
"tags": [
|
|
11
|
+
"record",
|
|
12
|
+
"properties",
|
|
13
|
+
"form",
|
|
14
|
+
"chat",
|
|
15
|
+
"feed"
|
|
16
|
+
],
|
|
17
|
+
"capabilities": [
|
|
18
|
+
"field-renderers",
|
|
19
|
+
"confirmation",
|
|
20
|
+
"expiry",
|
|
21
|
+
"live-announcement"
|
|
22
|
+
],
|
|
23
|
+
"custom_element": "sf-view-flow",
|
|
24
|
+
"templates": [
|
|
25
|
+
"default"
|
|
26
|
+
],
|
|
27
|
+
"exported_parts": [],
|
|
28
|
+
"composition": {
|
|
29
|
+
"uses": [
|
|
30
|
+
"component.icons",
|
|
31
|
+
"smart.avatar",
|
|
32
|
+
"smart.badge",
|
|
33
|
+
"smart.button",
|
|
34
|
+
"smart.button-group",
|
|
35
|
+
"smart.button-icon",
|
|
36
|
+
"smart.checkbox",
|
|
37
|
+
"smart.dropdown",
|
|
38
|
+
"smart.file-preview",
|
|
39
|
+
"smart.help-mark",
|
|
40
|
+
"smart.icon",
|
|
41
|
+
"smart.input",
|
|
42
|
+
"smart.input-color",
|
|
43
|
+
"smart.input-country",
|
|
44
|
+
"smart.input-date",
|
|
45
|
+
"smart.input-image",
|
|
46
|
+
"smart.input-quantity",
|
|
47
|
+
"smart.input-rich",
|
|
48
|
+
"smart.input-textarea",
|
|
49
|
+
"smart.list-item",
|
|
50
|
+
"smart.progress-scale",
|
|
51
|
+
"smart.reference-link",
|
|
52
|
+
"smart.slider-range",
|
|
53
|
+
"smart.spinner",
|
|
54
|
+
"smart.switch",
|
|
55
|
+
"smart.tag"
|
|
56
|
+
],
|
|
57
|
+
"public_parts": []
|
|
58
|
+
},
|
|
59
|
+
"inputs": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"properties": {
|
|
62
|
+
"template": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"default": "default",
|
|
65
|
+
"description": "Template variant name for SfBaseElement external templates.",
|
|
66
|
+
"const": "default"
|
|
67
|
+
},
|
|
68
|
+
"root-class": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"default": "",
|
|
71
|
+
"description": "Classes added to the root element the component draws."
|
|
72
|
+
},
|
|
73
|
+
"root-style": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"default": "",
|
|
76
|
+
"description": "Inline style declarations set on the root element the component draws, custom properties included."
|
|
77
|
+
},
|
|
78
|
+
"mode": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"default": "view",
|
|
81
|
+
"description": "view: the fields shown, read-only, with no foot. edit: the fields as controls and the answers at the foot (Send, Cancel); after the answer they are shown again, read-only.",
|
|
82
|
+
"enum": [
|
|
83
|
+
"view",
|
|
84
|
+
"edit"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"heading": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"default": "",
|
|
90
|
+
"description": "The header line; also the block's accessible name. Without one the block is named «Properties»."
|
|
91
|
+
},
|
|
92
|
+
"heading-level": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"default": "3",
|
|
95
|
+
"description": "The heading's level where the block is placed.",
|
|
96
|
+
"enum": [
|
|
97
|
+
"2",
|
|
98
|
+
"3",
|
|
99
|
+
"4",
|
|
100
|
+
"5",
|
|
101
|
+
"6"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"state": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"default": "open",
|
|
107
|
+
"description": "Where the answer is (edit mode). open: the controls and the answers. pending: an answer is on its way (set by a press). accepted: the values sent, read-only. declined, expired: only the outcome.",
|
|
108
|
+
"enum": [
|
|
109
|
+
"open",
|
|
110
|
+
"pending",
|
|
111
|
+
"accepted",
|
|
112
|
+
"declined",
|
|
113
|
+
"expired"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"expires-at": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"default": "",
|
|
119
|
+
"description": "ISO 8601. Past it an open block reads as expired and says so once with sf-view-flow-expired."
|
|
120
|
+
},
|
|
121
|
+
"block-id": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"default": "",
|
|
124
|
+
"description": "The host's name for the block, carried back in every event."
|
|
125
|
+
},
|
|
126
|
+
"disabled": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"default": false,
|
|
129
|
+
"description": "The controls and the answers are shown and cannot be used (an answer is on its way elsewhere in the flow)."
|
|
130
|
+
},
|
|
131
|
+
"size": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"default": "1/2",
|
|
134
|
+
"description": "The block's size: its text, labels and controls. 1/2 sits in a message.",
|
|
135
|
+
"enum": [
|
|
136
|
+
"1",
|
|
137
|
+
"1/2"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"cancelable": {
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"default": true,
|
|
143
|
+
"description": "Whether Cancel is offered beside Send."
|
|
144
|
+
},
|
|
145
|
+
"submit-text": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"description": "The sending answer; empty is Send in the page's language."
|
|
148
|
+
},
|
|
149
|
+
"cancel-text": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"description": "The cancelling answer; empty is Cancel in the page's language."
|
|
152
|
+
},
|
|
153
|
+
"empty-text": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"description": "What an empty value reads as."
|
|
156
|
+
},
|
|
157
|
+
"required-text": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"description": "Said under a required field left empty when Send is pressed."
|
|
160
|
+
},
|
|
161
|
+
"invalid-text": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"description": "The status line when Send was stopped by the fields."
|
|
164
|
+
},
|
|
165
|
+
"fields": {
|
|
166
|
+
"type": "array",
|
|
167
|
+
"default": [],
|
|
168
|
+
"description": "The field descriptors, sf-view-properties' shape (key, label, propertyType, value, required, readonly, width, hint, options, when ...). JSON in markup; a property set from script wins."
|
|
169
|
+
},
|
|
170
|
+
"groups": {
|
|
171
|
+
"type": "array",
|
|
172
|
+
"default": [],
|
|
173
|
+
"description": "Named groups of field descriptors, each optionally collapsible (collapsible, collapsed). Wins over fields when both are given."
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"additionalProperties": false
|
|
177
|
+
},
|
|
178
|
+
"item_contract": {},
|
|
179
|
+
"contracts": {
|
|
180
|
+
"field": {
|
|
181
|
+
"const": "The field descriptor of simai.property-view-port (sf-view-properties): key, label, propertyType, value, required, readonly, width (half|full), hint, placeholder, options, min, max, step, unit, variant, multiple, mask, when."
|
|
182
|
+
},
|
|
183
|
+
"answers": {
|
|
184
|
+
"const": "Send checks the required fields and the controls' own entries, moves the block to pending and dispatches sf-view-flow-answer {id, accepted: true, values} (cancelable; a cancelled event reopens it). Cancel dispatches {id, accepted: false}. The host answers with settle({answer: applied|refused, errors, message, values}) or sets state."
|
|
185
|
+
},
|
|
186
|
+
"slots": {
|
|
187
|
+
"type": "object",
|
|
188
|
+
"properties": {
|
|
189
|
+
"description": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"description": "A line under the heading."
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"methods": {
|
|
197
|
+
"open": {
|
|
198
|
+
"summary": "Puts the question again (state open); asked by an assembly it answers {accepted, reason, value} when the person answers or the time runs out.",
|
|
199
|
+
"arguments": [],
|
|
200
|
+
"returns": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"description": "{outcome: applied} or {outcome: refused, reason}"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"answer": {
|
|
206
|
+
"summary": "Answer as the person would: accepted true sends (after the block's own check of the fields), false cancels. Refused invalid, closed, disabled or prevented.",
|
|
207
|
+
"arguments": [
|
|
208
|
+
{
|
|
209
|
+
"name": "accepted",
|
|
210
|
+
"schema": {
|
|
211
|
+
"type": "boolean"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
"returns": {
|
|
216
|
+
"type": "object",
|
|
217
|
+
"description": "{outcome: applied} or {outcome: refused, reason}"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"confirm": {
|
|
221
|
+
"summary": "Send; data-sf-action=\"<id>.confirm\".",
|
|
222
|
+
"arguments": [],
|
|
223
|
+
"returns": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"description": "{outcome: applied} or {outcome: refused, reason}"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"cancel": {
|
|
229
|
+
"summary": "Cancel; data-sf-action=\"<id>.cancel\".",
|
|
230
|
+
"arguments": [],
|
|
231
|
+
"returns": {
|
|
232
|
+
"type": "object",
|
|
233
|
+
"description": "{outcome: applied} or {outcome: refused, reason}"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"settle": {
|
|
237
|
+
"summary": "The host's answer to an answer, in the record port's words: {answer: applied, values?} shows the values sent, read-only; {answer: refused, errors?, message?} reopens the block with each error under its field; reason closed or expired closes it.",
|
|
238
|
+
"arguments": [
|
|
239
|
+
{
|
|
240
|
+
"name": "result",
|
|
241
|
+
"schema": {
|
|
242
|
+
"type": "object"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"returns": {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"description": "{outcome: applied} or {outcome: refused, reason}"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"events": {
|
|
253
|
+
"sf-view-flow-answer": {
|
|
254
|
+
"summary": "The person answered (vocabulary answer): Send with the values, or Cancel. Cancel the event to keep the block open.",
|
|
255
|
+
"payload": {
|
|
256
|
+
"type": "object",
|
|
257
|
+
"required": [
|
|
258
|
+
"id",
|
|
259
|
+
"accepted"
|
|
260
|
+
],
|
|
261
|
+
"properties": {
|
|
262
|
+
"id": {
|
|
263
|
+
"description": "block-id"
|
|
264
|
+
},
|
|
265
|
+
"accepted": {
|
|
266
|
+
"type": "boolean"
|
|
267
|
+
},
|
|
268
|
+
"values": {
|
|
269
|
+
"type": "object",
|
|
270
|
+
"description": "With accepted true: every shown, editable field's value by key."
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"additionalProperties": true
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"sf-view-flow-expired": {
|
|
277
|
+
"summary": "An open block passed expires-at; said once per time.",
|
|
278
|
+
"payload": {
|
|
279
|
+
"type": "object",
|
|
280
|
+
"required": [
|
|
281
|
+
"id"
|
|
282
|
+
],
|
|
283
|
+
"properties": {
|
|
284
|
+
"id": {
|
|
285
|
+
"description": "block-id"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"additionalProperties": true
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"sf-view-flow-open": {
|
|
292
|
+
"summary": "A reference value (a record, a user) was pressed, vocabulary open: {id, field, value}. Following it is the host's.",
|
|
293
|
+
"payload": {
|
|
294
|
+
"type": "object",
|
|
295
|
+
"required": [
|
|
296
|
+
"id",
|
|
297
|
+
"field",
|
|
298
|
+
"value"
|
|
299
|
+
],
|
|
300
|
+
"properties": {
|
|
301
|
+
"id": {
|
|
302
|
+
"description": "block-id"
|
|
303
|
+
},
|
|
304
|
+
"field": {
|
|
305
|
+
"type": "string"
|
|
306
|
+
},
|
|
307
|
+
"value": {
|
|
308
|
+
"type": "object"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"additionalProperties": true
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"state": {
|
|
316
|
+
"machines": {
|
|
317
|
+
"answer": [
|
|
318
|
+
"open",
|
|
319
|
+
"pending",
|
|
320
|
+
"accepted",
|
|
321
|
+
"declined",
|
|
322
|
+
"expired"
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
"visual_states": [
|
|
326
|
+
"default",
|
|
327
|
+
"loading",
|
|
328
|
+
"success",
|
|
329
|
+
"error",
|
|
330
|
+
"disabled"
|
|
331
|
+
]
|
|
332
|
+
},
|
|
333
|
+
"persistence": {
|
|
334
|
+
"mode": "none",
|
|
335
|
+
"source_of_truth": "host",
|
|
336
|
+
"network_owner": "host",
|
|
337
|
+
"revision_field": null
|
|
338
|
+
},
|
|
339
|
+
"ownership": {
|
|
340
|
+
"source": "simai/ui-view",
|
|
341
|
+
"data": "host",
|
|
342
|
+
"effects": "host",
|
|
343
|
+
"forbidden_client_responsibilities": [
|
|
344
|
+
"saving the values",
|
|
345
|
+
"validating beyond required fields and the controls' own entries",
|
|
346
|
+
"access decisions"
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
"security": {
|
|
350
|
+
"permissions_owner": "host",
|
|
351
|
+
"untrusted_inputs": [
|
|
352
|
+
"heading, labels and values (drawn by the field renderers as text)"
|
|
353
|
+
],
|
|
354
|
+
"network_policy": "deny"
|
|
355
|
+
},
|
|
356
|
+
"accessibility": {
|
|
357
|
+
"role": "region",
|
|
358
|
+
"accessible_name": "internal",
|
|
359
|
+
"keyboard": [
|
|
360
|
+
"Tab",
|
|
361
|
+
"Enter",
|
|
362
|
+
"Space"
|
|
363
|
+
],
|
|
364
|
+
"focus": "A section named by its heading (role=heading at heading-level). The status line is a polite live region, present before it speaks; when the answers go, focus moves to it; when Send is stopped or refused, to the first field in error."
|
|
365
|
+
},
|
|
366
|
+
"presentation": {
|
|
367
|
+
"themes": [
|
|
368
|
+
"light",
|
|
369
|
+
"dark"
|
|
370
|
+
],
|
|
371
|
+
"locales": [
|
|
372
|
+
"en",
|
|
373
|
+
"ru"
|
|
374
|
+
],
|
|
375
|
+
"responsive": [
|
|
376
|
+
"desktop",
|
|
377
|
+
"mobile"
|
|
378
|
+
],
|
|
379
|
+
"skeleton": {
|
|
380
|
+
"shape": "none",
|
|
381
|
+
"while_loading": "none"
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
"adapter": {
|
|
385
|
+
"kind": "generic",
|
|
386
|
+
"protocol": "simai.smart-studio-adapter.v1",
|
|
387
|
+
"module": null
|
|
388
|
+
},
|
|
389
|
+
"artifacts": {
|
|
390
|
+
"fixtures": [],
|
|
391
|
+
"scenarios": []
|
|
392
|
+
},
|
|
393
|
+
"readiness": {
|
|
394
|
+
"level": "host-required",
|
|
395
|
+
"required_checks": [
|
|
396
|
+
"manifest",
|
|
397
|
+
"loader-rule",
|
|
398
|
+
"view-flow-contract",
|
|
399
|
+
"view-flow-browser"
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
"compatibility": {
|
|
403
|
+
"contract_schema": {
|
|
404
|
+
"id": "https://simai.io/contracts/smart-component-manifest.v2.schema.json",
|
|
405
|
+
"version": 2
|
|
406
|
+
},
|
|
407
|
+
"runtime_pair": {
|
|
408
|
+
"ui_revision": "62b1d9b6dc8d390837b7daa7c28a4543297521ad",
|
|
409
|
+
"ui_smart_revision": "62b1d9b6dc8d390837b7daa7c28a4543297521ad"
|
|
410
|
+
},
|
|
411
|
+
"aliases": [],
|
|
412
|
+
"deprecations": [],
|
|
413
|
+
"replacement": null,
|
|
414
|
+
"migrations": []
|
|
415
|
+
},
|
|
416
|
+
"provenance": {
|
|
417
|
+
"source_repository": "simai/ui-view",
|
|
418
|
+
"source_revision": "94a63c638f63c0cae50623b2f911a3120e4c5a6b",
|
|
419
|
+
"source_artifacts": [
|
|
420
|
+
{
|
|
421
|
+
"path": "src/smart/view-flow/index.js",
|
|
422
|
+
"sha256": "8a519d3bb7a6bda52339aa2a74ad905bce8d898022bc5c9c6d819e2b4663366b"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"path": "src/smart/view-flow/js/answer.js",
|
|
426
|
+
"sha256": "7ade765807ce11ef2ebeb813f8d91e6e742a8cf94ea147e01738e928d6a348fc"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"path": "src/smart/view-flow/js/templates/default.js",
|
|
430
|
+
"sha256": "dff4ddc80b56d3fb07b1481441ca6ec0248678e9513b95319e05f0f471c8d504"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"path": "src/smart/view-flow/js/templates/default.css",
|
|
434
|
+
"sha256": "1950e47fd8609d263df3d15745cb190d377fbd9a1f59d4e1705e9aa6a4f8f18d"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"path": "src/smart/view-properties/js/field-value.js",
|
|
438
|
+
"sha256": "18194d28683ab6dc3f876cd4f39928745017b5e03f2abd310876c079ffe74188"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"path": "src/smart/view-properties/js/conditions.js",
|
|
442
|
+
"sha256": "bf48b0bf4d2affb43433d1142b1a0ca57e22dc26088c5bd0b28e3212fba7134b"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"path": "src/smart/helpers/confirm-surface.js",
|
|
446
|
+
"sha256": "d46e8651582d9fcba73394af057fed4d8dc79c3ee5b8b525abb689d41a0613c4"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"path": "src/smart/view-flow/rule.js",
|
|
450
|
+
"sha256": "e91d2c9ebaa697679a5911af4a884beeedc9e6eab09667277599e52b7fa6369c"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
"path": "src/smart/view-flow/docs.md",
|
|
454
|
+
"sha256": "6c9e6914dadee80e973c8e4171f7b1aac3895e5a8dc9dc75b8e8edf49b24c9bb"
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"generated_runtime": []
|
|
458
|
+
},
|
|
459
|
+
"ai_guidance": {
|
|
460
|
+
"use_when": "Use sf-view-flow for a few properties inside a flow: an assistant's answer showing a record, or asking the person to fill in a few fields and send them. For a record on a page or in a panel use sf-view-properties.",
|
|
461
|
+
"do_not": [
|
|
462
|
+
"Do not save in the element; answer the answer event and call settle",
|
|
463
|
+
"Do not leave the block pending: settle it, or set state",
|
|
464
|
+
"Do not send markup in labels or values"
|
|
465
|
+
],
|
|
466
|
+
"required_reads": [
|
|
467
|
+
"inputs",
|
|
468
|
+
"contracts",
|
|
469
|
+
"events",
|
|
470
|
+
"accessibility"
|
|
471
|
+
],
|
|
472
|
+
"minimal_example": "<sf-view-flow mode=\"edit\" heading=\"Командировка\" block-id=\"b1\" fields='[{\"key\":\"city\",\"label\":\"Город\",\"propertyType\":\"string\",\"required\":true}]'></sf-view-flow>",
|
|
473
|
+
"owner_commands": [
|
|
474
|
+
"node scripts/test.mjs",
|
|
475
|
+
"node scripts/run-browser-probes.mjs <free> <set build>"
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
}
|
|
Binary file
|