xmlui 0.9.31 → 0.9.33

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.
Files changed (27) hide show
  1. package/dist/lib/{apiInterceptorWorker-BcQy1dRU.mjs → apiInterceptorWorker-C0U8QH8_.mjs} +1 -1
  2. package/dist/lib/{index-DqWRcUpA.mjs → index-EIC8XLtz.mjs} +5556 -3016
  3. package/dist/lib/index.css +56 -45
  4. package/dist/lib/language-server-web-worker.mjs +1 -1
  5. package/dist/lib/language-server.mjs +1 -1
  6. package/dist/lib/lint-B5OU130e.mjs +659 -0
  7. package/dist/lib/{metadata-utils-CCIMqe69.mjs → metadata-utils-DyYovNew.mjs} +42 -15
  8. package/dist/lib/{server-common-Cucl1Ik4.mjs → server-common-CUmSKua6.mjs} +3 -28
  9. package/dist/lib/{transform-DC0Gy6qw.mjs → transform-B-MhfH46.mjs} +78 -78
  10. package/dist/lib/xmlui-parser.mjs +47 -538
  11. package/dist/lib/xmlui.d.ts +221 -1
  12. package/dist/lib/xmlui.mjs +12 -2
  13. package/dist/metadata/style.css +54 -43
  14. package/dist/metadata/xmlui-metadata.mjs +5 -4
  15. package/dist/metadata/xmlui-metadata.umd.js +5 -4
  16. package/dist/scripts/package.json +3 -2
  17. package/dist/scripts/src/components/App/App.js +1 -0
  18. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +35 -1
  19. package/dist/scripts/src/components/NestedApp/utils.js +544 -0
  20. package/dist/scripts/src/components/Pages/Pages.js +2 -2
  21. package/dist/scripts/src/components/Select/SelectNative.js +2 -2
  22. package/dist/scripts/src/parsers/xmlui-parser/xmlui-serializer.js +582 -0
  23. package/dist/scripts/src/parsers/xmlui-parser/xmlui-tree.js +2 -0
  24. package/dist/standalone/xmlui-standalone.es.d.ts +0 -2157
  25. package/dist/standalone/xmlui-standalone.umd.js +4149 -965
  26. package/package.json +3 -2
  27. package/dist/lib/lint-CYAUfk0_.mjs +0 -168
@@ -1,2160 +1,3 @@
1
- import { CSSProperties } from 'react';
2
- import { default as default_2 } from 'react';
3
- import { default as default_3 } from 'react/jsx-runtime';
4
- import { DefaultToastOptions } from 'react-hot-toast';
5
- import { ErrorInfo } from 'react';
6
- import { ForwardedRef } from 'react';
7
- import { ForwardRefExoticComponent } from 'react';
8
- import { JSX as JSX_2 } from 'react/jsx-runtime';
9
- import { NavigateOptions } from 'react-router-dom';
10
- import { QueryClient } from '@tanstack/react-query';
11
- import { ReactNode } from 'react';
12
- import { RefAttributes } from 'react';
13
- import { RefObject } from 'react';
14
- import { Renderable } from 'react-hot-toast';
15
- import { Root } from 'react-dom/client';
16
- import { To } from 'react-router-dom';
17
- import { Toast } from 'react-hot-toast';
18
- import { ToastOptions } from 'react-hot-toast';
19
- import { ValueOrFunction } from 'react-hot-toast';
20
-
21
- /**
22
- * This type represents the context in which an action is executed.
23
- */
24
- declare interface ActionExecutionContext {
25
- /**
26
- * A unique identifier for the container that the action is executed in.
27
- */
28
- uid: symbol;
29
- /**
30
- * The state of the container that the action is executed in.
31
- */
32
- state: ContainerState;
33
- getCurrentState: () => ContainerState;
34
- /**
35
- * The appContext object passed to the current app
36
- */
37
- appContext: AppContextObject;
38
- /**
39
- * The lookup function to resolve a sync action by its name.
40
- */
41
- lookupAction: LookupAsyncFnInner;
42
- navigate: any;
43
- location: any;
44
- }
45
-
46
- /**
47
- * This type represents a function that executes a particular action within the specified context
48
- * using the given arguments.
49
- */
50
- declare type ActionFunction = (executionContext: ActionExecutionContext, ...args: any[]) => any;
51
-
52
- declare type AlignmentOptions = (typeof alignmentOptionValues)[number];
53
-
54
- declare const alignmentOptionValues: readonly ["start", "center", "end"];
55
-
56
- declare namespace all {
57
- export {
58
- ThemeDefinition,
59
- ComponentDef,
60
- ComponentRendererDef,
61
- CompoundComponentDef,
62
- ComponentLike,
63
- StandaloneAppDescription,
64
- StandaloneJsonConfig,
65
- ApiInterceptorDefinition,
66
- RegisterComponentApiFn,
67
- TreeNode,
68
- RendererContext,
69
- ComponentMetadata,
70
- StandaloneApp,
71
- StandaloneExtensionManager,
72
- createComponentRenderer,
73
- createMetadata,
74
- d,
75
- parseScssVar,
76
- startApp,
77
- useTheme,
78
- AppRoot,
79
- ErrorBoundary,
80
- Icon,
81
- Stack,
82
- Button,
83
- Splitter,
84
- getColor,
85
- TabItemComponent as TabItem,
86
- Tabs,
87
- useColors,
88
- toCssVar,
89
- useDevTools,
90
- useLogger
91
- }
92
- }
93
-
94
- declare type ApiInterceptorDefinition = {
95
- type?: string;
96
- config?: Record<string, any>;
97
- schemaDescriptor?: SchemaDescriptor;
98
- apiUrl?: string;
99
- initialData?: Record<string, any[]> | (() => Promise<Record<string, any[]>>);
100
- helpers?: Record<string, any>;
101
- initialize?: string;
102
- operations?: Record<string, InterceptorOperationDef>;
103
- auth?: AuthDefinition;
104
- };
105
-
106
- /**
107
- * This interface defines the properties and services of an app context that the application components can use when
108
- * implementing their behavior.
109
- */
110
- declare type AppContextObject = {
111
- /**
112
- * Accept other methods
113
- */
114
- [x: string]: unknown;
115
- version: string;
116
- Actions: Record<string, ActionFunction>;
117
- /* Excluded from this release type: apiInterceptorContext */
118
- /**
119
- * This property returns a hash object containing all application-global settings
120
- * defined in the app's configuration file.
121
- */
122
- appGlobals?: Record<string, any>;
123
- /* Excluded from this release type: debugEnabled */
124
- /* Excluded from this release type: decorateComponentsWithTestId */
125
- /**
126
- * This property returns an object with some properties of the current environment.
127
- */
128
- environment: {
129
- isWindowFocused: boolean;
130
- };
131
- /**
132
- * This property returns an object with information about the current media size.
133
- */
134
- mediaSize: MediaSize;
135
- /* Excluded from this release type: queryClient */
136
- /**
137
- * This property returns `true` if the app is a standalone XMLUI app; otherwise
138
- * (for example, as part of a website), it returns `false`.
139
- */
140
- standalone?: boolean;
141
- /**
142
- * This function formats the specified value's date part into a local date string
143
- * (according to the machine's local settings).
144
- * @param date Date to format
145
- */
146
- formatDate: (date: string | Date) => string | undefined;
147
- /**
148
- * This function formats the specified value into a local
149
- * date and time string (according to the machine's local settings).
150
- * @param date Date to format
151
- */
152
- formatDateTime: (date: any) => string | undefined;
153
- /**
154
- * This function formats the specified value's date part (without year)
155
- * into a local date string (according to the machine's local settings).
156
- * @param date Date to format
157
- */
158
- formatDateWithoutYear: (date: string | Date) => string | undefined;
159
- /**
160
- * This function formats the specified value's time part into a local date
161
- * string (according to the machine's local settings).
162
- * @param date Date to format
163
- */
164
- formatTime: (date: any) => string | undefined;
165
- /**
166
- * This function formats the specified value's time part (without seconds)
167
- * into a local date string (according to the machine's local settings).
168
- * @param date Date to format
169
- */
170
- formatTimeWithoutSeconds: (date: string | Date) => string | undefined;
171
- /**
172
- * This function creates a date from the specified input value. If no input
173
- * is provided, it returns the current date and time.
174
- */
175
- getDate: (date?: string | number | Date) => Date;
176
- /**
177
- * This function calculates the difference between the current date and the
178
- * provided one and returns it in a human-readable form, such as "1 month", "2 weeks", etc.
179
- * @param date
180
- * @param nowLabel
181
- * @param time
182
- * @returns
183
- */
184
- getDateUntilNow: (date?: string | number | Date, nowLabel?: string, time?: string) => string;
185
- /**
186
- * This function converts the input string into a date value and returns
187
- * the ISO 8601 string representation of the date. It can pass dates between
188
- * the UI and backend APIs in a standard format.
189
- * @param date Date to format
190
- */
191
- isoDateString: (date?: string) => string;
192
- /**
193
- * This function checks if the specified date is today.
194
- * @param date Date to check
195
- */
196
- isToday: (date: string | Date) => boolean;
197
- /**
198
- * This function checks if the specified date is tomorrow.
199
- * @param date Date to check
200
- */
201
- isTomorrow: (date: string | Date) => boolean;
202
- /**
203
- * This function checks if the specified date is yesterday.
204
- * @param date Date to check
205
- */
206
- isYesterday: (date: string | Date) => boolean;
207
- /**
208
- * This function checks the date value provided for some particular
209
- * values and returns accordingly. Otherwise, returns it as `formatDate` would.
210
- * @param date Date to format
211
- */
212
- smartFormatDate: (date?: string | number | Date) => string;
213
- /**
214
- * This function checks the date value provided for some particular values and
215
- * returns accordingly. Otherwise, returns it as `formatDateTime` would.
216
- * @param date Date to format
217
- */
218
- smartFormatDateTime: (date: string | Date) => string | undefined;
219
- /**
220
- * This functions creates the difference between two dates in minutes.
221
- * @param date1 First date
222
- * @param date2 Second date
223
- * @returns The difference in minutes
224
- */
225
- differenceInMinutes: (date1: number | Date, date2: number | Date) => number;
226
- /**
227
- * This function checks if the specified dates are on the same day.
228
- * @param dateLeft First date
229
- * @param dateRight Second Date
230
- * @returns True, if the dates are on the same day; otherwise, false.
231
- */
232
- isSameDay: (dateLeft: number | Date, dateRight: number | Date) => boolean;
233
- /**
234
- * This function checks if the specified date is in the current calendar year.
235
- * @param date Date to check
236
- * @returns True, if the date is in the current year; otherwise, false.
237
- */
238
- isThisYear: (date: Date | number) => boolean;
239
- /**
240
- * This function calculates the average of the specified values and returns it.
241
- * @param values Values to calculate the average
242
- * @param decimals Number of decimal places to round the result
243
- */
244
- avg: (values: number[], decimals?: number) => number;
245
- /**
246
- * This function calculates the sum of the specified values and returns it.
247
- * @param values Values to calculate the sum
248
- */
249
- sum: (values: number[]) => number;
250
- /**
251
- * This function returns the specified file size in a compact form, such as
252
- * "112 B", "2.0 KiB", "23.4 KiB", "2.3 MiB", etc.
253
- * @param bytes Number of bytes to format
254
- */
255
- formatFileSizeInBytes: (bytes: number) => string | undefined;
256
- /**
257
- * This function returns the type of the specified file.
258
- * @param fileName Filename to check for extension
259
- */
260
- getFileExtension: (fileName: string) => string | undefined;
261
- /**
262
- * This function navigates to the specified `url`.
263
- * @param url New app location
264
- * @param options Navigation options
265
- */
266
- navigate: (url: To, options?: NavigateOptions) => void;
267
- /**
268
- * This property determines the base name used for the router.
269
- */
270
- routerBaseName: string;
271
- /**
272
- * Instructs the browser to display a dialog with an optional message, and to wait until the
273
- * user either confirms or cancels the dialog. It returns a boolean indicating whether OK
274
- * (`true`) or Cancel (`false`) was selected.
275
- * @param title Dialog title
276
- * @param message Confirmation message
277
- * @param actionLabel Optional action label
278
- * @return True, if the user confirmed the action; otherwise, false.
279
- */
280
- confirm: (title: string, message?: string, actionLabel?: string) => Promise<boolean>;
281
- /**
282
- * This method displays the specified `error` (error message) on the UI.
283
- * @param error Error to display
284
- */
285
- signError(error: Error | string): void;
286
- /**
287
- * The toast service that displays messages in the UI.
288
- */
289
- toast: {
290
- (message: Message, opts?: ToastOptions): string;
291
- error: ToastHandler;
292
- success: ToastHandler;
293
- loading: ToastHandler;
294
- custom: ToastHandler;
295
- dismiss(toastId?: string): void;
296
- remove(toastId?: string): void;
297
- promise<T>(promise: Promise<T>, msgs: {
298
- loading: Renderable;
299
- success: ValueOrFunction<Renderable, T>;
300
- error: ValueOrFunction<Renderable, any>;
301
- }, opts?: DefaultToastOptions): Promise<T>;
302
- };
303
- /**
304
- * This property returns the ID of the currently active theme.
305
- */
306
- activeThemeId: string;
307
- /**
308
- * This property returns the tone of the currently active theme ("light" or "dark").
309
- */
310
- activeThemeTone: "light" | "dark";
311
- /**
312
- * This property returns an array of all available theme IDs.
313
- */
314
- availableThemeIds: string[];
315
- /**
316
- * This function sets the current theme to the one with the specified `themeId`.
317
- * @param themId New theme to set
318
- */
319
- setTheme: (themId: string) => void;
320
- /**
321
- * This function sets the current theme tone to the specified `tone` value ("light" or "dark").
322
- * @param newTone New tone to set
323
- */
324
- setThemeTone: (newTone: "light" | "dark") => void;
325
- /**
326
- * This function toggles the current theme tone from "light" to "dark" or vice versa.
327
- */
328
- toggleThemeTone: () => void;
329
- /**
330
- * This property gets the information about the logged-in user. If `null`, no user is
331
- * logged in. The user information may have any value; the app must be able to leverage
332
- * this information.
333
- */
334
- loggedInUser: LoggedInUserDto | null;
335
- /**
336
- * This function sets the information about the logged-in user. The user information
337
- * may have any value; the app must be able to leverage this information.
338
- * @param loggedInUser Logged-in user information
339
- */
340
- setLoggedInUser: (loggedInUser: any) => void;
341
- readonly resources?: Record<string, string>;
342
- capitalize: (s?: string) => string;
343
- pluralize: (number: number, singular: string, plural: string) => string;
344
- delay: (timeInMs: number, callback?: any) => Promise<void>;
345
- toHashObject: (arr: any[], keyProp: string, valueProp: string) => any;
346
- findByField: (arr: any[], field: string, value: any) => any;
347
- readonly embed: {
348
- isInIFrame: boolean;
349
- };
350
- distinct: (arr: any[]) => any[];
351
- forceRefreshAnchorScroll: () => void;
352
- };
353
-
354
- /**
355
- * This component is responsible for running a pre-compiled xmlui app. It
356
- * receives the internal representation of the app markup and code (coming
357
- * from either code-behind files or inlined markup expressions) and executes
358
- * the app accordingly.
359
- */
360
- declare function AppRoot({ apiInterceptor, contributes, node, decorateComponentsWithTestId, debugEnabled, defaultTheme, defaultTone, resources, globalProps, standalone, trackContainerHeight, routerBaseName, previewMode, resourceMap, sources, extensionManager, children, projectCompilation, }: AppWrapperProps & {
361
- extensionManager?: StandaloneExtensionManager;
362
- }): JSX_2.Element;
363
-
364
- declare type AppWrapperProps = {
365
- node: ComponentLike;
366
- previewMode?: boolean;
367
- routerBaseName?: string;
368
- contributes?: ContributesDefinition;
369
- globalProps?: GlobalProps;
370
- resources?: Record<string, string>;
371
- standalone?: boolean;
372
- trackContainerHeight?: TrackContainerHeight;
373
- decorateComponentsWithTestId?: boolean;
374
- debugEnabled?: boolean;
375
- apiInterceptor?: ApiInterceptorDefinition;
376
- defaultTheme?: string;
377
- defaultTone?: ThemeTone;
378
- resourceMap?: Record<string, string>;
379
- sources?: Record<string, string>;
380
- projectCompilation?: ProjectCompilation;
381
- children?: ReactNode;
382
- };
383
-
384
- declare type ARRAY_DESTRUCTURE = typeof T_ARRAY_DESTRUCTURE;
385
-
386
- declare type ARRAY_LITERAL = typeof T_ARRAY_LITERAL;
387
-
388
- declare interface ArrayDestructure extends DestructureBase {
389
- type: ARRAY_DESTRUCTURE;
390
- }
391
-
392
- declare interface ArrayLiteral extends ExpressionBase {
393
- type: ARRAY_LITERAL;
394
- items: Expression[];
395
- loose?: boolean;
396
- }
397
-
398
- declare type ARROW_EXPRESSION = typeof T_ARROW_EXPRESSION;
399
-
400
- declare type ARROW_EXPRESSION_STATEMENT = typeof T_ARROW_EXPRESSION_STATEMENT;
401
-
402
- declare interface ArrowExpression extends ExpressionBase {
403
- type: ARROW_EXPRESSION;
404
- name?: string;
405
- args: Expression[];
406
- statement: Statement;
407
- }
408
-
409
- declare interface ArrowExpressionStatement extends ScripNodeBase {
410
- type: ARROW_EXPRESSION_STATEMENT;
411
- expr: ArrowExpression;
412
- }
413
-
414
- declare type ASSIGNMENT_EXPRESSION = typeof T_ASSIGNMENT_EXPRESSION;
415
-
416
- declare interface AssignmentExpression extends ExpressionBase {
417
- type: ASSIGNMENT_EXPRESSION;
418
- leftValue: Expression;
419
- op: AssignmentSymbols;
420
- expr: Expression;
421
- }
422
-
423
- declare type AssignmentSymbols = "=" | "+=" | "-=" | "**=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|=" | "&&=" | "||=" | "??=";
424
-
425
- /**
426
- * XMLUI executes its code asynchronously. This type defines functions that can be used in XMLUI
427
- * as actions or event handlers.
428
- */
429
- declare type AsyncFunction = (...args: any) => Promise<any> | any;
430
-
431
- declare type AuthDefinition = {
432
- defaultLoggedInUser?: any;
433
- };
434
-
435
- declare type BINARY_EXPRESSION = typeof T_BINARY_EXPRESSION;
436
-
437
- declare interface BinaryExpression extends ExpressionBase {
438
- type: BINARY_EXPRESSION;
439
- op: BinaryOpSymbols;
440
- left: Expression;
441
- right: Expression;
442
- }
443
-
444
- declare type BinaryOpSymbols = "**" | "*" | "/" | "%" | "+" | "-" | "<<" | ">>" | ">>>" | "<" | "<=" | ">" | ">=" | "==" | "===" | "!=" | "!==" | "&" | "|" | "^" | "&&" | "||" | "??" | "in";
445
-
446
- declare type BLOCK_STATEMENT = typeof T_BLOCK_STATEMENT;
447
-
448
- declare interface BlockStatement extends ScripNodeBase {
449
- type: BLOCK_STATEMENT;
450
- stmts: Statement[];
451
- }
452
-
453
- declare type BREAK_STATEMENT = typeof T_BREAK_STATEMENT;
454
-
455
- declare interface BreakStatement extends ScripNodeBase {
456
- type: BREAK_STATEMENT;
457
- }
458
-
459
- declare const Button: default_2.ForwardRefExoticComponent<{
460
- id?: string;
461
- type?: ButtonType;
462
- variant?: ButtonVariant;
463
- themeColor?: ButtonThemeColor;
464
- size?: ComponentSize;
465
- disabled?: boolean;
466
- children?: default_2.ReactNode | default_2.ReactNode[];
467
- icon?: default_2.ReactNode;
468
- iconPosition?: IconPosition;
469
- contentPosition?: AlignmentOptions;
470
- orientation?: OrientationOptions;
471
- formId?: string;
472
- style?: CSSProperties;
473
- gap?: string | number;
474
- accessibilityProps?: any;
475
- autoFocus?: boolean;
476
- contextualLabel?: string;
477
- } & Pick<default_2.HTMLAttributes<HTMLButtonElement>, "className" | "aria-disabled" | "aria-label" | "aria-controls" | "aria-expanded" | "onClick" | "onFocus" | "onBlur" | "tabIndex" | "onMouseEnter" | "onMouseLeave"> & default_2.RefAttributes<HTMLButtonElement>>;
478
-
479
- declare type ButtonThemeColor = (typeof buttonThemeValues)[number];
480
-
481
- declare const buttonThemeValues: readonly ["attention", "primary", "secondary"];
482
-
483
- declare type ButtonType = (typeof buttonTypeValues)[number];
484
-
485
- declare const buttonTypeValues: readonly ["button", "submit", "reset"];
486
-
487
- declare type ButtonVariant = (typeof buttonVariantValues)[number];
488
-
489
- declare const buttonVariantValues: readonly ["solid", "outlined", "ghost"];
490
-
491
- declare type CALCULATED_MEMBER_ACCESS_EXPRESSION = typeof T_CALCULATED_MEMBER_ACCESS_EXPRESSION;
492
-
493
- declare interface CalculatedMemberAccessExpression extends ExpressionBase {
494
- type: CALCULATED_MEMBER_ACCESS_EXPRESSION;
495
- obj: Expression;
496
- member: Expression;
497
- }
498
-
499
- declare type CodeDeclaration = {
500
- source?: string;
501
- tree: Expression;
502
- [x: string]: unknown;
503
- };
504
-
505
- declare type CollectedDeclarations = {
506
- vars: Record<string, CodeDeclaration>;
507
- functions: Record<string, CodeDeclaration>;
508
- moduleErrors?: ModuleErrors;
509
- };
510
-
511
- declare type ColorDef = {
512
- name: string;
513
- format: "hex" | "rgb" | "hsl";
514
- };
515
-
516
- declare type CompilationUnit = {
517
- /** The file name */
518
- filename: string;
519
- /** Optional markup source (used in dev mode) */
520
- markupSource?: string;
521
- /** Optional code behind source (used in dev mode) */
522
- codeBehindSource?: string;
523
- /** Other (non-core) component names this component depends on */
524
- dependencies: Set<string>;
525
- };
526
-
527
- /**
528
- * Components can provide an API that other components can invoke (using
529
- * the host component ID). This type defines the shape of a hash object that
530
- * stores the API endpoints.
531
- */
532
- declare type ComponentApi = Record<string, ((...args: any[]) => any) | boolean>;
533
-
534
- declare type ComponentCompilation = CompilationUnit & {
535
- /** The compiled markup of the component file */
536
- definition: CompoundComponentDef;
537
- };
538
-
539
- /**
540
- * This interface represents the properties of a component definition.
541
- */
542
- declare interface ComponentDef<TMd extends ComponentMetadata = ComponentMetadata> extends ComponentDefCore, Scriptable {
543
- props?: Record<keyof TMd["props"], any>;
544
- events?: Record<keyof TMd["events"], any>;
545
- /**
546
- * Components may have an API that other components can use to interact with them. This property holds
547
- * the API methods associated with this component definition.
548
- */
549
- api?: Record<keyof TMd["apis"], any>;
550
- /**
551
- * Components may provide context variables that can be used to in expressions and event handlers
552
- * within the component.
553
- * REVIEW: This property can be removed after migration to the new componend definition type.
554
- */
555
- contextVars?: Record<keyof TMd["contextVars"], string>;
556
- }
557
-
558
- /**
559
- * This interface represents the core properties of a component definition (independent
560
- * of component metadata).
561
- */
562
- declare interface ComponentDefCore {
563
- type: string;
564
- uid?: string;
565
- testId?: string;
566
- /**
567
- * A component can define namespaces on it, with the <ComponentName xmlns:KEY="VALUE" /> syntax
568
- * these are used later to resolve the `type` of the componentDef.
569
- * <KEY:Button/> will have type `VALUE.Button` (joined with a "." (dot) )
570
- */
571
- namespaces?: Record<string, string>;
572
- /**
573
- * Though components manage their state internally, the app logic may require user state management.
574
- * Components may have user *variables*, which the UI logic uses to manage the application state.
575
- * This property holds the variables (name and value pairs) associated with this component definition.
576
- */
577
- vars?: Record<string, any>;
578
- /**
579
- * Each component may have child components to constitute a hierarchy of components. This property
580
- * holds the definition of these nested children.
581
- */
582
- children?: ComponentDef[];
583
- /**
584
- * Components may have slots that can be filled with other components. This property holds the
585
- * contents of the slots
586
- */
587
- slots?: Record<string, ComponentDef[]>;
588
- /**
589
- * This property is evaluated to a Boolean value during run time. When this value is `true`, the
590
- * component with its children chain is rendered; otherwise, the entire component hierarchy is omitted
591
- * from the rendered tree.
592
- */
593
- when?: string | boolean;
594
- /**
595
- * Some components work with data obtained asynchronously. Fetching this data requires some state
596
- * management handling the complexity (including error handling) of data access. A *loader* is
597
- * responsible for managing this logic. This property holds the loaders associated with this component
598
- * definition.
599
- */
600
- loaders?: ComponentDef[];
601
- /**
602
- * Components may have functions that are used to perform some logic. This property holds the functions
603
- * (name and function body) associated with this component definition.
604
- */
605
- functions?: Record<string, any>;
606
- /**
607
- * Components managing state through variables or loaders are wrapped with containers responsible
608
- * for this job. Just as components, containers form a hierarchy. While working with this hierarchy,
609
- * parent components may flow state values (key and value pairs) to their child containers. This
610
- * property holds the name of state values to flow down to the direct child containers.
611
- */
612
- uses?: string[];
613
- /**
614
- * Arbitrary debug information that can be attached to a component definition.
615
- * Current usage:
616
- * - `debug: { source: { start: number, end: number } }` Ther start and end positions of of the source
617
- * belonging to the particular component definition.
618
- */
619
- debug?: Record<string, any>;
620
- }
621
-
622
- declare type ComponentExtension = ComponentRendererDef | CompoundComponentDef;
623
-
624
- /**
625
- * Sometimes, components and compound components can both be used
626
- */
627
- declare type ComponentLike = ComponentDef | CompoundComponentDef;
628
-
629
- /**
630
- * Components have metadata that the rendering engine uses to render the
631
- * component. This type defines the structure of such metadata.
632
- *
633
- * The type has generic parameters to ensure that type-checking works with
634
- * the metadata defined here in concert with the renderer object using the
635
- * same metadata type.
636
- */
637
- declare type ComponentMetadata<TProps extends Record<string, ComponentPropertyMetadata> = Record<string, any>, TEvents extends Record<string, ComponentPropertyMetadata> = Record<string, any>, TContextValues extends Record<string, ComponentPropertyMetadata> = Record<string, any>, TApis extends Record<string, ComponentPropertyMetadata> = Record<string, any>> = {
638
- status?: "stable" | "experimental" | "deprecated" | "in progress";
639
- description?: string;
640
- shortDescription?: string;
641
- props?: TProps;
642
- events?: TEvents;
643
- contextVars?: TContextValues;
644
- apis?: TApis;
645
- nonVisual?: boolean;
646
- childrenAsTemplate?: string;
647
- opaque?: boolean;
648
- themeVars?: Array<string>;
649
- themeVarDescriptions?: Record<string, string>;
650
- defaultThemeVars?: DefaultThemeVars;
651
- toneSpecificThemeVars?: Record<string, Record<string, string>>;
652
- allowArbitraryProps?: boolean;
653
- specializedFrom?: string;
654
- docFolder?: string;
655
- isHtmlTag?: boolean;
656
- };
657
-
658
- /**
659
- * Components have properties, events, context values, and exposed API
660
- * endpoints, each holding metadata the rendering engine uses at run time.
661
- * This type defines the structure of such metadata.
662
- */
663
- declare type ComponentPropertyMetadata = {
664
- /**
665
- * This field defines the description explaining the property. You can use
666
- * markdown, as the UI may display this value.
667
- */
668
- readonly description: string;
669
- /**
670
- * This field defines the type of the property. The rendering engine uses this
671
- * information to validate the property value.
672
- */
673
- readonly valueType?: PropertyValueType;
674
- /**
675
- * This field defines the available values of the property. The rendering engine
676
- * uses this information to validate the property value.
677
- */
678
- readonly availableValues?: readonly PropertyValueDescription[];
679
- /**
680
- * This field defines the default value of the property. The rendering engine uses
681
- * this information to set the default value of the property.
682
- */
683
- defaultValue?: any;
684
- /**
685
- * This field defines a validation function that the rendering engine uses to validate
686
- * the property value. The function returns one or more hinst if the property value is
687
- * invalid.
688
- */
689
- isValid?: IsValidFunction<any>;
690
- /**
691
- * Indicates that a particular property is internal and should not be exposed in the
692
- * documentation
693
- */
694
- isInternal?: boolean;
695
- /**
696
- * Indicates that a particular property is required for the component to essentially function.
697
- */
698
- isRequired?: boolean;
699
- };
700
-
701
- declare interface ComponentRendererContextBase<TMd extends ComponentMetadata = ComponentMetadata> {
702
- node: ComponentDef<TMd>;
703
- state: ContainerState;
704
- appContext?: AppContextObject;
705
- renderChild: RenderChildFn;
706
- layoutContext?: LayoutContext;
707
- }
708
-
709
- /**
710
- * Components must be registered with a component registry so the engine can use them. This type
711
- * collects the information held by the registry.
712
- */
713
- declare type ComponentRendererDef<T extends ComponentDef = any> = {
714
- /**
715
- * The component's type identifier. In the markup, the component must use this name to be recognized.
716
- */
717
- type: string;
718
- /**
719
- * This function renders the component from its definition to its React representation.
720
- */
721
- renderer: ComponentRendererFn<T>;
722
- /**
723
- * The metadata to use when rendering the component
724
- */
725
- metadata?: ComponentMetadata;
726
- };
727
-
728
- /**
729
- * This function renders a component definition into a React component
730
- */
731
- declare type ComponentRendererFn<T extends ComponentDef> = (context: RendererContext<T>) => ReactNode;
732
-
733
- declare type ComponentSize = (typeof sizeValues)[number];
734
-
735
- /**
736
- * XMLUI allows the creation of reusable components assembled from other XMLUI components (with markup).
737
- * This type represents such components. The name `CompoundComponent` refers to the assembled nature
738
- * of reusable components.
739
- */
740
- declare interface CompoundComponentDef extends Scriptable {
741
- /**
742
- * Each compound component must have a unique name. The markup uses this name to refer to the
743
- * particular compound component.
744
- */
745
- name: string;
746
- /**
747
- * Each compound component must have a single root component defining the component contents.
748
- */
749
- component: ComponentDef;
750
- /**
751
- * Compound components may provide an API that other components can use to interact with them. This
752
- * property holds the API methods associated with this compound component definition.
753
- */
754
- api?: Record<string, any>;
755
- /**
756
- * This property holds the variables (name and value pairs) associated with this compound component
757
- * definition.
758
- */
759
- vars?: Record<string, any>;
760
- /**
761
- * A component can define namespaces on it, with the <ComponentName xmlns:KEY="VALUE" /> syntax
762
- * these are used later to resolve the `type` of the componentDef.
763
- * <KEY:Button/> will have type `VALUE.Button` (joined with a "." (dot) )
764
- */
765
- namespaces?: Record<string, string>;
766
- /**
767
- * Arbitrary debug information that can be attached to a component definition.
768
- * Current usage:
769
- * - `debug: { source: { start: number, end: number } }` Ther start and end positions of of the source
770
- * belonging to the particular component definition.
771
- */
772
- debug?: Record<string, any>;
773
- }
774
-
775
- declare type CONDITIONAL_EXPRESSION = typeof T_CONDITIONAL_EXPRESSION;
776
-
777
- declare interface ConditionalExpression extends ExpressionBase {
778
- type: CONDITIONAL_EXPRESSION;
779
- cond: Expression;
780
- thenE: Expression;
781
- elseE: Expression;
782
- }
783
-
784
- declare type CONST_STATEMENT = typeof T_CONST_STATEMENT;
785
-
786
- declare interface ConstStatement extends ScripNodeBase {
787
- type: CONST_STATEMENT;
788
- decls: VarDeclaration[];
789
- }
790
-
791
- /**
792
- * We store the state application state in a hierarchical structure of containers. This type represents
793
- * the state within a single container stored as key and value pairs.
794
- */
795
- declare type ContainerState = Record<string | symbol, any>;
796
-
797
- declare type CONTINUE_STATEMENT = typeof T_CONTINUE_STATEMENT;
798
-
799
- declare interface ContinueStatement extends ScripNodeBase {
800
- type: CONTINUE_STATEMENT;
801
- }
802
-
803
- /**
804
- * Applications can contribute to the registry with their custom (third-party)
805
- * and application-specific components and others. This type holds the
806
- * definitions of these extra artifacts.
807
- */
808
- declare type ContributesDefinition = {
809
- /**
810
- * Native xmlui components that come with the app.
811
- */
812
- components?: ComponentRendererDef[];
813
- /**
814
- * Application-specific compound components that come with the app.
815
- */
816
- compoundComponents?: CompoundComponentDef[];
817
- /**
818
- * Themes that come with the app.
819
- */
820
- themes?: ThemeDefinition[];
821
- };
822
-
823
- /**
824
- * This helper function creates a component renderer definition from its arguments.
825
- * @param type The unique identifier of the component definition
826
- * @param renderer The function that renders the component definition into a React node
827
- * @param metadata Optional hints to help fix the rendering errors coming from invalid component property definitions
828
- * @returns The view renderer definition composed of the arguments
829
- */
830
- declare function createComponentRenderer<TMd extends ComponentMetadata>(type: string, metadata: TMd, renderer: ComponentRendererFn<ComponentDef<TMd>>): ComponentRendererDef;
831
-
832
- declare function createMetadata<TProps extends Record<string, ComponentPropertyMetadata>, TEvents extends Record<string, ComponentPropertyMetadata>, TContextVars extends Record<string, ComponentPropertyMetadata> = Record<string, any>, TApis extends Record<string, ComponentPropertyMetadata> = Record<string, any>>(metadata: ComponentMetadata<TProps, TEvents, TContextVars, TApis>): ComponentMetadata<TProps, TEvents, TContextVars, TApis>;
833
-
834
- declare function d(description: string, availableValues?: readonly PropertyValueDescription[], valueType?: PropertyValueType, defaultValue?: any, isValid?: IsValidFunction<any>, isRequired?: boolean): ComponentPropertyMetadata;
835
-
836
- declare const _default: {
837
- standalone: StandaloneExtensionManager;
838
- StandaloneApp: typeof all.StandaloneApp;
839
- StandaloneExtensionManager: typeof StandaloneExtensionManager;
840
- createComponentRenderer: typeof all.createComponentRenderer;
841
- createMetadata: typeof all.createMetadata;
842
- d: typeof all.d;
843
- parseScssVar: typeof all.parseScssVar;
844
- startApp: typeof startApp;
845
- useTheme: typeof all.useTheme;
846
- AppRoot: typeof all.AppRoot;
847
- ErrorBoundary: typeof all.ErrorBoundary;
848
- Icon: default_2.ForwardRefExoticComponent<IconBaseProps & default_2.RefAttributes<unknown>>;
849
- Stack: default_2.ForwardRefExoticComponent<{
850
- children: default_2.ReactNode;
851
- orientation?: string;
852
- uid?: string;
853
- horizontalAlignment?: string;
854
- verticalAlignment?: string;
855
- style?: default_2.CSSProperties;
856
- reverse?: boolean;
857
- hoverContainer?: boolean;
858
- visibleOnHover?: boolean;
859
- onClick?: any;
860
- onMount?: any;
861
- } & default_2.RefAttributes<any>>;
862
- Button: default_2.ForwardRefExoticComponent<{
863
- id?: string;
864
- type?: "button" | "reset" | "submit";
865
- variant?: "solid" | "outlined" | "ghost";
866
- themeColor?: "primary" | "secondary" | "attention";
867
- size?: string;
868
- disabled?: boolean;
869
- children?: default_2.ReactNode | default_2.ReactNode[];
870
- icon?: default_2.ReactNode;
871
- iconPosition?: "start" | "end";
872
- contentPosition?: "center" | "start" | "end";
873
- orientation?: "vertical" | "horizontal";
874
- formId?: string;
875
- style?: default_2.CSSProperties;
876
- gap?: string | number;
877
- accessibilityProps?: any;
878
- autoFocus?: boolean;
879
- contextualLabel?: string;
880
- } & Pick<default_2.HTMLAttributes<HTMLButtonElement>, "className" | "aria-disabled" | "aria-label" | "aria-controls" | "aria-expanded" | "onClick" | "onFocus" | "onBlur" | "tabIndex" | "onMouseEnter" | "onMouseLeave"> & default_2.RefAttributes<HTMLButtonElement>>;
881
- Splitter: ({ initialPrimarySize, minPrimarySize, maxPrimarySize, orientation, children, style, swapped, floating, splitterTemplate, resize, }: {
882
- children: default_2.ReactNode | default_2.ReactNode[];
883
- style?: default_2.CSSProperties;
884
- splitterTemplate?: default_2.ReactNode;
885
- orientation?: "vertical" | "horizontal";
886
- floating?: boolean;
887
- resize?: (sizes: [number, number]) => void;
888
- swapped?: boolean;
889
- initialPrimarySize?: string;
890
- minPrimarySize?: string;
891
- maxPrimarySize?: string;
892
- }) => default_3.JSX.Element;
893
- getColor: typeof all.getColor;
894
- TabItem: default_2.ForwardRefExoticComponent<Tab & default_2.RefAttributes<HTMLDivElement>>;
895
- Tabs: default_2.ForwardRefExoticComponent<{
896
- activeTab?: number;
897
- orientation?: "vertical" | "horizontal";
898
- tabRenderer?: (item: {
899
- label: string;
900
- isActive: boolean;
901
- }) => default_2.ReactNode;
902
- style?: default_2.CSSProperties;
903
- children?: default_2.ReactNode;
904
- registerComponentApi?: all.RegisterComponentApiFn;
905
- className?: string;
906
- distributeEvenly?: boolean;
907
- } & default_2.RefAttributes<HTMLDivElement>>;
908
- useColors: typeof all.useColors;
909
- toCssVar: typeof all.toCssVar;
910
- useDevTools: typeof all.useDevTools;
911
- useLogger: () => {
912
- logs: {
913
- timestamp: Date;
914
- args: any[];
915
- }[];
916
- addLog: (args: any[]) => void;
917
- };
918
- };
919
- export default _default;
920
-
921
- declare type DefaultThemeVars = Record<string | ThemeTone, string | Record<string, string>>;
922
-
923
- declare type DefaultValueDescriptor = (string | ThemeIdDescriptor)[];
924
-
925
- declare type DESTRUCTURE = typeof T_DESTRUCTURE;
926
-
927
- declare interface Destructure extends DestructureBase {
928
- type: DESTRUCTURE;
929
- aDestr?: ArrayDestructure[];
930
- oDestr?: ObjectDestructure[];
931
- }
932
-
933
- declare interface DestructureBase extends ExpressionBase {
934
- id?: string;
935
- aDestr?: ArrayDestructure[];
936
- oDestr?: ObjectDestructure[];
937
- }
938
-
939
- declare type DO_WHILE_STATEMENT = typeof T_DO_WHILE_STATEMENT;
940
-
941
- declare interface DoWhileStatement extends ScripNodeBase {
942
- type: DO_WHILE_STATEMENT;
943
- cond: Expression;
944
- body: Statement;
945
- }
946
-
947
- /**
948
- * Some components render their nested child components dynamically using the current context of
949
- * their parents. For example, reusable components (`CompoundComponentDef`) have a `Slot`
950
- * placeholder that marks the location where the children should be rendered. Other component types
951
- * (e.g., `ApiBoundComponent` and `ContainerComponent`) use this dynamic rendering, too.
952
- *
953
- * This interface represents this functionality.
954
- */
955
- declare interface DynamicChildComponentDef extends ComponentDef {
956
- /**
957
- * This property holds a function that can render a particular child or children into a specific
958
- * layout context.
959
- */
960
- renderChild: RenderChildFn;
961
- /**
962
- * This property holds the child component that should be rendered.
963
- */
964
- childToRender: ComponentDef;
965
- }
966
-
967
- declare type EMPTY_STATEMENT = typeof T_EMPTY_STATEMENT;
968
-
969
- declare interface EmptyStatement extends ScripNodeBase {
970
- type: EMPTY_STATEMENT;
971
- }
972
-
973
- declare type EntrypointCompilation = CompilationUnit & {
974
- /** The compiled markup of the main file */
975
- definition: ComponentDef;
976
- };
977
-
978
- /**
979
- * This React component serves as an error boundary; it catches any errors within
980
- * the nested components
981
- */
982
- declare class ErrorBoundary extends default_2.Component<Props, State> {
983
- state: State;
984
- /**
985
- * This method implements the Error Boundaries for the React application.
986
- * It is invoked if errors occur during the rendering phase of any lifecycle
987
- * methods or children components.
988
- *
989
- * DO NOT DELETE this method! Though it is not referenced directly from the code,
990
- * it is a required part of the React component lifecycle.
991
- */
992
- static getDerivedStateFromError(error: Error): State;
993
- /**
994
- * Display any error in the console
995
- * @param error Error object
996
- * @param errorInfo Extra information about the error
997
- */
998
- componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
999
- /**
1000
- * Whenever the `restoreOnChangeOf` property of this component instance
1001
- * changes, we reset the state to "no error".
1002
- * @param prevProps Previous property values
1003
- * @param prevState Previous state
1004
- * @param snapshot Optional snapshot (not used in this component)
1005
- */
1006
- componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<State>, snapshot?: any): void;
1007
- /**
1008
- * Display an error message if an error occurred during rendering.
1009
- */
1010
- render(): string | number | boolean | Iterable<default_2.ReactNode> | JSX_2.Element;
1011
- }
1012
-
1013
- declare type Expression = UnaryExpression | BinaryExpression | SequenceExpression | ConditionalExpression | FunctionInvocationExpression | MemberAccessExpression | CalculatedMemberAccessExpression | Identifier | TemplateLiteralExpression | Literal | ArrayLiteral | ObjectLiteral | SpreadExpression | AssignmentExpression | NoArgExpression | ArrowExpression | PrefixOpExpression | PostfixOpExpression | ReactiveVarDeclaration | VarDeclaration | Destructure | ObjectDestructure | ArrayDestructure | SwitchCase;
1014
-
1015
- declare type EXPRESSION_STATEMENT = typeof T_EXPRESSION_STATEMENT;
1016
-
1017
- declare interface ExpressionBase extends ScripNodeBase {
1018
- parenthesized?: number;
1019
- }
1020
-
1021
- declare interface ExpressionStatement extends ScripNodeBase {
1022
- type: EXPRESSION_STATEMENT;
1023
- expr: Expression;
1024
- }
1025
-
1026
- declare interface Extension {
1027
- namespace?: string;
1028
- components?: ComponentExtension[];
1029
- themes?: ThemeDefinition[];
1030
- }
1031
-
1032
- declare type ExtensionRegisteredCallbackFn = (extension: Extension) => void;
1033
-
1034
- /**
1035
- * This type describes a font definition resource.
1036
- */
1037
- declare type FontDef = {
1038
- /**
1039
- * Specifies a name that will be used as the font face value for font properties
1040
- */
1041
- fontFamily: string;
1042
- /**
1043
- * A fontStyle value. Accepts two values to specify a range that is supported by a font-face,
1044
- * for example `fontStyle: oblique 20deg 50deg`
1045
- */
1046
- fontStyle?: string;
1047
- /**
1048
- * A font-weight value. Accepts two values to specify a range that is supported by a font-face,
1049
- * for example `font-weight: 100 900`
1050
- */
1051
- fontWeight?: string;
1052
- /**
1053
- * This property determines how a font face is displayed based on whether and when it is downloaded
1054
- * and ready to use.
1055
- */
1056
- fontDisplay?: string;
1057
- /**
1058
- * The mime type of the font file
1059
- */
1060
- format?: string;
1061
- /**
1062
- * Specifies references to font resources.
1063
- */
1064
- src: string;
1065
- } | string;
1066
-
1067
- declare type FOR_IN_STATEMENT = typeof T_FOR_IN_STATEMENT;
1068
-
1069
- declare type FOR_OF_STATEMENT = typeof T_FOR_OF_STATEMENT;
1070
-
1071
- declare type FOR_STATEMENT = typeof T_FOR_STATEMENT;
1072
-
1073
- declare interface ForInStatement extends ScripNodeBase {
1074
- type: FOR_IN_STATEMENT;
1075
- varB: ForVarBinding;
1076
- id: Identifier;
1077
- expr: Expression;
1078
- body: Statement;
1079
- }
1080
-
1081
- declare interface ForOfStatement extends ScripNodeBase {
1082
- type: FOR_OF_STATEMENT;
1083
- varB: ForVarBinding;
1084
- id: Identifier;
1085
- expr: Expression;
1086
- body: Statement;
1087
- }
1088
-
1089
- declare interface ForStatement extends ScripNodeBase {
1090
- type: FOR_STATEMENT;
1091
- init?: ExpressionStatement | LetStatement;
1092
- cond?: Expression;
1093
- upd?: Expression;
1094
- body: Statement;
1095
- }
1096
-
1097
- declare type ForVarBinding = "let" | "const" | "none";
1098
-
1099
- declare type FUNCTION_DECLARATION = typeof T_FUNCTION_DECLARATION;
1100
-
1101
- declare type FUNCTION_INVOCATION_EXPRESSION = typeof T_FUNCTION_INVOCATION_EXPRESSION;
1102
-
1103
- declare interface FunctionDeclaration extends ScripNodeBase {
1104
- type: FUNCTION_DECLARATION;
1105
- id: Identifier;
1106
- args: Expression[];
1107
- stmt: BlockStatement;
1108
- }
1109
-
1110
- declare interface FunctionInvocationExpression extends ExpressionBase {
1111
- type: FUNCTION_INVOCATION_EXPRESSION;
1112
- obj: Expression;
1113
- arguments: Expression[];
1114
- }
1115
-
1116
- declare type GenericToken<T> = {
1117
- text: string;
1118
- type: T;
1119
- startPosition: number;
1120
- endPosition: number;
1121
- startLine: number;
1122
- endLine: number;
1123
- startColumn: number;
1124
- endColumn: number;
1125
- };
1126
-
1127
- declare function getColor(varName: string, format?: "hex" | "rgb" | "hsl"): string;
1128
-
1129
- declare type GlobalProps = Record<string, any>;
1130
-
1131
- declare interface IApiInterceptorContext {
1132
- isMocked: (url: string) => boolean;
1133
- }
1134
-
1135
- declare const Icon: default_2.ForwardRefExoticComponent<IconBaseProps & default_2.RefAttributes<unknown>>;
1136
-
1137
- declare interface IconBaseProps extends default_2.SVGAttributes<SVGElement> {
1138
- children?: default_2.ReactNode;
1139
- color?: string;
1140
- title?: string;
1141
- size?: string;
1142
- isInline?: boolean;
1143
- fallback?: string;
1144
- style?: CSSProperties;
1145
- }
1146
-
1147
- declare type IconPosition = (typeof iconPositionValues)[number];
1148
-
1149
- declare const iconPositionValues: readonly ["start", "end"];
1150
-
1151
- declare type IDENTIFIER = typeof T_IDENTIFIER;
1152
-
1153
- declare interface Identifier extends ExpressionBase {
1154
- type: IDENTIFIER;
1155
- name: string;
1156
- isGlobal?: boolean;
1157
- }
1158
-
1159
- declare type IF_STATEMENT = typeof T_IF_STATEMENT;
1160
-
1161
- declare interface IfStatement extends ScripNodeBase {
1162
- type: IF_STATEMENT;
1163
- cond: Expression;
1164
- thenB: Statement;
1165
- elseB?: Statement;
1166
- }
1167
-
1168
- declare type InterceptorOperationDef = {
1169
- method: "get" | "post" | "put" | "delete";
1170
- url: string | Array<string>;
1171
- handler: string;
1172
- requestShape?: any;
1173
- responseShape?: any;
1174
- pathParamTypes?: Record<string, string>;
1175
- queryParamTypes?: Record<string, string>;
1176
- successStatusCode?: number;
1177
- };
1178
-
1179
- declare type IsValidFunction<T> = (propKey: string, propValue: T) => string | string[] | undefined | null;
1180
-
1181
- /**
1182
- * Each component is rendered in a particular layout context (for example, within a stack). This
1183
- * type provides information about that context and the operations that render children in it.
1184
- */
1185
- declare type LayoutContext<T extends ComponentDef = ComponentDef> = {
1186
- /**
1187
- * The type of the layout context
1188
- */
1189
- type?: string;
1190
- /**
1191
- * This function allows the React representation of a particular child node to be wrapped in
1192
- * whatever React components to accommodate the current layout context. When the engine is about to
1193
- * render children in a particular layout context, it checks the existence of this function.
1194
- * If declared, the engine invokes it.
1195
- * @param context Rendering context
1196
- * @param renderedChild The React node representing the rendered child
1197
- * @param metadata The metadata of the child component
1198
- * @returns The wrapped React node
1199
- */
1200
- wrapChild?: (context: RendererContext<T>, renderedChild: ReactNode, metadata?: ComponentMetadata) => ReactNode;
1201
- /**
1202
- * Arbitrary props extending the layout context
1203
- */
1204
- [key: string]: any;
1205
- };
1206
-
1207
- declare type LET_STATEMENT = typeof T_LET_STATEMENT;
1208
-
1209
- declare interface LetStatement extends ScripNodeBase {
1210
- type: LET_STATEMENT;
1211
- decls: VarDeclaration[];
1212
- }
1213
-
1214
- declare type LITERAL = typeof T_LITERAL;
1215
-
1216
- declare interface Literal extends ExpressionBase {
1217
- type: LITERAL;
1218
- value: any;
1219
- }
1220
-
1221
- declare type LogContextType = {
1222
- logs: LogEntry[];
1223
- addLog: (args: any[]) => void;
1224
- };
1225
-
1226
- declare type LogEntry = {
1227
- timestamp: Date;
1228
- args: any[];
1229
- };
1230
-
1231
- declare type LoggedInUserDto = {
1232
- id: number;
1233
- email: string;
1234
- name: string;
1235
- imageRelativeUrl: string;
1236
- permissions: Record<string, string>;
1237
- };
1238
-
1239
- /**
1240
- * This type represents the options to use for looking up actions.
1241
- */
1242
- declare type LookupActionOptions = {
1243
- /**
1244
- * This property (by default, true) indicates that any error should be signed while
1245
- * executing an event handler. Set it to `false` to suppress error indication.
1246
- */
1247
- signError?: boolean;
1248
- /**
1249
- * We can use the event's name to get info about a particular event's progress. Note: Multiple
1250
- * events can run simultaneously.
1251
- */
1252
- eventName?: string;
1253
- /**
1254
- * By default, we cache resolved action functions. This property signs that we don't want to cache
1255
- * this function. Use true on one-off handlers, like the ones in Actions (e.g., `MutateAction`).
1256
- */
1257
- ephemeral?: boolean;
1258
- /**
1259
- * This property declares the script code to use as a default for a particular event handler.
1260
- */
1261
- defaultHandler?: string;
1262
- context?: any;
1263
- };
1264
-
1265
- /**
1266
- * This function resolves an action by its name with the specified options and returns the action
1267
- * function if found. Otherwise, return undefined.
1268
- */
1269
- declare type LookupAsyncFn = (action: string | undefined, actionOptions?: LookupActionOptions) => AsyncFunction | undefined;
1270
-
1271
- /**
1272
- * This function resolves an action by its name (within the component node that runs the action)
1273
- * with the specified options and returns the action function if found. Otherwise, return undefined.
1274
- */
1275
- declare type LookupAsyncFnInner = (action: string | undefined,
1276
- /**
1277
- * The unique identifier of the container that the action is executed in.
1278
- */
1279
- uid: symbol, actionOptions?: LookupActionOptions) => AsyncFunction | undefined;
1280
-
1281
- /**
1282
- * This function retrieves an async function for a particular component's specified event to be
1283
- * invoked as an event handler (`undefined` if the particular event handler is not defined).
1284
- */
1285
- declare type LookupEventHandlerFn<TMd extends ComponentMetadata = ComponentMetadata> = (eventName: keyof NonNullable<TMd["events"]>, actionOptions?: LookupActionOptions) => AsyncFunction | undefined;
1286
-
1287
- /**
1288
- * This function resolves a sync action by its name and returns the action function if it is found.
1289
- * Otherwise, it returns undefined.
1290
- */
1291
- declare type LookupSyncFn = (action: string | undefined) => SyncFunction | undefined;
1292
-
1293
- declare type MediaBreakpointType = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1294
-
1295
- declare type MediaSize = {
1296
- phone: boolean;
1297
- landscapePhone: boolean;
1298
- tablet: boolean;
1299
- desktop: boolean;
1300
- largeDesktop: boolean;
1301
- xlDesktop: boolean;
1302
- smallScreen: boolean;
1303
- largeScreen: boolean;
1304
- size: MediaBreakpointType;
1305
- sizeIndex: number;
1306
- };
1307
-
1308
- declare type MEMBER_ACCESS_EXPRESSION = typeof T_MEMBER_ACCESS_EXPRESSION;
1309
-
1310
- declare interface MemberAccessExpression extends ExpressionBase {
1311
- type: MEMBER_ACCESS_EXPRESSION;
1312
- obj: Expression;
1313
- member: string;
1314
- opt?: boolean;
1315
- }
1316
-
1317
- declare type Message = ValueOrFunction<Renderable, Toast>;
1318
-
1319
- /**
1320
- * Represents a module error
1321
- */
1322
- declare type ModuleErrors = Record<string, ScriptParserErrorMessage[]>;
1323
-
1324
- declare type NO_ARG_EXPRESSION = typeof T_NO_ARG_EXPRESSION;
1325
-
1326
- declare interface NoArgExpression extends ExpressionBase {
1327
- type: NO_ARG_EXPRESSION;
1328
- }
1329
-
1330
- declare type OBJECT_DESTRUCTURE = typeof T_OBJECT_DESTRUCTURE;
1331
-
1332
- declare type OBJECT_LITERAL = typeof T_OBJECT_LITERAL;
1333
-
1334
- declare interface ObjectDestructure extends DestructureBase {
1335
- type: OBJECT_DESTRUCTURE;
1336
- id: string;
1337
- alias?: string;
1338
- }
1339
-
1340
- declare interface ObjectLiteral extends ExpressionBase {
1341
- type: OBJECT_LITERAL;
1342
- props: (SpreadExpression | [Expression, Expression])[];
1343
- }
1344
-
1345
- declare type OrientationOptions = (typeof orientationOptionValues)[number];
1346
-
1347
- declare const orientationOptionValues: readonly ["horizontal", "vertical"];
1348
-
1349
- declare interface ParentRenderContext {
1350
- renderChild: RenderChildFn;
1351
- children?: ComponentDef[];
1352
- props?: Record<string, any>;
1353
- }
1354
-
1355
- /**
1356
- * This function extracts CSS variables from the specified SCSS input. It uses a hack to convert the CSS input to JSON
1357
- * and then calls a JSON parser to create the desired object.
1358
- * @param scssStr The scss input
1359
- */
1360
- declare function parseScssVar(scssStr: any): any;
1361
-
1362
- declare type POSTFIX_OP_EXPRESSION = typeof T_POSTFIX_OP_EXPRESSION;
1363
-
1364
- declare interface PostfixOpExpression extends ExpressionBase {
1365
- type: POSTFIX_OP_EXPRESSION;
1366
- op: PrefixOpSymbol;
1367
- expr: Expression;
1368
- }
1369
-
1370
- declare type PREFIX_OP_EXPRESSION = typeof T_PREFIX_OP_EXPRESSION;
1371
-
1372
- declare interface PrefixOpExpression extends ExpressionBase {
1373
- type: PREFIX_OP_EXPRESSION;
1374
- op: PrefixOpSymbol;
1375
- expr: Expression;
1376
- }
1377
-
1378
- declare type PrefixOpSymbol = "++" | "--";
1379
-
1380
- /** Contains the compilation result of a project */
1381
- declare type ProjectCompilation = {
1382
- /** The compiled Main.xmlui file (with its optional code behind) */
1383
- entrypoint: EntrypointCompilation;
1384
- /** The compiled component files (with their optional code behind) */
1385
- components: ComponentCompilation[];
1386
- /** The compiled theme files */
1387
- themes: Record<string, ThemeDefinition>;
1388
- };
1389
-
1390
- /**
1391
- * This type represents the description of a property value, which can be a string, a number,
1392
- * or an object with a value and a description. This type is used in the metadata of a component.
1393
- */
1394
- declare type PropertyValueDescription = string | number | {
1395
- value: string | number;
1396
- description: string;
1397
- };
1398
-
1399
- declare type PropertyValueType = "boolean" | "string" | "number" | "any" | "ComponentDef";
1400
-
1401
- declare interface Props {
1402
- children: ReactNode;
1403
- node?: ComponentLike;
1404
- location?: string;
1405
- }
1406
-
1407
- declare type Props_2 = {
1408
- children: ReactNode;
1409
- orientation?: string;
1410
- uid?: string;
1411
- horizontalAlignment?: string;
1412
- verticalAlignment?: string;
1413
- style?: CSSProperties;
1414
- reverse?: boolean;
1415
- hoverContainer?: boolean;
1416
- visibleOnHover?: boolean;
1417
- onClick?: any;
1418
- onMount?: any;
1419
- };
1420
-
1421
- declare type Props_3 = {
1422
- activeTab?: number;
1423
- orientation?: "horizontal" | "vertical";
1424
- tabRenderer?: (item: {
1425
- label: string;
1426
- isActive: boolean;
1427
- }) => ReactNode;
1428
- style?: CSSProperties;
1429
- children?: ReactNode;
1430
- registerComponentApi?: RegisterComponentApiFn;
1431
- className?: string;
1432
- distributeEvenly?: boolean;
1433
- };
1434
-
1435
- declare type REACTIVE_VAR_DECLARATION = typeof T_REACTIVE_VAR_DECLARATION;
1436
-
1437
- declare interface ReactiveVarDeclaration extends ExpressionBase {
1438
- type: REACTIVE_VAR_DECLARATION;
1439
- id: Identifier;
1440
- expr: Expression;
1441
- }
1442
-
1443
- /**
1444
- * This type represents a function that registers all API endpoints of a particular component.
1445
- */
1446
- declare type RegisterComponentApiFn = (componentApi: ComponentApi) => void;
1447
-
1448
- declare type RenderChildFn<L extends ComponentDef = ComponentDef> = (children?: ComponentDef | ComponentDef[] | DynamicChildComponentDef | DynamicChildComponentDef[] | string, layoutContext?: LayoutContext<L>, parentRenderContext?: ParentRenderContext, uidInfoRef?: RefObject<Record<string, any>>, ref?: ForwardedRef<any>) => ReactNode | ReactNode[];
1449
-
1450
- /**
1451
- * This interface defines the renderer context for the exposed components of the XMLUI framework.
1452
- */
1453
- declare interface RendererContext<TMd extends ComponentMetadata = ComponentMetadata> extends ComponentRendererContextBase<TMd> {
1454
- /**
1455
- * The unique identifier of the component instance
1456
- */
1457
- uid: symbol;
1458
- /**
1459
- * A component invokes this function to change its internal state
1460
- */
1461
- updateState: UpdateStateFn;
1462
- /**
1463
- * When a component wants to access a property value (which may contain a binding expression to
1464
- * evaluate), it must use this property to get the current value.
1465
- */
1466
- extractValue: ValueExtractor;
1467
- /**
1468
- * This function gets a physical resource URL according to the provided logical URL.
1469
- */
1470
- extractResourceUrl: (url?: string) => string | undefined;
1471
- /**
1472
- * This function gets an async executable function that handles an event.
1473
- */
1474
- lookupEventHandler: LookupEventHandlerFn<TMd>;
1475
- /**
1476
- * A component can register its APIs with this function
1477
- */
1478
- registerComponentApi: RegisterComponentApiFn;
1479
- /**
1480
- * This function obtains an action by its name with the specified options
1481
- */
1482
- lookupAction: LookupAsyncFn;
1483
- /**
1484
- * This function retrieves a sync function the component can use as a callback
1485
- */
1486
- lookupSyncCallback: LookupSyncFn;
1487
- layoutCss: CSSProperties;
1488
- }
1489
-
1490
- declare type RETURN_STATEMENT = typeof T_RETURN_STATEMENT;
1491
-
1492
- declare interface ReturnStatement extends ScripNodeBase {
1493
- type: RETURN_STATEMENT;
1494
- expr?: Expression;
1495
- }
1496
-
1497
- declare type SchemaDescriptor = {
1498
- tables: Array<TableDescriptor>;
1499
- relationships?: any;
1500
- dtos?: any;
1501
- };
1502
-
1503
- declare interface ScripNodeBase {
1504
- type: ScriptNode["type"];
1505
- nodeId: number;
1506
- startToken?: ScriptingToken;
1507
- endToken?: ScriptingToken;
1508
- }
1509
-
1510
- /**
1511
- * This interface holds the properties representing a scriptable component definition.
1512
- */
1513
- declare interface Scriptable {
1514
- /**
1515
- * This property holds the text defined in all <script> sections attached to a component.
1516
- */
1517
- script?: string;
1518
- /**
1519
- * This property holds the parsed form of scripts stored in code-behind files.
1520
- */
1521
- scriptCollected?: CollectedDeclarations;
1522
- /**
1523
- * This property holds errors coming from parsing the code-behind scripts.
1524
- */
1525
- scriptError?: any;
1526
- }
1527
-
1528
- declare type ScriptingToken = GenericToken<TokenType>;
1529
-
1530
- declare type ScriptNode = Statement | Expression;
1531
-
1532
- declare interface ScriptParserErrorMessage {
1533
- code: ScriptParsingErrorCodes;
1534
- text: string;
1535
- position?: number;
1536
- line?: number;
1537
- column?: number;
1538
- }
1539
-
1540
- declare type ScriptParsingErrorCodes = "W001" | "W002" | "W003" | "W004" | "W005" | "W006" | "W007" | "W008" | "W009" | "W010" | "W011" | "W012" | "W013" | "W014" | "W015" | "W016" | "W017" | "W018" | "W019" | "W020" | "W021" | "W022" | "W023" | "W024" | "W025" | "W026" | "W027" | "W028" | "W029" | "W030" | "W031";
1541
-
1542
- declare type SEQUENCE_EXPRESSION = typeof T_SEQUENCE_EXPRESSION;
1543
-
1544
- declare interface SequenceExpression extends ExpressionBase {
1545
- type: SEQUENCE_EXPRESSION;
1546
- exprs: Expression[];
1547
- loose?: boolean;
1548
- }
1549
-
1550
- declare const sizeValues: string[];
1551
-
1552
- declare const Splitter: ({ initialPrimarySize, minPrimarySize, maxPrimarySize, orientation, children, style, swapped, floating, splitterTemplate, resize, }: SplitterProps) => JSX_2.Element;
1553
-
1554
- declare type SplitterProps = {
1555
- children: default_2.ReactNode[] | default_2.ReactNode;
1556
- style?: default_2.CSSProperties;
1557
- splitterTemplate?: default_2.ReactNode;
1558
- orientation?: OrientationOptions;
1559
- floating?: boolean;
1560
- resize?: (sizes: [number, number]) => void;
1561
- swapped?: boolean;
1562
- initialPrimarySize?: string;
1563
- minPrimarySize?: string;
1564
- maxPrimarySize?: string;
1565
- };
1566
-
1567
- declare type SPREAD_EXPRESSION = typeof T_SPREAD_EXPRESSION;
1568
-
1569
- declare interface SpreadExpression extends ExpressionBase {
1570
- type: SPREAD_EXPRESSION;
1571
- expr: Expression;
1572
- }
1573
-
1574
- declare const Stack: ForwardRefExoticComponent<Props_2 & RefAttributes<any>>;
1575
-
1576
- /**
1577
- * This React component represents a standalone app that implements a web
1578
- * application with xmlui components. A StandaloneApp instance uses a
1579
- * AppRoot wrapped into an ApiInterceptor.
1580
- *
1581
- * AppRoot is responsible for rendering the app (using an internal
1582
- * representation); ApiInterceptor can emulate some backend functionality
1583
- * running in the browser.
1584
- */
1585
- declare function StandaloneApp({ appDef, decorateComponentsWithTestId, debugEnabled, runtime, extensionManager, }: StandaloneAppProps): JSX_2.Element;
1586
-
1587
- declare type StandaloneAppDescription = {
1588
- name?: string;
1589
- version?: string;
1590
- entryPoint?: ComponentLike;
1591
- components?: CompoundComponentDef[];
1592
- themes?: ThemeDefinition[];
1593
- defaultTheme?: string;
1594
- defaultTone?: string;
1595
- resources?: Record<string, string>;
1596
- resourceMap?: Record<string, string>;
1597
- appGlobals?: Record<string, any>;
1598
- apiInterceptor?: ApiInterceptorDefinition;
1599
- sources?: Record<string, string>;
1600
- };
1601
-
1602
- declare type StandaloneAppProps = {
1603
- appDef?: StandaloneAppDescription;
1604
- decorateComponentsWithTestId?: boolean;
1605
- debugEnabled?: boolean;
1606
- runtime?: any;
1607
- extensionManager?: StandaloneExtensionManager;
1608
- };
1609
-
1610
- /**
1611
- * This class allows external component libraries to add their components to
1612
- * the xmlui component registry. The framework resolves the components used
1613
- * in an application markup with this registry.
1614
- */
1615
- declare class StandaloneExtensionManager {
1616
- subscriptions: Set<ExtensionRegisteredCallbackFn>;
1617
- registeredExtensions: Array<Extension>;
1618
- constructor();
1619
- /**
1620
- * You can add a callback function invoked whenever a new component is added
1621
- * to the registry. When you register a new callback function, the component
1622
- * manager automatically invokes it for all components already in the
1623
- * registry.
1624
- * @param cb Function to call when a new component is registered
1625
- */
1626
- subscribeToRegistrations(cb: ExtensionRegisteredCallbackFn): void;
1627
- /**
1628
- * You can remove a function added by `subscribeToRegistrations`. After
1629
- * calling this method, the particular callback function won't be invoked
1630
- * for a new component registration.
1631
- * @param cb Function to call when a new component is registered
1632
- */
1633
- unSubscribeFromRegistrations(cb: ExtensionRegisteredCallbackFn): void;
1634
- registerExtension(component: Extension | Extension[]): void;
1635
- }
1636
-
1637
- declare type StandaloneJsonConfig = {
1638
- name?: string;
1639
- appGlobals?: Record<string, any>;
1640
- entryPoint?: string;
1641
- components?: string[];
1642
- themes?: string[];
1643
- defaultTheme?: string;
1644
- resources?: Record<string, string>;
1645
- resourceMap?: Record<string, string>;
1646
- apiInterceptor?: ApiInterceptorDefinition;
1647
- };
1648
-
1649
- /**
1650
- * This function injects the StandaloneApp component into a React app. It looks
1651
- * up a component with the "root" id as the host of the standalone app. If such
1652
- * an element does not exist, it creates a `<div id="root">` element.
1653
- * @param runtime The app's runtime representation
1654
- * @param components The related component's runtime representation
1655
- * @returns The content's root element
1656
- */
1657
- declare function startApp(runtime: any, extensions?: Extension[] | Extension, extensionManager?: StandaloneExtensionManager): Root;
1658
-
1659
- declare type State = {
1660
- hasError: boolean;
1661
- error: Error | null;
1662
- };
1663
-
1664
- declare type Statement = BlockStatement | EmptyStatement | ExpressionStatement | ArrowExpressionStatement | LetStatement | ConstStatement | VarStatement | IfStatement | ReturnStatement | BreakStatement | ContinueStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ThrowStatement | TryStatement | SwitchStatement | FunctionDeclaration;
1665
-
1666
- declare type SWITCH_CASE = typeof T_SWITCH_CASE;
1667
-
1668
- declare type SWITCH_STATEMENT = typeof T_SWITCH_STATEMENT;
1669
-
1670
- declare interface SwitchCase extends ExpressionBase {
1671
- type: SWITCH_CASE;
1672
- caseE?: Expression;
1673
- stmts?: Statement[];
1674
- }
1675
-
1676
- declare interface SwitchStatement extends ScripNodeBase {
1677
- type: SWITCH_STATEMENT;
1678
- expr: Expression;
1679
- cases: SwitchCase[];
1680
- }
1681
-
1682
- /**
1683
- * XMLUI executes some code synchronously. This type defines those functions' signature
1684
- */
1685
- declare type SyncFunction = (...args: any) => any;
1686
-
1687
- declare const T_ARRAY_DESTRUCTURE = 202;
1688
-
1689
- declare const T_ARRAY_LITERAL = 110;
1690
-
1691
- declare const T_ARROW_EXPRESSION = 115;
1692
-
1693
- declare const T_ARROW_EXPRESSION_STATEMENT = 4;
1694
-
1695
- declare const T_ASSIGNMENT_EXPRESSION = 113;
1696
-
1697
- declare const T_BINARY_EXPRESSION = 101;
1698
-
1699
- declare const T_BLOCK_STATEMENT = 1;
1700
-
1701
- declare const T_BREAK_STATEMENT = 10;
1702
-
1703
- declare const T_CALCULATED_MEMBER_ACCESS_EXPRESSION = 106;
1704
-
1705
- declare const T_CONDITIONAL_EXPRESSION = 103;
1706
-
1707
- declare const T_CONST_STATEMENT = 6;
1708
-
1709
- declare const T_CONTINUE_STATEMENT = 11;
1710
-
1711
- declare const T_DESTRUCTURE = 201;
1712
-
1713
- declare const T_DO_WHILE_STATEMENT = 13;
1714
-
1715
- declare const T_EMPTY_STATEMENT = 2;
1716
-
1717
- declare const T_EXPRESSION_STATEMENT = 3;
1718
-
1719
- declare const T_FOR_IN_STATEMENT = 15;
1720
-
1721
- declare const T_FOR_OF_STATEMENT = 16;
1722
-
1723
- declare const T_FOR_STATEMENT = 14;
1724
-
1725
- declare const T_FUNCTION_DECLARATION = 20;
1726
-
1727
- declare const T_FUNCTION_INVOCATION_EXPRESSION = 104;
1728
-
1729
- declare const T_IDENTIFIER = 107;
1730
-
1731
- declare const T_IF_STATEMENT = 8;
1732
-
1733
- declare const T_LET_STATEMENT = 5;
1734
-
1735
- declare const T_LITERAL = 109;
1736
-
1737
- declare const T_MEMBER_ACCESS_EXPRESSION = 105;
1738
-
1739
- declare const T_NO_ARG_EXPRESSION = 114;
1740
-
1741
- declare const T_OBJECT_DESTRUCTURE = 203;
1742
-
1743
- declare const T_OBJECT_LITERAL = 111;
1744
-
1745
- declare const T_POSTFIX_OP_EXPRESSION = 117;
1746
-
1747
- declare const T_PREFIX_OP_EXPRESSION = 116;
1748
-
1749
- declare const T_REACTIVE_VAR_DECLARATION = 118;
1750
-
1751
- declare const T_RETURN_STATEMENT = 9;
1752
-
1753
- declare const T_SEQUENCE_EXPRESSION = 102;
1754
-
1755
- declare const T_SPREAD_EXPRESSION = 112;
1756
-
1757
- declare const T_SWITCH_CASE = 204;
1758
-
1759
- declare const T_SWITCH_STATEMENT = 19;
1760
-
1761
- declare const T_TEMPLATE_LITERAL_EXPRESSION = 108;
1762
-
1763
- declare const T_THROW_STATEMENT = 17;
1764
-
1765
- declare const T_TRY_STATEMENT = 18;
1766
-
1767
- declare const T_UNARY_EXPRESSION = 100;
1768
-
1769
- declare const T_VAR_DECLARATION = 200;
1770
-
1771
- declare const T_VAR_STATEMENT = 7;
1772
-
1773
- declare const T_WHILE_STATEMENT = 12;
1774
-
1775
- declare type Tab = {
1776
- label: string;
1777
- children?: ReactNode;
1778
- style?: CSSProperties;
1779
- };
1780
-
1781
- declare const TabItemComponent: ForwardRefExoticComponent<Tab & RefAttributes<HTMLDivElement>>;
1782
-
1783
- declare type TableDescriptor = {
1784
- name: string;
1785
- fields?: Record<string, any>;
1786
- pk: Array<string>;
1787
- indexes?: Array<string>;
1788
- };
1789
-
1790
- declare const Tabs: ForwardRefExoticComponent<Props_3 & RefAttributes<HTMLDivElement>>;
1791
-
1792
- declare type TEMPLATE_LITERAL_EXPRESSION = typeof T_TEMPLATE_LITERAL_EXPRESSION;
1793
-
1794
- declare interface TemplateLiteralExpression extends ExpressionBase {
1795
- type: TEMPLATE_LITERAL_EXPRESSION;
1796
- segments: (Literal | Expression)[];
1797
- }
1798
-
1799
- /**
1800
- * This type represents a theme definition object. Theme files can use this object's JSON-serialized
1801
- * format to define an app theme; an app can have multiple theme files.
1802
- */
1803
- declare interface ThemeDefinition extends ThemeDefinitionDetails {
1804
- /**
1805
- * Theme id
1806
- */
1807
- id: string;
1808
- /**
1809
- * Optional theme name
1810
- */
1811
- name?: string;
1812
- /**
1813
- * A theme can extend existing themes. The extension means that the theme variable values defined
1814
- * in the new theme override the base theme's variable values.
1815
- */
1816
- extends?: string | Array<string>;
1817
- /**
1818
- * This property defines the tone-dependent theme variable values. When a theme variable value is
1819
- * resolved, the common theme variable values are overridden with their theme-specific values.
1820
- */
1821
- tones?: Record<string | ThemeTone, ThemeDefinitionDetails>;
1822
- }
1823
-
1824
- declare interface ThemeDefinitionDetails {
1825
- themeVars?: Record<string, string>;
1826
- resources?: Record<string, string | FontDef>;
1827
- }
1828
-
1829
- declare type ThemeIdDescriptor = {
1830
- id: string;
1831
- defaultValue?: DefaultValueDescriptor;
1832
- };
1833
-
1834
- /**
1835
- * When rendering any part of an XMLUI app, the styles to apply are enclosed in a theme scope.
1836
- * Most apps use a single theme scope that includes all nodes within the root app node. However,
1837
- * any app can use multiple theme scopes.
1838
- *
1839
- * The scope determines how the app applies styles to the particular section. This type defines
1840
- * the properties of such a theme scope.
1841
- */
1842
- declare type ThemeScope = {
1843
- /**
1844
- * Gets the id of the scope's theme
1845
- */
1846
- activeThemeId: string;
1847
- /**
1848
- * Gets the current tone of the scope's theme
1849
- */
1850
- activeThemeTone: ThemeTone;
1851
- /**
1852
- * The HTML element that works as the root of the theme's scope.
1853
- */
1854
- root: HTMLElement | undefined;
1855
- /**
1856
- * The active theme in the current scope
1857
- */
1858
- activeTheme: ThemeDefinition;
1859
- /**
1860
- * This hash object stores the CSS theme variable names with their CSS values definition,
1861
- * like "--xmlui-verticalAlign-Text-sub": "sub";
1862
- * "--xmlui-backgroundColor": "var(--xmlui-color-surface-50)"
1863
- */
1864
- themeStyles: Record<string, string>;
1865
- /**
1866
- * This hash object stores the theme variable names with their CSS values definition, like
1867
- * "verticalAlign-Text-sub": "sub"; "backgroundColor": "var(--xmlui-color-surface-50)".
1868
- */
1869
- themeVars: Record<string, string>;
1870
- /**
1871
- * This function retrieves the physical path of the provided resource. The path can be used
1872
- * as a URL in HTML tags, like in the `src` attribute of `<img>`.
1873
- * @param resourceString The recource name to resolve to an URL
1874
- */
1875
- getResourceUrl: (resourceString?: string) => string | undefined;
1876
- /**
1877
- * This function gets the value of the specified theme variable.
1878
- * @param themeVar Theme variable name to resolve
1879
- */
1880
- getThemeVar: (themeVar: string) => string | undefined;
1881
- };
1882
-
1883
- /**
1884
- * This type describes one the available theme tones.
1885
- */
1886
- declare type ThemeTone = (typeof ThemeToneKeys)[number];
1887
-
1888
- /**
1889
- * Each theme can have a light or a dark tone.
1890
- */
1891
- declare const ThemeToneKeys: readonly ["light", "dark"];
1892
-
1893
- declare type THROW_STATEMENT = typeof T_THROW_STATEMENT;
1894
-
1895
- declare interface ThrowStatement extends ScripNodeBase {
1896
- type: THROW_STATEMENT;
1897
- expr: Expression;
1898
- }
1899
-
1900
- declare type ToastHandler = (message: Message, options?: ToastOptions) => string;
1901
-
1902
- /**
1903
- * Converts the specified themeID to a CSS var string
1904
- * @param c segment to convert
1905
- */
1906
- declare function toCssVar(c: string | ThemeIdDescriptor): string;
1907
-
1908
- declare enum TokenType {
1909
- Eof = -1,
1910
- Ws = -2,
1911
- BlockComment = -3,
1912
- EolComment = -4,
1913
- Unknown = 0,
1914
- LParent = 1,
1915
- RParent = 2,
1916
- Identifier = 3,
1917
- Exponent = 4,
1918
- Divide = 5,
1919
- Multiply = 6,
1920
- Remainder = 7,
1921
- Plus = 8,
1922
- Minus = 9,
1923
- BitwiseXor = 10,
1924
- BitwiseOr = 11,
1925
- LogicalOr = 12,
1926
- BitwiseAnd = 13,
1927
- LogicalAnd = 14,
1928
- IncOp = 15,
1929
- DecOp = 16,
1930
- Assignment = 17,
1931
- AddAssignment = 18,
1932
- SubtractAssignment = 19,
1933
- ExponentAssignment = 20,
1934
- MultiplyAssignment = 21,
1935
- DivideAssignment = 22,
1936
- RemainderAssignment = 23,
1937
- ShiftLeftAssignment = 24,
1938
- ShiftRightAssignment = 25,
1939
- SignedShiftRightAssignment = 26,
1940
- BitwiseAndAssignment = 27,
1941
- BitwiseXorAssignment = 28,
1942
- BitwiseOrAssignment = 29,
1943
- LogicalAndAssignment = 30,
1944
- LogicalOrAssignment = 31,
1945
- NullCoalesceAssignment = 32,
1946
- Semicolon = 33,
1947
- Comma = 34,
1948
- Colon = 35,
1949
- LSquare = 36,
1950
- RSquare = 37,
1951
- QuestionMark = 38,
1952
- NullCoalesce = 39,
1953
- OptionalChaining = 40,
1954
- BinaryNot = 41,
1955
- LBrace = 42,
1956
- RBrace = 43,
1957
- Equal = 44,
1958
- StrictEqual = 45,
1959
- LogicalNot = 46,
1960
- NotEqual = 47,
1961
- StrictNotEqual = 48,
1962
- LessThan = 49,
1963
- LessThanOrEqual = 50,
1964
- ShiftLeft = 51,
1965
- GreaterThan = 52,
1966
- GreaterThanOrEqual = 53,
1967
- ShiftRight = 54,
1968
- SignedShiftRight = 55,
1969
- Dot = 56,
1970
- Spread = 57,
1971
- Global = 58,
1972
- Backtick = 59,
1973
- DollarLBrace = 60,
1974
- Arrow = 61,
1975
- DecimalLiteral = 62,
1976
- HexadecimalLiteral = 63,
1977
- BinaryLiteral = 64,
1978
- RealLiteral = 65,
1979
- StringLiteral = 66,
1980
- Infinity = 67,
1981
- NaN = 68,
1982
- True = 69,
1983
- False = 70,
1984
- Typeof = 71,
1985
- Null = 72,
1986
- Undefined = 73,
1987
- In = 74,
1988
- Let = 75,
1989
- Const = 76,
1990
- Var = 77,
1991
- If = 78,
1992
- Else = 79,
1993
- Return = 80,
1994
- Break = 81,
1995
- Continue = 82,
1996
- Do = 83,
1997
- While = 84,
1998
- For = 85,
1999
- Of = 86,
2000
- Try = 87,
2001
- Catch = 88,
2002
- Finally = 89,
2003
- Throw = 90,
2004
- Switch = 91,
2005
- Case = 92,
2006
- Default = 93,
2007
- Delete = 94,
2008
- Function = 95,
2009
- As = 96,
2010
- From = 97
2011
- }
2012
-
2013
- declare type TrackContainerHeight = "auto" | "fixed";
2014
-
2015
- declare interface TreeNode {
2016
- uid: string;
2017
- key: string;
2018
- path: any[];
2019
- subPath?: string;
2020
- displayName?: string;
2021
- children?: TreeNode[];
2022
- parentIds: string[];
2023
- selectable: boolean;
2024
- groupKey?: string;
2025
- [x: string]: any;
2026
- }
2027
-
2028
- declare type TRY_STATEMENT = typeof T_TRY_STATEMENT;
2029
-
2030
- declare interface TryStatement extends ScripNodeBase {
2031
- type: TRY_STATEMENT;
2032
- tryB: BlockStatement;
2033
- catchB?: BlockStatement;
2034
- catchV?: Identifier;
2035
- finallyB?: BlockStatement;
2036
- }
2037
-
2038
- declare type UNARY_EXPRESSION = typeof T_UNARY_EXPRESSION;
2039
-
2040
- declare interface UnaryExpression extends ExpressionBase {
2041
- type: UNARY_EXPRESSION;
2042
- op: UnaryOpSymbols;
2043
- expr: Expression;
2044
- }
2045
-
2046
- declare type UnaryOpSymbols = "+" | "-" | "~" | "!" | "typeof" | "delete";
2047
-
2048
- /**
2049
- * This function updates the state of a component.
2050
- * @param componentState The new state of the component
2051
- */
2052
- declare type UpdateStateFn = (componentState: any, options?: any) => void;
2053
-
2054
- declare function useColors(...colorNames: (string | ColorDef)[]): Record<string, string>;
2055
-
2056
- declare function useDevTools(): {
2057
- projectCompilation: ProjectCompilation;
2058
- inspectedNode: any;
2059
- sources: Record<string, string>;
2060
- setIsOpen: (isOpen: boolean) => void;
2061
- devToolsSize: number;
2062
- setDevToolsSize: (size: number) => void;
2063
- devToolsSide: "left" | "right" | "bottom";
2064
- setDevToolsSide: (side: "left" | "right" | "bottom") => void;
2065
- devToolsEnabled: boolean;
2066
- mockApi: any;
2067
- };
2068
-
2069
- declare const useLogger: () => LogContextType;
2070
-
2071
- declare function useTheme(): ThemeScope;
2072
-
2073
- /**
2074
- * This type represent the function that extracts the value from a component property
2075
- */
2076
- declare type ValueExtractor = {
2077
- /**
2078
- * Get a value (any) from a component property
2079
- * @param expression Value expression
2080
- * @param strict Strict matching?
2081
- */
2082
- (expression?: any, strict?: boolean): any;
2083
- /**
2084
- * Get a string value from an expression
2085
- * @param expression Value expression
2086
- */
2087
- asString(expression?: any): string;
2088
- /**
2089
- * Get an optional string value from an expression
2090
- * @param expression Value expression
2091
- * @param defValue Default value, if the parameter value is undefined
2092
- */
2093
- asOptionalString<T extends string>(expression?: any, defValue?: string): T | undefined;
2094
- /**
2095
- * Get an optional string value from an expression
2096
- * @param expression Value expression
2097
- */
2098
- asOptionalStringArray(expression?: any): (string | undefined)[];
2099
- /**
2100
- * Get a display string value from an expression
2101
- * @param expression Value expression
2102
- */
2103
- asDisplayText(expression?: any): string;
2104
- /**
2105
- * Get a number value from an expression
2106
- * @param expression Value expression
2107
- */
2108
- asNumber(expression?: any): number;
2109
- /**
2110
- * Get an optional number value from an expression
2111
- * @param expression Value expression
2112
- * @param defValue Default value, if the parameter value is undefined
2113
- */
2114
- asOptionalNumber(expression?: any, defValue?: number): number | undefined;
2115
- /**
2116
- * Get a boolean value (JavaScript semantics) from an expression
2117
- * @param expression Value expression
2118
- */
2119
- asBoolean(expression?: any): boolean;
2120
- /**
2121
- * Get an optional Boolean value from an expression
2122
- * @param expression Value expression
2123
- * @param defValue Default value, if the parameter value is undefined
2124
- */
2125
- asOptionalBoolean(expression?: any, defValue?: boolean): boolean | undefined;
2126
- /**
2127
- * Get a CSS size value from an expression
2128
- * @param expression Value expression
2129
- */
2130
- asSize(expression?: any): string;
2131
- };
2132
-
2133
- declare type VAR_DECLARATION = typeof T_VAR_DECLARATION;
2134
-
2135
- declare type VAR_STATEMENT = typeof T_VAR_STATEMENT;
2136
-
2137
- declare interface VarDeclaration extends ExpressionBase {
2138
- type: VAR_DECLARATION;
2139
- id?: string;
2140
- aDestr?: ArrayDestructure[];
2141
- oDestr?: ObjectDestructure[];
2142
- expr?: Expression;
2143
- }
2144
-
2145
- declare interface VarStatement extends ScripNodeBase {
2146
- type: VAR_STATEMENT;
2147
- decls: ReactiveVarDeclaration[];
2148
- }
2149
-
2150
- declare type WHILE_STATEMENT = typeof T_WHILE_STATEMENT;
2151
-
2152
- declare interface WhileStatement extends ScripNodeBase {
2153
- type: WHILE_STATEMENT;
2154
- cond: Expression;
2155
- body: Statement;
2156
- }
2157
-
2158
1
  export { }
2159
2
 
2160
3