xmlui 0.9.60 → 0.9.62
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/lib/{apiInterceptorWorker-CNiXy9XE.mjs → apiInterceptorWorker-BXyXjzpe.mjs} +1 -1
- package/dist/lib/{index-B1V2vJWh.mjs → index-BRbUXnCk.mjs} +13541 -12973
- package/dist/lib/index.css +1 -1
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-4EQ6kQIM.mjs → metadata-utils-DJM8orNd.mjs} +40 -31
- package/dist/lib/{server-common-SNl_47nE.mjs → server-common-D0VA8gIv.mjs} +1450 -858
- package/dist/lib/{transform-CgRMkbb0.mjs → transform-BdB0APqE.mjs} +1543 -1384
- package/dist/lib/xmlui-parser.d.ts +76 -253
- package/dist/lib/xmlui-parser.mjs +49 -42
- package/dist/lib/{xmlui-serializer-EDw51UFN.mjs → xmlui-serializer-COAfRndx.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +88 -670
- package/dist/lib/xmlui.mjs +2 -2
- package/dist/metadata/{apiInterceptorWorker-DsjW46f_.mjs → apiInterceptorWorker-8ismUE1H.mjs} +1 -1
- package/dist/metadata/{collectedComponentMetadata-CBiI_eDf.mjs → collectedComponentMetadata-xeEJhtEt.mjs} +13617 -12870
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +116 -116
- package/dist/scripts/package.json +5 -5
- package/dist/scripts/src/abstractions/ComponentDefs.js +0 -8
- package/dist/scripts/src/abstractions/ThemingDefs.js +0 -9
- package/dist/scripts/src/components/APICall/APICall.js +30 -18
- package/dist/scripts/src/components/Accordion/Accordion.js +5 -4
- package/dist/scripts/src/components/Accordion/AccordionItem.js +10 -4
- package/dist/scripts/src/components/App/App.js +9 -4
- package/dist/scripts/src/components/App/AppNative.js +11 -1
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -2
- package/dist/scripts/src/components/AppState/AppState.js +3 -3
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +6 -7
- package/dist/scripts/src/components/Avatar/Avatar.js +3 -3
- package/dist/scripts/src/components/Backdrop/Backdrop.js +1 -2
- package/dist/scripts/src/components/Badge/Badge.js +1 -2
- package/dist/scripts/src/components/Bookmark/Bookmark.js +2 -2
- package/dist/scripts/src/components/Breakout/Breakout.js +2 -2
- package/dist/scripts/src/components/Button/Button.js +1 -2
- package/dist/scripts/src/components/Card/Card.js +2 -3
- package/dist/scripts/src/components/Card/CardNative.js +2 -1
- package/dist/scripts/src/components/Carousel/Carousel.js +6 -7
- package/dist/scripts/src/components/Carousel/CarouselItem.js +2 -2
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +1 -2
- package/dist/scripts/src/components/Charts/BarChart/BarChart.js +2 -2
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +8 -7
- package/dist/scripts/src/components/Charts/LabelList/LabelList.js +2 -2
- package/dist/scripts/src/components/Charts/Legend/Legend.js +2 -2
- package/dist/scripts/src/components/Charts/LineChart/LineChart.js +6 -6
- package/dist/scripts/src/components/Charts/PieChart/PieChart.js +14 -10
- package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +9 -4
- package/dist/scripts/src/components/Checkbox/Checkbox.js +1 -2
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +6 -3
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
- package/dist/scripts/src/components/ColorPicker/ColorPicker.js +1 -2
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +2 -2
- package/dist/scripts/src/components/Column/Column.js +2 -2
- package/dist/scripts/src/components/ComponentProvider.js +4 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +2 -2
- package/dist/scripts/src/components/DatePicker/DatePicker.js +2 -3
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +6 -7
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +2 -3
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.js +9 -10
- package/dist/scripts/src/components/FileInput/FileInput.js +14 -15
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +4 -4
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +2 -2
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +35 -6
- package/dist/scripts/src/components/Footer/Footer.js +4 -3
- package/dist/scripts/src/components/Form/Form.js +12 -9
- package/dist/scripts/src/components/Form/FormNative.js +12 -4
- package/dist/scripts/src/components/FormItem/FormItem.js +7 -8
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +1 -1
- package/dist/scripts/src/components/FormSection/FormSection.js +2 -2
- package/dist/scripts/src/components/Heading/Heading.js +11 -11
- package/dist/scripts/src/components/HelloWorld/HelloWorld.js +102 -0
- package/dist/scripts/src/components/HelloWorld/HelloWorldNative.js +92 -0
- package/dist/scripts/src/components/HoverCard/HoverCard.js +1 -2
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +297 -297
- package/dist/scripts/src/components/Icon/Icon.js +5 -5
- package/dist/scripts/src/components/Image/Image.js +4 -5
- package/dist/scripts/src/components/InspectButton/InspectButton.js +2 -2
- package/dist/scripts/src/components/Items/Items.js +2 -3
- package/dist/scripts/src/components/Link/Link.js +3 -4
- package/dist/scripts/src/components/Link/LinkNative.js +46 -1
- package/dist/scripts/src/components/List/List.js +15 -16
- package/dist/scripts/src/components/Logo/Logo.js +2 -2
- package/dist/scripts/src/components/Markdown/Markdown.js +6 -6
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +2 -4
- package/dist/scripts/src/components/Markdown/parse-binding-expr.js +1 -1
- package/dist/scripts/src/components/Markdown/utils.js +32 -13
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +9 -9
- package/dist/scripts/src/components/NavGroup/NavGroup.js +2 -3
- package/dist/scripts/src/components/NavGroup/NavGroupContext.js +1 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +6 -2
- package/dist/scripts/src/components/NavLink/NavLink.js +3 -4
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +10 -9
- package/dist/scripts/src/components/NavPanel/NavPanel.js +4 -4
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +132 -3
- package/dist/scripts/src/components/NestedApp/AppWithCodeView.js +24 -5
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +64 -7
- package/dist/scripts/src/components/NestedApp/NestedApp.js +19 -9
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +11 -7
- package/dist/scripts/src/components/NoResult/NoResult.js +1 -2
- package/dist/scripts/src/components/NumberBox/NumberBox.js +5 -6
- package/dist/scripts/src/components/NumberBox/NumberBox2.js +5 -6
- package/dist/scripts/src/components/Option/Option.js +5 -5
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +2 -2
- package/dist/scripts/src/components/Pages/Pages.js +7 -8
- package/dist/scripts/src/components/Pages/PagesNative.js +8 -3
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +3 -3
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +2 -2
- package/dist/scripts/src/components/Queue/Queue.js +16 -16
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +13 -13
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +13 -28
- package/dist/scripts/src/components/RadioGroup/RadioItem.js +2 -2
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +3 -3
- package/dist/scripts/src/components/Redirect/Redirect.js +2 -2
- package/dist/scripts/src/components/Select/Select.js +8 -8
- package/dist/scripts/src/components/Select/SelectNative.js +1 -1
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +2 -2
- package/dist/scripts/src/components/Slider/Slider.js +4 -5
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +2 -2
- package/dist/scripts/src/components/Spinner/Spinner.js +2 -2
- package/dist/scripts/src/components/Splitter/Splitter.js +2 -3
- package/dist/scripts/src/components/Stack/Stack.js +1 -2
- package/dist/scripts/src/components/StickyBox/StickyBox.js +2 -2
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +2 -0
- package/dist/scripts/src/components/Switch/Switch.js +7 -4
- package/dist/scripts/src/components/Table/Table.js +19 -20
- package/dist/scripts/src/components/Table/TableNative.js +6 -2
- package/dist/scripts/src/components/Table/useRowSelection.js +6 -2
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +2 -2
- package/dist/scripts/src/components/Tabs/TabItem.js +1 -2
- package/dist/scripts/src/components/Tabs/Tabs.js +9 -6
- package/dist/scripts/src/components/Text/Text.js +6 -6
- package/dist/scripts/src/components/TextArea/TextArea.js +4 -5
- package/dist/scripts/src/components/TextBox/TextBox.js +4 -5
- package/dist/scripts/src/components/Theme/NotificationToast.js +11 -0
- package/dist/scripts/src/components/Theme/Theme.js +4 -4
- package/dist/scripts/src/components/Theme/ThemeNative.js +4 -4
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +2 -2
- package/dist/scripts/src/components/Tree/TreeComponent.js +1 -2
- package/dist/scripts/src/components/TreeDisplay/TreeDisplay.js +4 -2
- package/dist/scripts/src/components/metadata-helpers.js +8 -0
- package/dist/scripts/src/components-core/Fragment.js +7 -4
- package/dist/scripts/src/components-core/LoaderComponent.js +1 -1
- package/dist/scripts/src/components-core/RestApiProxy.js +11 -8
- package/dist/scripts/src/components-core/Slot.js +3 -3
- package/dist/scripts/src/components-core/appContext/date-functions.js +1 -0
- package/dist/scripts/src/components-core/descriptorHelper.js +9 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +2 -2
- package/dist/scripts/src/components-core/loader/ApiLoader.js +4 -4
- package/dist/scripts/src/components-core/loader/DataLoader.js +20 -20
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +6 -6
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +4 -4
- package/dist/scripts/src/components-core/rendering/AppContent.js +8 -4
- package/dist/scripts/src/components-core/rendering/AppRoot.js +4 -2
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +1 -1
- package/dist/scripts/src/components-core/rendering/Container.js +2 -2
- package/dist/scripts/src/components-core/rendering/StateContainer.js +8 -2
- package/dist/scripts/src/components-core/rendering/reducer.js +1 -1
- package/dist/scripts/src/components-core/script-runner/ScriptingSourceTree.js +45 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +1 -1
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +1 -1
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +1 -1
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +1 -1
- package/dist/scripts/src/components-core/script-runner/visitors.js +1 -1
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +2 -2
- package/dist/scripts/src/components-core/theming/layout-resolver.js +18 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +3 -0
- package/dist/scripts/src/components-core/theming/utils.js +31 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +60 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +1 -1
- package/dist/scripts/src/parsers/scripting/Parser.js +1 -1
- package/dist/scripts/src/parsers/scripting/code-behind-collect.js +1 -1
- package/dist/scripts/src/parsers/scripting/modules.js +1 -1
- package/dist/scripts/src/parsers/scripting/tree-visitor.js +1 -1
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +42 -39
- package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +65 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +10 -8
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +1 -2
- package/dist/standalone/xmlui-standalone.es.d.ts +88 -670
- package/dist/standalone/xmlui-standalone.umd.js +257 -257
- package/package.json +5 -5
- /package/dist/scripts/src/components-core/{abstractions → rendering}/containers.js +0 -0
- /package/dist/scripts/src/{abstractions/scripting/ScriptingSourceTree.js → parsers/scripting/ScriptingNodeTypes.js} +0 -0
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.evalBindingExpression = evalBindingExpression;
|
|
4
4
|
exports.evalBinding = evalBinding;
|
|
5
5
|
exports.executeArrowExpressionSync = executeArrowExpressionSync;
|
|
6
|
-
const ScriptingSourceTree_1 = require("
|
|
6
|
+
const ScriptingSourceTree_1 = require("./ScriptingSourceTree");
|
|
7
7
|
const Parser_1 = require("../../parsers/scripting/Parser");
|
|
8
8
|
const bannedFunctions_1 = require("./bannedFunctions");
|
|
9
9
|
const eval_tree_common_1 = require("./eval-tree-common");
|
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.processStatementQueueAsync = processStatementQueueAsync;
|
|
13
13
|
exports.processDeclarationsAsync = processDeclarationsAsync;
|
|
14
|
-
const ScriptingSourceTree_1 = require("
|
|
14
|
+
const ScriptingSourceTree_1 = require("./ScriptingSourceTree");
|
|
15
15
|
const EngineError_1 = require("../EngineError");
|
|
16
16
|
const reportEngineError_1 = require("../reportEngineError");
|
|
17
17
|
const statement_queue_1 = require("./statement-queue");
|
|
@@ -16,7 +16,7 @@ exports.provideFinallyBody = provideFinallyBody;
|
|
|
16
16
|
exports.provideFinallyErrorBody = provideFinallyErrorBody;
|
|
17
17
|
exports.ensureMainThread = ensureMainThread;
|
|
18
18
|
exports.hoistFunctionDeclarations = hoistFunctionDeclarations;
|
|
19
|
-
const ScriptingSourceTree_1 = require("
|
|
19
|
+
const ScriptingSourceTree_1 = require("./ScriptingSourceTree");
|
|
20
20
|
const eval_tree_common_1 = require("./eval-tree-common");
|
|
21
21
|
const statement_queue_1 = require("./statement-queue");
|
|
22
22
|
const Parser_1 = require("../../parsers/scripting/Parser");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processStatementQueue = processStatementQueue;
|
|
4
4
|
exports.processDeclarations = processDeclarations;
|
|
5
|
-
const ScriptingSourceTree_1 = require("
|
|
5
|
+
const ScriptingSourceTree_1 = require("./ScriptingSourceTree");
|
|
6
6
|
const reportEngineError_1 = require("../reportEngineError");
|
|
7
7
|
const EngineError_1 = require("../EngineError");
|
|
8
8
|
const process_statement_common_1 = require("./process-statement-common");
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.collectVariableDependencies = collectVariableDependencies;
|
|
4
4
|
const lodash_es_1 = require("lodash-es");
|
|
5
5
|
const eval_tree_common_1 = require("./eval-tree-common");
|
|
6
|
-
const ScriptingSourceTree_1 = require("
|
|
6
|
+
const ScriptingSourceTree_1 = require("./ScriptingSourceTree");
|
|
7
7
|
const process_statement_common_1 = require("./process-statement-common");
|
|
8
8
|
/**
|
|
9
9
|
* Collects the name of local context variables the specified program depends on
|
|
@@ -56,7 +56,7 @@ const extendThemeUtils_1 = require("../theming/extendThemeUtils");
|
|
|
56
56
|
const ComponentRegistryContext_1 = require("../../components/ComponentRegistryContext");
|
|
57
57
|
const xmlui_1 = require("../theming/themes/xmlui");
|
|
58
58
|
const hooks_1 = require("../utils/hooks");
|
|
59
|
-
const
|
|
59
|
+
const utils_1 = require("./utils");
|
|
60
60
|
function useCompiledTheme(activeTheme, activeTone, themes = constants_1.EMPTY_ARRAY, resources = constants_1.EMPTY_OBJECT, resourceMap = constants_1.EMPTY_OBJECT) {
|
|
61
61
|
const componentRegistry = (0, ComponentRegistryContext_1.useComponentRegistry)();
|
|
62
62
|
const { componentThemeVars, componentDefaultThemeVars } = componentRegistry;
|
|
@@ -203,7 +203,7 @@ exports.builtInThemes = [
|
|
|
203
203
|
function ThemeProvider({ children, themes: custThemes = constants_1.EMPTY_ARRAY, defaultTheme = "xmlui", defaultTone = "light", resources = constants_1.EMPTY_OBJECT, resourceMap = constants_1.EMPTY_OBJECT, localThemes = constants_1.EMPTY_OBJECT, }) {
|
|
204
204
|
const [activeThemeTone, setActiveThemeTone] = (0, react_1.useState)(() => {
|
|
205
205
|
if (!defaultTone) {
|
|
206
|
-
return
|
|
206
|
+
return utils_1.ThemeToneKeys[0];
|
|
207
207
|
}
|
|
208
208
|
return defaultTone;
|
|
209
209
|
});
|
|
@@ -111,11 +111,15 @@ function resolveLayoutProps(layoutProps = constants_1.EMPTY_OBJECT, layoutContex
|
|
|
111
111
|
collectCss("fontSize");
|
|
112
112
|
collectCss("fontWeight");
|
|
113
113
|
collectCss("fontStyle");
|
|
114
|
+
collectCss("fontVariant");
|
|
115
|
+
collectCss("lineBreak");
|
|
114
116
|
collectCss("textDecoration");
|
|
115
117
|
collectCss("textDecorationLine");
|
|
116
118
|
collectCss("textDecorationColor");
|
|
117
119
|
collectCss("textDecorationStyle");
|
|
118
120
|
collectCss("textDecorationThickness");
|
|
121
|
+
collectCss("textIndent");
|
|
122
|
+
collectCss("textShadow");
|
|
119
123
|
collectCss("textUnderlineOffset");
|
|
120
124
|
collectCss("userSelect");
|
|
121
125
|
collectCss("letterSpacing");
|
|
@@ -124,6 +128,10 @@ function resolveLayoutProps(layoutProps = constants_1.EMPTY_OBJECT, layoutContex
|
|
|
124
128
|
collectCss("textAlign");
|
|
125
129
|
collectCss("textAlignLast");
|
|
126
130
|
collectCss("textWrap");
|
|
131
|
+
collectCss("wordBreak");
|
|
132
|
+
collectCss("wordSpacing");
|
|
133
|
+
collectCss("wordWrap");
|
|
134
|
+
collectCss("writingMode");
|
|
127
135
|
// --- Other
|
|
128
136
|
collectCss("backgroundColor");
|
|
129
137
|
collectCss("background");
|
|
@@ -339,6 +347,8 @@ const layoutPatterns = {
|
|
|
339
347
|
fontSize: [],
|
|
340
348
|
fontWeight: [],
|
|
341
349
|
fontStyle: [booleanRegex],
|
|
350
|
+
fontVariant: [],
|
|
351
|
+
lineBreak: [],
|
|
342
352
|
textDecoration: [],
|
|
343
353
|
userSelect: [],
|
|
344
354
|
letterSpacing: [],
|
|
@@ -347,6 +357,12 @@ const layoutPatterns = {
|
|
|
347
357
|
textAlign: [],
|
|
348
358
|
textWrap: [],
|
|
349
359
|
textAlignLast: [],
|
|
360
|
+
textIndent: [],
|
|
361
|
+
textShadow: [],
|
|
362
|
+
wordBreak: [],
|
|
363
|
+
wordSpacing: [],
|
|
364
|
+
wordWrap: [],
|
|
365
|
+
writingMode: [],
|
|
350
366
|
// --- Content rendering
|
|
351
367
|
wrapContent: [],
|
|
352
368
|
canShrink: [],
|
|
@@ -365,4 +381,6 @@ const layoutPatterns = {
|
|
|
365
381
|
outlineColor: [],
|
|
366
382
|
outlineStyle: [],
|
|
367
383
|
outlineOffset: [],
|
|
384
|
+
// --- Animation
|
|
385
|
+
transition: [],
|
|
368
386
|
};
|
|
@@ -208,6 +208,9 @@ exports.RootThemeDefinition = {
|
|
|
208
208
|
"textColor-secondary": $colorSurface600,
|
|
209
209
|
// --- Input is an abstract component, so we define its default theme variables here
|
|
210
210
|
"backgroundColor-Input-default": $colorSurface0,
|
|
211
|
+
"backgroundColor-Input-success": $colorSurface0,
|
|
212
|
+
"backgroundColor-Input-warning": $colorSurface0,
|
|
213
|
+
"backgroundColor-Input-error": $colorSurface0,
|
|
211
214
|
"borderColor-Input-default": $colorSurface200,
|
|
212
215
|
"borderColor-Input-default--hover": $colorSurface600,
|
|
213
216
|
"borderColor-Input-default--focus": $colorSurface600,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SizeScaleReadableKeys = exports.SizeScaleKeys = exports.ThemeToneKeys = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Each theme can have a light or a dark tone.
|
|
6
|
+
*/
|
|
7
|
+
exports.ThemeToneKeys = ["light", "dark"];
|
|
8
|
+
exports.SizeScaleKeys = {
|
|
9
|
+
// small scale
|
|
10
|
+
none: "none",
|
|
11
|
+
xs: "xs",
|
|
12
|
+
sm: "sm",
|
|
13
|
+
md: "md",
|
|
14
|
+
// large scale
|
|
15
|
+
lg: "lg",
|
|
16
|
+
xl: "xl",
|
|
17
|
+
"2xl": "2xl",
|
|
18
|
+
"3xl": "3xl",
|
|
19
|
+
};
|
|
20
|
+
exports.SizeScaleReadableKeys = {
|
|
21
|
+
// small scale
|
|
22
|
+
none: "None",
|
|
23
|
+
xs: "Extra Small",
|
|
24
|
+
sm: "Small",
|
|
25
|
+
md: "Medium",
|
|
26
|
+
// large scale
|
|
27
|
+
lg: "Large",
|
|
28
|
+
xl: "Extra Large",
|
|
29
|
+
"2xl": "Double Extra Large",
|
|
30
|
+
"3xl": "Triple Extra Large",
|
|
31
|
+
};
|
|
@@ -13,6 +13,7 @@ exports.smartFormatDate = smartFormatDate;
|
|
|
13
13
|
exports.isDateToday = isDateToday;
|
|
14
14
|
exports.isDateYesterday = isDateYesterday;
|
|
15
15
|
exports.isDateTomorrow = isDateTomorrow;
|
|
16
|
+
exports.formatHumanElapsedTime = formatHumanElapsedTime;
|
|
16
17
|
const date_fns_1 = require("date-fns");
|
|
17
18
|
const misc_1 = require("../utils/misc");
|
|
18
19
|
function isoDateString(date) {
|
|
@@ -76,3 +77,62 @@ function isDateYesterday(date) {
|
|
|
76
77
|
function isDateTomorrow(date) {
|
|
77
78
|
return (0, date_fns_1.isTomorrow)(new Date(date));
|
|
78
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Formats a date into a human-readable elapsed time string.
|
|
82
|
+
* Returns strings like "now", "12 seconds ago", "3 hours ago", "today", "yesterday", "3 weeks ago", etc.
|
|
83
|
+
*
|
|
84
|
+
* @param date The date to format
|
|
85
|
+
* @returns A human-readable elapsed time string
|
|
86
|
+
*/
|
|
87
|
+
function formatHumanElapsedTime(date) {
|
|
88
|
+
const now = new Date();
|
|
89
|
+
const inputDate = new Date(date);
|
|
90
|
+
// Calculate time difference in milliseconds
|
|
91
|
+
const diffMs = now.getTime() - inputDate.getTime();
|
|
92
|
+
// Handle future dates
|
|
93
|
+
if (diffMs < 0) {
|
|
94
|
+
return formatDate(date);
|
|
95
|
+
}
|
|
96
|
+
// Convert to seconds, minutes, hours, days, weeks
|
|
97
|
+
const diffSeconds = Math.floor(diffMs / 1000);
|
|
98
|
+
const diffMinutes = Math.floor(diffSeconds / 60);
|
|
99
|
+
const diffHours = Math.floor(diffMinutes / 60);
|
|
100
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
101
|
+
const diffWeeks = Math.floor(diffDays / 7);
|
|
102
|
+
const diffMonths = Math.floor(diffDays / 30);
|
|
103
|
+
const diffYears = Math.floor(diffDays / 365);
|
|
104
|
+
// Just now (within 10 seconds)
|
|
105
|
+
if (diffSeconds < 10) {
|
|
106
|
+
return "now";
|
|
107
|
+
}
|
|
108
|
+
// Seconds ago (up to 1 minute)
|
|
109
|
+
if (diffSeconds < 60) {
|
|
110
|
+
return `${diffSeconds} second${diffSeconds === 1 ? "" : "s"} ago`;
|
|
111
|
+
}
|
|
112
|
+
// Minutes ago (up to 1 hour)
|
|
113
|
+
if (diffMinutes < 60) {
|
|
114
|
+
return `${diffMinutes} minute${diffMinutes === 1 ? "" : "s"} ago`;
|
|
115
|
+
}
|
|
116
|
+
// Hours ago (up to today)
|
|
117
|
+
if ((0, date_fns_1.isToday)(inputDate)) {
|
|
118
|
+
return `${diffHours} hour${diffHours === 1 ? "" : "s"} ago`;
|
|
119
|
+
}
|
|
120
|
+
// Yesterday
|
|
121
|
+
if ((0, date_fns_1.isYesterday)(inputDate)) {
|
|
122
|
+
return "yesterday";
|
|
123
|
+
}
|
|
124
|
+
// Days ago (up to 1 week)
|
|
125
|
+
if (diffDays < 7) {
|
|
126
|
+
return `${diffDays} day${diffDays === 1 ? "" : "s"} ago`;
|
|
127
|
+
}
|
|
128
|
+
// Weeks ago (up to 4 weeks / 1 month)
|
|
129
|
+
if (diffWeeks < 4) {
|
|
130
|
+
return `${diffWeeks} week${diffWeeks === 1 ? "" : "s"} ago`;
|
|
131
|
+
}
|
|
132
|
+
// Months ago (up to 12 months / 1 year)
|
|
133
|
+
if (diffMonths < 12) {
|
|
134
|
+
return `${diffMonths} month${diffMonths === 1 ? "" : "s"} ago`;
|
|
135
|
+
}
|
|
136
|
+
// Years ago
|
|
137
|
+
return `${diffYears} year${diffYears === 1 ? "" : "s"} ago`;
|
|
138
|
+
}
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.parseHandlerCode = parseHandlerCode;
|
|
13
13
|
exports.prepareHandlerStatements = prepareHandlerStatements;
|
|
14
14
|
exports.runEventHandlerCode = runEventHandlerCode;
|
|
15
|
-
const ScriptingSourceTree_1 = require("
|
|
15
|
+
const ScriptingSourceTree_1 = require("../script-runner/ScriptingSourceTree");
|
|
16
16
|
const Parser_1 = require("../../parsers/scripting/Parser");
|
|
17
17
|
const process_statement_async_1 = require("../script-runner/process-statement-async");
|
|
18
18
|
const reportEngineError_1 = require("../reportEngineError");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Parser = void 0;
|
|
4
4
|
exports.createXmlUiTreeNodeId = createXmlUiTreeNodeId;
|
|
5
|
-
const ScriptingSourceTree_1 = require("../../
|
|
5
|
+
const ScriptingSourceTree_1 = require("../../components-core/script-runner/ScriptingSourceTree");
|
|
6
6
|
const InputStream_1 = require("../common/InputStream");
|
|
7
7
|
const Lexer_1 = require("./Lexer");
|
|
8
8
|
const ParserError_1 = require("./ParserError");
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PARSED_MARK_PROP = void 0;
|
|
4
4
|
exports.collectCodeBehindFromSource = collectCodeBehindFromSource;
|
|
5
5
|
exports.removeCodeBehindTokensFromTree = removeCodeBehindTokensFromTree;
|
|
6
|
-
const ScriptingSourceTree_1 = require("../../
|
|
6
|
+
const ScriptingSourceTree_1 = require("../../components-core/script-runner/ScriptingSourceTree");
|
|
7
7
|
const tree_visitor_1 = require("./tree-visitor");
|
|
8
8
|
const modules_1 = require("./modules");
|
|
9
9
|
exports.PARSED_MARK_PROP = "__PARSED__";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isModuleErrors = isModuleErrors;
|
|
4
4
|
exports.parseScriptModule = parseScriptModule;
|
|
5
|
-
const ScriptingSourceTree_1 = require("../../
|
|
5
|
+
const ScriptingSourceTree_1 = require("../../components-core/script-runner/ScriptingSourceTree");
|
|
6
6
|
const Parser_1 = require("./Parser");
|
|
7
7
|
const ParserError_1 = require("./ParserError");
|
|
8
8
|
const TokenType_1 = require("./TokenType");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.visitNode = visitNode;
|
|
4
|
-
const ScriptingSourceTree_1 = require("../../
|
|
4
|
+
const ScriptingSourceTree_1 = require("../../components-core/script-runner/ScriptingSourceTree");
|
|
5
5
|
const unreachable = (_x) => { };
|
|
6
6
|
/*Walk through the ast, executing visitors on the nodes
|
|
7
7
|
*
|
|
@@ -2,16 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createXmlUiParser = createXmlUiParser;
|
|
4
4
|
exports.parseXmlUiMarkup = parseXmlUiMarkup;
|
|
5
|
+
const syntax_node_1 = require("./syntax-node");
|
|
5
6
|
const CharacterCodes_1 = require("./CharacterCodes");
|
|
6
7
|
const scanner_1 = require("./scanner");
|
|
7
8
|
const syntax_kind_1 = require("./syntax-kind");
|
|
8
9
|
const utils_1 = require("./utils");
|
|
9
10
|
const diagnostics_1 = require("./diagnostics");
|
|
10
11
|
const RECOVER_FILE = [syntax_kind_1.SyntaxKind.CData, syntax_kind_1.SyntaxKind.Script, syntax_kind_1.SyntaxKind.OpenNodeStart];
|
|
11
|
-
const RECOVER_OPEN_TAG = [
|
|
12
|
+
const RECOVER_OPEN_TAG = [
|
|
13
|
+
syntax_kind_1.SyntaxKind.OpenNodeStart,
|
|
14
|
+
syntax_kind_1.SyntaxKind.NodeEnd,
|
|
15
|
+
syntax_kind_1.SyntaxKind.NodeClose,
|
|
16
|
+
syntax_kind_1.SyntaxKind.CloseNodeStart,
|
|
17
|
+
syntax_kind_1.SyntaxKind.CData,
|
|
18
|
+
syntax_kind_1.SyntaxKind.Script,
|
|
19
|
+
];
|
|
12
20
|
const RECOVER_ATTR = [syntax_kind_1.SyntaxKind.Identifier, ...RECOVER_OPEN_TAG];
|
|
13
|
-
const RECOVER_CONTENT_LIST = [
|
|
14
|
-
|
|
21
|
+
const RECOVER_CONTENT_LIST = [
|
|
22
|
+
syntax_kind_1.SyntaxKind.TextNode,
|
|
23
|
+
syntax_kind_1.SyntaxKind.StringLiteral,
|
|
24
|
+
syntax_kind_1.SyntaxKind.CData,
|
|
25
|
+
syntax_kind_1.SyntaxKind.Script,
|
|
26
|
+
syntax_kind_1.SyntaxKind.OpenNodeStart,
|
|
27
|
+
syntax_kind_1.SyntaxKind.CloseNodeStart,
|
|
28
|
+
];
|
|
29
|
+
const RECOVER_CLOSE_TAG = [
|
|
30
|
+
syntax_kind_1.SyntaxKind.NodeEnd,
|
|
31
|
+
syntax_kind_1.SyntaxKind.OpenNodeStart,
|
|
32
|
+
syntax_kind_1.SyntaxKind.CloseNodeStart,
|
|
33
|
+
syntax_kind_1.SyntaxKind.CData,
|
|
34
|
+
syntax_kind_1.SyntaxKind.Script,
|
|
35
|
+
];
|
|
15
36
|
function createXmlUiParser(source) {
|
|
16
37
|
return {
|
|
17
38
|
parse: () => parseXmlUiMarkup(source),
|
|
@@ -208,7 +229,11 @@ function parseXmlUiMarkup(text) {
|
|
|
208
229
|
nameIdent = bump(syntax_kind_1.SyntaxKind.Identifier);
|
|
209
230
|
}
|
|
210
231
|
else {
|
|
211
|
-
const errNode = errNodeUntil([
|
|
232
|
+
const errNode = errNodeUntil([
|
|
233
|
+
syntax_kind_1.SyntaxKind.Equal,
|
|
234
|
+
syntax_kind_1.SyntaxKind.Identifier,
|
|
235
|
+
...RECOVER_OPEN_TAG,
|
|
236
|
+
]);
|
|
212
237
|
if (errNode) {
|
|
213
238
|
errorAt(diagnostics_1.DIAGS.expAttrNameAfterNamespace, errNode.pos, errNode.end);
|
|
214
239
|
}
|
|
@@ -225,7 +250,8 @@ function parseXmlUiMarkup(text) {
|
|
|
225
250
|
if (at(syntax_kind_1.SyntaxKind.Identifier)) {
|
|
226
251
|
const closeTagName = parseClosingTagName();
|
|
227
252
|
if (!skipNameMatching) {
|
|
228
|
-
const namesMismatch = openTagName !== null &&
|
|
253
|
+
const namesMismatch = openTagName !== null &&
|
|
254
|
+
!(0, utils_1.tagNameNodesWithoutErrorsMatch)(openTagName, closeTagName, getText);
|
|
229
255
|
if (namesMismatch) {
|
|
230
256
|
const msg = diagnostics_1.DIAGS.tagNameMismatch(getText(openTagName), getText(closeTagName));
|
|
231
257
|
errorAt(msg, closeTagName.pos, closeTagName.end);
|
|
@@ -306,10 +332,10 @@ function parseXmlUiMarkup(text) {
|
|
|
306
332
|
});
|
|
307
333
|
}
|
|
308
334
|
/**
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
335
|
+
*
|
|
336
|
+
* @param tokens that won't be consumed
|
|
337
|
+
* @returns the error node with the consumed tokens, or null if there were no tokens consumed
|
|
338
|
+
*/
|
|
313
339
|
function errNodeUntil(tokens) {
|
|
314
340
|
startNode();
|
|
315
341
|
advance(tokens);
|
|
@@ -422,7 +448,7 @@ function parseXmlUiMarkup(text) {
|
|
|
422
448
|
}
|
|
423
449
|
end = scanner.getTokenEnd();
|
|
424
450
|
}
|
|
425
|
-
peekedToken =
|
|
451
|
+
peekedToken = new syntax_node_1.Node(kind, pos, end, triviaBefore);
|
|
426
452
|
return peekedToken;
|
|
427
453
|
}
|
|
428
454
|
/** Same as bumpAny, but with an assertion of the token that was bumped over.
|
|
@@ -479,20 +505,14 @@ function parseXmlUiMarkup(text) {
|
|
|
479
505
|
err = errFromScanner.message;
|
|
480
506
|
}
|
|
481
507
|
const pos = scanner.getTokenStart();
|
|
482
|
-
const
|
|
483
|
-
kind,
|
|
484
|
-
start,
|
|
485
|
-
pos,
|
|
486
|
-
end: scanner.getTokenEnd(),
|
|
487
|
-
triviaBefore: triviaCollected.length > 0 ? triviaCollected : undefined,
|
|
488
|
-
};
|
|
508
|
+
const triviaBefore = triviaCollected.length > 0 ? triviaCollected : undefined;
|
|
489
509
|
triviaCollected = [];
|
|
490
510
|
if (inContent && err.code === diagnostics_1.ErrCodes.invalidChar) {
|
|
491
511
|
errFromScanner = undefined;
|
|
492
|
-
return
|
|
512
|
+
return new syntax_node_1.Node(kind, pos, scanner.getTokenEnd(), triviaBefore);
|
|
493
513
|
}
|
|
494
514
|
const badPrefixEnd = pos + errFromScanner.prefixLength;
|
|
495
|
-
token
|
|
515
|
+
const token = new syntax_node_1.Node(kind, pos, badPrefixEnd, triviaBefore);
|
|
496
516
|
scanner.resetTokenState(badPrefixEnd);
|
|
497
517
|
startNode();
|
|
498
518
|
node.children.push(token);
|
|
@@ -505,21 +525,10 @@ function parseXmlUiMarkup(text) {
|
|
|
505
525
|
case syntax_kind_1.SyntaxKind.CommentTrivia:
|
|
506
526
|
case syntax_kind_1.SyntaxKind.NewLineTrivia:
|
|
507
527
|
case syntax_kind_1.SyntaxKind.WhitespaceTrivia:
|
|
508
|
-
triviaCollected.push(
|
|
509
|
-
kind,
|
|
510
|
-
start,
|
|
511
|
-
pos: scanner.getTokenStart(),
|
|
512
|
-
end: scanner.getTokenEnd(),
|
|
513
|
-
});
|
|
528
|
+
triviaCollected.push(new syntax_node_1.Node(kind, scanner.getTokenStart(), scanner.getTokenEnd()));
|
|
514
529
|
break;
|
|
515
530
|
default:
|
|
516
|
-
return
|
|
517
|
-
kind,
|
|
518
|
-
start,
|
|
519
|
-
pos: scanner.getTokenStart(),
|
|
520
|
-
end: scanner.getTokenEnd(),
|
|
521
|
-
triviaBefore: triviaCollected.length > 0 ? triviaCollected : undefined,
|
|
522
|
-
};
|
|
531
|
+
return new syntax_node_1.Node(kind, scanner.getTokenStart(), scanner.getTokenEnd(), triviaCollected.length > 0 ? triviaCollected : undefined);
|
|
523
532
|
}
|
|
524
533
|
}
|
|
525
534
|
}
|
|
@@ -533,11 +542,5 @@ function parseXmlUiMarkup(text) {
|
|
|
533
542
|
function createNode(kind, children) {
|
|
534
543
|
const firstChild = children[0];
|
|
535
544
|
const lastChild = children[children.length - 1];
|
|
536
|
-
return
|
|
537
|
-
kind,
|
|
538
|
-
start: firstChild.start,
|
|
539
|
-
pos: firstChild.pos,
|
|
540
|
-
end: lastChild.end,
|
|
541
|
-
children,
|
|
542
|
-
};
|
|
545
|
+
return new syntax_node_1.Node(kind, firstChild.pos, lastChild.end, undefined, children);
|
|
543
546
|
}
|
|
@@ -1,2 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TagNameNode = exports.AttributeListNode = exports.ContentListNode = exports.AttributeKeyNode = exports.AttributeNode = exports.ElementNode = exports.Node = void 0;
|
|
4
|
+
const syntax_kind_1 = require("./syntax-kind");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
class Node {
|
|
7
|
+
constructor(kind, pos, end, triviaBefore, children) {
|
|
8
|
+
var _a, _b, _c, _d;
|
|
9
|
+
this.kind = kind;
|
|
10
|
+
this.pos = pos;
|
|
11
|
+
this.end = end;
|
|
12
|
+
this.triviaBefore = triviaBefore;
|
|
13
|
+
this.children = children;
|
|
14
|
+
if (triviaBefore) {
|
|
15
|
+
this.start = (_b = (_a = triviaBefore[0]) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : pos;
|
|
16
|
+
}
|
|
17
|
+
else if (children) {
|
|
18
|
+
this.start = (_d = (_c = children[0]) === null || _c === void 0 ? void 0 : _c.start) !== null && _d !== void 0 ? _d : pos;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.start = pos;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
isElementNode() {
|
|
25
|
+
return this.kind === syntax_kind_1.SyntaxKind.ElementNode;
|
|
26
|
+
}
|
|
27
|
+
isAttributeNode() {
|
|
28
|
+
return this.kind === syntax_kind_1.SyntaxKind.AttributeNode;
|
|
29
|
+
}
|
|
30
|
+
isAttributeKeyNode() {
|
|
31
|
+
return this.kind === syntax_kind_1.SyntaxKind.AttributeKeyNode;
|
|
32
|
+
}
|
|
33
|
+
isContentListNode() {
|
|
34
|
+
return this.kind === syntax_kind_1.SyntaxKind.ContentListNode;
|
|
35
|
+
}
|
|
36
|
+
isAttributeListNode() {
|
|
37
|
+
return this.kind === syntax_kind_1.SyntaxKind.AttributeListNode;
|
|
38
|
+
}
|
|
39
|
+
isTagNameNode() {
|
|
40
|
+
return this.kind === syntax_kind_1.SyntaxKind.TagNameNode;
|
|
41
|
+
}
|
|
42
|
+
findTokenAtPos(position) {
|
|
43
|
+
return (0, utils_1.findTokenAtPos)(this, position);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.Node = Node;
|
|
47
|
+
class ElementNode extends Node {
|
|
48
|
+
getAttributeListNode() {
|
|
49
|
+
return this.children.find((c) => c.isContentListNode());
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.ElementNode = ElementNode;
|
|
53
|
+
class AttributeNode extends Node {
|
|
54
|
+
}
|
|
55
|
+
exports.AttributeNode = AttributeNode;
|
|
56
|
+
class AttributeKeyNode extends Node {
|
|
57
|
+
}
|
|
58
|
+
exports.AttributeKeyNode = AttributeKeyNode;
|
|
59
|
+
class ContentListNode extends Node {
|
|
60
|
+
}
|
|
61
|
+
exports.ContentListNode = ContentListNode;
|
|
62
|
+
class AttributeListNode extends Node {
|
|
63
|
+
}
|
|
64
|
+
exports.AttributeListNode = AttributeListNode;
|
|
65
|
+
class TagNameNode extends Node {
|
|
66
|
+
}
|
|
67
|
+
exports.TagNameNode = TagNameNode;
|
|
@@ -4,6 +4,7 @@ exports.CORE_NAMESPACE_VALUE = exports.onPrefixRegex = exports.UCRegex = exports
|
|
|
4
4
|
exports.nodeToComponentDef = nodeToComponentDef;
|
|
5
5
|
exports.stripOnPrefix = stripOnPrefix;
|
|
6
6
|
const code_behind_collect_1 = require("../scripting/code-behind-collect");
|
|
7
|
+
const syntax_node_1 = require("./syntax-node");
|
|
7
8
|
const syntax_kind_1 = require("./syntax-kind");
|
|
8
9
|
const ParserError_1 = require("./ParserError");
|
|
9
10
|
const Parser_1 = require("../scripting/Parser");
|
|
@@ -1012,16 +1013,17 @@ function getChildNodes(node) {
|
|
|
1012
1013
|
return (_c = (_b = (_a = node.children) === null || _a === void 0 ? void 0 : _a.find((c) => c.kind === syntax_kind_1.SyntaxKind.ContentListNode)) === null || _b === void 0 ? void 0 : _b.children) !== null && _c !== void 0 ? _c : [];
|
|
1013
1014
|
}
|
|
1014
1015
|
function withNewChildNodes(node, newChildren) {
|
|
1015
|
-
var _a;
|
|
1016
|
+
var _a, _b, _c, _d, _e;
|
|
1016
1017
|
const childrenListIdx = (_a = node.children) === null || _a === void 0 ? void 0 : _a.findIndex((c) => c.kind === syntax_kind_1.SyntaxKind.ContentListNode);
|
|
1017
1018
|
if (childrenListIdx === undefined || childrenListIdx === -1) {
|
|
1018
1019
|
return node;
|
|
1019
1020
|
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1021
|
+
const contentListChild = node.children[childrenListIdx];
|
|
1022
|
+
return new syntax_node_1.Node(node.kind, (_b = node.pos) !== null && _b !== void 0 ? _b : 0, (_c = node.end) !== null && _c !== void 0 ? _c : 0, node.triviaBefore, [
|
|
1023
|
+
...node.children.slice(0, childrenListIdx),
|
|
1024
|
+
new syntax_node_1.Node(contentListChild.kind, (_d = contentListChild.pos) !== null && _d !== void 0 ? _d : 0, (_e = contentListChild.end) !== null && _e !== void 0 ? _e : 0, undefined, newChildren),
|
|
1025
|
+
...node.children.slice(childrenListIdx),
|
|
1026
|
+
]);
|
|
1025
1027
|
}
|
|
1026
1028
|
function desugarKeyOnlyAttrs(attrs) {
|
|
1027
1029
|
var _a;
|
|
@@ -1113,8 +1115,8 @@ function getNamespaceResolvedComponentName(node, getText, namespaceStack) {
|
|
|
1113
1115
|
return resolvedNamespace + "." + name;
|
|
1114
1116
|
}
|
|
1115
1117
|
/**
|
|
1116
|
-
* @param name - The name of the event in camelCase, with "on" prefix.
|
|
1117
|
-
*/
|
|
1118
|
+
* @param name - The name of the event in camelCase, with "on" prefix.
|
|
1119
|
+
*/
|
|
1118
1120
|
function stripOnPrefix(name) {
|
|
1119
1121
|
return name[2].toLowerCase() + name.substring(3);
|
|
1120
1122
|
}
|
|
@@ -37,7 +37,6 @@ function tagNameNodesWithoutErrorsMatch(name1, name2, getText) {
|
|
|
37
37
|
}
|
|
38
38
|
function findTokenAtPos(node, position) {
|
|
39
39
|
const chain = [node];
|
|
40
|
-
let chainBeforePos;
|
|
41
40
|
let sharedParents;
|
|
42
41
|
if (node.start > position || position > node.end) {
|
|
43
42
|
return undefined;
|
|
@@ -45,7 +44,7 @@ function findTokenAtPos(node, position) {
|
|
|
45
44
|
const res = {
|
|
46
45
|
chainAtPos: chain,
|
|
47
46
|
chainBeforePos: undefined,
|
|
48
|
-
sharedParents: undefined
|
|
47
|
+
sharedParents: undefined,
|
|
49
48
|
};
|
|
50
49
|
while (node.children !== undefined && node.children.length > 0) {
|
|
51
50
|
//todo: make it a binary search before finding a fork
|