@gooddata/sdk-ui-metric-component 0.0.0-stage → 11.65.0-alpha.4
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/LICENSE +29 -0
- package/NOTICE +71721 -0
- package/README.md +13 -2
- package/esm/MaqlEditor/components/ExpandableTooltip.d.ts +50 -0
- package/esm/MaqlEditor/components/ExpandableTooltip.d.ts.map +1 -0
- package/esm/MaqlEditor/components/ExpandableTooltip.js +150 -0
- package/esm/MaqlEditor/components/ExpandableTooltipContext.d.ts +10 -0
- package/esm/MaqlEditor/components/ExpandableTooltipContext.d.ts.map +1 -0
- package/esm/MaqlEditor/components/ExpandableTooltipContext.js +17 -0
- package/esm/MaqlEditor/components/hooks/useExpandableTooltip.d.ts +3 -0
- package/esm/MaqlEditor/components/hooks/useExpandableTooltip.d.ts.map +1 -0
- package/esm/MaqlEditor/components/hooks/useExpandableTooltip.js +10 -0
- package/esm/MaqlEditor/components/hooks/useOutsideEvents.d.ts +10 -0
- package/esm/MaqlEditor/components/hooks/useOutsideEvents.d.ts.map +1 -0
- package/esm/MaqlEditor/components/hooks/useOutsideEvents.js +43 -0
- package/esm/MaqlEditor/components/hooks/useRePosition.d.ts +20 -0
- package/esm/MaqlEditor/components/hooks/useRePosition.d.ts.map +1 -0
- package/esm/MaqlEditor/components/hooks/useRePosition.js +108 -0
- package/esm/MaqlEditor/components/hooks/utils.d.ts +4 -0
- package/esm/MaqlEditor/components/hooks/utils.d.ts.map +1 -0
- package/esm/MaqlEditor/components/hooks/utils.js +18 -0
- package/esm/MaqlEditor/hooks/useAutoformat.d.ts +3 -0
- package/esm/MaqlEditor/hooks/useAutoformat.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useAutoformat.js +15 -0
- package/esm/MaqlEditor/hooks/useCleanCallback.d.ts +4 -0
- package/esm/MaqlEditor/hooks/useCleanCallback.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useCleanCallback.js +12 -0
- package/esm/MaqlEditor/hooks/useCodeTheme.d.ts +3 -0
- package/esm/MaqlEditor/hooks/useCodeTheme.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useCodeTheme.js +48 -0
- package/esm/MaqlEditor/hooks/useCopyToClipboard.d.ts +3 -0
- package/esm/MaqlEditor/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useCopyToClipboard.js +16 -0
- package/esm/MaqlEditor/hooks/useMountCallback.d.ts +13 -0
- package/esm/MaqlEditor/hooks/useMountCallback.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useMountCallback.js +26 -0
- package/esm/MaqlEditor/hooks/useUpdateCallback.d.ts +19 -0
- package/esm/MaqlEditor/hooks/useUpdateCallback.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useUpdateCallback.js +63 -0
- package/esm/MaqlEditor/hooks/useValueCallbacks.d.ts +6 -0
- package/esm/MaqlEditor/hooks/useValueCallbacks.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useValueCallbacks.js +14 -0
- package/esm/MaqlEditor/languageService/LanguageServiceContext.d.ts +13 -0
- package/esm/MaqlEditor/languageService/LanguageServiceContext.d.ts.map +1 -0
- package/esm/MaqlEditor/languageService/LanguageServiceContext.js +20 -0
- package/esm/MaqlEditor/maql/MaqlEditor.d.ts +30 -0
- package/esm/MaqlEditor/maql/MaqlEditor.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/MaqlEditor.js +42 -0
- package/esm/MaqlEditor/maql/MaqlEditor.styles.d.ts +8 -0
- package/esm/MaqlEditor/maql/MaqlEditor.styles.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/MaqlEditor.styles.js +154 -0
- package/esm/MaqlEditor/maql/MaqlEditor.tooltip.d.ts +36 -0
- package/esm/MaqlEditor/maql/MaqlEditor.tooltip.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/MaqlEditor.tooltip.js +187 -0
- package/esm/MaqlEditor/maql/constants.d.ts +2 -0
- package/esm/MaqlEditor/maql/constants.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/constants.js +2 -0
- package/esm/MaqlEditor/maql/formatter.d.ts +6 -0
- package/esm/MaqlEditor/maql/formatter.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/formatter.js +14 -0
- package/esm/MaqlEditor/maql/hooks/hover/doHover.d.ts +12 -0
- package/esm/MaqlEditor/maql/hooks/hover/doHover.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/hover/doHover.js +126 -0
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.js +32 -0
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.js +60 -0
- package/esm/MaqlEditor/maql/hooks/useDecoration.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useDecoration.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useDecoration.js +73 -0
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.d.ts +3 -0
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.js +29 -0
- package/esm/MaqlEditor/maql/hooks/useHover.d.ts +6 -0
- package/esm/MaqlEditor/maql/hooks/useHover.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useHover.js +77 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.js +21 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageService.d.ts +3 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageService.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageService.js +21 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageServiceInitializer.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageServiceInitializer.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageServiceInitializer.js +11 -0
- package/esm/MaqlEditor/maql/hooks/useMonaco.d.ts +21 -0
- package/esm/MaqlEditor/maql/hooks/useMonaco.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useMonaco.js +75 -0
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.js +33 -0
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.d.ts +2 -0
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.js +28 -0
- package/esm/MaqlEditor/maql/hooks/useValidation.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useValidation.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useValidation.js +56 -0
- package/esm/MaqlEditor/maql/utils.d.ts +4 -0
- package/esm/MaqlEditor/maql/utils.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/utils.js +6 -0
- package/esm/MaqlEditor/mock/monaco-shim.d.ts +2 -0
- package/esm/MaqlEditor/mock/monaco-shim.d.ts.map +1 -0
- package/esm/MaqlEditor/mock/monaco-shim.js +36 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.d.ts +49 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.js +71 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.d.ts +47 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.js +427 -0
- package/esm/MaqlEditor/monaco/hooks/useAutofocus.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useAutofocus.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useAutofocus.js +33 -0
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.js +14 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.js +84 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.js +51 -0
- package/esm/MaqlEditor/monaco/hooks/useMonaco.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useMonaco.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useMonaco.js +24 -0
- package/esm/MaqlEditor/monaco/monacoContributions.d.ts +74 -0
- package/esm/MaqlEditor/monaco/monacoContributions.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/monacoContributions.js +88 -0
- package/esm/MaqlEditor/monaco/monacoWorkers.d.ts +12 -0
- package/esm/MaqlEditor/monaco/monacoWorkers.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/monacoWorkers.js +63 -0
- package/esm/MaqlEditor/sql/SqlEditor.d.ts +21 -0
- package/esm/MaqlEditor/sql/SqlEditor.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/SqlEditor.js +45 -0
- package/esm/MaqlEditor/sql/SqlEditor.styles.d.ts +3 -0
- package/esm/MaqlEditor/sql/SqlEditor.styles.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/SqlEditor.styles.js +3 -0
- package/esm/MaqlEditor/sql/constants.d.ts +2 -0
- package/esm/MaqlEditor/sql/constants.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/constants.js +2 -0
- package/esm/MaqlEditor/sql/formatter.d.ts +6 -0
- package/esm/MaqlEditor/sql/formatter.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/formatter.js +17 -0
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.d.ts +2 -0
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.js +26 -0
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.d.ts +4 -0
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.js +29 -0
- package/esm/MaqlEditor/sql/hooks/useMonaco.d.ts +14 -0
- package/esm/MaqlEditor/sql/hooks/useMonaco.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/hooks/useMonaco.js +26 -0
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.d.ts +2 -0
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.js +796 -0
- package/esm/MaqlEditor/sql/utils.d.ts +4 -0
- package/esm/MaqlEditor/sql/utils.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/utils.js +6 -0
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.d.ts +9 -0
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.d.ts.map +1 -0
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.js +38 -0
- package/esm/MaqlEditor/theme/default.d.ts +204 -0
- package/esm/MaqlEditor/theme/default.d.ts.map +1 -0
- package/esm/MaqlEditor/theme/default.js +223 -0
- package/esm/MaqlEditor/theme/styles.d.ts +411 -0
- package/esm/MaqlEditor/theme/styles.d.ts.map +1 -0
- package/esm/MaqlEditor/theme/styles.js +5 -0
- package/esm/MaqlEditor/theme/theme.d.ts +206 -0
- package/esm/MaqlEditor/theme/theme.d.ts.map +1 -0
- package/esm/MaqlEditor/theme/theme.js +9 -0
- package/esm/MetricComponent/ConflictContext/ConflictContext.d.ts +9 -0
- package/esm/MetricComponent/ConflictContext/ConflictContext.d.ts.map +1 -0
- package/esm/MetricComponent/ConflictContext/ConflictContext.js +9 -0
- package/esm/MetricComponent/ConflictContext/useConflictDetection.d.ts +8 -0
- package/esm/MetricComponent/ConflictContext/useConflictDetection.d.ts.map +1 -0
- package/esm/MetricComponent/ConflictContext/useConflictDetection.js +48 -0
- package/esm/MetricComponent/Content/EditMetricContent.d.ts +3 -0
- package/esm/MetricComponent/Content/EditMetricContent.d.ts.map +1 -0
- package/esm/MetricComponent/Content/EditMetricContent.data.d.ts +52 -0
- package/esm/MetricComponent/Content/EditMetricContent.data.d.ts.map +1 -0
- package/esm/MetricComponent/Content/EditMetricContent.data.js +12 -0
- package/esm/MetricComponent/Content/EditMetricContent.events.d.ts +9 -0
- package/esm/MetricComponent/Content/EditMetricContent.events.d.ts.map +1 -0
- package/esm/MetricComponent/Content/EditMetricContent.events.js +21 -0
- package/esm/MetricComponent/Content/EditMetricContent.js +27 -0
- package/esm/MetricComponent/DeleteMetric.d.ts +12 -0
- package/esm/MetricComponent/DeleteMetric.d.ts.map +1 -0
- package/esm/MetricComponent/DeleteMetric.events.d.ts +10 -0
- package/esm/MetricComponent/DeleteMetric.events.d.ts.map +1 -0
- package/esm/MetricComponent/DeleteMetric.events.js +24 -0
- package/esm/MetricComponent/DeleteMetric.js +8 -0
- package/esm/MetricComponent/DeleteMetricConfirmDialog/DeleteMetricConfirmDialog.d.ts +6 -0
- package/esm/MetricComponent/DeleteMetricConfirmDialog/DeleteMetricConfirmDialog.d.ts.map +1 -0
- package/esm/MetricComponent/DeleteMetricConfirmDialog/DeleteMetricConfirmDialog.js +19 -0
- package/esm/MetricComponent/EditMetric.d.ts +48 -0
- package/esm/MetricComponent/EditMetric.d.ts.map +1 -0
- package/esm/MetricComponent/EditMetric.events.d.ts +16 -0
- package/esm/MetricComponent/EditMetric.events.d.ts.map +1 -0
- package/esm/MetricComponent/EditMetric.events.js +55 -0
- package/esm/MetricComponent/EditMetric.js +30 -0
- package/esm/MetricComponent/FeaturesAndSettings/index.d.ts +18 -0
- package/esm/MetricComponent/FeaturesAndSettings/index.d.ts.map +1 -0
- package/esm/MetricComponent/FeaturesAndSettings/index.js +25 -0
- package/esm/MetricComponent/Form/CloseButton/CloseButton.d.ts +6 -0
- package/esm/MetricComponent/Form/CloseButton/CloseButton.d.ts.map +1 -0
- package/esm/MetricComponent/Form/CloseButton/CloseButton.js +14 -0
- package/esm/MetricComponent/Form/EditMetricCenterForm.d.ts +15 -0
- package/esm/MetricComponent/Form/EditMetricCenterForm.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditMetricCenterForm.js +157 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.d.ts +45 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.events.d.ts +13 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.events.js +32 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.js +106 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRow.d.ts +16 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRow.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRow.js +82 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRowError.d.ts +13 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRowError.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRowError.js +5 -0
- package/esm/MetricComponent/Form/EditableRow/InlineEditableValue.d.ts +27 -0
- package/esm/MetricComponent/Form/EditableRow/InlineEditableValue.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditableRow/InlineEditableValue.js +125 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.d.ts +9 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.events.d.ts +7 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.events.js +11 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.js +63 -0
- package/esm/MetricComponent/Form/Footer/EditMetricSaveMessage.d.ts +8 -0
- package/esm/MetricComponent/Form/Footer/EditMetricSaveMessage.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Footer/EditMetricSaveMessage.js +22 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.d.ts +28 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.events.d.ts +7 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.events.js +11 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.js +48 -0
- package/esm/MetricComponent/Form/Header/LockedBubble.d.ts +3 -0
- package/esm/MetricComponent/Form/Header/LockedBubble.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/LockedBubble.js +14 -0
- package/esm/MetricComponent/Form/Header/MetricDescriptionField.d.ts +10 -0
- package/esm/MetricComponent/Form/Header/MetricDescriptionField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricDescriptionField.js +24 -0
- package/esm/MetricComponent/Form/Header/MetricIdField.d.ts +9 -0
- package/esm/MetricComponent/Form/Header/MetricIdField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricIdField.js +80 -0
- package/esm/MetricComponent/Form/Header/MetricTagsField.d.ts +8 -0
- package/esm/MetricComponent/Form/Header/MetricTagsField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricTagsField.js +61 -0
- package/esm/MetricComponent/Form/Header/MetricTitleField.d.ts +8 -0
- package/esm/MetricComponent/Form/Header/MetricTitleField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricTitleField.js +40 -0
- package/esm/MetricComponent/Form/Header/MetricTypeField.d.ts +8 -0
- package/esm/MetricComponent/Form/Header/MetricTypeField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricTypeField.js +42 -0
- package/esm/MetricComponent/Form/Header/Usage/Usage.d.ts +13 -0
- package/esm/MetricComponent/Form/Header/Usage/Usage.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/Usage/Usage.js +68 -0
- package/esm/MetricComponent/Form/Header/Usage/UsageItems.d.ts +11 -0
- package/esm/MetricComponent/Form/Header/Usage/UsageItems.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/Usage/UsageItems.js +88 -0
- package/esm/MetricComponent/Form/Header/Usage/UsagesOverlay.d.ts +17 -0
- package/esm/MetricComponent/Form/Header/Usage/UsagesOverlay.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/Usage/UsagesOverlay.js +119 -0
- package/esm/MetricComponent/Form/Header/share/MetricAccessChip.d.ts +9 -0
- package/esm/MetricComponent/Form/Header/share/MetricAccessChip.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/share/MetricAccessChip.js +39 -0
- package/esm/MetricComponent/Form/Header/share/MetricShare.d.ts +17 -0
- package/esm/MetricComponent/Form/Header/share/MetricShare.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/share/MetricShare.js +36 -0
- package/esm/MetricComponent/Form/Header/share/useApplyMetricAccess.d.ts +10 -0
- package/esm/MetricComponent/Form/Header/share/useApplyMetricAccess.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/share/useApplyMetricAccess.js +39 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorEditor.d.ts +11 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorEditor.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorEditor.js +128 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.d.ts +9 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.events.d.ts +11 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.events.js +25 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.js +68 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorHeader.d.ts +14 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorHeader.js +84 -0
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.d.ts +3 -0
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.js +57 -0
- package/esm/MetricComponent/Form/MaqlEditorUtils/Placeholder.d.ts +8 -0
- package/esm/MetricComponent/Form/MaqlEditorUtils/Placeholder.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorUtils/Placeholder.js +72 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResult.d.ts +19 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResult.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResult.js +144 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResultHeader.d.ts +23 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResultHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResultHeader.js +54 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSql.d.ts +8 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSql.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSql.js +54 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSqlHeader.d.ts +10 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSqlHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSqlHeader.js +46 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelect.d.ts +15 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelect.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelect.js +171 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelectItem.d.ts +10 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelectItem.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelectItem.js +23 -0
- package/esm/MetricComponent/Form/MaqlResult/components/LimitSelect.d.ts +11 -0
- package/esm/MetricComponent/Form/MaqlResult/components/LimitSelect.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/components/LimitSelect.js +134 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.d.ts +10 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.d.ts.map +1 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.events.d.ts +7 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.events.js +12 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.js +83 -0
- package/esm/MetricComponent/Form/OtherMetrics/OtherMetricsContext.d.ts +13 -0
- package/esm/MetricComponent/Form/OtherMetrics/OtherMetricsContext.d.ts.map +1 -0
- package/esm/MetricComponent/Form/OtherMetrics/OtherMetricsContext.js +23 -0
- package/esm/MetricComponent/Form/OtherMetrics/useOtherMetrics.d.ts +3 -0
- package/esm/MetricComponent/Form/OtherMetrics/useOtherMetrics.d.ts.map +1 -0
- package/esm/MetricComponent/Form/OtherMetrics/useOtherMetrics.js +6 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeader.d.ts +20 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeader.js +90 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeaderButton.d.ts +16 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeaderButton.d.ts.map +1 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeaderButton.js +29 -0
- package/esm/MetricComponent/Form/Prefixes/PrefixesContext.d.ts +12 -0
- package/esm/MetricComponent/Form/Prefixes/PrefixesContext.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Prefixes/PrefixesContext.js +10 -0
- package/esm/MetricComponent/Form/Prefixes/usePrefixes.d.ts +3 -0
- package/esm/MetricComponent/Form/Prefixes/usePrefixes.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Prefixes/usePrefixes.js +6 -0
- package/esm/MetricComponent/Form/TestingFormProvider.d.ts +10 -0
- package/esm/MetricComponent/Form/TestingFormProvider.d.ts.map +1 -0
- package/esm/MetricComponent/Form/TestingFormProvider.js +7 -0
- package/esm/MetricComponent/Form/attribute.d.ts +3 -0
- package/esm/MetricComponent/Form/attribute.d.ts.map +1 -0
- package/esm/MetricComponent/Form/attribute.js +9 -0
- package/esm/MetricComponent/Form/data.d.ts +23 -0
- package/esm/MetricComponent/Form/data.d.ts.map +1 -0
- package/esm/MetricComponent/Form/data.js +12 -0
- package/esm/MetricComponent/Form/hooks/useCatalog.d.ts +9 -0
- package/esm/MetricComponent/Form/hooks/useCatalog.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useCatalog.js +72 -0
- package/esm/MetricComponent/Form/hooks/useExecute.d.ts +14 -0
- package/esm/MetricComponent/Form/hooks/useExecute.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useExecute.js +26 -0
- package/esm/MetricComponent/Form/hooks/useExplain.d.ts +10 -0
- package/esm/MetricComponent/Form/hooks/useExplain.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useExplain.js +50 -0
- package/esm/MetricComponent/Form/hooks/useInvalidFocus.d.ts +5 -0
- package/esm/MetricComponent/Form/hooks/useInvalidFocus.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useInvalidFocus.js +20 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormField.d.ts +10 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormField.js +16 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormStatus.d.ts +5 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormStatus.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormStatus.js +5 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormatState.d.ts +41 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormatState.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormatState.js +50 -0
- package/esm/MetricComponent/Form/hooks/useMetricValidation.d.ts +11 -0
- package/esm/MetricComponent/Form/hooks/useMetricValidation.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useMetricValidation.js +53 -0
- package/esm/MetricComponent/Form/hooks/useTitleExistsCheck.d.ts +2 -0
- package/esm/MetricComponent/Form/hooks/useTitleExistsCheck.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useTitleExistsCheck.js +19 -0
- package/esm/MetricComponent/Form/hooks/useToggleWithCollapse.d.ts +4 -0
- package/esm/MetricComponent/Form/hooks/useToggleWithCollapse.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useToggleWithCollapse.js +16 -0
- package/esm/MetricComponent/Form/hooks/useUniqIdGenerator.d.ts +2 -0
- package/esm/MetricComponent/Form/hooks/useUniqIdGenerator.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useUniqIdGenerator.js +48 -0
- package/esm/MetricComponent/Form/hooks/useValidationScheme.d.ts +10 -0
- package/esm/MetricComponent/Form/hooks/useValidationScheme.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useValidationScheme.js +17 -0
- package/esm/MetricComponent/Form/inlineMeasure.d.ts +3 -0
- package/esm/MetricComponent/Form/inlineMeasure.d.ts.map +1 -0
- package/esm/MetricComponent/Form/inlineMeasure.js +11 -0
- package/esm/MetricComponent/Form/maqlFieldFunctions.d.ts +17 -0
- package/esm/MetricComponent/Form/maqlFieldFunctions.d.ts.map +1 -0
- package/esm/MetricComponent/Form/maqlFieldFunctions.js +43 -0
- package/esm/MetricComponent/Form/validationSchema.d.ts +12 -0
- package/esm/MetricComponent/Form/validationSchema.d.ts.map +1 -0
- package/esm/MetricComponent/Form/validationSchema.js +123 -0
- package/esm/MetricComponent/IdChangeConfirmDialog/IdChangeConfirmDialog.d.ts +15 -0
- package/esm/MetricComponent/IdChangeConfirmDialog/IdChangeConfirmDialog.d.ts.map +1 -0
- package/esm/MetricComponent/IdChangeConfirmDialog/IdChangeConfirmDialog.js +75 -0
- package/esm/MetricComponent/ManageMetric.d.ts +38 -0
- package/esm/MetricComponent/ManageMetric.d.ts.map +1 -0
- package/esm/MetricComponent/ManageMetric.js +29 -0
- package/esm/MetricComponent/ManageMetrics.d.ts +23 -0
- package/esm/MetricComponent/ManageMetrics.d.ts.map +1 -0
- package/esm/MetricComponent/ManageMetrics.js +32 -0
- package/esm/MetricComponent/MetricService.d.ts +7 -0
- package/esm/MetricComponent/MetricService.d.ts.map +1 -0
- package/esm/MetricComponent/MetricService.js +7 -0
- package/esm/MetricComponent/MetricState/TabContent.d.ts +37 -0
- package/esm/MetricComponent/MetricState/TabContent.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/TabContent.js +21 -0
- package/esm/MetricComponent/MetricState/hooks/useChangeIdDialog.d.ts +23 -0
- package/esm/MetricComponent/MetricState/hooks/useChangeIdDialog.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useChangeIdDialog.js +68 -0
- package/esm/MetricComponent/MetricState/hooks/useDirtyChanged.d.ts +4 -0
- package/esm/MetricComponent/MetricState/hooks/useDirtyChanged.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useDirtyChanged.js +16 -0
- package/esm/MetricComponent/MetricState/hooks/useOnChangeCallback.d.ts +17 -0
- package/esm/MetricComponent/MetricState/hooks/useOnChangeCallback.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useOnChangeCallback.js +41 -0
- package/esm/MetricComponent/MetricState/hooks/useOnDeleteCallback.d.ts +5 -0
- package/esm/MetricComponent/MetricState/hooks/useOnDeleteCallback.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useOnDeleteCallback.js +9 -0
- package/esm/MetricComponent/MetricState/hooks/useOnSaveCallback.d.ts +6 -0
- package/esm/MetricComponent/MetricState/hooks/useOnSaveCallback.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useOnSaveCallback.js +9 -0
- package/esm/MetricComponent/MetricState/hooks/useSaveTab.d.ts +9 -0
- package/esm/MetricComponent/MetricState/hooks/useSaveTab.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useSaveTab.js +93 -0
- package/esm/MetricComponent/MetricState/hooks/useTabsData.d.ts +16 -0
- package/esm/MetricComponent/MetricState/hooks/useTabsData.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useTabsData.js +62 -0
- package/esm/MetricComponent/MetricState/hooks/useUnsavedChanges.d.ts +17 -0
- package/esm/MetricComponent/MetricState/hooks/useUnsavedChanges.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useUnsavedChanges.js +86 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricData.d.ts +5 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricData.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricData.js +10 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricTab.d.ts +6 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricTab.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricTab.js +17 -0
- package/esm/MetricComponent/MetricState/metricState.data.d.ts +37 -0
- package/esm/MetricComponent/MetricState/metricState.data.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/metricState.data.js +13 -0
- package/esm/MetricComponent/MetricState/useMetricState.d.ts +27 -0
- package/esm/MetricComponent/MetricState/useMetricState.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/useMetricState.js +127 -0
- package/esm/MetricComponent/MetricsContext/MetricsContext.d.ts +11 -0
- package/esm/MetricComponent/MetricsContext/MetricsContext.d.ts.map +1 -0
- package/esm/MetricComponent/MetricsContext/MetricsContext.js +14 -0
- package/esm/MetricComponent/MetricsContext/useMetricsContext.d.ts +3 -0
- package/esm/MetricComponent/MetricsContext/useMetricsContext.d.ts.map +1 -0
- package/esm/MetricComponent/MetricsContext/useMetricsContext.js +6 -0
- package/esm/MetricComponent/MetricsState.d.ts +39 -0
- package/esm/MetricComponent/MetricsState.d.ts.map +1 -0
- package/esm/MetricComponent/MetricsState.js +73 -0
- package/esm/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.d.ts +12 -0
- package/esm/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.d.ts.map +1 -0
- package/esm/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.js +110 -0
- package/esm/MetricComponent/MinimizedMetrics.d.ts +10 -0
- package/esm/MetricComponent/MinimizedMetrics.d.ts.map +1 -0
- package/esm/MetricComponent/MinimizedMetrics.js +19 -0
- package/esm/MetricComponent/MultipleMetricsState.d.ts +61 -0
- package/esm/MetricComponent/MultipleMetricsState.d.ts.map +1 -0
- package/esm/MetricComponent/MultipleMetricsState.js +53 -0
- package/esm/MetricComponent/UnsavedChangesConfirmDialog/UnsavedChangesConfirmDialog.d.ts +14 -0
- package/esm/MetricComponent/UnsavedChangesConfirmDialog/UnsavedChangesConfirmDialog.d.ts.map +1 -0
- package/esm/MetricComponent/UnsavedChangesConfirmDialog/UnsavedChangesConfirmDialog.js +52 -0
- package/esm/MetricComponent/hooks/useDeleteCallbacks.d.ts +7 -0
- package/esm/MetricComponent/hooks/useDeleteCallbacks.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useDeleteCallbacks.js +52 -0
- package/esm/MetricComponent/hooks/useDirtyChanged.d.ts +2 -0
- package/esm/MetricComponent/hooks/useDirtyChanged.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useDirtyChanged.js +10 -0
- package/esm/MetricComponent/hooks/useEditCallbacks.d.ts +23 -0
- package/esm/MetricComponent/hooks/useEditCallbacks.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useEditCallbacks.js +107 -0
- package/esm/MetricComponent/hooks/useFocusedField.d.ts +4 -0
- package/esm/MetricComponent/hooks/useFocusedField.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useFocusedField.js +9 -0
- package/esm/MetricComponent/hooks/useIdCallbacks.d.ts +22 -0
- package/esm/MetricComponent/hooks/useIdCallbacks.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useIdCallbacks.js +46 -0
- package/esm/MetricComponent/hooks/useInitialValueMetric.d.ts +4 -0
- package/esm/MetricComponent/hooks/useInitialValueMetric.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useInitialValueMetric.js +12 -0
- package/esm/MetricComponent/hooks/useInitialValues.d.ts +3 -0
- package/esm/MetricComponent/hooks/useInitialValues.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useInitialValues.js +13 -0
- package/esm/MetricComponent/hooks/useMetricContentState.d.ts +38 -0
- package/esm/MetricComponent/hooks/useMetricContentState.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useMetricContentState.js +73 -0
- package/esm/MetricComponent/hooks/useMetricDelete.d.ts +3 -0
- package/esm/MetricComponent/hooks/useMetricDelete.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useMetricDelete.js +14 -0
- package/esm/MetricComponent/hooks/useMetricSave.d.ts +4 -0
- package/esm/MetricComponent/hooks/useMetricSave.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useMetricSave.js +52 -0
- package/esm/MetricComponent/hooks/useMetricUsage.d.ts +8 -0
- package/esm/MetricComponent/hooks/useMetricUsage.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useMetricUsage.js +21 -0
- package/esm/MetricComponent/hooks/useOnCloseOrCancel.d.ts +7 -0
- package/esm/MetricComponent/hooks/useOnCloseOrCancel.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useOnCloseOrCancel.js +26 -0
- package/esm/MetricComponent/hooks/useOnSaveUnchanged.d.ts +12 -0
- package/esm/MetricComponent/hooks/useOnSaveUnchanged.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useOnSaveUnchanged.js +30 -0
- package/esm/MetricComponent/hooks/useSaveAsClick.d.ts +6 -0
- package/esm/MetricComponent/hooks/useSaveAsClick.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useSaveAsClick.js +62 -0
- package/esm/MetricComponent/hooks/useSaveClick.d.ts +11 -0
- package/esm/MetricComponent/hooks/useSaveClick.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useSaveClick.js +47 -0
- package/esm/MetricComponent/metric/deleteInfo.d.ts +6 -0
- package/esm/MetricComponent/metric/deleteInfo.d.ts.map +1 -0
- package/esm/MetricComponent/metric/deleteInfo.js +6 -0
- package/esm/MetricComponent/metric/emptyMetric.d.ts +8 -0
- package/esm/MetricComponent/metric/emptyMetric.d.ts.map +1 -0
- package/esm/MetricComponent/metric/emptyMetric.js +13 -0
- package/esm/MetricComponent/metric/idChangeHelper.d.ts +5 -0
- package/esm/MetricComponent/metric/idChangeHelper.d.ts.map +1 -0
- package/esm/MetricComponent/metric/idChangeHelper.js +11 -0
- package/esm/MetricComponent/metric/idValidator.d.ts +3 -0
- package/esm/MetricComponent/metric/idValidator.d.ts.map +1 -0
- package/esm/MetricComponent/metric/idValidator.js +5 -0
- package/esm/MetricComponent/metric/metricHelpers.d.ts +29 -0
- package/esm/MetricComponent/metric/metricHelpers.d.ts.map +1 -0
- package/esm/MetricComponent/metric/metricHelpers.js +114 -0
- package/esm/MetricComponent/metric/nameGenerators.d.ts +13 -0
- package/esm/MetricComponent/metric/nameGenerators.d.ts.map +1 -0
- package/esm/MetricComponent/metric/nameGenerators.js +63 -0
- package/esm/MetricComponent/metric/prefixHelper.d.ts +7 -0
- package/esm/MetricComponent/metric/prefixHelper.d.ts.map +1 -0
- package/esm/MetricComponent/metric/prefixHelper.js +43 -0
- package/esm/MetricComponent/metric/saveInfo.d.ts +13 -0
- package/esm/MetricComponent/metric/saveInfo.d.ts.map +1 -0
- package/esm/MetricComponent/metric/saveInfo.js +10 -0
- package/esm/MetricComponent/metric/transformer.d.ts +5 -0
- package/esm/MetricComponent/metric/transformer.d.ts.map +1 -0
- package/esm/MetricComponent/metric/transformer.js +17 -0
- package/esm/index.d.ts +41 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +35 -0
- package/esm/shared/Form/Form.d.ts +25 -0
- package/esm/shared/Form/Form.d.ts.map +1 -0
- package/esm/shared/Form/Form.js +48 -0
- package/esm/shared/Form/FormApi.d.ts +8 -0
- package/esm/shared/Form/FormApi.d.ts.map +1 -0
- package/esm/shared/Form/FormApi.js +14 -0
- package/esm/shared/Form/FormContext.d.ts +52 -0
- package/esm/shared/Form/FormContext.d.ts.map +1 -0
- package/esm/shared/Form/FormContext.js +50 -0
- package/esm/shared/Form/data.d.ts +5 -0
- package/esm/shared/Form/data.d.ts.map +1 -0
- package/esm/shared/Form/data.js +6 -0
- package/esm/shared/Form/hooks/useChanged.d.ts +5 -0
- package/esm/shared/Form/hooks/useChanged.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useChanged.js +14 -0
- package/esm/shared/Form/hooks/useDirty.d.ts +3 -0
- package/esm/shared/Form/hooks/useDirty.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useDirty.js +9 -0
- package/esm/shared/Form/hooks/useFormHandlersInternal.d.ts +12 -0
- package/esm/shared/Form/hooks/useFormHandlersInternal.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useFormHandlersInternal.js +16 -0
- package/esm/shared/Form/hooks/useFormState.d.ts +4 -0
- package/esm/shared/Form/hooks/useFormState.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useFormState.js +33 -0
- package/esm/shared/Form/hooks/useFormStatusInternal.d.ts +32 -0
- package/esm/shared/Form/hooks/useFormStatusInternal.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useFormStatusInternal.js +34 -0
- package/esm/shared/Form/hooks/useInvalidFocusField.d.ts +3 -0
- package/esm/shared/Form/hooks/useInvalidFocusField.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useInvalidFocusField.js +8 -0
- package/esm/shared/Form/hooks/useMutations.d.ts +4 -0
- package/esm/shared/Form/hooks/useMutations.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useMutations.js +97 -0
- package/esm/shared/Form/hooks/useRealFocus.d.ts +5 -0
- package/esm/shared/Form/hooks/useRealFocus.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useRealFocus.js +38 -0
- package/esm/shared/Form/useFormChanged.d.ts +2 -0
- package/esm/shared/Form/useFormChanged.d.ts.map +1 -0
- package/esm/shared/Form/useFormChanged.js +12 -0
- package/esm/shared/Form/useFormDefaults.d.ts +2 -0
- package/esm/shared/Form/useFormDefaults.d.ts.map +1 -0
- package/esm/shared/Form/useFormDefaults.js +7 -0
- package/esm/shared/Form/useFormDirty.d.ts +2 -0
- package/esm/shared/Form/useFormDirty.d.ts.map +1 -0
- package/esm/shared/Form/useFormDirty.js +13 -0
- package/esm/shared/Form/useFormErrors.d.ts +3 -0
- package/esm/shared/Form/useFormErrors.d.ts.map +1 -0
- package/esm/shared/Form/useFormErrors.js +18 -0
- package/esm/shared/Form/useFormField.d.ts +24 -0
- package/esm/shared/Form/useFormField.d.ts.map +1 -0
- package/esm/shared/Form/useFormField.js +60 -0
- package/esm/shared/Form/useFormFieldElementRef.d.ts +3 -0
- package/esm/shared/Form/useFormFieldElementRef.d.ts.map +1 -0
- package/esm/shared/Form/useFormFieldElementRef.js +10 -0
- package/esm/shared/Form/useFormHandlers.d.ts +8 -0
- package/esm/shared/Form/useFormHandlers.d.ts.map +1 -0
- package/esm/shared/Form/useFormHandlers.js +45 -0
- package/esm/shared/Form/useFormStatus.d.ts +3 -0
- package/esm/shared/Form/useFormStatus.d.ts.map +1 -0
- package/esm/shared/Form/useFormStatus.js +10 -0
- package/esm/shared/Form/useFormValues.d.ts +3 -0
- package/esm/shared/Form/useFormValues.d.ts.map +1 -0
- package/esm/shared/Form/useFormValues.js +11 -0
- package/esm/shared/Form/utils.d.ts +2 -0
- package/esm/shared/Form/utils.d.ts.map +1 -0
- package/esm/shared/Form/utils.js +5 -0
- package/esm/shared/GlobalLoading/GlobalLoading.d.ts +2 -0
- package/esm/shared/GlobalLoading/GlobalLoading.d.ts.map +1 -0
- package/esm/shared/GlobalLoading/GlobalLoading.js +15 -0
- package/esm/shared/MaqlPreview/MaqlPreview.d.ts +19 -0
- package/esm/shared/MaqlPreview/MaqlPreview.d.ts.map +1 -0
- package/esm/shared/MaqlPreview/MaqlPreview.js +107 -0
- package/esm/shared/MaqlPreview/backend/measureExpressionTokens.d.ts +18 -0
- package/esm/shared/MaqlPreview/backend/measureExpressionTokens.d.ts.map +1 -0
- package/esm/shared/MaqlPreview/backend/measureExpressionTokens.js +83 -0
- package/esm/shared/MaqlPreview/hooks/useMetricTokens.d.ts +8 -0
- package/esm/shared/MaqlPreview/hooks/useMetricTokens.d.ts.map +1 -0
- package/esm/shared/MaqlPreview/hooks/useMetricTokens.js +14 -0
- package/esm/shared/MetricTooltip/MetricTooltip.d.ts +14 -0
- package/esm/shared/MetricTooltip/MetricTooltip.d.ts.map +1 -0
- package/esm/shared/MetricTooltip/MetricTooltip.events.d.ts +9 -0
- package/esm/shared/MetricTooltip/MetricTooltip.events.d.ts.map +1 -0
- package/esm/shared/MetricTooltip/MetricTooltip.events.js +18 -0
- package/esm/shared/MetricTooltip/MetricTooltip.js +46 -0
- package/esm/shared/MetricTooltip/MetricTooltipContent.d.ts +12 -0
- package/esm/shared/MetricTooltip/MetricTooltipContent.d.ts.map +1 -0
- package/esm/shared/MetricTooltip/MetricTooltipContent.js +38 -0
- package/esm/shared/MetricTooltip/fixtures.d.ts +3 -0
- package/esm/shared/MetricTooltip/fixtures.d.ts.map +1 -0
- package/esm/shared/MetricTooltip/fixtures.js +16 -0
- package/esm/shared/Tabs/Tab.d.ts +31 -0
- package/esm/shared/Tabs/Tab.d.ts.map +1 -0
- package/esm/shared/Tabs/Tab.js +171 -0
- package/esm/shared/Tabs/Tabs.classes.d.ts +13 -0
- package/esm/shared/Tabs/Tabs.classes.d.ts.map +1 -0
- package/esm/shared/Tabs/Tabs.classes.js +13 -0
- package/esm/shared/Tabs/Tabs.d.ts +4 -0
- package/esm/shared/Tabs/Tabs.d.ts.map +1 -0
- package/esm/shared/Tabs/Tabs.data.d.ts +37 -0
- package/esm/shared/Tabs/Tabs.data.d.ts.map +1 -0
- package/esm/shared/Tabs/Tabs.data.js +4 -0
- package/esm/shared/Tabs/Tabs.js +195 -0
- package/esm/shared/Tabs/hooks/useChangeScroll.d.ts +2 -0
- package/esm/shared/Tabs/hooks/useChangeScroll.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useChangeScroll.js +19 -0
- package/esm/shared/Tabs/hooks/useMouseDownRepeat.d.ts +3 -0
- package/esm/shared/Tabs/hooks/useMouseDownRepeat.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useMouseDownRepeat.js +43 -0
- package/esm/shared/Tabs/hooks/useScrollByButtons.d.ts +9 -0
- package/esm/shared/Tabs/hooks/useScrollByButtons.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useScrollByButtons.js +76 -0
- package/esm/shared/Tabs/hooks/useScrollToActive.d.ts +2 -0
- package/esm/shared/Tabs/hooks/useScrollToActive.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useScrollToActive.js +36 -0
- package/esm/shared/Tabs/hooks/useTabCallbacks.d.ts +7 -0
- package/esm/shared/Tabs/hooks/useTabCallbacks.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useTabCallbacks.js +17 -0
- package/esm/shared/Tabs/hooks/useTabs.d.ts +24 -0
- package/esm/shared/Tabs/hooks/useTabs.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useTabs.js +130 -0
- package/esm/shared/Tabs/hooks/useTabsCallbacks.d.ts +8 -0
- package/esm/shared/Tabs/hooks/useTabsCallbacks.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useTabsCallbacks.js +19 -0
- package/esm/shared/authentication/Authentication.d.ts +8 -0
- package/esm/shared/authentication/Authentication.d.ts.map +1 -0
- package/esm/shared/authentication/Authentication.js +51 -0
- package/esm/shared/backend/tigerContractExpiredHandler.d.ts +3 -0
- package/esm/shared/backend/tigerContractExpiredHandler.d.ts.map +1 -0
- package/esm/shared/backend/tigerContractExpiredHandler.js +19 -0
- package/esm/shared/backend/tigerNotAuthenticatedHandler.d.ts +9 -0
- package/esm/shared/backend/tigerNotAuthenticatedHandler.d.ts.map +1 -0
- package/esm/shared/backend/tigerNotAuthenticatedHandler.js +36 -0
- package/esm/shared/eventing/EventContext.d.ts +25 -0
- package/esm/shared/eventing/EventContext.d.ts.map +1 -0
- package/esm/shared/eventing/EventContext.js +35 -0
- package/esm/shared/eventing/events.d.ts +52 -0
- package/esm/shared/eventing/events.d.ts.map +1 -0
- package/esm/shared/eventing/events.js +56 -0
- package/esm/shared/eventing/functions/errorToTrackingData.d.ts +12 -0
- package/esm/shared/eventing/functions/errorToTrackingData.d.ts.map +1 -0
- package/esm/shared/eventing/functions/errorToTrackingData.js +10 -0
- package/esm/shared/eventing/useEvents.d.ts +10 -0
- package/esm/shared/eventing/useEvents.d.ts.map +1 -0
- package/esm/shared/eventing/useEvents.js +16 -0
- package/esm/shared/hooks/useApi.d.ts +4 -0
- package/esm/shared/hooks/useApi.d.ts.map +1 -0
- package/esm/shared/hooks/useApi.js +15 -0
- package/esm/shared/hooks/useFocus.d.ts +3 -0
- package/esm/shared/hooks/useFocus.d.ts.map +1 -0
- package/esm/shared/hooks/useFocus.js +55 -0
- package/esm/shared/hooks/usePromiseHandlerIndicator.d.ts +2 -0
- package/esm/shared/hooks/usePromiseHandlerIndicator.d.ts.map +1 -0
- package/esm/shared/hooks/usePromiseHandlerIndicator.js +11 -0
- package/esm/shared/hooks/useProp.d.ts +3 -0
- package/esm/shared/hooks/useProp.d.ts.map +1 -0
- package/esm/shared/hooks/useProp.js +15 -0
- package/esm/shared/links.d.ts +9 -0
- package/esm/shared/links.d.ts.map +1 -0
- package/esm/shared/links.js +9 -0
- package/esm/shared/metrics/MetricsReloadContext.d.ts +8 -0
- package/esm/shared/metrics/MetricsReloadContext.d.ts.map +1 -0
- package/esm/shared/metrics/MetricsReloadContext.js +14 -0
- package/esm/shared/metrics/functions/metricListData.d.ts +4 -0
- package/esm/shared/metrics/functions/metricListData.d.ts.map +1 -0
- package/esm/shared/metrics/functions/metricListData.js +29 -0
- package/esm/shared/metrics/useMetricListData.d.ts +29 -0
- package/esm/shared/metrics/useMetricListData.d.ts.map +1 -0
- package/esm/shared/metrics/useMetricListData.events.d.ts +12 -0
- package/esm/shared/metrics/useMetricListData.events.d.ts.map +1 -0
- package/esm/shared/metrics/useMetricListData.events.js +31 -0
- package/esm/shared/metrics/useMetricListData.js +52 -0
- package/esm/shared/metrics/useMetrics.d.ts +16 -0
- package/esm/shared/metrics/useMetrics.d.ts.map +1 -0
- package/esm/shared/metrics/useMetrics.js +34 -0
- package/esm/shared/metrics/useReloadMetrics.d.ts +3 -0
- package/esm/shared/metrics/useReloadMetrics.d.ts.map +1 -0
- package/esm/shared/metrics/useReloadMetrics.js +10 -0
- package/esm/shared/permissions.d.ts +10 -0
- package/esm/shared/permissions.d.ts.map +1 -0
- package/esm/shared/permissions.js +53 -0
- package/esm/shared/platform.d.ts +2 -0
- package/esm/shared/platform.d.ts.map +1 -0
- package/esm/shared/platform.js +4 -0
- package/esm/shared/theme/index.d.ts +416 -0
- package/esm/shared/theme/index.d.ts.map +1 -0
- package/esm/shared/theme/index.js +193 -0
- package/esm/tests/render.test.utils.d.ts +9 -0
- package/esm/tests/render.test.utils.d.ts.map +1 -0
- package/esm/tests/render.test.utils.js +18 -0
- package/esm/translations/IntlWrapper.d.ts +9 -0
- package/esm/translations/IntlWrapper.d.ts.map +1 -0
- package/esm/translations/IntlWrapper.js +11 -0
- package/esm/translations/de-DE.json +131 -0
- package/esm/translations/en-AU.json +131 -0
- package/esm/translations/en-GB.json +131 -0
- package/esm/translations/en-US.json +518 -0
- package/esm/translations/es-419.json +131 -0
- package/esm/translations/es-ES.json +131 -0
- package/esm/translations/fi-FI.json +131 -0
- package/esm/translations/fr-CA.json +131 -0
- package/esm/translations/fr-FR.json +131 -0
- package/esm/translations/id-ID.json +131 -0
- package/esm/translations/it-IT.json +131 -0
- package/esm/translations/ja-JP.json +131 -0
- package/esm/translations/ko-KR.json +131 -0
- package/esm/translations/nl-NL.json +131 -0
- package/esm/translations/pl-PL.json +131 -0
- package/esm/translations/pt-BR.json +131 -0
- package/esm/translations/pt-PT.json +131 -0
- package/esm/translations/ru-RU.json +131 -0
- package/esm/translations/sl-SI.json +131 -0
- package/esm/translations/th-TH.json +131 -0
- package/esm/translations/tr-TR.json +131 -0
- package/esm/translations/translations.d.ts +21 -0
- package/esm/translations/translations.d.ts.map +1 -0
- package/esm/translations/translations.js +89 -0
- package/esm/translations/uk-UA.json +131 -0
- package/esm/translations/vi-VN.json +131 -0
- package/esm/translations/zh-HK.json +131 -0
- package/esm/translations/zh-Hans.json +131 -0
- package/esm/translations/zh-Hant.json +131 -0
- package/package.json +116 -3
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import * as monaco from "monaco-editor/editor/editor.api.js";
|
|
4
|
+
import { MonacoToProtocolConverter, ProtocolToMonacoConverter } from "monaco-languageclient/monaco-converter";
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
|
+
import { useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
7
|
+
import { destroyMaqlTooltip } from "../MaqlEditor.tooltip.js";
|
|
8
|
+
import { createDocument } from "../utils.js";
|
|
9
|
+
import { doHover } from "./hover/doHover.js";
|
|
10
|
+
import { useHoverEvent } from "./hover/useHoverEvent.js";
|
|
11
|
+
export function useHover(editor, languageId, languageService, initializeData, onOpen) {
|
|
12
|
+
const tooltip = useRef(null);
|
|
13
|
+
const [isHoverShortcut, shortcut] = useHoverShortcut();
|
|
14
|
+
const currentEvent = useHoverEvent(editor?.getContainerDomNode() ?? null, tooltip, isHoverShortcut);
|
|
15
|
+
const backend = useBackendStrict();
|
|
16
|
+
const workspaceId = useWorkspaceStrict();
|
|
17
|
+
const intl = useIntl();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!isReady(editor, languageService, initializeData)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
editor.addCommand(shortcut, () => {
|
|
23
|
+
editor.trigger("", "editor.action.showHover", "");
|
|
24
|
+
});
|
|
25
|
+
const m2p = new MonacoToProtocolConverter(monaco);
|
|
26
|
+
const p2m = new ProtocolToMonacoConverter(monaco);
|
|
27
|
+
const disposeHover = monaco.languages.registerHoverProvider(languageId, {
|
|
28
|
+
provideHover: (model, position) => {
|
|
29
|
+
const document = createDocument(model);
|
|
30
|
+
return languageService
|
|
31
|
+
?.doHover(document, m2p.asPosition(position.lineNumber, position.column))
|
|
32
|
+
.then((hover) => {
|
|
33
|
+
const readOnly = Boolean(editor.getRawOptions().readOnly || hover?.object?.isLocked);
|
|
34
|
+
const monacoHover = p2m.asHover(hover) || null;
|
|
35
|
+
const settings = {
|
|
36
|
+
backend,
|
|
37
|
+
workspaceId,
|
|
38
|
+
intl,
|
|
39
|
+
content: hover?.object,
|
|
40
|
+
readOnly,
|
|
41
|
+
};
|
|
42
|
+
return doHover(currentEvent.current, tooltip, editor, monacoHover, settings, onOpen);
|
|
43
|
+
})
|
|
44
|
+
.catch((_error) => {
|
|
45
|
+
return null;
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
return () => {
|
|
50
|
+
disposeHover.dispose();
|
|
51
|
+
destroyMaqlTooltip(tooltip);
|
|
52
|
+
};
|
|
53
|
+
}, [
|
|
54
|
+
shortcut,
|
|
55
|
+
editor,
|
|
56
|
+
intl,
|
|
57
|
+
languageId,
|
|
58
|
+
languageService,
|
|
59
|
+
initializeData,
|
|
60
|
+
backend,
|
|
61
|
+
workspaceId,
|
|
62
|
+
currentEvent,
|
|
63
|
+
onOpen,
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
function isReady(editor, languageService, initializeData) {
|
|
67
|
+
return Boolean(editor && languageService && initializeData?.capabilities?.hoverProvider);
|
|
68
|
+
}
|
|
69
|
+
function useHoverShortcut() {
|
|
70
|
+
return useMemo(() => [
|
|
71
|
+
(e) => isCtrlOrCmd(e) && e.key === "u",
|
|
72
|
+
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyU,
|
|
73
|
+
], []);
|
|
74
|
+
}
|
|
75
|
+
function isCtrlOrCmd(e) {
|
|
76
|
+
return e.ctrlKey || e.metaKey;
|
|
77
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type * as monaco from "monaco-editor/editor/editor.api.js";
|
|
2
|
+
export type ILanguageConfiguration = monaco.languages.LanguageConfiguration;
|
|
3
|
+
export declare function useLanguageConfiguration(): ILanguageConfiguration;
|
|
4
|
+
//# sourceMappingURL=useLanguageConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLanguageConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/maql/hooks/useLanguageConfiguration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,oCAAoC,CAAC;AAGlE,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,SAAS,CAAC,qBAAqB,CAAC;AAE5E,wBAAgB,wBAAwB,IAAI,sBAAsB,CAqBjE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
export function useLanguageConfiguration() {
|
|
4
|
+
return useMemo(() => ({
|
|
5
|
+
comments: {
|
|
6
|
+
lineComment: "#",
|
|
7
|
+
blockComment: null,
|
|
8
|
+
},
|
|
9
|
+
brackets: [["(", ")"]],
|
|
10
|
+
autoClosingPairs: [
|
|
11
|
+
{ open: "{", close: "}" },
|
|
12
|
+
{ open: "(", close: ")" },
|
|
13
|
+
{ open: '"', close: '"' },
|
|
14
|
+
],
|
|
15
|
+
surroundingPairs: [
|
|
16
|
+
{ open: "{", close: "}" },
|
|
17
|
+
{ open: "(", close: ")" },
|
|
18
|
+
{ open: '"', close: '"' },
|
|
19
|
+
],
|
|
20
|
+
}), []);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLanguageService.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/maql/hooks/useLanguageService.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,oCAAoC,CAAC;AAK1F,wBAAgB,kBAAkB,IAAI,mBAAmB,GAAG,SAAS,CAiBpE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useContext, useEffect, useState } from "react";
|
|
3
|
+
import { MaqlLanguageService, MetadataService } from "@gooddata/sdk-maql-language-server";
|
|
4
|
+
import { useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
5
|
+
import { LanguageServiceContext } from "../../languageService/LanguageServiceContext.js";
|
|
6
|
+
export function useLanguageService() {
|
|
7
|
+
const contextService = useContext(LanguageServiceContext);
|
|
8
|
+
const backend = useBackendStrict();
|
|
9
|
+
const workspaceId = useWorkspaceStrict();
|
|
10
|
+
const [languageService, setLanguageService] = useState();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (contextService) {
|
|
13
|
+
setLanguageService(contextService);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
const metadataService = MetadataService.withBackend(workspaceId, backend);
|
|
17
|
+
setLanguageService(new MaqlLanguageService(undefined, metadataService));
|
|
18
|
+
}
|
|
19
|
+
}, [contextService, backend, workspaceId]);
|
|
20
|
+
return languageService;
|
|
21
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type InitializeResult } from "vscode-languageserver";
|
|
2
|
+
import { type MaqlLanguageService } from "@gooddata/sdk-maql-language-server";
|
|
3
|
+
export declare function useLanguageServiceInitializer(languageService: MaqlLanguageService | undefined): InitializeResult | undefined;
|
|
4
|
+
//# sourceMappingURL=useLanguageServiceInitializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLanguageServiceInitializer.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/maql/hooks/useLanguageServiceInitializer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,wBAAgB,6BAA6B,CACzC,eAAe,EAAE,mBAAmB,GAAG,SAAS,GACjD,gBAAgB,GAAG,SAAS,CAU9B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
export function useLanguageServiceInitializer(languageService) {
|
|
4
|
+
const [initializeData, setInitializeData] = useState();
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
if (languageService) {
|
|
7
|
+
setInitializeData(languageService.initialize());
|
|
8
|
+
}
|
|
9
|
+
}, [languageService, setInitializeData]);
|
|
10
|
+
return initializeData;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CompletionList } from "vscode-languageserver";
|
|
2
|
+
import { type IMetadataObject } from "@gooddata/sdk-model";
|
|
3
|
+
import { type IStandaloneCodeEditor, type Monaco } from "../../monaco/MonacoEditor.js";
|
|
4
|
+
export type MonacoHandlers = {
|
|
5
|
+
onFocus?: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
6
|
+
onBlur?: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
7
|
+
onEditorMount?: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
8
|
+
onEditorUpdate?: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
9
|
+
onList: (list: CompletionList | null, el: HTMLElement | null) => void;
|
|
10
|
+
onChange?: (editor: IStandaloneCodeEditor, monaco: Monaco, value: string) => void;
|
|
11
|
+
onValid?: (editor: IStandaloneCodeEditor, monaco: Monaco, valid: boolean) => void;
|
|
12
|
+
onOpen?: (editor: IStandaloneCodeEditor, object: IMetadataObject) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function useMonaco(languageId: string, autohint: boolean, decorators: boolean, handlers: MonacoHandlers): {
|
|
15
|
+
onMount: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
16
|
+
onUpdate: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
17
|
+
autoformat: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
18
|
+
getValue: (editor: IStandaloneCodeEditor) => string;
|
|
19
|
+
getValid: (editor: IStandaloneCodeEditor, monaco: Monaco) => boolean;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useMonaco.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMonaco.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/maql/hooks/useMonaco.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAQ3D,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAavF,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,MAAM,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACtE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClF,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAClF,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CAC7E,CAAC;AAEF,wBAAgB,SAAS,CACrB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,cAAc,GACzB;IACC,OAAO,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,UAAU,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,MAAM,CAAC;IACpD,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;CACxE,CAmFA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { useProp } from "../../../shared/hooks/useProp.js";
|
|
4
|
+
import { useAutoformat } from "../../hooks/useAutoformat.js";
|
|
5
|
+
import { useCleanCallback } from "../../hooks/useCleanCallback.js";
|
|
6
|
+
import { useMountCallback } from "../../hooks/useMountCallback.js";
|
|
7
|
+
import { useUpdateCallback } from "../../hooks/useUpdateCallback.js";
|
|
8
|
+
import { useValueCallbacks } from "../../hooks/useValueCallbacks.js";
|
|
9
|
+
import { onSuggestionElement } from "../../statusBar/SuggestionStatusBar.js";
|
|
10
|
+
import { useAutocomplete } from "./useAutocomplete.js";
|
|
11
|
+
import { useDecoration } from "./useDecoration.js";
|
|
12
|
+
import { useDocumentFormatting } from "./useDocumentFormatting.js";
|
|
13
|
+
import { useHover } from "./useHover.js";
|
|
14
|
+
import { useLanguageService } from "./useLanguageService.js";
|
|
15
|
+
import { useLanguageServiceInitializer } from "./useLanguageServiceInitializer.js";
|
|
16
|
+
import { useSemanticHighlight } from "./useSemanticHighlight.js";
|
|
17
|
+
import { useSyntaxHighlight } from "./useSyntaxHighlight.js";
|
|
18
|
+
import { useValidation } from "./useValidation.js";
|
|
19
|
+
export function useMonaco(languageId, autohint, decorators, handlers) {
|
|
20
|
+
const [hints, setHints] = useProp(autohint);
|
|
21
|
+
const [list, setList] = useState(null);
|
|
22
|
+
const [listElement, setListElement] = useState(null);
|
|
23
|
+
const [codeEditor, setCodeEditor] = useState(null);
|
|
24
|
+
const { onFocus, onBlur, onEditorMount, onEditorUpdate, onValid, onList, onChange, onOpen } = handlers;
|
|
25
|
+
const languageService = useLanguageService();
|
|
26
|
+
const initializeData = useLanguageServiceInitializer(languageService);
|
|
27
|
+
const validation = useValidation(languageService);
|
|
28
|
+
const decoration = useDecoration(languageService, decorators);
|
|
29
|
+
useEffect(() => onList(list, listElement), [list, listElement, onList]);
|
|
30
|
+
useEffect(() => decoration(codeEditor), [codeEditor, decoration]);
|
|
31
|
+
useAutocomplete(languageId, languageService, initializeData, setList);
|
|
32
|
+
useSyntaxHighlight(languageId);
|
|
33
|
+
useSemanticHighlight(languageId, languageService, initializeData);
|
|
34
|
+
useHover(codeEditor, languageId, languageService, initializeData, onOpen);
|
|
35
|
+
useDocumentFormatting(languageId, languageService);
|
|
36
|
+
const { getValue, getValid } = useValueCallbacks();
|
|
37
|
+
const [mountCallback, disposableMount] = useMountCallback({
|
|
38
|
+
setCodeEditor,
|
|
39
|
+
afterStart: useCallback((editor, monaco) => {
|
|
40
|
+
//suggestion element
|
|
41
|
+
onSuggestionElement(editor, setListElement);
|
|
42
|
+
//validate and decorate on start
|
|
43
|
+
decoration(editor);
|
|
44
|
+
validation(editor, monaco);
|
|
45
|
+
}, [decoration, validation]),
|
|
46
|
+
}, { onEditorMount });
|
|
47
|
+
const [updateCallback, disposableUpdate] = useUpdateCallback({
|
|
48
|
+
getValue,
|
|
49
|
+
getValid,
|
|
50
|
+
afterFocus: useCallback((editor) => {
|
|
51
|
+
if (hints) {
|
|
52
|
+
editor.trigger("", "editor.action.marker.next", "");
|
|
53
|
+
}
|
|
54
|
+
}, [hints]),
|
|
55
|
+
afterChange: useCallback((editor, monaco) => {
|
|
56
|
+
decoration(editor);
|
|
57
|
+
validation(editor, monaco);
|
|
58
|
+
setHints(false);
|
|
59
|
+
}, [decoration, setHints, validation]),
|
|
60
|
+
afterValidate: useCallback((_editor, _monaco, valid) => {
|
|
61
|
+
if (valid) {
|
|
62
|
+
setHints(false);
|
|
63
|
+
}
|
|
64
|
+
}, [setHints]),
|
|
65
|
+
}, { onFocus, onBlur, onValid, onChange, onEditorUpdate });
|
|
66
|
+
const autoformat = useAutoformat(onChange);
|
|
67
|
+
useCleanCallback(disposableMount, disposableUpdate);
|
|
68
|
+
return {
|
|
69
|
+
onMount: mountCallback,
|
|
70
|
+
onUpdate: updateCallback,
|
|
71
|
+
autoformat,
|
|
72
|
+
getValue,
|
|
73
|
+
getValid,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type InitializeResult } from "vscode-languageserver";
|
|
2
|
+
import { type MaqlLanguageService } from "@gooddata/sdk-maql-language-server";
|
|
3
|
+
export declare function useSemanticHighlight(languageId: string, languageService: MaqlLanguageService | undefined, initializeData: InitializeResult | undefined): void;
|
|
4
|
+
//# sourceMappingURL=useSemanticHighlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSemanticHighlight.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/maql/hooks/useSemanticHighlight.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,mBAAmB,GAAG,SAAS,EAChD,cAAc,EAAE,gBAAgB,GAAG,SAAS,GAC7C,IAAI,CA+BN"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import * as monaco from "monaco-editor/editor/editor.api.js";
|
|
4
|
+
import { createDocument } from "../utils.js";
|
|
5
|
+
export function useSemanticHighlight(languageId, languageService, initializeData) {
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (!languageService || !initializeData) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
// Semantic highlighting - register a semantic tokens provider from MAQL LS
|
|
11
|
+
const disposeHighlighting = monaco.languages.registerDocumentSemanticTokensProvider(languageId, {
|
|
12
|
+
getLegend: () => initializeData.capabilities.semanticTokensProvider?.legend || {
|
|
13
|
+
tokenTypes: [],
|
|
14
|
+
tokenModifiers: [],
|
|
15
|
+
},
|
|
16
|
+
provideDocumentSemanticTokens: (model) => {
|
|
17
|
+
const document = createDocument(model);
|
|
18
|
+
return languageService.doSemanticTokens(document).then((tokens) => {
|
|
19
|
+
return {
|
|
20
|
+
...tokens,
|
|
21
|
+
data: new Uint32Array(tokens.data),
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
releaseDocumentSemanticTokens: () => {
|
|
26
|
+
/*do nothing*/
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
disposeHighlighting.dispose();
|
|
31
|
+
};
|
|
32
|
+
}, [languageId, languageService, initializeData]);
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSyntaxHighlight.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/maql/hooks/useSyntaxHighlight.ts"],"names":[],"mappings":"AAQA,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAwB3D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import * as monaco from "monaco-editor/editor/editor.api.js";
|
|
4
|
+
//more info in README.md
|
|
5
|
+
export function useSyntaxHighlight(languageId) {
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
// Syntax highlighting - register a tokens provider for MAQL - works for code blocks in Markdown
|
|
8
|
+
const disposeHighlighting = monaco.languages.setMonarchTokensProvider(languageId, {
|
|
9
|
+
tokenizer: {
|
|
10
|
+
root: [
|
|
11
|
+
[/\{fact\/[^}]*\}/gi, "fact"],
|
|
12
|
+
[/\{metric\/[^}]*\}/gi, "metric"],
|
|
13
|
+
[/\{dataset\/[^}]*\}/gi, "dataset"],
|
|
14
|
+
[/\{attribute\/[^}]*\}/gi, "attribute"],
|
|
15
|
+
[/\{computed_attribute\/[^}]*\}/gi, "attribute"],
|
|
16
|
+
[/\{label\/[^}]*\}/gi, "label"],
|
|
17
|
+
[/\{[^}]*\}/g, "variable"],
|
|
18
|
+
[/\w+/g, "keyword"],
|
|
19
|
+
[/"(?:[^"\\]|\\.)*"/g, "string"],
|
|
20
|
+
[/#[^\n]*/g, "comment"],
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return () => {
|
|
25
|
+
disposeHighlighting.dispose();
|
|
26
|
+
};
|
|
27
|
+
}, [languageId]);
|
|
28
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type MaqlLanguageService } from "@gooddata/sdk-maql-language-server";
|
|
2
|
+
import { type IStandaloneCodeEditor, type Monaco } from "../../monaco/MonacoEditor.js";
|
|
3
|
+
export declare function useValidation(languageService: MaqlLanguageService | undefined): (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
4
|
+
//# sourceMappingURL=useValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidation.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/maql/hooks/useValidation.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAG9E,OAAO,EAAoB,KAAK,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAMzG,wBAAgB,aAAa,CACzB,eAAe,EAAE,mBAAmB,GAAG,SAAS,GACjD,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CA6DzD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import * as monaco from "monaco-editor/editor/editor.api.js";
|
|
4
|
+
import { ProtocolToMonacoConverter } from "monaco-languageclient/monaco-converter";
|
|
5
|
+
import { createDocument } from "../utils.js";
|
|
6
|
+
// pending validations are stored here, so we don't run multiple validations on same document
|
|
7
|
+
const pendingValidationRequests = new Map();
|
|
8
|
+
export function useValidation(languageService) {
|
|
9
|
+
return useMemo(() => {
|
|
10
|
+
const p2m = new ProtocolToMonacoConverter(monaco);
|
|
11
|
+
// validate function should be called with some debounce
|
|
12
|
+
function validate(editor, monaco) {
|
|
13
|
+
const model = editor?.getModel();
|
|
14
|
+
if (model) {
|
|
15
|
+
const document = createDocument(model);
|
|
16
|
+
cleanPendingValidation(document);
|
|
17
|
+
pendingValidationRequests.set(document.uri, window.setTimeout(() => {
|
|
18
|
+
// validations are stored as timeouts, so we can cancel the promise easily
|
|
19
|
+
doValidate(document, editor, monaco);
|
|
20
|
+
pendingValidationRequests.delete(document.uri);
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function cleanPendingValidation(document) {
|
|
25
|
+
const request = pendingValidationRequests.get(document.uri);
|
|
26
|
+
if (request !== undefined) {
|
|
27
|
+
clearTimeout(request);
|
|
28
|
+
pendingValidationRequests.delete(document.uri);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function doValidate(document, editor, monaco) {
|
|
32
|
+
if (document.getText().length === 0) {
|
|
33
|
+
setModelMarkers([], editor, monaco);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (languageService) {
|
|
37
|
+
languageService
|
|
38
|
+
.doValidation(document)
|
|
39
|
+
.then((diagnostics) => {
|
|
40
|
+
const markers = p2m.asDiagnostics(diagnostics);
|
|
41
|
+
setModelMarkers(markers, editor, monaco);
|
|
42
|
+
})
|
|
43
|
+
.catch((_reason) => {
|
|
44
|
+
setModelMarkers([], editor, monaco); // validation failed - clear previous diagnostics
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function setModelMarkers(markers, editor, monaco) {
|
|
49
|
+
const model = editor?.getModel();
|
|
50
|
+
if (model) {
|
|
51
|
+
monaco?.editor.setModelMarkers(model, "default", markers);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return validate;
|
|
55
|
+
}, [languageService]);
|
|
56
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
2
|
+
import { type IReadOnlyModel, type Range } from "../monaco/MonacoEditor.js";
|
|
3
|
+
export declare function createDocument(model: IReadOnlyModel, range?: Range): TextDocument;
|
|
4
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/MaqlEditor/maql/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAG5E,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,YAAY,CAOjF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
const MODEL_URI = "inmemory://model.maql";
|
|
4
|
+
export function createDocument(model, range) {
|
|
5
|
+
return TextDocument.create(MODEL_URI, model.getLanguageId(), model.getVersionId(), range ? model.getValueInRange(range) : model.getValue());
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monaco-shim.d.ts","sourceRoot":"","sources":["../../../src/MaqlEditor/mock/monaco-shim.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,IAAI,IAAI,CAmCrC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
export function shimMaqlEditor() {
|
|
3
|
+
const noop = () => void 0;
|
|
4
|
+
//monaco shim methods
|
|
5
|
+
if (!document.queryCommandSupported) {
|
|
6
|
+
document.queryCommandSupported = () => false;
|
|
7
|
+
}
|
|
8
|
+
if (!global.matchMedia) {
|
|
9
|
+
global.matchMedia = () => {
|
|
10
|
+
return {
|
|
11
|
+
matches: false,
|
|
12
|
+
media: "",
|
|
13
|
+
dispatchEvent: noop,
|
|
14
|
+
addEventListener: noop,
|
|
15
|
+
removeEventListener: noop,
|
|
16
|
+
addListener: noop,
|
|
17
|
+
removeListener: noop,
|
|
18
|
+
onchange: noop,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (!global.ResizeObserver) {
|
|
23
|
+
class ResizeObserver {
|
|
24
|
+
observe() {
|
|
25
|
+
// do nothing
|
|
26
|
+
}
|
|
27
|
+
unobserve() {
|
|
28
|
+
// do nothing
|
|
29
|
+
}
|
|
30
|
+
disconnect() {
|
|
31
|
+
// do nothing
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
global.ResizeObserver = ResizeObserver;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
2
|
+
import type * as monaco from "monaco-editor/editor/editor.api.js";
|
|
3
|
+
import { type IMaqlEditorIcons } from "./MonacoEditor.styles.js";
|
|
4
|
+
export type Monaco = typeof monaco;
|
|
5
|
+
export interface IMonacoEditorProps {
|
|
6
|
+
inline?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
options?: Partial<IStandaloneEditorConstructionOptions>;
|
|
9
|
+
icons?: IMaqlEditorIcons;
|
|
10
|
+
autofocus?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
languageConfiguration?: monaco.languages.LanguageConfiguration;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
themeName?: string;
|
|
16
|
+
themeData?: IStandaloneThemeData;
|
|
17
|
+
onEditorMount?: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
18
|
+
onEditorUpdate?: (editor: IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
19
|
+
onContentSizeChange?: (editor: IStandaloneCodeEditor, monaco: Monaco, width: number, height: number) => void;
|
|
20
|
+
heightOffset?: number;
|
|
21
|
+
ref?: Ref<IStandaloneCodeEditor | null>;
|
|
22
|
+
}
|
|
23
|
+
export type IDisposable = monaco.IDisposable;
|
|
24
|
+
export type IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;
|
|
25
|
+
export type IStandaloneEditorConstructionOptions = monaco.editor.IStandaloneEditorConstructionOptions;
|
|
26
|
+
export type IEditorContribution = monaco.editor.IEditorContribution;
|
|
27
|
+
export type IStandaloneThemeData = monaco.editor.IStandaloneThemeData;
|
|
28
|
+
export type IMarkerData = monaco.editor.IMarkerData;
|
|
29
|
+
export type IReadOnlyModel = monaco.editor.IReadOnlyModel;
|
|
30
|
+
export type FormattingOptions = monaco.languages.FormattingOptions;
|
|
31
|
+
export type Range = monaco.Range;
|
|
32
|
+
export type ISuggestContribution = IEditorContribution & {
|
|
33
|
+
widget: {
|
|
34
|
+
value: {
|
|
35
|
+
onDidShow: (handler: () => void) => void;
|
|
36
|
+
onDidHide: (handler: () => void) => void;
|
|
37
|
+
element: {
|
|
38
|
+
domNode: HTMLElement;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export type IMarkersContribution = IEditorContribution & {
|
|
44
|
+
close(focusEditor?: boolean): void;
|
|
45
|
+
};
|
|
46
|
+
export declare const MainClass = "maql-editor";
|
|
47
|
+
export declare const MainClassContent = "maql-editor-content";
|
|
48
|
+
export declare const MonacoEditor: import("react").ForwardRefExoticComponent<Omit<IMonacoEditorProps, "ref"> & import("react").RefAttributes<monaco.editor.IStandaloneCodeEditor | null>>;
|
|
49
|
+
//# sourceMappingURL=MonacoEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonacoEditor.d.ts","sourceRoot":"","sources":["../../../src/MaqlEditor/monaco/MonacoEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAA0D,MAAM,OAAO,CAAC;AAGzF,OAAO,KAAK,KAAK,MAAM,MAAM,oCAAoC,CAAC;AAOlE,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,0BAA0B,CAAC;AAE/E,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC,oCAAoC,CAAC,CAAC;IACxD,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,qBAAqB,CAAC;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,mBAAmB,CAAC,EAAE,CAClB,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,KACb,IAAI,CAAC;IACV,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,GAAG,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC7C,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC;AACxE,MAAM,MAAM,oCAAoC,GAAG,MAAM,CAAC,MAAM,CAAC,oCAAoC,CAAC;AACtG,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC;AACtE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC;AACnE,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACjC,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG;IACrD,MAAM,EAAE;QACJ,KAAK,EAAE;YACH,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;YACzC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;YACzC,OAAO,EAAE;gBACL,OAAO,EAAE,WAAW,CAAC;aACxB,CAAC;SACL,CAAC;KACL,CAAC;CACL,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG;IACrD,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACtC,CAAC;AAmBF,eAAO,MAAM,SAAS,gBAAgB,CAAC;AACvC,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,eAAO,MAAM,YAAY,wJAwDxB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2021-2026 GoodData Corporation
|
|
3
|
+
import { forwardRef, useCallback, useImperativeHandle, useState } from "react";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
//more info in README.md
|
|
6
|
+
import { makeStyles } from "../theme/styles.js";
|
|
7
|
+
import { useAutofocus } from "./hooks/useAutofocus.js";
|
|
8
|
+
import { useMonaco } from "./hooks/useMonaco.js";
|
|
9
|
+
import { MonacoStyles } from "./MonacoEditor.styles.js";
|
|
10
|
+
const useStyles = makeStyles()(() => ({
|
|
11
|
+
editor: {
|
|
12
|
+
display: "flex",
|
|
13
|
+
position: "relative",
|
|
14
|
+
textAlign: "initial",
|
|
15
|
+
width: "100%",
|
|
16
|
+
height: "100%",
|
|
17
|
+
},
|
|
18
|
+
inline: {
|
|
19
|
+
width: "100%",
|
|
20
|
+
height: "100%",
|
|
21
|
+
},
|
|
22
|
+
content: {
|
|
23
|
+
width: "100%",
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
export const MainClass = "maql-editor";
|
|
27
|
+
export const MainClassContent = "maql-editor-content";
|
|
28
|
+
export const MonacoEditor = forwardRef(function MonacoEditor({ icons, options, autofocus = false, className = "", language = "", languageConfiguration, defaultValue = "", themeName = "", themeData, onEditorMount = () => { }, onEditorUpdate = () => { }, inline = false, readonly = false, }, ref) {
|
|
29
|
+
const [element, setElement] = useState(null);
|
|
30
|
+
const [uniqueId] = useState(`${MainClassContent}-${Math.random().toString(36).slice(2)}`);
|
|
31
|
+
const { width, height, onContentSizeChange } = useContentSize(inline);
|
|
32
|
+
const editor = useMonaco(element, {
|
|
33
|
+
className: [MainClass, className].join(" "),
|
|
34
|
+
options,
|
|
35
|
+
language,
|
|
36
|
+
languageConfiguration,
|
|
37
|
+
defaultValue,
|
|
38
|
+
themeName,
|
|
39
|
+
themeData,
|
|
40
|
+
inline,
|
|
41
|
+
readonly,
|
|
42
|
+
onEditorMount,
|
|
43
|
+
onEditorUpdate,
|
|
44
|
+
onContentSizeChange,
|
|
45
|
+
});
|
|
46
|
+
useImperativeHandle(ref, () => editor, [
|
|
47
|
+
editor,
|
|
48
|
+
]);
|
|
49
|
+
const { classes } = useStyles();
|
|
50
|
+
useAutofocus(element, editor, autofocus || false);
|
|
51
|
+
return (_jsxs("section", { id: uniqueId, className: classNames(classes.editor, MainClassContent, inline && classes.inline), style: getStyles(width, height, inline), children: [_jsx(MonacoStyles, { id: uniqueId, icons: icons, themeData: themeData, options: options }), _jsx("div", { ref: (ref) => setElement(ref), className: classes.content })] }));
|
|
52
|
+
});
|
|
53
|
+
function useContentSize(inline) {
|
|
54
|
+
const [height, setHeight] = useState(0);
|
|
55
|
+
const [width, setWidth] = useState(0);
|
|
56
|
+
const onContentSizeChange = useCallback(
|
|
57
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
|
+
(...[, , currentWidth, currentHeight]) => {
|
|
59
|
+
if (inline) {
|
|
60
|
+
setWidth(currentWidth);
|
|
61
|
+
setHeight(currentHeight);
|
|
62
|
+
}
|
|
63
|
+
}, [inline]);
|
|
64
|
+
return { width, height, onContentSizeChange };
|
|
65
|
+
}
|
|
66
|
+
function getStyles(width, height, inline) {
|
|
67
|
+
if (inline && width > 0 && height > 0) {
|
|
68
|
+
return { height, width };
|
|
69
|
+
}
|
|
70
|
+
return {};
|
|
71
|
+
}
|