@nullplatform/ui-plugin-sdk 0.18.0 → 0.19.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/dist/calendar.d.ts +58 -0
- package/dist/calendar.js +1 -0
- package/dist/components.d.ts +1 -0
- package/dist/components.generated.d.ts +144 -6
- package/dist/components.generated.js +12 -1
- package/dist/contract/allowlist.d.ts +5 -0
- package/dist/contract/allowlist.js +78 -0
- package/dist/contract/documents.d.ts +71 -0
- package/dist/contract/documents.js +237 -0
- package/dist/contract/index.d.ts +3 -2
- package/dist/contract/index.js +3 -2
- package/dist/contract/manifest.d.ts +9 -0
- package/dist/contract/manifest.js +24 -1
- package/dist/contract/pageTemplate.d.ts +36 -0
- package/dist/contract/pageTemplate.js +125 -0
- package/dist/contract-cjs/allowlist.js +79 -0
- package/dist/contract-cjs/documents.js +244 -0
- package/dist/contract-cjs/index.js +9 -1
- package/dist/contract-cjs/manifest.js +25 -1
- package/dist/contract-cjs/pageTemplate.js +130 -0
- package/dist/contractProps.d.ts +23 -0
- package/dist/contracts.generated.d.ts +157 -0
- package/dist/contracts.generated.js +78 -2
- package/package.json +2 -2
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentError = exports.DOCUMENT_NODE_TYPES = exports.DOCUMENT_VOCABULARY_LINE = exports.DOCUMENT_PROFILES = void 0;
|
|
4
|
+
exports.validatePluginDocument = validatePluginDocument;
|
|
5
|
+
exports.assertDocumentVocabulary = assertDocumentVocabulary;
|
|
6
|
+
exports.documentReadCheck = documentReadCheck;
|
|
7
|
+
const allowlist_1 = require("./allowlist");
|
|
8
|
+
/**
|
|
9
|
+
* Plugin documents (contracts 6 to 8): a `document` contribution is a JSON view in the SDUI vocabulary that the host
|
|
10
|
+
* draws with no plugin code running. This module holds the plugin profile's first cut: which node types a document may
|
|
11
|
+
* use, and the rule every read obeys. The full shape of each node is `@nullplatform/sdui-spec`'s to check, and the
|
|
12
|
+
* caller passes the spec in (`assertDocumentVocabulary`) until it is published, so the SDK depends on no renderer.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The plugin profile per vocabulary line (contract 7, proposal to validate with the SDUI owners): the node types a
|
|
16
|
+
* plugin document of that line may use. Within a line the list only grows, so a document published once keeps
|
|
17
|
+
* drawing; a change that would break one opens a new line. A document declares its line in its root (`vocabulary`),
|
|
18
|
+
* the `VOCABULARY_LINE` of `@nullplatform/sdui-spec`.
|
|
19
|
+
*
|
|
20
|
+
* Line 1, the first cut: layouts, labels, read controls, collections drawn as tables and navigation. Left out until
|
|
21
|
+
* the profile grows: `Definition` and `Reference` (the server expands them), `Page`, `Outlet`, `Slot`,
|
|
22
|
+
* `Categorization` and `Category` (routing and placement are the host's), and `Component` (another plugin's code).
|
|
23
|
+
*/
|
|
24
|
+
exports.DOCUMENT_PROFILES = {
|
|
25
|
+
1: ['VerticalLayout', 'HorizontalLayout', 'GridLayout', 'Group', 'Label', 'Control', 'Collection', 'Action'],
|
|
26
|
+
};
|
|
27
|
+
/** The line documents are written in today; the API accepts every line in `DOCUMENT_PROFILES`. */
|
|
28
|
+
exports.DOCUMENT_VOCABULARY_LINE = 1;
|
|
29
|
+
/** Node types of the current line's profile. */
|
|
30
|
+
exports.DOCUMENT_NODE_TYPES = exports.DOCUMENT_PROFILES[exports.DOCUMENT_VOCABULARY_LINE];
|
|
31
|
+
class DocumentError extends Error {
|
|
32
|
+
constructor(message) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.name = 'DocumentError';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.DocumentError = DocumentError;
|
|
38
|
+
/**
|
|
39
|
+
* Keys that write, ask with a body, or need the server, anywhere in the document: a draft and its checks, pickers
|
|
40
|
+
* (`choices` reads candidates as a form), steps after an action, `rule` (expressions over the data, not in this
|
|
41
|
+
* cut), and what only the server writes (`contributions`, `release`).
|
|
42
|
+
*/
|
|
43
|
+
const OUT_OF_CUT_KEYS = new Set(['draft', 'body', 'validate', 'choices', 'then', 'rule', 'contributes', 'contributions', 'release']);
|
|
44
|
+
/** One `{{ … }}` placeholder that is a singular path into the context (`$.url.params.id`), never an expression. */
|
|
45
|
+
const PLACEHOLDER = /^\{\{\s*(\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[[0-9]+\])+)\s*\}\}$/;
|
|
46
|
+
/** A literal path segment: characters an API path or a host route is written with, nothing a browser would drop. */
|
|
47
|
+
const LITERAL_SEGMENT = /^[A-Za-z0-9_~-][A-Za-z0-9_.~-]*$/;
|
|
48
|
+
/**
|
|
49
|
+
* Whitespace, control characters and backslashes anywhere in a url: a browser strips tabs and newlines and reads a
|
|
50
|
+
* backslash as a slash, so `/\t/evil.example.com` would become another site.
|
|
51
|
+
*/
|
|
52
|
+
const UNSAFE_CHARACTERS = /[\s\\\u0000-\u001f\u007f]/;
|
|
53
|
+
/** A query parameter's name: a field, or a field with an operator (`name:contains`), as `sdui-spec` names them. */
|
|
54
|
+
const QUERY_PARAM = /^[a-z_][a-z0-9_.]*(:[a-z_]+)?$/;
|
|
55
|
+
/**
|
|
56
|
+
* What a placeholder segment becomes for the permission check: a pattern segment `{param}` matches it, a literal one
|
|
57
|
+
* can't, since no API path segment is written with braces.
|
|
58
|
+
*/
|
|
59
|
+
const HOLE = '{{}}';
|
|
60
|
+
const isPlainObject = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
|
|
61
|
+
/**
|
|
62
|
+
* Parses a read url of a plugin document: a public API path, each placeholder a whole segment or a whole query value.
|
|
63
|
+
* Throws a `DocumentError` saying what to write instead.
|
|
64
|
+
*/
|
|
65
|
+
function parseRead(url, where) {
|
|
66
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(url) || url.startsWith('//')) {
|
|
67
|
+
throw new DocumentError(`${where}: "${url}" names a host; a document reads public API paths such as "/application/{{ $.url.params.id }}"`);
|
|
68
|
+
}
|
|
69
|
+
if (!url.startsWith('/'))
|
|
70
|
+
throw new DocumentError(`${where}: "${url}" must start with "/" (a public API path)`);
|
|
71
|
+
if (UNSAFE_CHARACTERS.test(url.replace(/\{\{[^}]*\}\}/g, ''))) {
|
|
72
|
+
throw new DocumentError(`${where}: "${url}" has whitespace, a control character or a backslash`);
|
|
73
|
+
}
|
|
74
|
+
const [path, query] = url.split(/\?(.*)/s, 2);
|
|
75
|
+
const segments = path.split('/').slice(1).map((segment) => {
|
|
76
|
+
if (segment.includes('{') || segment.includes('}')) {
|
|
77
|
+
if (PLACEHOLDER.test(segment))
|
|
78
|
+
return null;
|
|
79
|
+
throw new DocumentError(`${where}: "${url}": a placeholder takes a whole path segment and is a path into the context, such as {{ $.url.params.id }}`);
|
|
80
|
+
}
|
|
81
|
+
if (!LITERAL_SEGMENT.test(segment) || segment === '..') {
|
|
82
|
+
throw new DocumentError(`${where}: "${url}" has an empty, relative or encoded segment, or one with characters outside A-Z, a-z, 0-9 and _ . ~ -`);
|
|
83
|
+
}
|
|
84
|
+
return segment;
|
|
85
|
+
});
|
|
86
|
+
for (const pair of query ? query.split('&') : []) {
|
|
87
|
+
const [name, value = ''] = pair.split(/=(.*)/s, 2);
|
|
88
|
+
if (!QUERY_PARAM.test(name))
|
|
89
|
+
throw new DocumentError(`${where}: "${url}": "${name}" is not a query parameter name`);
|
|
90
|
+
if ((value.includes('{') || value.includes('}')) && !PLACEHOLDER.test(value)) {
|
|
91
|
+
throw new DocumentError(`${where}: "${url}": a placeholder takes a whole query value and is a path into the context`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return { segments };
|
|
95
|
+
}
|
|
96
|
+
const asPath = (read, hole) => '/' + read.segments.map((segment, index) => segment ?? hole(index)).join('/');
|
|
97
|
+
/** Checks one read against the plugin's `permissions.api`, with the runtime's own matcher. */
|
|
98
|
+
function assertCovered(read, url, permissions, where) {
|
|
99
|
+
if ((0, allowlist_1.isApiRequestAllowed)(permissions, 'GET', asPath(read, () => HOLE)))
|
|
100
|
+
return;
|
|
101
|
+
const suggested = asPath(read, (index) => `{param${index}}`);
|
|
102
|
+
const hint = read.segments[0] === 'v1' ? ' Paths are relative to the public API root, without "/v1".' : '';
|
|
103
|
+
throw new DocumentError(`${where}: GET ${url} is not covered by permissions.api; declare { "method": "GET", "path": "${suggested}" } or a pattern that covers it.${hint}`);
|
|
104
|
+
}
|
|
105
|
+
function checkText(value, where) {
|
|
106
|
+
if (isPlainObject(value) && 'i18n' in value)
|
|
107
|
+
throw new DocumentError(`${where}: translatable texts ({ "i18n": … }) are not in the first cut; write the text`);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Walks every value of a node's options: each `url` is a read the plugin declared, a `schema` given as a url too,
|
|
111
|
+
* `method` is only GET, and nothing that writes or needs the server.
|
|
112
|
+
*/
|
|
113
|
+
function checkOptions(value, where, visit) {
|
|
114
|
+
if (Array.isArray(value)) {
|
|
115
|
+
value.forEach((item, index) => checkOptions(item, `${where}[${index}]`, visit));
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (!isPlainObject(value))
|
|
119
|
+
return;
|
|
120
|
+
checkText(value, where);
|
|
121
|
+
for (const [key, child] of Object.entries(value)) {
|
|
122
|
+
const at = `${where}.${key}`;
|
|
123
|
+
if (OUT_OF_CUT_KEYS.has(key))
|
|
124
|
+
throw new DocumentError(`${at} is not in the first cut of plugin documents (read-only, resolved shape)`);
|
|
125
|
+
if (key === 'method' && child !== 'GET')
|
|
126
|
+
throw new DocumentError(`${at}: a document only reads (GET)`);
|
|
127
|
+
if (key === 'kind' && child !== 'navigate')
|
|
128
|
+
throw new DocumentError(`${at}: "${String(child)}" is not in the first cut; an action only navigates`);
|
|
129
|
+
if (key === 'to')
|
|
130
|
+
throw new DocumentError(`${at}: "to" is a page the server turns into a link; a document is drawn as written, so write the host path in "href"`);
|
|
131
|
+
if (key === 'href') {
|
|
132
|
+
if (typeof child !== 'string')
|
|
133
|
+
throw new DocumentError(`${at} must be a string`);
|
|
134
|
+
// A host path, built like a read: never a scheme or a second slash (another site, a script), never `..`, only
|
|
135
|
+
// safe characters. A placeholder fills one segment; the renderer refuses a filled-in link that is not a path
|
|
136
|
+
// of this origin (sdui-engine's `isRootRelativeHref`).
|
|
137
|
+
parseRead(child, at);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (key === 'url' || (key === 'schema' && typeof child === 'string' && child.startsWith('/'))) {
|
|
141
|
+
if (typeof child !== 'string')
|
|
142
|
+
throw new DocumentError(`${at} must be a string`);
|
|
143
|
+
visit(child, at);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
checkOptions(child, at, visit);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function checkNode(node, where, types, visit) {
|
|
150
|
+
if (!isPlainObject(node))
|
|
151
|
+
throw new DocumentError(`${where} must be an object`);
|
|
152
|
+
const type = node.type;
|
|
153
|
+
if (typeof type !== 'string' || !types.includes(type)) {
|
|
154
|
+
throw new DocumentError(`${where}: node type "${String(type)}" is not in the first cut (${types.join(', ')})`);
|
|
155
|
+
}
|
|
156
|
+
const at = `${where}(${type})`;
|
|
157
|
+
for (const key of Object.keys(node)) {
|
|
158
|
+
if (OUT_OF_CUT_KEYS.has(key))
|
|
159
|
+
throw new DocumentError(`${at}.${key} is not in the first cut of plugin documents (read-only, resolved shape)`);
|
|
160
|
+
}
|
|
161
|
+
checkText(node.label, `${at}.label`);
|
|
162
|
+
const options = node.options;
|
|
163
|
+
if (options !== undefined && !isPlainObject(options))
|
|
164
|
+
throw new DocumentError(`${at}.options must be an object`);
|
|
165
|
+
if (type === 'Collection' && options?.format !== 'table')
|
|
166
|
+
throw new DocumentError(`${at}: a collection is drawn as a table (options.format "table") in the first cut`);
|
|
167
|
+
if (type === 'Action' && options?.kind !== 'navigate')
|
|
168
|
+
throw new DocumentError(`${at}: an action only navigates (options.kind "navigate") in the first cut`);
|
|
169
|
+
checkOptions(options, `${at}.options`, visit);
|
|
170
|
+
if (node.elements !== undefined) {
|
|
171
|
+
if (!Array.isArray(node.elements))
|
|
172
|
+
throw new DocumentError(`${at}.elements must be an array`);
|
|
173
|
+
node.elements.forEach((child, index) => checkNode(child, `${at}.elements[${index}]`, types, visit));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/** Every read url of a document that already passed `validatePluginDocument`, in document order. */
|
|
177
|
+
function readsOf(document, permissions) {
|
|
178
|
+
const reads = [];
|
|
179
|
+
const types = exports.DOCUMENT_PROFILES[document.vocabulary] ?? [];
|
|
180
|
+
checkNode(document, 'document', types, (url, where) => {
|
|
181
|
+
const read = parseRead(url, where);
|
|
182
|
+
assertCovered(read, url, permissions, where);
|
|
183
|
+
reads.push(read);
|
|
184
|
+
});
|
|
185
|
+
return reads;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Validates an untrusted plugin document against the first cut of the plugin profile and the plugin's
|
|
189
|
+
* `permissions.api` (contract 8): every read is a public API path, GET, covered by a declared permission, with its
|
|
190
|
+
* placeholders as whole segments. Throws a `DocumentError` describing the first problem.
|
|
191
|
+
*/
|
|
192
|
+
function validatePluginDocument(input, permissions) {
|
|
193
|
+
if (!isPlainObject(input))
|
|
194
|
+
throw new DocumentError('A document must be a JSON object');
|
|
195
|
+
if (typeof input.vocabulary !== 'number' || !(input.vocabulary in exports.DOCUMENT_PROFILES)) {
|
|
196
|
+
throw new DocumentError(`A document declares its vocabulary line in its root: "vocabulary": ${exports.DOCUMENT_VOCABULARY_LINE} (accepted: ${Object.keys(exports.DOCUMENT_PROFILES).join(', ')})`);
|
|
197
|
+
}
|
|
198
|
+
readsOf(input, permissions);
|
|
199
|
+
return input;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Checks a document against the vocabulary itself (contract 6): a node as the server would answer it, the shape SDUI's
|
|
203
|
+
* renderer draws (ids are uuids, links are `href`, options closed per type). `vocabulary` is the plugin document's own
|
|
204
|
+
* envelope key, so it is set aside first. A line newer than the vocabulary's is refused. Run it after
|
|
205
|
+
* `validatePluginDocument`; throws a `DocumentError` naming up to five problems.
|
|
206
|
+
*/
|
|
207
|
+
function assertDocumentVocabulary(document, vocabulary) {
|
|
208
|
+
const { vocabulary: line, ...node } = document;
|
|
209
|
+
if (line > vocabulary.line) {
|
|
210
|
+
throw new DocumentError(`The document's vocabulary line ${line} is newer than this platform's (${vocabulary.line})`);
|
|
211
|
+
}
|
|
212
|
+
const parsed = vocabulary.node.safeParse(node);
|
|
213
|
+
if (parsed.success)
|
|
214
|
+
return;
|
|
215
|
+
const issues = (parsed.error?.issues ?? [])
|
|
216
|
+
.slice(0, 5)
|
|
217
|
+
.map((issue) => `${issue.path.length ? '/' + issue.path.map(String).join('/') : '/'}: ${issue.message}`);
|
|
218
|
+
throw new DocumentError(`The document is not a view the renderer draws: ${issues.join('; ')}`);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Builds the check for the reads the renderer asks for while drawing a document: a read is allowed when it is a GET,
|
|
222
|
+
* the interpolated url's path matches one of the document's read urls (each placeholder exactly one segment) and
|
|
223
|
+
* `permissions.api` covers it. Query strings are never part of the decision, as with widgets. The document is walked
|
|
224
|
+
* once, here, and not on every read; a document whose reads don't pass allows none.
|
|
225
|
+
*/
|
|
226
|
+
function documentReadCheck(document, permissions) {
|
|
227
|
+
let reads;
|
|
228
|
+
try {
|
|
229
|
+
reads = readsOf(document, permissions);
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
reads = [];
|
|
233
|
+
}
|
|
234
|
+
return (method, url) => {
|
|
235
|
+
if (method.toUpperCase() !== 'GET')
|
|
236
|
+
return false;
|
|
237
|
+
const [path] = url.split('?', 1);
|
|
238
|
+
const requested = (0, allowlist_1.normalizePath)(path);
|
|
239
|
+
if (!requested || !(0, allowlist_1.isApiRequestAllowed)(permissions, 'GET', path))
|
|
240
|
+
return false;
|
|
241
|
+
return reads.some((read) => read.segments.length === requested.length &&
|
|
242
|
+
read.segments.every((segment, index) => (segment === null ? requested[index].length > 0 : segment === requested[index])));
|
|
243
|
+
};
|
|
244
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertTopicValue = exports.redactBySchema = exports.projectFields = exports.canProvideTopic = exports.consumeGrant = exports.isFieldPath = exports.topicOwner = exports.isHostTopic = exports.isTopicName = exports.TOPIC_VALUE_MAX_CHARS = exports.resolveAssetUrl = exports.validateStorageUrl = exports.PLUGIN_STORAGE_ORIGIN = exports.WhenError = exports.rolloutIncludes = exports.evaluateWhen = exports.validateWhen = exports.extractRoots = exports.CONTEXT_ROOTS = exports.matchFixture = exports.canonicalizePath = exports.normalizePath = exports.isRequestAllowed = exports.isHttpRequestAllowed = exports.isApiRequestAllowed = exports.layoutConflicts = exports.pageOf = exports.readPlaceRoots = exports.contextSatisfies = exports.missingContext = exports.PLACE_ROOTS = exports.ManifestError = exports.isSectionSlot = exports.RESERVED_PLUGIN_ID = exports.contributionId = exports.unnamedContributions = exports.validatePublishableManifest = exports.validateManifest = exports.PROTOCOL_VERSION = void 0;
|
|
3
|
+
exports.assertTopicValue = exports.redactBySchema = exports.projectFields = exports.canProvideTopic = exports.consumeGrant = exports.isFieldPath = exports.topicOwner = exports.isHostTopic = exports.isTopicName = exports.TOPIC_VALUE_MAX_CHARS = exports.resolveAssetUrl = exports.validateStorageUrl = exports.PLUGIN_STORAGE_ORIGIN = exports.WhenError = exports.rolloutIncludes = exports.evaluateWhen = exports.validateWhen = exports.extractRoots = exports.CONTEXT_ROOTS = exports.matchFixture = exports.canonicalizePath = exports.normalizePath = exports.isReservedApiRequest = exports.isRequestAllowed = exports.isHttpRequestAllowed = exports.isApiRequestAllowed = exports.isPageTemplateDefinition = exports.pageTemplateProblems = exports.MIN_PAGE_AREA_WIDTH = exports.REQUIRED_PAGE_AREA = exports.PAGE_AREAS = exports.layoutConflicts = exports.pageOf = exports.readPlaceRoots = exports.contextSatisfies = exports.missingContext = exports.PLACE_ROOTS = exports.ManifestError = exports.isSectionSlot = exports.RESERVED_PLUGIN_ID = exports.contributionId = exports.unnamedContributions = exports.validateAuthoredApiPermissions = exports.validatePublishableManifest = exports.validateManifest = exports.PROTOCOL_VERSION = void 0;
|
|
4
4
|
var manifest_1 = require("./manifest");
|
|
5
5
|
Object.defineProperty(exports, "PROTOCOL_VERSION", { enumerable: true, get: function () { return manifest_1.PROTOCOL_VERSION; } });
|
|
6
6
|
Object.defineProperty(exports, "validateManifest", { enumerable: true, get: function () { return manifest_1.validateManifest; } });
|
|
7
7
|
Object.defineProperty(exports, "validatePublishableManifest", { enumerable: true, get: function () { return manifest_1.validatePublishableManifest; } });
|
|
8
|
+
Object.defineProperty(exports, "validateAuthoredApiPermissions", { enumerable: true, get: function () { return manifest_1.validateAuthoredApiPermissions; } });
|
|
8
9
|
Object.defineProperty(exports, "unnamedContributions", { enumerable: true, get: function () { return manifest_1.unnamedContributions; } });
|
|
9
10
|
Object.defineProperty(exports, "contributionId", { enumerable: true, get: function () { return manifest_1.contributionId; } });
|
|
10
11
|
Object.defineProperty(exports, "RESERVED_PLUGIN_ID", { enumerable: true, get: function () { return manifest_1.RESERVED_PLUGIN_ID; } });
|
|
@@ -18,10 +19,17 @@ Object.defineProperty(exports, "readPlaceRoots", { enumerable: true, get: functi
|
|
|
18
19
|
var layout_1 = require("./layout");
|
|
19
20
|
Object.defineProperty(exports, "pageOf", { enumerable: true, get: function () { return layout_1.pageOf; } });
|
|
20
21
|
Object.defineProperty(exports, "layoutConflicts", { enumerable: true, get: function () { return layout_1.layoutConflicts; } });
|
|
22
|
+
var pageTemplate_1 = require("./pageTemplate");
|
|
23
|
+
Object.defineProperty(exports, "PAGE_AREAS", { enumerable: true, get: function () { return pageTemplate_1.PAGE_AREAS; } });
|
|
24
|
+
Object.defineProperty(exports, "REQUIRED_PAGE_AREA", { enumerable: true, get: function () { return pageTemplate_1.REQUIRED_PAGE_AREA; } });
|
|
25
|
+
Object.defineProperty(exports, "MIN_PAGE_AREA_WIDTH", { enumerable: true, get: function () { return pageTemplate_1.MIN_PAGE_AREA_WIDTH; } });
|
|
26
|
+
Object.defineProperty(exports, "pageTemplateProblems", { enumerable: true, get: function () { return pageTemplate_1.pageTemplateProblems; } });
|
|
27
|
+
Object.defineProperty(exports, "isPageTemplateDefinition", { enumerable: true, get: function () { return pageTemplate_1.isPageTemplateDefinition; } });
|
|
21
28
|
var allowlist_1 = require("./allowlist");
|
|
22
29
|
Object.defineProperty(exports, "isApiRequestAllowed", { enumerable: true, get: function () { return allowlist_1.isApiRequestAllowed; } });
|
|
23
30
|
Object.defineProperty(exports, "isHttpRequestAllowed", { enumerable: true, get: function () { return allowlist_1.isHttpRequestAllowed; } });
|
|
24
31
|
Object.defineProperty(exports, "isRequestAllowed", { enumerable: true, get: function () { return allowlist_1.isRequestAllowed; } });
|
|
32
|
+
Object.defineProperty(exports, "isReservedApiRequest", { enumerable: true, get: function () { return allowlist_1.isReservedApiRequest; } });
|
|
25
33
|
Object.defineProperty(exports, "normalizePath", { enumerable: true, get: function () { return allowlist_1.normalizePath; } });
|
|
26
34
|
Object.defineProperty(exports, "canonicalizePath", { enumerable: true, get: function () { return allowlist_1.canonicalizePath; } });
|
|
27
35
|
var fixtures_1 = require("./fixtures");
|
|
@@ -5,10 +5,12 @@ exports.isSectionSlot = isSectionSlot;
|
|
|
5
5
|
exports.validateManifest = validateManifest;
|
|
6
6
|
exports.contributionId = contributionId;
|
|
7
7
|
exports.validatePublishableManifest = validatePublishableManifest;
|
|
8
|
+
exports.validateAuthoredApiPermissions = validateAuthoredApiPermissions;
|
|
8
9
|
exports.unnamedContributions = unnamedContributions;
|
|
9
10
|
const when_1 = require("./when");
|
|
10
11
|
const topics_1 = require("./topics");
|
|
11
12
|
const context_1 = require("./context");
|
|
13
|
+
const allowlist_1 = require("./allowlist");
|
|
12
14
|
exports.PROTOCOL_VERSION = 1;
|
|
13
15
|
class ManifestError extends Error {
|
|
14
16
|
constructor(message) {
|
|
@@ -102,7 +104,8 @@ function validateManifest(input) {
|
|
|
102
104
|
permissions.api = rawPermissions.api.map((raw, index) => {
|
|
103
105
|
const p = (raw ?? {});
|
|
104
106
|
const where = `permissions.api[${index}]`;
|
|
105
|
-
|
|
107
|
+
const method = readMethod(p.method, where);
|
|
108
|
+
return { method, path: readPath(p.path, where) };
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
111
|
if (rawPermissions.http !== undefined) {
|
|
@@ -214,6 +217,27 @@ function validatePublishableManifest(input) {
|
|
|
214
217
|
});
|
|
215
218
|
return manifest;
|
|
216
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* What a manifest's `permissions.api` must meet where the manifest is written: at publish and in developer mode, never
|
|
222
|
+
* where a stored revision is read. Each path names its resource, so a reviewer reading the manifest sees what the
|
|
223
|
+
* plugin calls, and none names an operation no plugin may call (`isReservedApiRequest`). A revision published before
|
|
224
|
+
* these rules keeps loading, and the call itself is refused (`isApiRequestAllowed`), so a page loses one call, not
|
|
225
|
+
* the whole plugin. A placeholder deeper in the path can still cover a reserved operation (`POST /catalog/{kind}/{type}`):
|
|
226
|
+
* that too is refused at call time, on the path actually requested.
|
|
227
|
+
*/
|
|
228
|
+
function validateAuthoredApiPermissions(manifest) {
|
|
229
|
+
(manifest.permissions?.api ?? []).forEach(({ method, path }, index) => {
|
|
230
|
+
const where = `permissions.api[${index}]`;
|
|
231
|
+
const [resource] = path.slice(1).split('/');
|
|
232
|
+
if (resource.startsWith('{') && resource.endsWith('}')) {
|
|
233
|
+
throw new ManifestError(`${where}.path must name its resource: "${resource}" cannot be the first segment`);
|
|
234
|
+
}
|
|
235
|
+
if ((0, allowlist_1.isReservedApiRequest)(method, path)) {
|
|
236
|
+
throw new ManifestError(`${where}: plugins may not ${method === '*' ? 'call' : method} ${path}: it is reserved, because a plugin acts with the rights of whoever views it`);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
return manifest;
|
|
240
|
+
}
|
|
217
241
|
/**
|
|
218
242
|
* Contributions that go by their widget for lack of an `id`. Publishable, but renaming the widget would rename the
|
|
219
243
|
* block, its flag and its place in layouts, so the CLI warns about them.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Page templates an organization saves (proposal P-1): a grid of named areas, in the grammar of `GridLayout` of
|
|
4
|
+
* react-ui-components (`columns` and `areas`, each a value or one per breakpoint). Each area of a page is a region
|
|
5
|
+
* named `<page>.<area>`, so the areas a template may name are the regions a page can have. Shared by the API, which
|
|
6
|
+
* refuses an invalid definition at write, and the host, which drops one it reads.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.MIN_PAGE_AREA_WIDTH = exports.REQUIRED_PAGE_AREA = exports.PAGE_AREAS = void 0;
|
|
10
|
+
exports.pageTemplateProblems = pageTemplateProblems;
|
|
11
|
+
exports.isPageTemplateDefinition = isPageTemplateDefinition;
|
|
12
|
+
/** The areas of a page, each the last segment of a region's name (`application.overview.sidebar`). */
|
|
13
|
+
exports.PAGE_AREAS = ['top', 'main', 'sidebar', 'bottom'];
|
|
14
|
+
/** The area every template has: the page's blocks need somewhere to go. */
|
|
15
|
+
exports.REQUIRED_PAGE_AREA = 'main';
|
|
16
|
+
/**
|
|
17
|
+
* The narrowest an area of a page is drawn, in px. An editor that resizes a page's columns stacks the side column below
|
|
18
|
+
* `main` rather than draw either one under it, so a plugin can rely on at least this width wherever it lands.
|
|
19
|
+
*/
|
|
20
|
+
exports.MIN_PAGE_AREA_WIDTH = 240;
|
|
21
|
+
const BREAKPOINTS = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
22
|
+
/** GridLayout's limits (sdui-spec): 12 columns, tracks and rows at most; 12 equal columns where none are set. */
|
|
23
|
+
const MAX = 12;
|
|
24
|
+
const DEFAULT_COLUMNS = 12;
|
|
25
|
+
/** 12 cells of a name of up to 20 characters: far over the page's areas, and short enough to check cheaply. */
|
|
26
|
+
const MAX_ROW_LENGTH = 12 * 21;
|
|
27
|
+
// sdui-spec's `gridTrack` and `gridAreasRow`, verbatim.
|
|
28
|
+
const TRACK_PATTERN = /^(?:\d+(?:\.\d+)?(?:fr|px|%|rem)|auto|min-content|max-content)$/;
|
|
29
|
+
const AREAS_ROW_PATTERN = /^(?:[a-z][a-z0-9_-]*|\.)(?: (?:[a-z][a-z0-9_-]*|\.))*$/;
|
|
30
|
+
const EMPTY_CELL = '.';
|
|
31
|
+
const OPTIONS = ['columns', 'areas'];
|
|
32
|
+
const isPlainObject = (value) => typeof value === 'object' && value !== null && Object.getPrototypeOf(value) === Object.prototype;
|
|
33
|
+
const isTracks = (value) => (Number.isInteger(value) && value >= 1 && value <= MAX) ||
|
|
34
|
+
(Array.isArray(value) &&
|
|
35
|
+
value.length >= 1 &&
|
|
36
|
+
value.length <= MAX &&
|
|
37
|
+
value.every((track) => typeof track === 'string' && TRACK_PATTERN.test(track)));
|
|
38
|
+
const isRows = (value) => Array.isArray(value) &&
|
|
39
|
+
value.length >= 1 &&
|
|
40
|
+
value.length <= MAX &&
|
|
41
|
+
value.every((row) => typeof row === 'string' && row.length <= MAX_ROW_LENGTH && AREAS_ROW_PATTERN.test(row));
|
|
42
|
+
/** A responsive value as one entry per breakpoint it names; `undefined` when it is not one. */
|
|
43
|
+
function perBreakpoint(value, isValue) {
|
|
44
|
+
if (isValue(value))
|
|
45
|
+
return { xs: value };
|
|
46
|
+
if (!isPlainObject(value))
|
|
47
|
+
return undefined;
|
|
48
|
+
const valid = Object.entries(value).every(([breakpoint, entry]) => BREAKPOINTS.includes(breakpoint) && isValue(entry));
|
|
49
|
+
return valid ? value : undefined;
|
|
50
|
+
}
|
|
51
|
+
const namesIn = (rows) => rows.flatMap((row) => row.split(' ')).filter((name) => name !== EMPTY_CELL);
|
|
52
|
+
const columnCount = (tracks) => (typeof tracks === 'number' ? tracks : tracks.length);
|
|
53
|
+
/**
|
|
54
|
+
* What a template of rows breaks at one breakpoint: a row with the wrong cell count, an area that is no rectangle,
|
|
55
|
+
* or one another breakpoint names and this one leaves out (its region would land outside the grid).
|
|
56
|
+
*/
|
|
57
|
+
function rowProblems(rows, columns, breakpoint, allNames) {
|
|
58
|
+
// A row with the wrong cell count is the problem to fix first: the shapes are read only when every row fits.
|
|
59
|
+
const misfit = rows.map((row) => [row, row.split(' ').length]).filter(([, cells]) => cells !== columns);
|
|
60
|
+
if (misfit.length)
|
|
61
|
+
return misfit.map(([row, cells]) => `areas at ${breakpoint}: the row "${row}" has ${cells} cells for ${columns} columns`);
|
|
62
|
+
const problems = [];
|
|
63
|
+
const cells = new Map();
|
|
64
|
+
rows.forEach((row, rowIndex) => {
|
|
65
|
+
row.split(' ').forEach((name, column) => {
|
|
66
|
+
if (name === EMPTY_CELL)
|
|
67
|
+
return;
|
|
68
|
+
if (!cells.has(name))
|
|
69
|
+
cells.set(name, []);
|
|
70
|
+
cells.get(name).push([rowIndex, column]);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
for (const [name, at] of cells) {
|
|
74
|
+
const rowsOf = at.map(([row]) => row);
|
|
75
|
+
const columnsOf = at.map(([, column]) => column);
|
|
76
|
+
const height = Math.max(...rowsOf) - Math.min(...rowsOf) + 1;
|
|
77
|
+
const width = Math.max(...columnsOf) - Math.min(...columnsOf) + 1;
|
|
78
|
+
if (height * width !== at.length)
|
|
79
|
+
problems.push(`areas at ${breakpoint}: "${name}" is not a rectangle`);
|
|
80
|
+
}
|
|
81
|
+
for (const name of allNames)
|
|
82
|
+
if (!cells.has(name))
|
|
83
|
+
problems.push(`areas at ${breakpoint}: "${name}" is missing, though another breakpoint has it`);
|
|
84
|
+
return problems;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* What makes a template definition invalid, or nothing. GridLayout's own checks (shapes, one cell per column in
|
|
88
|
+
* effect, rectangles, every area at every breakpoint from `xs` up), plus the page's: only the page's areas, `main`
|
|
89
|
+
* among them, and no option but `columns` and `areas`.
|
|
90
|
+
*/
|
|
91
|
+
function pageTemplateProblems(definition) {
|
|
92
|
+
if (!isPlainObject(definition))
|
|
93
|
+
return ['a template definition is a plain object'];
|
|
94
|
+
const problems = Object.keys(definition)
|
|
95
|
+
.filter((name) => !OPTIONS.includes(name))
|
|
96
|
+
.map((name) => `"${name}" is no template option: a template has columns and areas`);
|
|
97
|
+
const columns = definition.columns === undefined ? {} : perBreakpoint(definition.columns, isTracks);
|
|
98
|
+
if (!columns)
|
|
99
|
+
problems.push(`columns is a count (1 to ${MAX}) or 1 to ${MAX} tracks, or one per breakpoint`);
|
|
100
|
+
const areas = perBreakpoint(definition.areas, isRows);
|
|
101
|
+
if (!areas)
|
|
102
|
+
problems.push(`areas is 1 to ${MAX} rows of area names, or one per breakpoint`);
|
|
103
|
+
if (!columns || !areas)
|
|
104
|
+
return problems;
|
|
105
|
+
const allNames = new Set(namesIn(BREAKPOINTS.flatMap((breakpoint) => areas[breakpoint] ?? [])));
|
|
106
|
+
const unknown = [...allNames].filter((name) => !exports.PAGE_AREAS.includes(name));
|
|
107
|
+
if (unknown.length)
|
|
108
|
+
problems.push(`areas name ${unknown.map((name) => `"${name}"`).join(', ')}: a page's areas are ${exports.PAGE_AREAS.join(', ')}`);
|
|
109
|
+
if (!allNames.has(exports.REQUIRED_PAGE_AREA))
|
|
110
|
+
problems.push(`areas have no "${exports.REQUIRED_PAGE_AREA}": every template has it`);
|
|
111
|
+
if (areas.xs === undefined)
|
|
112
|
+
problems.push('areas start above xs: below their first breakpoint nothing places the areas');
|
|
113
|
+
// Each in effect from its breakpoint up: a row is held to the columns in effect where either changes.
|
|
114
|
+
let count = DEFAULT_COLUMNS;
|
|
115
|
+
let rows;
|
|
116
|
+
for (const breakpoint of BREAKPOINTS) {
|
|
117
|
+
const tracks = columns[breakpoint];
|
|
118
|
+
if (tracks !== undefined)
|
|
119
|
+
count = columnCount(tracks);
|
|
120
|
+
if (areas[breakpoint] !== undefined)
|
|
121
|
+
rows = areas[breakpoint];
|
|
122
|
+
if (rows && (tracks !== undefined || areas[breakpoint] !== undefined))
|
|
123
|
+
problems.push(...rowProblems(rows, count, breakpoint, allNames));
|
|
124
|
+
}
|
|
125
|
+
return problems;
|
|
126
|
+
}
|
|
127
|
+
/** Whether a definition is valid: what a host checks before drawing a saved template. */
|
|
128
|
+
function isPageTemplateDefinition(definition) {
|
|
129
|
+
return pageTemplateProblems(definition).length === 0;
|
|
130
|
+
}
|
package/dist/contractProps.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { UI_COMPONENTS_CONTRACTS } from "./contracts.generated.js";
|
|
3
|
+
import type { CalendarEvent, CalendarSlot, CalendarTimelineBar, CalendarTimelineRow } from "./calendar.js";
|
|
3
4
|
import type { DataTableColumn, DataTablePagination, DataTableRow, DataTableState } from "./dataTable.js";
|
|
4
5
|
type Contract = (typeof UI_COMPONENTS_CONTRACTS)[number];
|
|
5
6
|
/** The elements the SDK takes from @nullplatform/react-ui-components' contracts. */
|
|
@@ -27,6 +28,28 @@ interface ContractPropTypes {
|
|
|
27
28
|
onChangeTableState?: (state: DataTableState) => void;
|
|
28
29
|
onRowClick?: (row: DataTableRow) => void;
|
|
29
30
|
};
|
|
31
|
+
"np-calendar-month": {
|
|
32
|
+
events?: readonly CalendarEvent[];
|
|
33
|
+
onEventPress?: (id: string) => void;
|
|
34
|
+
/** A `YYYY-MM-DD` day. */
|
|
35
|
+
onDayPress?: (day: string) => void;
|
|
36
|
+
onMorePress?: (day: string) => void;
|
|
37
|
+
};
|
|
38
|
+
"np-calendar-week": {
|
|
39
|
+
events?: readonly CalendarEvent[];
|
|
40
|
+
onEventPress?: (id: string) => void;
|
|
41
|
+
onSlotPress?: (slot: CalendarSlot) => void;
|
|
42
|
+
};
|
|
43
|
+
"np-calendar-timeline": {
|
|
44
|
+
rows?: readonly CalendarTimelineRow[];
|
|
45
|
+
bars?: readonly CalendarTimelineBar[];
|
|
46
|
+
/** The timeline reads only these two. */
|
|
47
|
+
emptyStateProps?: {
|
|
48
|
+
title?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
};
|
|
51
|
+
onBarPress?: (id: string) => void;
|
|
52
|
+
};
|
|
30
53
|
}
|
|
31
54
|
type Typed<Tag, Props> = Tag extends keyof ContractPropTypes ? Omit<Props, keyof ContractPropTypes[Tag]> & Pick<ContractPropTypes[Tag], Extract<keyof ContractPropTypes[Tag], keyof Props>> : Props;
|
|
32
55
|
/**
|
|
@@ -693,6 +693,9 @@ export declare const UI_COMPONENTS_CONTRACTS: readonly [{
|
|
|
693
693
|
readonly now: "string";
|
|
694
694
|
readonly locale: "string";
|
|
695
695
|
readonly resourceLabel: "string";
|
|
696
|
+
readonly loading: "boolean";
|
|
697
|
+
readonly emptyStateProps: "object";
|
|
698
|
+
readonly maxRows: "number";
|
|
696
699
|
};
|
|
697
700
|
readonly events: {
|
|
698
701
|
readonly barPress: "onBarPress";
|
|
@@ -765,4 +768,158 @@ export declare const UI_COMPONENTS_CONTRACTS: readonly [{
|
|
|
765
768
|
readonly events: {
|
|
766
769
|
readonly change: "onChange";
|
|
767
770
|
};
|
|
771
|
+
}, {
|
|
772
|
+
readonly tag: "np-checkbox";
|
|
773
|
+
readonly component: "Checkbox";
|
|
774
|
+
readonly properties: {
|
|
775
|
+
readonly checked: "boolean";
|
|
776
|
+
readonly disabled: "boolean";
|
|
777
|
+
};
|
|
778
|
+
readonly events: {
|
|
779
|
+
readonly change: "onChange";
|
|
780
|
+
};
|
|
781
|
+
}, {
|
|
782
|
+
readonly tag: "np-checkbox-card";
|
|
783
|
+
readonly component: "CheckboxCard";
|
|
784
|
+
readonly properties: {
|
|
785
|
+
readonly label: "string";
|
|
786
|
+
readonly description: "string";
|
|
787
|
+
readonly icon: "string";
|
|
788
|
+
readonly checked: "boolean";
|
|
789
|
+
readonly size: "string";
|
|
790
|
+
readonly variant: "string";
|
|
791
|
+
readonly align: "string";
|
|
792
|
+
readonly justify: "string";
|
|
793
|
+
readonly orientation: "string";
|
|
794
|
+
readonly indicator: "boolean";
|
|
795
|
+
readonly disabled: "boolean";
|
|
796
|
+
readonly readOnly: "boolean";
|
|
797
|
+
readonly error: "boolean";
|
|
798
|
+
};
|
|
799
|
+
readonly events: {
|
|
800
|
+
readonly change: "onChange";
|
|
801
|
+
};
|
|
802
|
+
readonly values: {
|
|
803
|
+
readonly size: readonly ["sm", "md", "lg"];
|
|
804
|
+
readonly variant: readonly ["outline", "surface", "subtle", "solid"];
|
|
805
|
+
readonly align: readonly ["start", "end", "center"];
|
|
806
|
+
readonly justify: readonly ["start", "end", "center"];
|
|
807
|
+
readonly orientation: readonly ["horizontal", "vertical"];
|
|
808
|
+
};
|
|
809
|
+
}, {
|
|
810
|
+
readonly tag: "np-slider";
|
|
811
|
+
readonly component: "Slider";
|
|
812
|
+
readonly properties: {
|
|
813
|
+
readonly value: "number";
|
|
814
|
+
readonly min: "number";
|
|
815
|
+
readonly max: "number";
|
|
816
|
+
readonly step: "number";
|
|
817
|
+
readonly disabled: "boolean";
|
|
818
|
+
readonly "aria-label": "string";
|
|
819
|
+
};
|
|
820
|
+
readonly events: {
|
|
821
|
+
readonly change: "onChange";
|
|
822
|
+
readonly changeCommitted: "onChangeCommitted";
|
|
823
|
+
};
|
|
824
|
+
}, {
|
|
825
|
+
readonly tag: "np-accordion";
|
|
826
|
+
readonly component: "Accordion";
|
|
827
|
+
readonly properties: {
|
|
828
|
+
readonly expanded: "boolean";
|
|
829
|
+
readonly defaultExpanded: "boolean";
|
|
830
|
+
readonly disabled: "boolean";
|
|
831
|
+
readonly disableGutters: "boolean";
|
|
832
|
+
};
|
|
833
|
+
readonly events: {
|
|
834
|
+
readonly change: "onChange";
|
|
835
|
+
};
|
|
836
|
+
readonly children: true;
|
|
837
|
+
}, {
|
|
838
|
+
readonly tag: "np-accordion-summary";
|
|
839
|
+
readonly component: "AccordionSummary";
|
|
840
|
+
readonly properties: {};
|
|
841
|
+
readonly events: {};
|
|
842
|
+
readonly slots: readonly ["expandIcon"];
|
|
843
|
+
readonly children: true;
|
|
844
|
+
}, {
|
|
845
|
+
readonly tag: "np-accordion-details";
|
|
846
|
+
readonly component: "AccordionDetails";
|
|
847
|
+
readonly properties: {};
|
|
848
|
+
readonly events: {};
|
|
849
|
+
readonly children: true;
|
|
850
|
+
}, {
|
|
851
|
+
readonly tag: "np-date-picker";
|
|
852
|
+
readonly component: "DatePickerField";
|
|
853
|
+
readonly properties: {
|
|
854
|
+
readonly value: "string";
|
|
855
|
+
readonly minDate: "string";
|
|
856
|
+
readonly maxDate: "string";
|
|
857
|
+
readonly timeZone: "string";
|
|
858
|
+
readonly label: "string";
|
|
859
|
+
readonly helperText: "string";
|
|
860
|
+
readonly error: "boolean";
|
|
861
|
+
readonly disabled: "boolean";
|
|
862
|
+
};
|
|
863
|
+
readonly events: {
|
|
864
|
+
readonly change: "onChange";
|
|
865
|
+
};
|
|
866
|
+
}, {
|
|
867
|
+
readonly tag: "np-filter-single-date";
|
|
868
|
+
readonly component: "FilterSingleDateField";
|
|
869
|
+
readonly properties: {
|
|
870
|
+
readonly value: "string";
|
|
871
|
+
readonly preset: "string";
|
|
872
|
+
readonly presets: "array";
|
|
873
|
+
readonly timeZone: "string";
|
|
874
|
+
readonly label: "string";
|
|
875
|
+
readonly placeholder: "string";
|
|
876
|
+
readonly customLabel: "string";
|
|
877
|
+
readonly helperText: "string";
|
|
878
|
+
readonly error: "boolean";
|
|
879
|
+
readonly required: "boolean";
|
|
880
|
+
readonly disabled: "boolean";
|
|
881
|
+
readonly minDate: "string";
|
|
882
|
+
readonly maxDate: "string";
|
|
883
|
+
readonly disablePast: "boolean";
|
|
884
|
+
readonly disableFuture: "boolean";
|
|
885
|
+
readonly hideActionButtons: "boolean";
|
|
886
|
+
};
|
|
887
|
+
readonly events: {
|
|
888
|
+
readonly change: "onChange";
|
|
889
|
+
};
|
|
890
|
+
}, {
|
|
891
|
+
readonly tag: "np-stepper";
|
|
892
|
+
readonly component: "Stepper";
|
|
893
|
+
readonly properties: {
|
|
894
|
+
readonly activeStep: "number";
|
|
895
|
+
readonly orientation: "string";
|
|
896
|
+
readonly alternativeLabel: "boolean";
|
|
897
|
+
readonly nonLinear: "boolean";
|
|
898
|
+
};
|
|
899
|
+
readonly events: {};
|
|
900
|
+
readonly values: {
|
|
901
|
+
readonly orientation: readonly ["horizontal", "vertical"];
|
|
902
|
+
};
|
|
903
|
+
readonly children: true;
|
|
904
|
+
}, {
|
|
905
|
+
readonly tag: "np-step";
|
|
906
|
+
readonly component: "Step";
|
|
907
|
+
readonly properties: {
|
|
908
|
+
readonly index: "number";
|
|
909
|
+
readonly last: "boolean";
|
|
910
|
+
readonly active: "boolean";
|
|
911
|
+
readonly completed: "boolean";
|
|
912
|
+
readonly disabled: "boolean";
|
|
913
|
+
};
|
|
914
|
+
readonly events: {};
|
|
915
|
+
readonly children: true;
|
|
916
|
+
}, {
|
|
917
|
+
readonly tag: "np-step-label";
|
|
918
|
+
readonly component: "StepLabel";
|
|
919
|
+
readonly properties: {
|
|
920
|
+
readonly error: "boolean";
|
|
921
|
+
};
|
|
922
|
+
readonly events: {};
|
|
923
|
+
readonly slots: readonly ["optional"];
|
|
924
|
+
readonly children: true;
|
|
768
925
|
}];
|