@perses-dev/plugin-system 0.53.0-rc.1 → 0.53.0-rc.3
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/cjs/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/cjs/components/CalculationSelector/index.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/index.js +1 -1
- package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +1 -1
- package/dist/cjs/components/DatasourceSelect/index.js +1 -1
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +1 -1
- package/dist/cjs/components/HTTPSettingsEditor/index.js +1 -1
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +1175 -0
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +30 -0
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +1 -1
- package/dist/cjs/components/LegendOptionsEditor/index.js +1 -1
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +1 -1
- package/dist/cjs/components/MetricLabelInput/index.js +1 -1
- package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +1 -1
- package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +1 -1
- package/dist/cjs/components/MultiQueryEditor/index.js +1 -1
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +1 -1
- package/dist/cjs/components/OptionsEditorRadios/index.js +1 -1
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/index.js +1 -1
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +1 -1
- package/dist/cjs/components/PanelSpecEditor/index.js +1 -1
- package/dist/cjs/components/PluginEditor/PluginEditor.js +1 -1
- package/dist/cjs/components/PluginEditor/index.js +1 -1
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +1 -1
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +1 -1
- package/dist/cjs/components/PluginKindSelect/index.js +1 -1
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/cjs/components/PluginRegistry/index.js +1 -1
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +1 -1
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
- package/dist/cjs/components/PluginSpecEditor/index.js +1 -1
- package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +43 -0
- package/dist/cjs/components/SelectionOptionsEditor/index.js +30 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +11 -3
- package/dist/cjs/components/TimeRangeControls/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/cjs/components/Variables/index.js +1 -1
- package/dist/cjs/components/Variables/variable-model.js +1 -1
- package/dist/cjs/components/index.js +2 -1
- package/dist/cjs/constants/index.js +1 -1
- package/dist/cjs/constants/user-interface-text.js +1 -1
- package/dist/cjs/context/ValidationProvider.js +1 -1
- package/dist/cjs/context/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/model/datasource.js +1 -1
- package/dist/cjs/model/explore.js +1 -1
- package/dist/cjs/model/index.js +1 -1
- package/dist/cjs/model/legend.js +1 -1
- package/dist/cjs/model/log-queries.js +1 -1
- package/dist/cjs/model/panels.js +1 -1
- package/dist/cjs/model/plugin-base.js +1 -1
- package/dist/cjs/model/plugin-loading.js +1 -1
- package/dist/cjs/model/plugins.js +1 -1
- package/dist/cjs/model/profile-queries.js +1 -1
- package/dist/cjs/model/time-series-queries.js +1 -1
- package/dist/cjs/model/trace-queries.js +1 -1
- package/dist/cjs/model/variables.js +1 -1
- package/dist/cjs/remote/PersesPlugin.types.js +1 -1
- package/dist/cjs/remote/PluginLoaderComponent.js +13 -1
- package/dist/cjs/remote/PluginRuntime.js +13 -1
- package/dist/cjs/remote/index.js +1 -1
- package/dist/cjs/remote/remotePluginLoader.js +1 -1
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +1 -1
- package/dist/cjs/runtime/DataQueriesProvider/index.js +1 -1
- package/dist/cjs/runtime/DataQueriesProvider/model.js +1 -1
- package/dist/cjs/runtime/QueryCountProvider.js +1 -1
- package/dist/cjs/runtime/RouterProvider.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +7 -2
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/index.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +28 -1
- package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +1 -1
- package/dist/cjs/runtime/UsageMetricsProvider.js +1 -1
- package/dist/cjs/runtime/builtin-variables.js +1 -1
- package/dist/cjs/runtime/datasources.js +1 -1
- package/dist/cjs/runtime/index.js +2 -1
- package/dist/cjs/runtime/item-actions.js +303 -0
- package/dist/cjs/runtime/log-queries.js +1 -1
- package/dist/cjs/runtime/plugin-registry.js +1 -1
- package/dist/cjs/runtime/profile-queries.js +1 -1
- package/dist/cjs/runtime/time-series-queries.js +1 -1
- package/dist/cjs/runtime/trace-queries.js +1 -1
- package/dist/cjs/runtime/utils.js +1 -1
- package/dist/cjs/runtime/variables.js +6 -6
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/test/mock-data.js +1 -1
- package/dist/cjs/test/render-hook.js +1 -1
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/test/setup-tests.js +1 -1
- package/dist/cjs/test/test-plugins/bert/index.js +1 -1
- package/dist/cjs/test/test-plugins/ernie/index.js +1 -1
- package/dist/cjs/test/test-plugins/index.js +1 -1
- package/dist/cjs/test/utils.js +1 -1
- package/dist/cjs/test-utils/index.js +1 -1
- package/dist/cjs/test-utils/mock-plugin-registry.js +1 -1
- package/dist/cjs/utils/action.js +1 -1
- package/dist/cjs/utils/event.js +1 -1
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/variables.js +9 -146
- package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/CalculationSelector/index.js +1 -1
- package/dist/components/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceEditorForm/index.js +1 -1
- package/dist/components/DatasourceEditorForm/index.js.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
- package/dist/components/DatasourceSelect/index.js +1 -1
- package/dist/components/DatasourceSelect/index.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/index.js +1 -1
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +49 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +1154 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/index.d.ts +2 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/index.d.ts.map +1 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js +15 -0
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LegendOptionsEditor/index.js +1 -1
- package/dist/components/LegendOptionsEditor/index.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.js +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
- package/dist/components/MetricLabelInput/index.js +1 -1
- package/dist/components/MetricLabelInput/index.js.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
- package/dist/components/MultiQueryEditor/index.js +1 -1
- package/dist/components/MultiQueryEditor/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorRadios/index.js +1 -1
- package/dist/components/OptionsEditorRadios/index.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/index.js +1 -1
- package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js +1 -1
- package/dist/components/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +1 -1
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/index.js +1 -1
- package/dist/components/PluginEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.js +1 -1
- package/dist/components/PluginKindSelect/index.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/index.js +1 -1
- package/dist/components/PluginRegistry/index.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/index.js +1 -1
- package/dist/components/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +10 -0
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -0
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +35 -0
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -0
- package/dist/components/SelectionOptionsEditor/index.d.ts +2 -0
- package/dist/components/SelectionOptionsEditor/index.d.ts.map +1 -0
- package/dist/components/SelectionOptionsEditor/index.js +15 -0
- package/dist/components/SelectionOptionsEditor/index.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +4 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +12 -4
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/index.js +1 -1
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.js +1 -1
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/user-interface-text.js +1 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/ValidationProvider.js +1 -1
- package/dist/context/ValidationProvider.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/datasource.js +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.js +1 -1
- package/dist/model/explore.js.map +1 -1
- package/dist/model/index.js +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/legend.js +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/log-queries.js +1 -1
- package/dist/model/log-queries.js.map +1 -1
- package/dist/model/panels.js +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.js +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.js +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.js +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/profile-queries.js +1 -1
- package/dist/model/profile-queries.js.map +1 -1
- package/dist/model/time-series-queries.js +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.js +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +4 -7
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +1 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PersesPlugin.types.js +1 -1
- package/dist/remote/PersesPlugin.types.js.map +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
- package/dist/remote/PluginLoaderComponent.js +13 -1
- package/dist/remote/PluginLoaderComponent.js.map +1 -1
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +13 -1
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/remote/index.js +1 -1
- package/dist/remote/index.js.map +1 -1
- package/dist/remote/remotePluginLoader.js +1 -1
- package/dist/remote/remotePluginLoader.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/index.js +1 -1
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +1 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/QueryCountProvider.js +1 -1
- package/dist/runtime/QueryCountProvider.js.map +1 -1
- package/dist/runtime/RouterProvider.js +1 -1
- package/dist/runtime/RouterProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +8 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +1 -1
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +11 -0
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +26 -2
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.js +1 -1
- package/dist/runtime/UsageMetricsProvider.js.map +1 -1
- package/dist/runtime/builtin-variables.js +1 -1
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.js +1 -1
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/item-actions.d.ts +35 -0
- package/dist/runtime/item-actions.d.ts.map +1 -0
- package/dist/runtime/item-actions.js +300 -0
- package/dist/runtime/item-actions.js.map +1 -0
- package/dist/runtime/log-queries.js +1 -1
- package/dist/runtime/log-queries.js.map +1 -1
- package/dist/runtime/plugin-registry.js +1 -1
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/profile-queries.js +1 -1
- package/dist/runtime/profile-queries.js.map +1 -1
- package/dist/runtime/time-series-queries.js +1 -1
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.js +1 -1
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/utils.js +1 -1
- package/dist/runtime/utils.js.map +1 -1
- package/dist/runtime/variables.d.ts +2 -18
- package/dist/runtime/variables.d.ts.map +1 -1
- package/dist/runtime/variables.js +3 -3
- package/dist/runtime/variables.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/mock-data.js +1 -1
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render-hook.js +1 -1
- package/dist/test/render-hook.js.map +1 -1
- package/dist/test/render.js +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.js +1 -1
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +1 -1
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test/test-plugins/index.js +1 -1
- package/dist/test/test-plugins/index.js.map +1 -1
- package/dist/test/utils.js +1 -1
- package/dist/test/utils.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +1 -1
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/action.js +1 -1
- package/dist/utils/action.js.map +1 -1
- package/dist/utils/event.js +1 -1
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/variables.d.ts +2 -30
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +3 -144
- package/dist/utils/variables.js.map +1 -1
- package/package.json +3 -3
package/dist/utils/action.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/action.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/utils/action.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Action } from '@perses-dev/core';\n\nexport function getTitleAction(action: Action, isDraft: boolean): string {\n if (action === 'read') return 'View';\n if (isDraft && action === 'create') return 'Add';\n if (!isDraft && action === 'create') return 'Create';\n if (action === 'update') return 'Edit';\n return '';\n}\n\nexport function getSubmitText(action: Action, isDraft: boolean): string {\n if (isDraft && action === 'create') return 'Add';\n if (isDraft && action === 'update') return 'Apply';\n if (!isDraft) return 'Save';\n return '';\n}\n"],"names":["getTitleAction","action","isDraft","getSubmitText"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,SAASA,eAAeC,MAAc,EAAEC,OAAgB;IAC7D,IAAID,WAAW,QAAQ,OAAO;IAC9B,IAAIC,WAAWD,WAAW,UAAU,OAAO;IAC3C,IAAI,CAACC,WAAWD,WAAW,UAAU,OAAO;IAC5C,IAAIA,WAAW,UAAU,OAAO;IAChC,OAAO;AACT;AAEA,OAAO,SAASE,cAAcF,MAAc,EAAEC,OAAgB;IAC5D,IAAIA,WAAWD,WAAW,UAAU,OAAO;IAC3C,IAAIC,WAAWD,WAAW,UAAU,OAAO;IAC3C,IAAI,CAACC,SAAS,OAAO;IACrB,OAAO;AACT"}
|
package/dist/utils/event.js
CHANGED
package/dist/utils/event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/event.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/utils/event.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useRef, useLayoutEffect, useCallback } from 'react';\n\n/**\n * A (temporary) userland implementation of `useEvent` from this React RFC: https://github.com/reactjs/rfcs/pull/220.\n *\n * Typically useful for getting a stable reference to an \"event\" function (i.e. one that isn't called during render\n * but is called later in a useEffect or event handler) that accesses state or props.\n */\nexport function useEvent<T extends unknown[], U>(handler: (...args: T) => U): (...args: T) => U {\n const handlerRef = useRef(handler);\n useLayoutEffect(() => {\n handlerRef.current = handler;\n });\n\n return useCallback((...args) => handlerRef.current(...args), []);\n}\n"],"names":["useRef","useLayoutEffect","useCallback","useEvent","handler","handlerRef","current","args"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,MAAM,EAAEC,eAAe,EAAEC,WAAW,QAAQ,QAAQ;AAE7D;;;;;CAKC,GACD,OAAO,SAASC,SAAiCC,OAA0B;IACzE,MAAMC,aAAaL,OAAOI;IAC1BH,gBAAgB;QACdI,WAAWC,OAAO,GAAGF;IACvB;IAEA,OAAOF,YAAY,CAAC,GAAGK,OAASF,WAAWC,OAAO,IAAIC,OAAO,EAAE;AACjE"}
|
package/dist/utils/index.js
CHANGED
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './action';\nexport * from './event';\nexport * from './variables';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,cAAc"}
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function replaceVariables(text: string, variableState: VariableStateMap): string;
|
|
4
|
-
export declare enum InterpolationFormat {
|
|
5
|
-
CSV = "csv",
|
|
6
|
-
DISTRIBUTED = "distributed",
|
|
7
|
-
DOUBLEQUOTE = "doublequote",
|
|
8
|
-
GLOB = "glob",
|
|
9
|
-
JSON = "json",
|
|
10
|
-
LUCENE = "lucene",
|
|
11
|
-
PERCENTENCODE = "percentencode",
|
|
12
|
-
PIPE = "pipe",
|
|
13
|
-
PROMETHEUS = "prometheus",
|
|
14
|
-
RAW = "raw",
|
|
15
|
-
REGEX = "regex",
|
|
16
|
-
SINGLEQUOTE = "singlequote",
|
|
17
|
-
SQLSTRING = "sqlstring",
|
|
18
|
-
TEXT = "text",
|
|
19
|
-
QUERYPARAM = "queryparam"
|
|
20
|
-
}
|
|
21
|
-
export declare function interpolate(values: string[], name: string, format: InterpolationFormat): string;
|
|
22
|
-
export declare function replaceVariable(text: string, varName: string, variableValue: VariableValue, varFormat?: InterpolationFormat): string;
|
|
23
|
-
/**
|
|
24
|
-
* Returns a list of variables
|
|
25
|
-
*/
|
|
26
|
-
export declare function parseVariables(text: string): string[];
|
|
27
|
-
/**
|
|
28
|
-
* Returns a map of variable names and its format. If no format is specified, it will be undefined.
|
|
29
|
-
*/
|
|
30
|
-
export declare function parseVariablesAndFormat(text: string): Map<string, InterpolationFormat | undefined>;
|
|
1
|
+
export type { VariableOption, VariableState, VariableStateMap } from '@perses-dev/components';
|
|
2
|
+
export { InterpolationFormat, interpolate, parseVariables, parseVariablesAndFormat, replaceVariable, replaceVariables, } from '@perses-dev/components';
|
|
31
3
|
//# sourceMappingURL=variables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/utils/variables.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/utils/variables.ts"],"names":[],"mappings":"AAcA,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,gBAAgB,GACjB,MAAM,wBAAwB,CAAC"}
|
package/dist/utils/variables.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -10,148 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
const variables = Array.from(variablesMap.keys());
|
|
16
|
-
let finalText = text;
|
|
17
|
-
variables// Sorting variables by their length.
|
|
18
|
-
// In order to not have a variable name have contained in another variable name.
|
|
19
|
-
// i.e.: $__range replacing $__range_ms => '3600_ms' instead of '3600000'
|
|
20
|
-
.sort((a, b)=>b.length - a.length).forEach((v)=>{
|
|
21
|
-
const variable = variableState[v];
|
|
22
|
-
if (variable && variable.value !== undefined) {
|
|
23
|
-
finalText = replaceVariable(finalText, v, variable?.value, variablesMap.get(v));
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return finalText;
|
|
27
|
-
}
|
|
28
|
-
export var InterpolationFormat = /*#__PURE__*/ function(InterpolationFormat) {
|
|
29
|
-
InterpolationFormat["CSV"] = "csv";
|
|
30
|
-
InterpolationFormat["DISTRIBUTED"] = "distributed";
|
|
31
|
-
InterpolationFormat["DOUBLEQUOTE"] = "doublequote";
|
|
32
|
-
InterpolationFormat["GLOB"] = "glob";
|
|
33
|
-
InterpolationFormat["JSON"] = "json";
|
|
34
|
-
InterpolationFormat["LUCENE"] = "lucene";
|
|
35
|
-
InterpolationFormat["PERCENTENCODE"] = "percentencode";
|
|
36
|
-
InterpolationFormat["PIPE"] = "pipe";
|
|
37
|
-
InterpolationFormat["PROMETHEUS"] = "prometheus";
|
|
38
|
-
InterpolationFormat["RAW"] = "raw";
|
|
39
|
-
InterpolationFormat["REGEX"] = "regex";
|
|
40
|
-
InterpolationFormat["SINGLEQUOTE"] = "singlequote";
|
|
41
|
-
InterpolationFormat["SQLSTRING"] = "sqlstring";
|
|
42
|
-
InterpolationFormat["TEXT"] = "text";
|
|
43
|
-
InterpolationFormat["QUERYPARAM"] = "queryparam";
|
|
44
|
-
return InterpolationFormat;
|
|
45
|
-
}({});
|
|
46
|
-
function stringToFormat(val) {
|
|
47
|
-
if (!val) return undefined;
|
|
48
|
-
const lowerVal = val.toLowerCase();
|
|
49
|
-
return Object.values(InterpolationFormat).find((format)=>format === lowerVal) || undefined;
|
|
50
|
-
}
|
|
51
|
-
export function interpolate(values, name, format) {
|
|
52
|
-
switch(format){
|
|
53
|
-
case "csv":
|
|
54
|
-
case "raw":
|
|
55
|
-
return values.join(',');
|
|
56
|
-
case "distributed":
|
|
57
|
-
{
|
|
58
|
-
const [first, ...rest] = values;
|
|
59
|
-
return `${[
|
|
60
|
-
first,
|
|
61
|
-
...rest.map((v)=>`${name}=${v}`)
|
|
62
|
-
].join(',')}`;
|
|
63
|
-
}
|
|
64
|
-
case "doublequote":
|
|
65
|
-
return values.map((v)=>`"${v}"`).join(',');
|
|
66
|
-
case "glob":
|
|
67
|
-
return `{${values.join(',')}}`;
|
|
68
|
-
case "json":
|
|
69
|
-
return JSON.stringify(values);
|
|
70
|
-
case "lucene":
|
|
71
|
-
return `(${values.map((v)=>`"${v}"`).join(' OR ')})`;
|
|
72
|
-
case "percentencode":
|
|
73
|
-
return encodeURIComponent(values.join(','));
|
|
74
|
-
case "pipe":
|
|
75
|
-
return values.join('|');
|
|
76
|
-
case "regex":
|
|
77
|
-
{
|
|
78
|
-
const escapedRegex = values.map((v)=>v.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'));
|
|
79
|
-
return `(${escapedRegex.join('|')})`;
|
|
80
|
-
}
|
|
81
|
-
case "singlequote":
|
|
82
|
-
return values.map((v)=>`'${v}'`).join(',');
|
|
83
|
-
case "sqlstring":
|
|
84
|
-
return values.map((v)=>`'${v.replace(/'/g, "''")}'`).join(',');
|
|
85
|
-
case "text":
|
|
86
|
-
return values.join(' + ');
|
|
87
|
-
case "queryparam":
|
|
88
|
-
return values.map((v)=>`${name}=${encodeURIComponent(v)}`).join('&');
|
|
89
|
-
case "prometheus":
|
|
90
|
-
default:
|
|
91
|
-
return `(${values.join('|')})`;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export function replaceVariable(text, varName, variableValue, varFormat) {
|
|
95
|
-
const variableSyntax = '$' + varName;
|
|
96
|
-
const alternativeVariableSyntax = '${' + varName + (varFormat ? ':' + varFormat : '') + '}';
|
|
97
|
-
let replaceString = '';
|
|
98
|
-
if (Array.isArray(variableValue)) {
|
|
99
|
-
replaceString = interpolate(variableValue, varName, varFormat || "prometheus");
|
|
100
|
-
}
|
|
101
|
-
if (typeof variableValue === 'string') {
|
|
102
|
-
replaceString = interpolate([
|
|
103
|
-
variableValue
|
|
104
|
-
], varName, varFormat || "raw");
|
|
105
|
-
}
|
|
106
|
-
text = text.replaceAll(variableSyntax, replaceString);
|
|
107
|
-
return text.replaceAll(alternativeVariableSyntax, replaceString);
|
|
108
|
-
}
|
|
109
|
-
// This regular expression is designed to identify variable references in a string.
|
|
110
|
-
// It supports two formats for referencing variables:
|
|
111
|
-
// 1. $variableName - This is a simpler format, and the regular expression captures the variable name (\w+ matches one or more word characters).
|
|
112
|
-
// 2. ${variableName} - This is a more complex format and the regular expression captures the variable name (\w+ matches one or more word characters) in the curly braces.
|
|
113
|
-
// 3. ${variableName:format} - This is a more complex format that allows specifying a format interpolation.
|
|
114
|
-
const VARIABLE_REGEX = /\$(\w+)|\${(\w+)(?:\.([^:^}]+))?(?::([^}]+))?}/gm;
|
|
115
|
-
/**
|
|
116
|
-
* Returns a list of variables
|
|
117
|
-
*/ export function parseVariables(text) {
|
|
118
|
-
const matches = new Set();
|
|
119
|
-
let match;
|
|
120
|
-
while((match = VARIABLE_REGEX.exec(text)) !== null){
|
|
121
|
-
if (match) {
|
|
122
|
-
if (match[1]) {
|
|
123
|
-
// \$(\w+)\
|
|
124
|
-
matches.add(match[1]);
|
|
125
|
-
} else if (match[2]) {
|
|
126
|
-
// \${(\w+)}\
|
|
127
|
-
matches.add(match[2]);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
// return unique matches
|
|
132
|
-
return Array.from(matches.values());
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Returns a map of variable names and its format. If no format is specified, it will be undefined.
|
|
136
|
-
*/ export function parseVariablesAndFormat(text) {
|
|
137
|
-
const matches = new Map();
|
|
138
|
-
let match;
|
|
139
|
-
while((match = VARIABLE_REGEX.exec(text)) !== null){
|
|
140
|
-
if (match) {
|
|
141
|
-
let format = undefined;
|
|
142
|
-
if (match[4]) {
|
|
143
|
-
format = match[4];
|
|
144
|
-
}
|
|
145
|
-
if (match[1]) {
|
|
146
|
-
// \$(\w+)\
|
|
147
|
-
matches.set(match[1], stringToFormat(format));
|
|
148
|
-
} else if (match[2]) {
|
|
149
|
-
// \${(\w+)}\
|
|
150
|
-
matches.set(match[2], stringToFormat(format));
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return matches;
|
|
155
|
-
}
|
|
13
|
+
// Re-export all variable interpolation utilities from @perses-dev/components for backwards compatibility
|
|
14
|
+
export { InterpolationFormat, interpolate, parseVariables, parseVariablesAndFormat, replaceVariable, replaceVariables } from '@perses-dev/components';
|
|
156
15
|
|
|
157
16
|
//# sourceMappingURL=variables.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/variables.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { VariableValue } from '@perses-dev/core';\nimport { VariableStateMap } from '@perses-dev/plugin-system';\n\nexport function replaceVariables(text: string, variableState: VariableStateMap): string {\n const variablesMap = parseVariablesAndFormat(text);\n const variables = Array.from(variablesMap.keys());\n let finalText = text;\n variables\n // Sorting variables by their length.\n // In order to not have a variable name have contained in another variable name.\n // i.e.: $__range replacing $__range_ms => '3600_ms' instead of '3600000'\n .sort((a, b) => b.length - a.length)\n .forEach((v) => {\n const variable = variableState[v];\n if (variable && variable.value !== undefined) {\n finalText = replaceVariable(finalText, v, variable?.value, variablesMap.get(v));\n }\n });\n\n return finalText;\n}\n\nexport enum InterpolationFormat {\n CSV = 'csv',\n DISTRIBUTED = 'distributed',\n DOUBLEQUOTE = 'doublequote',\n GLOB = 'glob',\n JSON = 'json',\n LUCENE = 'lucene',\n PERCENTENCODE = 'percentencode',\n PIPE = 'pipe',\n PROMETHEUS = 'prometheus',\n RAW = 'raw',\n REGEX = 'regex',\n SINGLEQUOTE = 'singlequote',\n SQLSTRING = 'sqlstring',\n TEXT = 'text',\n QUERYPARAM = 'queryparam',\n}\n\nfunction stringToFormat(val: string | undefined): InterpolationFormat | undefined {\n if (!val) return undefined;\n\n const lowerVal = val.toLowerCase();\n return Object.values(InterpolationFormat).find((format) => format === lowerVal) || undefined;\n}\n\nexport function interpolate(values: string[], name: string, format: InterpolationFormat): string {\n switch (format) {\n case InterpolationFormat.CSV:\n case InterpolationFormat.RAW:\n return values.join(',');\n case InterpolationFormat.DISTRIBUTED: {\n const [first, ...rest] = values;\n return `${[first, ...rest.map((v) => `${name}=${v}`)].join(',')}`;\n }\n case InterpolationFormat.DOUBLEQUOTE:\n return values.map((v) => `\"${v}\"`).join(',');\n case InterpolationFormat.GLOB:\n return `{${values.join(',')}}`;\n case InterpolationFormat.JSON:\n return JSON.stringify(values);\n case InterpolationFormat.LUCENE:\n return `(${values.map((v) => `\"${v}\"`).join(' OR ')})`;\n case InterpolationFormat.PERCENTENCODE:\n return encodeURIComponent(values.join(','));\n case InterpolationFormat.PIPE:\n return values.join('|');\n case InterpolationFormat.REGEX: {\n const escapedRegex = values.map((v) => v.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'));\n return `(${escapedRegex.join('|')})`;\n }\n case InterpolationFormat.SINGLEQUOTE:\n return values.map((v) => `'${v}'`).join(',');\n case InterpolationFormat.SQLSTRING:\n return values.map((v) => `'${v.replace(/'/g, \"''\")}'`).join(',');\n case InterpolationFormat.TEXT:\n return values.join(' + ');\n case InterpolationFormat.QUERYPARAM:\n return values.map((v) => `${name}=${encodeURIComponent(v)}`).join('&');\n case InterpolationFormat.PROMETHEUS:\n default:\n return `(${values.join('|')})`;\n }\n}\n\nexport function replaceVariable(\n text: string,\n varName: string,\n variableValue: VariableValue,\n varFormat?: InterpolationFormat\n): string {\n const variableSyntax = '$' + varName;\n const alternativeVariableSyntax = '${' + varName + (varFormat ? ':' + varFormat : '') + '}';\n\n let replaceString = '';\n if (Array.isArray(variableValue)) {\n replaceString = interpolate(variableValue, varName, varFormat || InterpolationFormat.PROMETHEUS);\n }\n if (typeof variableValue === 'string') {\n replaceString = interpolate([variableValue], varName, varFormat || InterpolationFormat.RAW);\n }\n\n text = text.replaceAll(variableSyntax, replaceString);\n return text.replaceAll(alternativeVariableSyntax, replaceString);\n}\n\n// This regular expression is designed to identify variable references in a string.\n// It supports two formats for referencing variables:\n// 1. $variableName - This is a simpler format, and the regular expression captures the variable name (\\w+ matches one or more word characters).\n// 2. ${variableName} - This is a more complex format and the regular expression captures the variable name (\\w+ matches one or more word characters) in the curly braces.\n// 3. ${variableName:format} - This is a more complex format that allows specifying a format interpolation.\n\nconst VARIABLE_REGEX = /\\$(\\w+)|\\${(\\w+)(?:\\.([^:^}]+))?(?::([^}]+))?}/gm;\n\n/**\n * Returns a list of variables\n */\nexport function parseVariables(text: string): string[] {\n const matches = new Set<string>();\n let match;\n\n while ((match = VARIABLE_REGEX.exec(text)) !== null) {\n if (match) {\n if (match[1]) {\n // \\$(\\w+)\\\n matches.add(match[1]);\n } else if (match[2]) {\n // \\${(\\w+)}\\\n matches.add(match[2]);\n }\n }\n }\n // return unique matches\n return Array.from(matches.values());\n}\n\n/**\n * Returns a map of variable names and its format. If no format is specified, it will be undefined.\n */\nexport function parseVariablesAndFormat(text: string): Map<string, InterpolationFormat | undefined> {\n const matches = new Map<string, InterpolationFormat | undefined>();\n let match;\n\n while ((match = VARIABLE_REGEX.exec(text)) !== null) {\n if (match) {\n let format = undefined;\n if (match[4]) {\n format = match[4];\n }\n if (match[1]) {\n // \\$(\\w+)\\\n matches.set(match[1], stringToFormat(format));\n } else if (match[2]) {\n // \\${(\\w+)}\\\n matches.set(match[2], stringToFormat(format));\n }\n }\n }\n return matches;\n}\n"],"names":["replaceVariables","text","variableState","variablesMap","parseVariablesAndFormat","variables","Array","from","keys","finalText","sort","a","b","length","forEach","v","variable","value","undefined","replaceVariable","get","InterpolationFormat","stringToFormat","val","lowerVal","toLowerCase","Object","values","find","format","interpolate","name","join","first","rest","map","JSON","stringify","encodeURIComponent","escapedRegex","replace","varName","variableValue","varFormat","variableSyntax","alternativeVariableSyntax","replaceString","isArray","replaceAll","VARIABLE_REGEX","parseVariables","matches","Set","match","exec","add","Map","set"],"mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/variables.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Re-export all variable interpolation utilities from @perses-dev/components for backwards compatibility\nexport type { VariableOption, VariableState, VariableStateMap } from '@perses-dev/components';\nexport {\n InterpolationFormat,\n interpolate,\n parseVariables,\n parseVariablesAndFormat,\n replaceVariable,\n replaceVariables,\n} from '@perses-dev/components';\n"],"names":["InterpolationFormat","interpolate","parseVariables","parseVariablesAndFormat","replaceVariable","replaceVariables"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,yGAAyG;AAEzG,SACEA,mBAAmB,EACnBC,WAAW,EACXC,cAAc,EACdC,uBAAuB,EACvBC,eAAe,EACfC,gBAAgB,QACX,yBAAyB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/plugin-system",
|
|
3
|
-
"version": "0.53.0-rc.
|
|
3
|
+
"version": "0.53.0-rc.3",
|
|
4
4
|
"description": "The plugin feature in Pereses",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@module-federation/enhanced": "^0.21.4",
|
|
32
|
-
"@perses-dev/components": "0.53.0-rc.
|
|
33
|
-
"@perses-dev/core": "0.53.0-
|
|
32
|
+
"@perses-dev/components": "0.53.0-rc.3",
|
|
33
|
+
"@perses-dev/core": "0.53.0-rc.1",
|
|
34
34
|
"date-fns": "^4.1.0",
|
|
35
35
|
"date-fns-tz": "^3.2.0",
|
|
36
36
|
"immer": "^10.1.1",
|