xmlui 0.9.21 → 0.9.25
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/apiInterceptorWorker-CFF3bC6o.mjs +818 -0
- package/dist/{index-B3CWFAxa.mjs → index-DtxDGaqF.mjs} +11942 -3291
- package/dist/index.css +1301 -564
- package/dist/language-server-web-worker.mjs +1 -1
- package/dist/language-server.mjs +1 -1
- package/dist/lint-CYAUfk0_.mjs +168 -0
- package/dist/metadata-utils-CCIMqe69.mjs +466 -0
- package/dist/scripts/package.json +252 -0
- package/dist/scripts/src/components/App/AppLayoutContext.js +0 -1
- package/dist/scripts/src/components/App/AppNative.js +21 -9
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -1
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +5 -2
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +13 -10
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +5 -1
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +31 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +82 -0
- package/dist/scripts/src/components/ComponentProvider.js +5 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +1 -0
- package/dist/scripts/src/components/Form/FormContext.js +5 -4
- package/dist/scripts/src/components/Form/FormNative.js +41 -43
- package/dist/scripts/src/components/Form/formActions.js +1 -1
- package/dist/scripts/src/components/FormItem/FormItem.js +6 -3
- package/dist/scripts/src/components/FormItem/FormItemNative.js +56 -15
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +1 -1
- package/dist/scripts/src/components/Heading/Heading.js +13 -0
- package/dist/scripts/src/components/Heading/HeadingNative.js +1 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +7 -3
- package/dist/scripts/src/components/Icon/DarkToLightIcon.js +10 -0
- package/dist/scripts/src/components/Icon/LightToDark.js +10 -0
- package/dist/scripts/src/components/IconProvider.js +4 -0
- package/dist/scripts/src/components/Image/ImageNative.js +1 -1
- package/dist/scripts/src/components/Items/ItemsNative.js +8 -6
- package/dist/scripts/src/components/Link/Link.js +5 -5
- package/dist/scripts/src/components/List/ListNative.js +1 -1
- package/dist/scripts/src/components/Markdown/Markdown.js +52 -16
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +34 -73
- package/dist/scripts/src/components/Markdown/highlight-code.js +160 -0
- package/dist/scripts/src/components/Markdown/parse-binding-expr.js +60 -0
- package/dist/scripts/src/components/Markdown/utils.js +282 -0
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
- package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +4 -5
- package/dist/scripts/src/components/NestedApp/NestedApp.js +61 -0
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +125 -0
- package/dist/scripts/src/components/NestedApp/Tooltip.js +46 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.js +4 -1
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +2 -2
- package/dist/scripts/src/components/Option/Option.js +3 -2
- package/dist/scripts/src/components/Select/Select.js +5 -3
- package/dist/scripts/src/components/Select/SelectNative.js +53 -40
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +1 -1
- package/dist/scripts/src/components/Spinner/Spinner.js +0 -1
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +1 -0
- package/dist/scripts/src/components/Text/Text.js +12 -1
- package/dist/scripts/src/components/Text/TextNative.js +5 -1
- package/dist/scripts/src/components/TextBox/TextBox.js +6 -1
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +2 -2
- package/dist/scripts/src/components/Theme/ThemeNative.js +7 -3
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +1 -3
- package/dist/scripts/src/components-core/RestApiProxy.js +10 -7
- package/dist/scripts/src/components-core/TableOfContentsContext.js +1 -1
- package/dist/scripts/src/components-core/appContext/date-functions.js +23 -0
- package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
- package/dist/scripts/src/components-core/appContext/misc-utils.js +13 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +199 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
- package/dist/scripts/src/components-core/interception/Backend.js +128 -0
- package/dist/scripts/src/components-core/interception/Errors.js +129 -0
- package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
- package/dist/scripts/src/components-core/interception/IndexedDb.js +207 -0
- package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
- package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
- package/dist/scripts/src/components-core/rendering/AppContent.js +336 -0
- package/dist/scripts/src/components-core/rendering/AppRoot.js +84 -0
- package/dist/scripts/src/components-core/rendering/AppWrapper.js +49 -0
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +17 -7
- package/dist/scripts/src/components-core/rendering/Container.js +2 -1
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +2 -7
- package/dist/scripts/src/components-core/theming/themes/root.js +1 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
- package/dist/scripts/src/components-core/utils/hooks.js +26 -0
- package/dist/scripts/src/components-core/utils/misc.js +1 -1
- package/dist/scripts/src/components-core/utils/request-params.js +70 -0
- package/dist/scripts/src/logging/LoggerContext.js +22 -0
- package/dist/scripts/src/logging/LoggerInitializer.js +14 -0
- package/dist/scripts/src/logging/LoggerService.js +60 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +7 -0
- package/dist/{server-common-DW5h7Q34.mjs → server-common-9TiLMTJj.mjs} +106 -98
- package/dist/style.css +3314 -2823
- package/dist/{lint-EcgF-9Wr.mjs → transform-DC0Gy6qw.mjs} +1246 -540
- package/dist/xmlui-metadata.mjs +2850 -2665
- package/dist/xmlui-metadata.umd.js +2850 -2665
- package/dist/xmlui-parser.d.ts +49 -4
- package/dist/xmlui-parser.mjs +49 -48
- package/dist/xmlui-standalone.umd.js +34674 -31457
- package/dist/xmlui.d.ts +3 -1
- package/dist/xmlui.mjs +10 -10
- package/package.json +3 -1
- package/dist/apiInterceptorWorker-7aKQ2rBj.mjs +0 -8447
- package/dist/parser-CBXS8ft2.mjs +0 -1196
package/dist/xmlui-parser.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ declare interface AssignmentExpression extends ExpressionBase {
|
|
|
51
51
|
|
|
52
52
|
declare type AssignmentSymbols = "=" | "+=" | "-=" | "**=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|=" | "&&=" | "||=" | "??=";
|
|
53
53
|
|
|
54
|
+
declare type AttributeKind = "prop" | "event" | "api" | "implicit" | "layout";
|
|
55
|
+
|
|
54
56
|
declare type AuthDefinition = {
|
|
55
57
|
defaultLoggedInUser?: any;
|
|
56
58
|
};
|
|
@@ -357,6 +359,30 @@ declare type ComponentMetadata<TProps extends Record<string, ComponentPropertyMe
|
|
|
357
359
|
isHtmlTag?: boolean;
|
|
358
360
|
};
|
|
359
361
|
|
|
362
|
+
declare type ComponentMetadataCollection = Record<string, RestrictedComponentMetadata>;
|
|
363
|
+
|
|
364
|
+
declare class ComponentMetadataProvider {
|
|
365
|
+
private readonly metadata;
|
|
366
|
+
constructor(metadata: RestrictedComponentMetadata);
|
|
367
|
+
/**
|
|
368
|
+
* Retrieves the metadata for a given property, explicit or implicit.
|
|
369
|
+
* @param name The name of the property.
|
|
370
|
+
* @returns The metadata for the property, or `undefined` if not found.
|
|
371
|
+
*/
|
|
372
|
+
getProp(name: string): any;
|
|
373
|
+
getAttr(name: string): any;
|
|
374
|
+
getAttrForKind({ name, kind }: TaggedAttribute): any;
|
|
375
|
+
getAllAttributes(): TaggedAttribute[];
|
|
376
|
+
getEvent(name: string): any;
|
|
377
|
+
getApi(name: string): any;
|
|
378
|
+
get events(): Record<string, string>;
|
|
379
|
+
get apis(): Record<string, string>;
|
|
380
|
+
get contextVars(): Record<string, string>;
|
|
381
|
+
get allowArbitraryProps(): boolean;
|
|
382
|
+
get shortDescription(): string;
|
|
383
|
+
getMetadata(): RestrictedComponentMetadata;
|
|
384
|
+
}
|
|
385
|
+
|
|
360
386
|
/**
|
|
361
387
|
* Components have properties, events, context values, and exposed API
|
|
362
388
|
* endpoints, each holding metadata the rendering engine uses at run time.
|
|
@@ -812,14 +838,14 @@ declare interface LetStatement extends ScripNodeBase {
|
|
|
812
838
|
decls: VarDeclaration[];
|
|
813
839
|
}
|
|
814
840
|
|
|
815
|
-
export declare function lint({ component,
|
|
841
|
+
export declare function lint({ component, metadataProvider, }: {
|
|
816
842
|
component: CompoundComponentDef | ComponentDef;
|
|
817
|
-
|
|
843
|
+
metadataProvider: MetadataProvider;
|
|
818
844
|
}): LintDiagnostic[];
|
|
819
845
|
|
|
820
|
-
export declare function lintApp({ appDef,
|
|
846
|
+
export declare function lintApp({ appDef, metadataProvider, }: {
|
|
821
847
|
appDef: StandaloneAppDescription;
|
|
822
|
-
|
|
848
|
+
metadataProvider: MetadataProvider;
|
|
823
849
|
}): ComponentLints[];
|
|
824
850
|
|
|
825
851
|
export declare enum LintDiagKind {
|
|
@@ -855,6 +881,13 @@ declare interface MemberAccessExpression extends ExpressionBase {
|
|
|
855
881
|
opt?: boolean;
|
|
856
882
|
}
|
|
857
883
|
|
|
884
|
+
declare class MetadataProvider {
|
|
885
|
+
private readonly metadataCollection;
|
|
886
|
+
constructor(metadataCollection: ComponentMetadataCollection);
|
|
887
|
+
componentNames(): string[];
|
|
888
|
+
getComponent(componentName: string): ComponentMetadataProvider | null;
|
|
889
|
+
}
|
|
890
|
+
|
|
858
891
|
/**
|
|
859
892
|
* Represents a module error
|
|
860
893
|
*/
|
|
@@ -959,6 +992,8 @@ declare interface ReadonlyTextRange {
|
|
|
959
992
|
readonly end: number;
|
|
960
993
|
}
|
|
961
994
|
|
|
995
|
+
declare type RestrictedComponentMetadata = Pick<ComponentMetadata, "description" | "status" | "props" | "events" | "apis" | "contextVars" | "allowArbitraryProps" | "shortDescription">;
|
|
996
|
+
|
|
962
997
|
declare type RETURN_STATEMENT = typeof T_RETURN_STATEMENT;
|
|
963
998
|
|
|
964
999
|
declare interface ReturnStatement extends ScripNodeBase {
|
|
@@ -1065,6 +1100,11 @@ declare type StandaloneAppDescription = {
|
|
|
1065
1100
|
|
|
1066
1101
|
declare type Statement = BlockStatement | EmptyStatement | ExpressionStatement | ArrowExpressionStatement | LetStatement | ConstStatement | VarStatement | IfStatement | ReturnStatement | BreakStatement | ContinueStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ThrowStatement | TryStatement | SwitchStatement | FunctionDeclaration;
|
|
1067
1102
|
|
|
1103
|
+
/**
|
|
1104
|
+
* @param name - The name of the event in camelCase, with "on" prefix.
|
|
1105
|
+
*/
|
|
1106
|
+
export declare function stripOnPrefix(name: string): string;
|
|
1107
|
+
|
|
1068
1108
|
declare type SWITCH_CASE = typeof T_SWITCH_CASE;
|
|
1069
1109
|
|
|
1070
1110
|
declare type SWITCH_STATEMENT = typeof T_SWITCH_STATEMENT;
|
|
@@ -1208,6 +1248,11 @@ declare type TableDescriptor = {
|
|
|
1208
1248
|
indexes?: Array<string>;
|
|
1209
1249
|
};
|
|
1210
1250
|
|
|
1251
|
+
declare type TaggedAttribute = {
|
|
1252
|
+
name: string;
|
|
1253
|
+
kind: AttributeKind;
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1211
1256
|
/** Disregards error nodes amongst the children of the 2 compared name node. (Those reported an error earlyer anyways)*/
|
|
1212
1257
|
export declare function tagNameNodesWithoutErrorsMatch(name1: Node_2, name2: Node_2, getText: GetText): boolean;
|
|
1213
1258
|
|
package/dist/xmlui-parser.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ak
|
|
3
|
-
import {
|
|
1
|
+
import { X as COMPOUND_COMP_ID } from "./transform-DC0Gy6qw.mjs";
|
|
2
|
+
import { al, Y, aa, a6, a4, a9, a3, a7, _, a8, a5, a1, a0, a2, $, Q, R, ac, S, aj, ae, N, Z, ad, ap, ai, af, ah, ag, O, ak, ab, am, ao, an } from "./transform-DC0Gy6qw.mjs";
|
|
3
|
+
import { d, L, a, c, g, e, l, b, m, p } from "./lint-CYAUfk0_.mjs";
|
|
4
4
|
const attrBreakRegex = /[\r\n<>'"&]/;
|
|
5
5
|
class XmlUiHelper {
|
|
6
6
|
/**
|
|
@@ -12,7 +12,7 @@ class XmlUiHelper {
|
|
|
12
12
|
const fragment = Array.isArray(xml) ? xml : [xml];
|
|
13
13
|
return serializeFragment(fragment, 0);
|
|
14
14
|
function serializeFragment(nodes, depth) {
|
|
15
|
-
return nodes.map((
|
|
15
|
+
return nodes.map((n) => serializeNode(n, depth)).join((options == null ? void 0 : options.prettify) ? "\n" + getIndent(depth) : "");
|
|
16
16
|
}
|
|
17
17
|
function serializeNode(node, depth) {
|
|
18
18
|
switch (node.type) {
|
|
@@ -37,7 +37,7 @@ class XmlUiHelper {
|
|
|
37
37
|
const hasChildren = (((_b = node.childNodes) == null ? void 0 : _b.length) ?? 0) > 0;
|
|
38
38
|
if (node.text || hasAttrs || hasChildren) {
|
|
39
39
|
if (hasAttrs) {
|
|
40
|
-
const attrTexts = node.attributes.map((
|
|
40
|
+
const attrTexts = node.attributes.map((a10) => serializeXmlAttribute(a10));
|
|
41
41
|
if (!(options == null ? void 0 : options.prettify)) {
|
|
42
42
|
elementStr += " " + attrTexts.join(" ");
|
|
43
43
|
} else {
|
|
@@ -493,49 +493,50 @@ class XmlUiHelper {
|
|
|
493
493
|
}
|
|
494
494
|
export {
|
|
495
495
|
COMPOUND_COMP_ID,
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
496
|
+
al as CORE_NAMESPACE_VALUE,
|
|
497
|
+
Y as CharacterCodes,
|
|
498
|
+
aa as Diag_Attr_Identifier_Expected,
|
|
499
|
+
a6 as Diag_Attr_Value_Expected,
|
|
500
|
+
a4 as Diag_CloseNodeStart_Token_Expected,
|
|
501
|
+
a9 as Diag_End_Or_Close_Token_Expected,
|
|
502
|
+
a3 as Diag_End_Token_Expected,
|
|
503
|
+
a7 as Diag_Eq_Token_Expected,
|
|
504
|
+
_ as Diag_Invalid_Character,
|
|
505
|
+
a8 as Diag_OpenNodeStart_Token_Expected,
|
|
506
|
+
a5 as Diag_Tag_Identifier_Expected,
|
|
507
|
+
a1 as Diag_Unterminated_CData,
|
|
508
|
+
a0 as Diag_Unterminated_Comment,
|
|
509
|
+
a2 as Diag_Unterminated_Script,
|
|
510
|
+
$ as Diag_Unterminated_String_Literal,
|
|
511
|
+
Q as DiagnosticCategory,
|
|
512
|
+
R as ErrCodes,
|
|
513
|
+
d as LintDiagKind,
|
|
514
|
+
L as LintSeverity,
|
|
515
|
+
ac as ParserError,
|
|
516
516
|
S as SyntaxKind,
|
|
517
|
-
|
|
517
|
+
aj as UCRegex,
|
|
518
518
|
XmlUiHelper,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
519
|
+
a as codeBehindFileExtension,
|
|
520
|
+
c as componentFileExtension,
|
|
521
|
+
ae as createScanner,
|
|
522
|
+
N as createXmlUiParser,
|
|
523
|
+
Z as diagnosticCategoryName,
|
|
524
|
+
ad as errorMessages,
|
|
525
|
+
ap as findTokenAtPos,
|
|
526
|
+
g as getLintSeverity,
|
|
527
|
+
ai as getSyntaxKindStrRepr,
|
|
528
|
+
af as isIdentifierStart,
|
|
529
|
+
ah as isInnerNode,
|
|
530
|
+
ag as isTrivia,
|
|
531
|
+
e as lint,
|
|
532
|
+
l as lintApp,
|
|
533
|
+
b as lintErrorsComponent,
|
|
534
|
+
m as moduleFileExtension,
|
|
535
|
+
O as nodeToComponentDef,
|
|
536
|
+
ak as onPrefixRegex,
|
|
537
|
+
ab as parseXmlUiMarkup,
|
|
538
|
+
p as printComponentLints,
|
|
539
|
+
am as stripOnPrefix,
|
|
540
|
+
ao as tagNameNodesWithoutErrorsMatch,
|
|
541
|
+
an as toDbgString
|
|
541
542
|
};
|