xmlui 0.10.12 → 0.10.14
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/{index-CDOoBf2R.mjs → index-779mp2Bm.mjs} +1508 -1287
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-BAV9RKui.mjs → initMock-CAXdczCj.mjs} +1 -1
- package/dist/lib/scss/components-core/theming/_themes.scss +1 -1
- package/dist/lib/xmlui.d.ts +17 -2
- package/dist/lib/xmlui.mjs +33 -32
- package/dist/metadata/{collectedComponentMetadata-Dp8BqWQO.mjs → collectedComponentMetadata-7DFXlw-J.mjs} +14957 -14751
- package/dist/metadata/{initMock-BvEO8W8r.mjs → initMock-AFWEftc6.mjs} +1 -1
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +3 -3
- package/dist/scripts/bin/build-lib.js +21 -13
- package/dist/scripts/bin/viteConfig.js +3 -1
- package/dist/scripts/package.json +1 -1
- package/dist/scripts/src/abstractions/scripting/Token.js +2 -0
- package/dist/scripts/src/abstractions/scripting/TryScope.js +2 -0
- package/dist/scripts/src/abstractions/scripting/modules.js +2 -0
- package/dist/scripts/src/components/APICall/APICall.spec.js +910 -0
- package/dist/scripts/src/components/Accordion/Accordion.spec.js +969 -0
- package/dist/scripts/src/components/Animation/Animation.js +50 -0
- package/dist/scripts/src/components/App/App.spec.js +219 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +169 -0
- package/dist/scripts/src/components/AppState/AppState.spec.js +268 -0
- package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +383 -0
- package/dist/scripts/src/components/Avatar/Avatar.spec.js +1543 -0
- package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +131 -0
- package/dist/scripts/src/components/Badge/Badge.spec.js +2214 -0
- package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +230 -0
- package/dist/scripts/src/components/Breakout/Breakout.spec.js +56 -0
- package/dist/scripts/src/components/Button/Button-style.spec.js +274 -0
- package/dist/scripts/src/components/Button/Button.spec.js +454 -0
- package/dist/scripts/src/components/Card/Card.spec.js +150 -0
- package/dist/scripts/src/components/Carousel/Carousel.spec.js +343 -0
- package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
- package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +169 -0
- package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +999 -0
- package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +597 -0
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +608 -0
- package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +539 -0
- package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +558 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +450 -0
- package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +584 -0
- package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +571 -0
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +449 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +964 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +196 -0
- package/dist/scripts/src/components/ColorPicker/ColorPicker.js +3 -3
- package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +283 -0
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +16 -5
- package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/ComponentProvider.js +6 -6
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +338 -0
- package/dist/scripts/src/components/DateInput/DateInput.spec.js +918 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +362 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +3 -3
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +331 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +1 -1
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +29 -0
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +435 -0
- package/dist/scripts/src/components/FileInput/FileInput.spec.js +249 -0
- package/dist/scripts/src/components/FileInput/FileInputNative.js +14 -10
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +296 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +1 -1
- package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +518 -0
- package/dist/scripts/src/components/Footer/Footer.spec.js +991 -0
- package/dist/scripts/src/components/Form/Form.js +6 -0
- package/dist/scripts/src/components/Form/Form.spec.js +1257 -0
- package/dist/scripts/src/components/Form/FormNative.js +13 -3
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +723 -0
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +2 -2
- package/dist/scripts/src/components/FormSection/FormSection.js +6 -31
- package/dist/scripts/src/components/Fragment/Fragment.js +5 -1
- package/dist/scripts/src/components/Fragment/Fragment.spec.js +50 -0
- package/dist/scripts/src/components/Heading/H1.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H2.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H3.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H4.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H5.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H6.spec.js +66 -0
- package/dist/scripts/src/components/Heading/Heading.js +0 -12
- package/dist/scripts/src/components/Heading/Heading.spec.js +897 -0
- package/dist/scripts/src/components/HtmlTags/HtmlTags.spec.js +69 -0
- package/dist/scripts/src/components/IFrame/IFrame.spec.js +527 -0
- package/dist/scripts/src/components/Icon/ArrowDropDown.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowDropUp.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowLeft.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowRight.js +11 -0
- package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
- package/dist/scripts/src/components/Icon/Icon.spec.js +527 -0
- package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
- package/dist/scripts/src/components/Image/Image.js +2 -1
- package/dist/scripts/src/components/Image/Image.spec.js +198 -0
- package/dist/scripts/src/components/Image/ImageNative.js +30 -2
- package/dist/scripts/src/components/Input/InputLabel.js +25 -0
- package/dist/scripts/src/components/Input/index.js +5 -0
- package/dist/scripts/src/components/Items/Items.spec.js +397 -0
- package/dist/scripts/src/components/Link/Link.spec.js +894 -0
- package/dist/scripts/src/components/List/List.spec.js +927 -0
- package/dist/scripts/src/components/List/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/Markdown/Markdown.spec.js +188 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -1
- package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +162 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +1 -1
- package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +153 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +2 -2
- package/dist/scripts/src/components/NavLink/NavLink.spec.js +864 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +864 -0
- package/dist/scripts/src/components/NoResult/NoResult.spec.js +863 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +1231 -0
- package/dist/scripts/src/components/Option/Option.spec.js +472 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +80 -0
- package/dist/scripts/src/components/Pagination/Pagination.spec.js +1003 -0
- package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +20 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +166 -0
- package/dist/scripts/src/components/Queue/Queue.spec.js +626 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +479 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +17 -1
- package/dist/scripts/src/components/Redirect/Redirect.spec.js +527 -0
- package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +76 -0
- package/dist/scripts/src/components/Select/Select.spec.js +527 -0
- package/dist/scripts/src/components/Slider/Slider.js +2 -0
- package/dist/scripts/src/components/Slider/Slider.spec.js +574 -0
- package/dist/scripts/src/components/Slider/SliderNative.js +62 -25
- package/dist/scripts/src/components/Slot/Slot.spec.js +368 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +184 -0
- package/dist/scripts/src/components/Spinner/Spinner.spec.js +161 -0
- package/dist/scripts/src/components/Splitter/HSplitter.spec.js +104 -0
- package/dist/scripts/src/components/Splitter/Splitter.spec.js +543 -0
- package/dist/scripts/src/components/Splitter/VSplitter.spec.js +104 -0
- package/dist/scripts/src/components/Stack/CHStack.spec.js +86 -0
- package/dist/scripts/src/components/Stack/CVStack.spec.js +86 -0
- package/dist/scripts/src/components/Stack/HStack.spec.js +67 -0
- package/dist/scripts/src/components/Stack/Stack.spec.js +654 -0
- package/dist/scripts/src/components/Stack/VStack.spec.js +67 -0
- package/dist/scripts/src/components/Switch/Switch.spec.js +829 -0
- package/dist/scripts/src/components/Table/Table.js +8 -5
- package/dist/scripts/src/components/Table/Table.spec.js +555 -0
- package/dist/scripts/src/components/Table/TableNative.js +1 -1
- package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +838 -0
- package/dist/scripts/src/components/Tabs/Tabs.spec.js +875 -0
- package/dist/scripts/src/components/Text/Text.js +0 -13
- package/dist/scripts/src/components/Text/Text.spec.js +1075 -0
- package/dist/scripts/src/components/TextArea/TextArea.spec.js +714 -0
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +8 -1
- package/dist/scripts/src/components/TextBox/TextBox.spec.js +643 -0
- package/dist/scripts/src/components/Theme/NotificationToast.js +4 -1
- package/dist/scripts/src/components/Theme/Theme.spec.js +124 -0
- package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +1122 -0
- package/dist/scripts/src/components/Timer/Timer.spec.js +358 -0
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +414 -0
- package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +89 -0
- package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +418 -0
- package/dist/scripts/src/components/chart-color-schemes.js +43 -0
- package/dist/scripts/src/components-core/CompoundComponent.js +5 -5
- package/dist/scripts/src/components-core/RestApiProxy.js +89 -11
- package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +8 -0
- package/dist/scripts/src/components-core/renderers.js +31 -0
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +1 -1
- package/dist/scripts/src/components-core/rendering/Container.js +19 -8
- package/dist/scripts/src/components-core/rendering/reducer.js +1 -1
- package/dist/scripts/src/components-core/script-runner/simplify-expression.js +386 -0
- package/dist/scripts/src/components-core/theming/component-layout-resolver.js +153 -0
- package/dist/scripts/src/components-core/theming/parse-layout-props.js +98 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +13 -20
- package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
- package/dist/scripts/src/components-core/utils/audio-utils.js +83 -0
- package/dist/scripts/src/index-standalone.js +61 -0
- package/dist/scripts/src/index.js +2 -1
- package/dist/scripts/src/language-server/server-common.js +151 -0
- package/dist/scripts/src/language-server/server-web-worker.js +47 -0
- package/dist/scripts/src/language-server/server.js +42 -0
- package/dist/scripts/src/language-server/services/common/docs-generation.js +73 -0
- package/dist/scripts/src/language-server/services/common/lsp-utils.js +9 -0
- package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +135 -0
- package/dist/scripts/src/language-server/services/completion.js +270 -0
- package/dist/scripts/src/language-server/services/diagnostic.js +19 -0
- package/dist/scripts/src/language-server/services/format.js +430 -0
- package/dist/scripts/src/language-server/services/hover.js +164 -0
- package/dist/scripts/src/language-server/xmlui-metadata-generated.mjs +16266 -0
- package/dist/scripts/src/logging/xmlui.js +21 -0
- package/dist/scripts/src/parsers/common/utils.js +19 -0
- package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +286 -0
- package/dist/scripts/src/syntax/monaco/index.js +14 -0
- package/dist/scripts/src/syntax/monaco/xmlui-dark.js +25 -0
- package/dist/scripts/src/syntax/monaco/xmlui-light.js +25 -0
- package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +310 -0
- package/dist/scripts/src/syntax/textMate/index.js +14 -0
- package/dist/scripts/src/syntax/textMate/xmlui-dark.json +631 -0
- package/dist/scripts/src/syntax/textMate/xmlui-light.json +565 -0
- package/dist/scripts/src/syntax/textMate/xmlui.json +564 -0
- package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +341 -0
- package/dist/scripts/src/testing/ComponentDrivers.js +1355 -0
- package/dist/scripts/src/testing/assertions.js +444 -0
- package/dist/scripts/src/testing/component-test-helpers.js +389 -0
- package/dist/scripts/src/testing/drivers/DateInputDriver.js +19 -0
- package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +10 -0
- package/dist/scripts/src/testing/drivers/TimeInputDriver.js +22 -0
- package/dist/scripts/src/testing/drivers/TimerDriver.js +64 -0
- package/dist/scripts/src/testing/fixtures.js +487 -0
- package/dist/scripts/src/testing/infrastructure/TestBed.js +17 -0
- package/dist/scripts/src/testing/infrastructure/main.js +9 -0
- package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +266 -0
- package/dist/scripts/src/testing/themed-app-test-helpers.js +139 -0
- package/dist/standalone/xmlui-standalone.es.d.ts +19 -2
- package/dist/standalone/xmlui-standalone.umd.js +36 -36
- package/package.json +1 -1
- package/dist/scripts/src/components/RadioGroup/RadioItem.js +0 -28
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseLayoutProperty = parseLayoutProperty;
|
|
4
|
+
const AppContextDefs_1 = require("../../abstractions/AppContextDefs");
|
|
5
|
+
function parseLayoutProperty(prop, parseComponent = false) {
|
|
6
|
+
if (!prop || typeof prop !== 'string') {
|
|
7
|
+
return "Property string cannot be empty";
|
|
8
|
+
}
|
|
9
|
+
// Split by '--' to separate states from the rest
|
|
10
|
+
const parts = prop.split('--');
|
|
11
|
+
const mainPart = parts[0];
|
|
12
|
+
const stateParts = parts.slice(1);
|
|
13
|
+
// Validate state names
|
|
14
|
+
const states = [];
|
|
15
|
+
for (const statePart of stateParts) {
|
|
16
|
+
if (!statePart) {
|
|
17
|
+
return "State name cannot be empty";
|
|
18
|
+
}
|
|
19
|
+
if (!isValidName(statePart)) {
|
|
20
|
+
return `Invalid state name: ${statePart}`;
|
|
21
|
+
}
|
|
22
|
+
states.push(statePart);
|
|
23
|
+
}
|
|
24
|
+
// Split main part by '-' to get segments
|
|
25
|
+
const segments = mainPart.split('-').filter(segment => segment.length > 0);
|
|
26
|
+
if (segments.length === 0) {
|
|
27
|
+
return "CSS property name is required";
|
|
28
|
+
}
|
|
29
|
+
// The first segment is always the CSS property name (camelCase, no dashes)
|
|
30
|
+
const property = segments[0];
|
|
31
|
+
// Validate CSS property name (camelCase)
|
|
32
|
+
if (!isValidPropertyName(property)) {
|
|
33
|
+
return `Invalid CSS property name: ${property}`;
|
|
34
|
+
}
|
|
35
|
+
const result = {
|
|
36
|
+
property,
|
|
37
|
+
states: states.length > 0 ? states : undefined
|
|
38
|
+
};
|
|
39
|
+
let segmentIndex = 1;
|
|
40
|
+
const screenSizes = [];
|
|
41
|
+
// Process remaining segments
|
|
42
|
+
while (segmentIndex < segments.length) {
|
|
43
|
+
const segment = segments[segmentIndex];
|
|
44
|
+
// Check if it's a screen size
|
|
45
|
+
if (isMediaBreakpoint(segment)) {
|
|
46
|
+
screenSizes.push(segment);
|
|
47
|
+
segmentIndex++;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
// Check if it's a component name (starts with uppercase)
|
|
51
|
+
if (isComponentName(segment)) {
|
|
52
|
+
if (!parseComponent) {
|
|
53
|
+
return `Component names are not allowed when parseComponent is false: ${segment}`;
|
|
54
|
+
}
|
|
55
|
+
if (result.component) {
|
|
56
|
+
return "Multiple component names found";
|
|
57
|
+
}
|
|
58
|
+
result.component = segment;
|
|
59
|
+
segmentIndex++;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
// Check if it's a part name (starts with lowercase)
|
|
63
|
+
if (isValidPartName(segment)) {
|
|
64
|
+
if (result.part) {
|
|
65
|
+
return "Multiple part names found";
|
|
66
|
+
}
|
|
67
|
+
result.part = segment;
|
|
68
|
+
segmentIndex++;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
// If we reach here, the segment is invalid
|
|
72
|
+
return `Invalid segment: ${segment}`;
|
|
73
|
+
}
|
|
74
|
+
// Set screen sizes if any were found
|
|
75
|
+
if (screenSizes.length > 0) {
|
|
76
|
+
result.screenSizes = screenSizes;
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
function isValidPropertyName(name) {
|
|
81
|
+
// CSS property names in camelCase - start with lowercase letter, can contain letters and numbers
|
|
82
|
+
return /^[a-z][a-zA-Z0-9]*$/.test(name);
|
|
83
|
+
}
|
|
84
|
+
function isValidName(name) {
|
|
85
|
+
// Names start with a letter and can contain letters, numbers, or underscores
|
|
86
|
+
return /^[a-zA-Z][a-zA-Z0-9_]*$/.test(name);
|
|
87
|
+
}
|
|
88
|
+
function isValidPartName(name) {
|
|
89
|
+
// Part names start with lowercase letter and can contain letters, numbers, or underscores
|
|
90
|
+
return /^[a-z][a-zA-Z0-9_]*$/.test(name);
|
|
91
|
+
}
|
|
92
|
+
function isComponentName(name) {
|
|
93
|
+
// Component names start with uppercase letter
|
|
94
|
+
return /^[A-Z][a-zA-Z0-9_]*$/.test(name);
|
|
95
|
+
}
|
|
96
|
+
function isMediaBreakpoint(value) {
|
|
97
|
+
return AppContextDefs_1.MediaBreakpointKeys.includes(value);
|
|
98
|
+
}
|
|
@@ -145,7 +145,7 @@ exports.RootThemeDefinition = {
|
|
|
145
145
|
"outlineStyle--focus": "solid",
|
|
146
146
|
"outlineOffset--focus": "0",
|
|
147
147
|
// --- The app's default font family
|
|
148
|
-
|
|
148
|
+
fontFamily: "$fontFamily-sans-serif",
|
|
149
149
|
// --- Various font sizes (relative to the current context)
|
|
150
150
|
"fontSize-tiny": "0.625rem",
|
|
151
151
|
"fontSize-xs": "0.75rem",
|
|
@@ -162,23 +162,16 @@ exports.RootThemeDefinition = {
|
|
|
162
162
|
"fontSize-7xl": "4.5rem",
|
|
163
163
|
"fontSize-8xl": "6rem",
|
|
164
164
|
"fontSize-9xl": "8rem",
|
|
165
|
-
// --- Various line height values
|
|
166
|
-
"lineHeight-tiny": "calc(0.85 / 0.625)", // 1.36
|
|
167
|
-
"lineHeight-xs": "calc(1 / 0.75)", // 1.33
|
|
168
|
-
"lineHeight-sm": "calc(1.25 / 0.875)", // 1.43
|
|
169
|
-
"lineHeight-base": "calc(1.5 / 1)", // 1.5
|
|
170
|
-
"lineHeight-lg": "calc(1.75 / 1.125)", // 1.56
|
|
171
|
-
"lineHeight-xl": "calc(1.75 / 1.25)", // 1.4
|
|
172
|
-
"lineHeight-2xl": "calc(2 / 1.5)", // 1.33
|
|
173
|
-
"lineHeight-3xl": "calc(2.25 / 1.875)", // 1.2
|
|
174
|
-
"lineHeight-4xl": "calc(2.5 / 2.25)", // 1.11
|
|
175
|
-
"lineHeight-5xl": "1",
|
|
176
|
-
"lineHeight-6xl": "1",
|
|
177
|
-
"lineHeight-7xl": "1",
|
|
178
|
-
"lineHeight-8xl": "1",
|
|
179
|
-
"lineHeight-9xl": "1",
|
|
180
165
|
// --- The default font size
|
|
181
|
-
|
|
166
|
+
fontSize: "$fontSize-base",
|
|
167
|
+
// --- Various line height values
|
|
168
|
+
// --- Default line height values (relative to the base unit, "space-base")
|
|
169
|
+
"lineHeight-none": "1",
|
|
170
|
+
"lineHeight-tight": "1.25",
|
|
171
|
+
"lineHeight-snug": "1.375",
|
|
172
|
+
"lineHeight-normal": "1.5",
|
|
173
|
+
"lineHeight-relaxed": "1.625",
|
|
174
|
+
"lineHeight-loose": "2",
|
|
182
175
|
// --- Predefined gap sizes
|
|
183
176
|
"gap-none": "$space-0",
|
|
184
177
|
"gap-tight": "$space-2",
|
|
@@ -195,7 +188,7 @@ exports.RootThemeDefinition = {
|
|
|
195
188
|
"space-normal": "$space-4",
|
|
196
189
|
"space-loose": "$space-8",
|
|
197
190
|
// --- Font used for body
|
|
198
|
-
|
|
191
|
+
fontWeight: "$fontWeight-normal",
|
|
199
192
|
// --- Various default values (review them)
|
|
200
193
|
"borderColor-dropdown-item": "$borderColor",
|
|
201
194
|
// --- Various predefined shadow values
|
|
@@ -209,14 +202,14 @@ exports.RootThemeDefinition = {
|
|
|
209
202
|
// --- The default maximum content width
|
|
210
203
|
"maxWidth-content": "1320px",
|
|
211
204
|
// --- Background colors
|
|
212
|
-
|
|
205
|
+
backgroundColor: "$color-surface-subtle",
|
|
213
206
|
"backgroundColor-overlay": "rgba(0, 0, 0, 0.2)",
|
|
214
207
|
"backgroundColor-dropdown-item--hover": $colorSurface50,
|
|
215
208
|
"backgroundColor-dropdown-item--active": $colorSurface100,
|
|
216
209
|
"backgroundColor-dropdown-item--active-hover": $colorSurface50,
|
|
217
210
|
"backgroundColor-tree-row--selected--before": $colorPrimary50,
|
|
218
211
|
// --- Border colors
|
|
219
|
-
|
|
212
|
+
borderColor: "rgb(from $color-surface-900 r g b / 0.1)",
|
|
220
213
|
"borderColor--disabled": $colorSurface100,
|
|
221
214
|
// --- Text colors
|
|
222
215
|
"textColor-secondary": $colorSurface600,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolidThemeDefinition = void 0;
|
|
4
|
+
exports.SolidThemeDefinition = {
|
|
5
|
+
id: "solid",
|
|
6
|
+
themeVars: {
|
|
7
|
+
"color-primary": "#2a69bb",
|
|
8
|
+
"color-secondary": "#98a9bc",
|
|
9
|
+
"color-surface": "hsl(0,0%,49%)",
|
|
10
|
+
"color-success": "#45a249",
|
|
11
|
+
"maxWidth-content": "100%",
|
|
12
|
+
borderRadius: "0",
|
|
13
|
+
"fontSize": "$fontSize-base",
|
|
14
|
+
"size-Icon": "1rem",
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Audio utility functions
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BeepPatterns = void 0;
|
|
7
|
+
exports.beep = beep;
|
|
8
|
+
exports.beepSequence = beepSequence;
|
|
9
|
+
/**
|
|
10
|
+
* Generates a beep sound using the Web Audio API
|
|
11
|
+
* @param frequency - The frequency of the beep in Hz (default: 800)
|
|
12
|
+
* @param durationInMs - The duration of the beep in milliseconds (default: 200)
|
|
13
|
+
*/
|
|
14
|
+
function beep(frequency = 800, durationInMs = 200) {
|
|
15
|
+
// Check if Web Audio API is supported
|
|
16
|
+
if (typeof window === 'undefined' || !window.AudioContext && !window.webkitAudioContext) {
|
|
17
|
+
console.warn('Web Audio API is not supported in this environment');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
// Create audio context (handle both standard and webkit prefixed versions)
|
|
22
|
+
const AudioContextClass = window.AudioContext || window.webkitAudioContext;
|
|
23
|
+
const audioContext = new AudioContextClass();
|
|
24
|
+
// Create oscillator for the tone
|
|
25
|
+
const oscillator = audioContext.createOscillator();
|
|
26
|
+
const gainNode = audioContext.createGain();
|
|
27
|
+
// Connect nodes: oscillator -> gain -> destination
|
|
28
|
+
oscillator.connect(gainNode);
|
|
29
|
+
gainNode.connect(audioContext.destination);
|
|
30
|
+
// Configure oscillator
|
|
31
|
+
oscillator.frequency.setValueAtTime(frequency, audioContext.currentTime);
|
|
32
|
+
oscillator.type = 'sine'; // Use sine wave for a clean tone
|
|
33
|
+
// Configure gain (volume) with fade in/out to avoid clicking
|
|
34
|
+
const currentTime = audioContext.currentTime;
|
|
35
|
+
const endTime = currentTime + durationInMs / 1000;
|
|
36
|
+
const fadeTime = Math.min(0.01, durationInMs / 1000 / 4); // Fade time is 1/4 of duration or 10ms, whichever is smaller
|
|
37
|
+
gainNode.gain.setValueAtTime(0, currentTime);
|
|
38
|
+
gainNode.gain.linearRampToValueAtTime(0.3, currentTime + fadeTime); // Fade in
|
|
39
|
+
gainNode.gain.setValueAtTime(0.3, endTime - fadeTime);
|
|
40
|
+
gainNode.gain.linearRampToValueAtTime(0, endTime); // Fade out
|
|
41
|
+
// Start and stop the oscillator
|
|
42
|
+
oscillator.start(currentTime);
|
|
43
|
+
oscillator.stop(endTime);
|
|
44
|
+
// Clean up after the beep is done
|
|
45
|
+
oscillator.addEventListener('ended', () => {
|
|
46
|
+
oscillator.disconnect();
|
|
47
|
+
gainNode.disconnect();
|
|
48
|
+
audioContext.close();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.warn('Failed to generate beep:', error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Generates a sequence of beeps
|
|
57
|
+
* @param count - Number of beeps
|
|
58
|
+
* @param frequency - The frequency of each beep in Hz (default: 800)
|
|
59
|
+
* @param durationInMs - The duration of each beep in milliseconds (default: 200)
|
|
60
|
+
* @param intervalInMs - The interval between beeps in milliseconds (default: 300)
|
|
61
|
+
*/
|
|
62
|
+
function beepSequence(count, frequency = 800, durationInMs = 200, intervalInMs = 300) {
|
|
63
|
+
for (let i = 0; i < count; i++) {
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
beep(frequency, durationInMs);
|
|
66
|
+
}, i * intervalInMs);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Predefined beep patterns for common use cases
|
|
71
|
+
*/
|
|
72
|
+
exports.BeepPatterns = {
|
|
73
|
+
/** Short, high-pitched beep for success */
|
|
74
|
+
success: () => beep(1000, 150),
|
|
75
|
+
/** Lower frequency beep for errors */
|
|
76
|
+
error: () => beep(400, 300),
|
|
77
|
+
/** Quick beep for notifications */
|
|
78
|
+
notification: () => beep(800, 100),
|
|
79
|
+
/** Double beep for warnings */
|
|
80
|
+
warning: () => beepSequence(2, 600, 150, 200),
|
|
81
|
+
/** Triple beep for alerts */
|
|
82
|
+
alert: () => beepSequence(3, 900, 100, 150),
|
|
83
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const react_1 = __importDefault(require("react"));
|
|
40
|
+
const jsx_runtime_1 = __importDefault(require("react/jsx-runtime"));
|
|
41
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
42
|
+
const StandaloneApp_1 = require("./components-core/StandaloneApp");
|
|
43
|
+
const StandaloneExtensionManager_1 = __importDefault(require("./components-core/StandaloneExtensionManager"));
|
|
44
|
+
const xmluiExports = __importStar(require("./index"));
|
|
45
|
+
const Xmlui = new StandaloneExtensionManager_1.default();
|
|
46
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
47
|
+
if (!document.getElementById("root")) {
|
|
48
|
+
// Your existing code unmodified...
|
|
49
|
+
const div = document.createElement('div');
|
|
50
|
+
div.id = 'root';
|
|
51
|
+
document.getElementsByTagName('body')[0].appendChild(div);
|
|
52
|
+
}
|
|
53
|
+
(0, StandaloneApp_1.startApp)(undefined, undefined, Xmlui);
|
|
54
|
+
});
|
|
55
|
+
window.React = react_1.default;
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
window.jsxRuntime = jsx_runtime_1.default;
|
|
58
|
+
window.ReactDOM = react_dom_1.default;
|
|
59
|
+
// Export everything from index.ts plus the standalone extension manager
|
|
60
|
+
const standaloneExports = Object.assign(Object.assign({}, xmluiExports), { standalone: Xmlui });
|
|
61
|
+
exports.default = standaloneExports;
|
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.StandaloneComponent = exports.useEvent = exports.StyleRegistry = exports.StyleProvider = exports.useAppLayoutContext = exports.useSearchContextContent = exports.Breakout = exports.Logo = exports.ToneChangerButton = exports.LinkNative = exports.VisuallyHidden = exports.NestedApp = exports.TextBox = exports.Text = exports.XmlUiHelper = exports.builtInThemes = exports.useThemes = exports.Spinner = exports.ApiInterceptorProvider = exports.xmlUiMarkupToComponent = exports.errReportComponent = exports.useLogger = exports.useDevTools = exports.toCssVar = exports.useColors = exports.Tabs = exports.TabItem = exports.getColor = exports.Splitter = exports.Button = exports.Stack = exports.Icon = exports.ErrorBoundary = exports.AppRoot = exports.useTheme = exports.startApp = exports.parseScssVar = exports.dComponent = exports.d = exports.createMetadata = exports.createComponentRenderer = exports.StandaloneExtensionManager = exports.StandaloneApp = void 0;
|
|
39
|
+
exports.StandaloneComponent = exports.useEvent = exports.StyleRegistry = exports.StyleProvider = exports.useAppLayoutContext = exports.useSearchContextContent = exports.Breakout = exports.Logo = exports.ToneChangerButton = exports.LinkNative = exports.VisuallyHidden = exports.NestedApp = exports.TextBox = exports.Text = exports.XmlUiHelper = exports.builtInThemes = exports.useThemes = exports.Spinner = exports.ApiInterceptorProvider = exports.xmlUiMarkupToComponent = exports.errReportComponent = exports.useLogger = exports.useDevTools = exports.toCssVar = exports.useColors = exports.Tabs = exports.TabItem = exports.getColor = exports.Splitter = exports.Button = exports.Stack = exports.Icon = exports.ErrorBoundary = exports.AppRoot = exports.useTheme = exports.startApp = exports.parseScssVar = exports.dComponent = exports.d = exports.createMetadata = exports.createUserDefinedComponentRenderer = exports.createComponentRenderer = exports.StandaloneExtensionManager = exports.StandaloneApp = void 0;
|
|
40
40
|
const StandaloneApp_1 = __importStar(require("./components-core/StandaloneApp"));
|
|
41
41
|
exports.StandaloneApp = StandaloneApp_1.default;
|
|
42
42
|
Object.defineProperty(exports, "startApp", { enumerable: true, get: function () { return StandaloneApp_1.startApp; } });
|
|
@@ -44,6 +44,7 @@ const AppRoot_1 = require("./components-core/rendering/AppRoot");
|
|
|
44
44
|
Object.defineProperty(exports, "AppRoot", { enumerable: true, get: function () { return AppRoot_1.AppRoot; } });
|
|
45
45
|
const renderers_1 = require("./components-core/renderers");
|
|
46
46
|
Object.defineProperty(exports, "createComponentRenderer", { enumerable: true, get: function () { return renderers_1.createComponentRenderer; } });
|
|
47
|
+
Object.defineProperty(exports, "createUserDefinedComponentRenderer", { enumerable: true, get: function () { return renderers_1.createUserDefinedComponentRenderer; } });
|
|
47
48
|
const IconNative_1 = require("./components/Icon/IconNative");
|
|
48
49
|
Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return IconNative_1.Icon; } });
|
|
49
50
|
const ErrorBoundary_1 = require("./components-core/rendering/ErrorBoundary");
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.start = start;
|
|
16
|
+
const vscode_languageserver_1 = require("vscode-languageserver");
|
|
17
|
+
const vscode_languageserver_textdocument_1 = require("vscode-languageserver-textdocument");
|
|
18
|
+
const xmlui_metadata_generated_mjs_1 = __importDefault(require("./xmlui-metadata-generated.mjs"));
|
|
19
|
+
const completion_1 = require("./services/completion");
|
|
20
|
+
const hover_1 = require("./services/hover");
|
|
21
|
+
const format_1 = require("./services/format");
|
|
22
|
+
const parser_1 = require("../parsers/xmlui-parser/parser");
|
|
23
|
+
const metadata_utils_1 = require("./services/common/metadata-utils");
|
|
24
|
+
const diagnostic_1 = require("./services/diagnostic");
|
|
25
|
+
const metaByComp = xmlui_metadata_generated_mjs_1.default;
|
|
26
|
+
const metadataProvider = new metadata_utils_1.MetadataProvider(metaByComp);
|
|
27
|
+
function start(connection) {
|
|
28
|
+
// Also include all preview / proposed LSP features.
|
|
29
|
+
// Create a simple text document manager.
|
|
30
|
+
const documents = new vscode_languageserver_1.TextDocuments(vscode_languageserver_textdocument_1.TextDocument);
|
|
31
|
+
let hasConfigurationCapability = false;
|
|
32
|
+
let hasWorkspaceFolderCapability = false;
|
|
33
|
+
let hasDiagnosticRelatedInformationCapability = false;
|
|
34
|
+
connection.onInitialize((params) => {
|
|
35
|
+
connection.console.log("initing!");
|
|
36
|
+
const capabilities = params.capabilities;
|
|
37
|
+
// Does the client support the `workspace/configuration` request?
|
|
38
|
+
// If not, we fall back using global settings.
|
|
39
|
+
hasConfigurationCapability = !!(capabilities.workspace && !!capabilities.workspace.configuration);
|
|
40
|
+
hasWorkspaceFolderCapability = !!(capabilities.workspace && !!capabilities.workspace.workspaceFolders);
|
|
41
|
+
hasDiagnosticRelatedInformationCapability = !!(capabilities.textDocument &&
|
|
42
|
+
capabilities.textDocument.publishDiagnostics &&
|
|
43
|
+
capabilities.textDocument.publishDiagnostics.relatedInformation);
|
|
44
|
+
const result = {
|
|
45
|
+
capabilities: {
|
|
46
|
+
textDocumentSync: vscode_languageserver_1.TextDocumentSyncKind.Incremental,
|
|
47
|
+
completionProvider: {
|
|
48
|
+
resolveProvider: true,
|
|
49
|
+
triggerCharacters: ["<", "/"],
|
|
50
|
+
},
|
|
51
|
+
hoverProvider: true,
|
|
52
|
+
documentFormattingProvider: true,
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
if (hasWorkspaceFolderCapability) {
|
|
56
|
+
result.capabilities.workspace = {
|
|
57
|
+
workspaceFolders: {
|
|
58
|
+
supported: true
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
});
|
|
64
|
+
connection.onInitialized(() => {
|
|
65
|
+
if (hasConfigurationCapability) {
|
|
66
|
+
// Register for all configuration changes.
|
|
67
|
+
connection.client.register(vscode_languageserver_1.DidChangeConfigurationNotification.type, undefined);
|
|
68
|
+
}
|
|
69
|
+
if (hasWorkspaceFolderCapability) {
|
|
70
|
+
connection.workspace.onDidChangeWorkspaceFolders(_event => {
|
|
71
|
+
connection.console.log('Workspace folder change event received.');
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
connection.onCompletion((_a) => __awaiter(this, [_a], void 0, function* ({ position, textDocument }) {
|
|
76
|
+
const document = documents.get(textDocument.uri);
|
|
77
|
+
if (!document) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const parseResult = parseDocument(document);
|
|
81
|
+
return (0, completion_1.handleCompletion)({ parseResult: parseResult.parseResult, getText: parseResult.getText, metaByComp: metadataProvider }, document.offsetAt(position));
|
|
82
|
+
}));
|
|
83
|
+
connection.onCompletionResolve((completionItem) => {
|
|
84
|
+
return (0, completion_1.handleCompletionResolve)({ metaByComp: metadataProvider, item: completionItem });
|
|
85
|
+
});
|
|
86
|
+
connection.onHover(({ position, textDocument }) => {
|
|
87
|
+
const document = documents.get(textDocument.uri);
|
|
88
|
+
if (!document) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const { parseResult, getText } = parseDocument(document);
|
|
92
|
+
const ctx = {
|
|
93
|
+
node: parseResult.node,
|
|
94
|
+
getText,
|
|
95
|
+
metaByComp: metadataProvider,
|
|
96
|
+
offsetToPosition: (offset) => document.positionAt(offset)
|
|
97
|
+
};
|
|
98
|
+
return (0, hover_1.handleHover)(ctx, document.offsetAt(position));
|
|
99
|
+
});
|
|
100
|
+
connection.onDocumentFormatting(({ textDocument, options }) => {
|
|
101
|
+
const document = documents.get(textDocument.uri);
|
|
102
|
+
if (!document) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const { parseResult: { node }, getText } = parseDocument(document);
|
|
106
|
+
return (0, format_1.handleDocumentFormatting)({ node, getText, options, offsetToPosition: (offset) => document.positionAt(offset) });
|
|
107
|
+
});
|
|
108
|
+
const parsedDocuments = new Map();
|
|
109
|
+
function parseDocument(document) {
|
|
110
|
+
const parseForDoc = parsedDocuments.get(document.uri);
|
|
111
|
+
if (parseForDoc !== undefined) {
|
|
112
|
+
if (parseForDoc.version === document.version) {
|
|
113
|
+
return {
|
|
114
|
+
parseResult: parseForDoc.parseResult,
|
|
115
|
+
getText: parseForDoc.getText,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const parser = (0, parser_1.createXmlUiParser)(document.getText());
|
|
120
|
+
const parseResult = parser.parse();
|
|
121
|
+
parsedDocuments.set(document.uri, {
|
|
122
|
+
parseResult,
|
|
123
|
+
version: document.version,
|
|
124
|
+
getText: parser.getText,
|
|
125
|
+
});
|
|
126
|
+
return { parseResult, getText: parser.getText };
|
|
127
|
+
}
|
|
128
|
+
documents.onDidClose(({ document }) => {
|
|
129
|
+
parsedDocuments.delete(document.uri);
|
|
130
|
+
});
|
|
131
|
+
documents.onDidChangeContent(handleDocunentContentChange);
|
|
132
|
+
function handleDocunentContentChange({ document }) {
|
|
133
|
+
const { parseResult } = parseDocument(document);
|
|
134
|
+
const ctx = {
|
|
135
|
+
parseResult,
|
|
136
|
+
offsetToPos: (offset) => document.positionAt(offset),
|
|
137
|
+
};
|
|
138
|
+
const diagnostics = (0, diagnostic_1.getDiagnostics)(ctx);
|
|
139
|
+
connection.sendDiagnostics({
|
|
140
|
+
version: document.version,
|
|
141
|
+
uri: document.uri,
|
|
142
|
+
diagnostics
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// Make the text document manager listen on the connection
|
|
146
|
+
// for open, change and close text document events
|
|
147
|
+
documents.listen(connection);
|
|
148
|
+
// Listen on the connection
|
|
149
|
+
console.log("starting to listen");
|
|
150
|
+
connection.listen();
|
|
151
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const browser_1 = require("vscode-languageserver/browser");
|
|
37
|
+
const serverCommon = __importStar(require("./server-common"));
|
|
38
|
+
/// <reference lib="WebWorker" />
|
|
39
|
+
// declare const self: DedicatedWorkerGlobalScope;
|
|
40
|
+
const messageReader = new browser_1.BrowserMessageReader(self);
|
|
41
|
+
messageReader.listen((message) => {
|
|
42
|
+
console.log('Received message from main thread:', message);
|
|
43
|
+
});
|
|
44
|
+
const messageWriter = new browser_1.BrowserMessageWriter(self);
|
|
45
|
+
const connection = (0, browser_1.createConnection)(messageReader, messageWriter);
|
|
46
|
+
console.log("starting lang server");
|
|
47
|
+
serverCommon.start(connection);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.start = start;
|
|
37
|
+
const node_1 = require("vscode-languageserver/node");
|
|
38
|
+
const serverCommon = __importStar(require("./server-common"));
|
|
39
|
+
function start() {
|
|
40
|
+
const connection = (0, node_1.createConnection)(node_1.ProposedFeatures.all);
|
|
41
|
+
serverCommon.start(connection);
|
|
42
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateCompNameDescription = generateCompNameDescription;
|
|
4
|
+
exports.generateAttrDescription = generateAttrDescription;
|
|
5
|
+
function generateCompNameDescription(componentName, metadata) {
|
|
6
|
+
const sections = [];
|
|
7
|
+
// Add title and description
|
|
8
|
+
sections.push(`# ${componentName}`);
|
|
9
|
+
if (metadata.description) {
|
|
10
|
+
sections.push(metadata.description);
|
|
11
|
+
}
|
|
12
|
+
// Add status if not stable
|
|
13
|
+
if (metadata.status && metadata.status !== 'stable') {
|
|
14
|
+
sections.push(`**Status:** ${metadata.status}`);
|
|
15
|
+
}
|
|
16
|
+
// Add Properties section if there are props
|
|
17
|
+
if (metadata.props && Object.keys(metadata.props).length > 0) {
|
|
18
|
+
sections.push('\n## Properties');
|
|
19
|
+
Object.entries(metadata.props)
|
|
20
|
+
.filter(([_, prop]) => !prop.isInternal)
|
|
21
|
+
.forEach(([propName, prop]) => {
|
|
22
|
+
sections.push(generateAttrDescription(propName, prop));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// Add Events section if there are events
|
|
26
|
+
if (metadata.events && Object.keys(metadata.events).length > 0) {
|
|
27
|
+
sections.push('\n## Events');
|
|
28
|
+
Object.entries(metadata.events)
|
|
29
|
+
.filter(([_, event]) => !event.isInternal)
|
|
30
|
+
.forEach(([eventName, event]) => {
|
|
31
|
+
sections.push(`### \`${eventName}\`\n${event.description}`);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
// Add APIs section if there are APIs
|
|
35
|
+
if (metadata.apis && Object.keys(metadata.apis).length > 0) {
|
|
36
|
+
sections.push('\n## APIs');
|
|
37
|
+
Object.entries(metadata.apis)
|
|
38
|
+
.filter(([_, api]) => !api.isInternal)
|
|
39
|
+
.forEach(([apiName, api]) => {
|
|
40
|
+
sections.push(`### \`${apiName}\`\n${api.description}`);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// Add Context Variables section if there are any
|
|
44
|
+
if (metadata.contextVars && Object.keys(metadata.contextVars).length > 0) {
|
|
45
|
+
sections.push('\n## Context Variables');
|
|
46
|
+
Object.entries(metadata.contextVars)
|
|
47
|
+
.filter(([_, contextVar]) => !contextVar.isInternal)
|
|
48
|
+
.forEach(([varName, contextVar]) => {
|
|
49
|
+
sections.push(`### \`${varName}\`\n${contextVar.description}`);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return sections.join('\n\n');
|
|
53
|
+
}
|
|
54
|
+
function generateAttrDescription(attrName, attrMd) {
|
|
55
|
+
let propText = `\`${attrName}\``;
|
|
56
|
+
if (attrMd.isRequired) {
|
|
57
|
+
propText += " (required)";
|
|
58
|
+
}
|
|
59
|
+
propText += ": ";
|
|
60
|
+
if (attrMd.description) {
|
|
61
|
+
propText += attrMd.description;
|
|
62
|
+
}
|
|
63
|
+
if (attrMd.defaultValue !== undefined) {
|
|
64
|
+
propText += `\n\nDefault: \`${attrMd.defaultValue}\``;
|
|
65
|
+
}
|
|
66
|
+
if (attrMd.availableValues && attrMd.availableValues.length > 0) {
|
|
67
|
+
const values = attrMd.availableValues.map(v => typeof v === 'object' ?
|
|
68
|
+
`- \`${v.value}\`: ${v.description}` :
|
|
69
|
+
`- \`${v}\``).join('\n');
|
|
70
|
+
propText += `\n\n**Allowed values**:\n${values}`;
|
|
71
|
+
}
|
|
72
|
+
return propText;
|
|
73
|
+
}
|