@perses-dev/plugin-system 0.21.0 → 0.22.0
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/CalculationSelector.test.js +1 -1
- package/dist/cjs/components/CalculationSelector/index.js +1 -1
- package/dist/cjs/components/DatasourceSelect.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.test.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/TabPanel.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/index.js +1 -1
- package/dist/cjs/components/PluginEditor/PluginEditor.js +1 -1
- package/dist/cjs/components/PluginEditor/PluginEditor.test.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.js +1 -1
- package/dist/cjs/components/PluginKindSelect.test.js +1 -1
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/cjs/components/PluginRegistry/PluginRegistry.test.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.js +1 -1
- package/dist/cjs/components/PluginSpecEditor.test.js +1 -1
- package/dist/cjs/components/TimeSeriesQueryEditor.js +1 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/model/calculations.js +1 -1
- package/dist/cjs/model/datasource.js +1 -1
- package/dist/cjs/model/index.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/time-series-queries.js +1 -1
- package/dist/cjs/model/variables.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/index.js +1 -1
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +1 -1
- package/dist/cjs/runtime/datasources.js +10 -2
- package/dist/cjs/runtime/index.js +1 -1
- package/dist/cjs/runtime/plugin-registry.js +1 -1
- package/dist/cjs/runtime/template-variables.js +1 -1
- package/dist/cjs/runtime/time-series-queries.js +1 -1
- package/dist/cjs/test/index.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/index.js +1 -1
- package/dist/cjs/test-utils/mock-plugin-registry.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.test.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.test.js.map +1 -1
- package/dist/components/CalculationSelector/index.js +1 -1
- package/dist/components/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceSelect.js +1 -1
- package/dist/components/DatasourceSelect.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/OptionsEditorTabs.test.js +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.test.js.map +1 -1
- package/dist/components/OptionsEditorTabs/TabPanel.js +1 -1
- package/dist/components/OptionsEditorTabs/TabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js +1 -1
- package/dist/components/OptionsEditorTabs/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/PluginEditor.test.js +1 -1
- package/dist/components/PluginEditor/PluginEditor.test.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.js +1 -1
- package/dist/components/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect.test.js +1 -1
- package/dist/components/PluginKindSelect.test.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/PluginRegistry.test.js +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.test.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.js +1 -1
- package/dist/components/PluginSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor.test.js +1 -1
- package/dist/components/PluginSpecEditor.test.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor.js +1 -1
- package/dist/components/TimeSeriesQueryEditor.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/calculations.js +1 -1
- package/dist/model/calculations.js.map +1 -1
- package/dist/model/datasource.js +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/index.js +1 -1
- package/dist/model/index.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/time-series-queries.js +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/variables.js +1 -1
- package/dist/model/variables.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/index.js +1 -1
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/datasources.d.ts +4 -0
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +10 -1
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.js +1 -1
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/template-variables.js +1 -1
- package/dist/runtime/template-variables.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/test/index.js +1 -1
- package/dist/test/index.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/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/package.json +3 -3
package/dist/test/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/test/index.ts"],"sourcesContent":["// Copyright 2023 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 './render';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,UAAU,CAAC"}
|
package/dist/test/render.js
CHANGED
package/dist/test/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/render.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/test/render.tsx"],"sourcesContent":["// Copyright 2023 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 { render, RenderOptions } from '@testing-library/react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { PluginRegistry } from '../components/PluginRegistry';\nimport { DefaultPluginKinds } from '../model';\nimport { testPluginLoader } from './test-plugins';\n\nconst testLogger = {\n log: console.log,\n warn: console.warn,\n error: () => {\n // Don't log network errors in tests to the console\n },\n};\n\ntype ContextOptions = {\n defaultPluginKinds?: DefaultPluginKinds;\n};\n\n/**\n * Test helper to render a React component with some common app-level providers, as well as the PluginRegistry\n * wrapped around it.\n */\nexport function renderWithContext(\n ui: React.ReactNode,\n renderOptions?: Omit<RenderOptions, 'queries'>,\n contextOptions?: ContextOptions\n) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({\n defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } },\n logger: testLogger,\n });\n return render(\n <QueryClientProvider client={queryClient}>\n <PluginRegistry pluginLoader={testPluginLoader} defaultPluginKinds={contextOptions?.defaultPluginKinds}>\n {ui}\n </PluginRegistry>\n </QueryClientProvider>,\n renderOptions\n );\n}\n"],"names":["render","QueryClient","QueryClientProvider","PluginRegistry","testPluginLoader","testLogger","log","console","warn","error","renderWithContext","ui","renderOptions","contextOptions","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","logger","client","pluginLoader","defaultPluginKinds"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,MAAM,QAAuB,wBAAwB,CAAC;AAC/D,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,uBAAuB,CAAC;AACzE,SAASC,cAAc,QAAQ,8BAA8B,CAAC;AAE9D,SAASC,gBAAgB,QAAQ,gBAAgB,CAAC;AAElD,MAAMC,UAAU,GAAG;IACjBC,GAAG,EAAEC,OAAO,CAACD,GAAG;IAChBE,IAAI,EAAED,OAAO,CAACC,IAAI;IAClBC,KAAK,EAAE,IAAM;IACX,mDAAmD;IACrD,CAAC;CACF,AAAC;AAMF;;;CAGC,GACD,OAAO,SAASC,iBAAiB,CAC/BC,EAAmB,EACnBC,aAA8C,EAC9CC,cAA+B,EAC/B;IACA,iEAAiE;IACjE,MAAMC,WAAW,GAAG,IAAIb,WAAW,CAAC;QAClCc,cAAc,EAAE;YAAEC,OAAO,EAAE;gBAAEC,oBAAoB,EAAE,KAAK;gBAAEC,KAAK,EAAE,KAAK;aAAE;SAAE;QAC1EC,MAAM,EAAEd,UAAU;KACnB,CAAC,AAAC;IACH,OAAOL,MAAM,eACX,KAACE,mBAAmB;QAACkB,MAAM,EAAEN,WAAW;kBACtC,cAAA,KAACX,cAAc;YAACkB,YAAY,EAAEjB,gBAAgB;YAAEkB,kBAAkB,EAAET,cAAc,aAAdA,cAAc,WAAoB,GAAlCA,KAAAA,CAAkC,GAAlCA,cAAc,CAAES,kBAAkB;sBACnGX,EAAE;UACY;MACG,EACtBC,aAAa,CACd,CAAC;AACJ,CAAC"}
|
package/dist/test/setup-tests.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/setup-tests.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/test/setup-tests.ts"],"sourcesContent":["// Copyright 2023 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// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,iCAAiC;AACjC,OAAO,yCAAyC,CAAC;AAEjD,iFAAiF;AACjFA,IAAI,CAACC,IAAI,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/test/test-plugins/bert/index.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../../src/test/test-plugins/bert/index.tsx"],"sourcesContent":["// Copyright 2023 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 { PanelPlugin } from '../../../model';\n\n// Dummy plugins to test loading\nexport const BertPanel1: PanelPlugin<{ option1: string }> = {\n PanelComponent: () => null,\n OptionsEditorComponent: function BertPanel1Editor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">BertPanel1 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.option1}\n onChange={(e) => onChange({ ...value, option1: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ option1: '' }),\n};\n\nexport const BertPanel2: PanelPlugin<{ option2: string }> = {\n PanelComponent: () => null,\n OptionsEditorComponent: function BertPanel2Editor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">BertPanel2 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.option2}\n onChange={(e) => onChange({ ...value, option2: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ option2: '' }),\n};\n"],"names":["BertPanel1","PanelComponent","OptionsEditorComponent","BertPanel1Editor","value","onChange","div","label","htmlFor","input","type","id","option1","e","target","createInitialOptions","BertPanel2","BertPanel2Editor","option2"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAEA,gCAAgC;AAChC,OAAO,MAAMA,UAAU,GAAqC;IAC1DC,cAAc,EAAE,IAAM,IAAI;IAC1BC,sBAAsB,EAAE,SAASC,gBAAgB,CAAC,EAAEC,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAAE,EAAE;QACrE,qBACE,MAACC,KAAG;;8BACF,KAACC,OAAK;oBAACC,OAAO,EAAC,cAAc;8BAAC,mBAAiB;kBAAQ;8BACvD,KAACC,OAAK;oBACJC,IAAI,EAAC,MAAM;oBACXC,EAAE,EAAC,cAAc;oBACjBP,KAAK,EAAEA,KAAK,CAACQ,OAAO;oBACpBP,QAAQ,EAAE,CAACQ,CAAC,GAAKR,QAAQ,CAAC;4BAAE,GAAGD,KAAK;4BAAEQ,OAAO,EAAEC,CAAC,CAACC,MAAM,CAACV,KAAK;yBAAE,CAAC;kBAChE;;UACE,CACN;IACJ,CAAC;IACDW,oBAAoB,EAAE,IAAO,CAAA;YAAEH,OAAO,EAAE,EAAE;SAAE,CAAA,AAAC;CAC9C,CAAC;AAEF,OAAO,MAAMI,UAAU,GAAqC;IAC1Df,cAAc,EAAE,IAAM,IAAI;IAC1BC,sBAAsB,EAAE,SAASe,gBAAgB,CAAC,EAAEb,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAAE,EAAE;QACrE,qBACE,MAACC,KAAG;;8BACF,KAACC,OAAK;oBAACC,OAAO,EAAC,cAAc;8BAAC,mBAAiB;kBAAQ;8BACvD,KAACC,OAAK;oBACJC,IAAI,EAAC,MAAM;oBACXC,EAAE,EAAC,cAAc;oBACjBP,KAAK,EAAEA,KAAK,CAACc,OAAO;oBACpBb,QAAQ,EAAE,CAACQ,CAAC,GAAKR,QAAQ,CAAC;4BAAE,GAAGD,KAAK;4BAAEc,OAAO,EAAEL,CAAC,CAACC,MAAM,CAACV,KAAK;yBAAE,CAAC;kBAChE;;UACE,CACN;IACJ,CAAC;IACDW,oBAAoB,EAAE,IAAO,CAAA;YAAEG,OAAO,EAAE,EAAE;SAAE,CAAA,AAAC;CAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/test/test-plugins/ernie/index.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../../src/test/test-plugins/ernie/index.tsx"],"sourcesContent":["// Copyright 2023 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 { VariablePlugin, VariableOption } from '../../../model';\n\nconst data: VariableOption[] = [\n { label: 'Grover', value: 'Grover' },\n { label: 'Snuffleupagus', value: 'Snuffleupagus' },\n];\n\n// Dummy plugin to test loading\nexport const ErnieVariable: VariablePlugin<{ variableOption: string }> = {\n getVariableOptions: async () => ({ data }),\n OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">ErnieVariable editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.variableOption}\n onChange={(e) => onChange({ ...value, variableOption: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ variableOption: '' }),\n};\n"],"names":["data","label","value","ErnieVariable","getVariableOptions","OptionsEditorComponent","ErnieVariableEditor","onChange","div","htmlFor","input","type","id","variableOption","e","target","createInitialOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAEA,MAAMA,IAAI,GAAqB;IAC7B;QAAEC,KAAK,EAAE,QAAQ;QAAEC,KAAK,EAAE,QAAQ;KAAE;IACpC;QAAED,KAAK,EAAE,eAAe;QAAEC,KAAK,EAAE,eAAe;KAAE;CACnD,AAAC;AAEF,+BAA+B;AAC/B,OAAO,MAAMC,aAAa,GAA+C;IACvEC,kBAAkB,EAAE,UAAa,CAAA;YAAEJ,IAAI;SAAE,CAAA,AAAC;IAC1CK,sBAAsB,EAAE,SAASC,mBAAmB,CAAC,EAAEJ,KAAK,CAAA,EAAEK,QAAQ,CAAA,EAAE,EAAE;QACxE,qBACE,MAACC,KAAG;;8BACF,KAACP,OAAK;oBAACQ,OAAO,EAAC,cAAc;8BAAC,sBAAoB;kBAAQ;8BAC1D,KAACC,OAAK;oBACJC,IAAI,EAAC,MAAM;oBACXC,EAAE,EAAC,cAAc;oBACjBV,KAAK,EAAEA,KAAK,CAACW,cAAc;oBAC3BN,QAAQ,EAAE,CAACO,CAAC,GAAKP,QAAQ,CAAC;4BAAE,GAAGL,KAAK;4BAAEW,cAAc,EAAEC,CAAC,CAACC,MAAM,CAACb,KAAK;yBAAE,CAAC;kBACvE;;UACE,CACN;IACJ,CAAC;IACDc,oBAAoB,EAAE,IAAO,CAAA;YAAEH,cAAc,EAAE,EAAE;SAAE,CAAA,AAAC;CACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/test/test-plugins/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/test/test-plugins/index.ts"],"sourcesContent":["// Copyright 2023 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 { dynamicImportPluginLoader, PluginLoader, PluginModuleResource } from '../../model';\nimport bertResource from './bert/plugin.json';\nimport ernieResource from './ernie/plugin.json';\n\n/**\n * A PluginLoader for tests that will dynamically load the plugins in this folder.\n */\nexport const testPluginLoader: PluginLoader = dynamicImportPluginLoader([\n { resource: bertResource as PluginModuleResource, importPlugin: () => import('./bert') },\n { resource: ernieResource as PluginModuleResource, importPlugin: () => import('./ernie') },\n]);\n"],"names":["dynamicImportPluginLoader","bertResource","ernieResource","testPluginLoader","resource","importPlugin"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,yBAAyB,QAA4C,aAAa,CAAC;AAC5F,OAAOC,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAOC,aAAa,MAAM,qBAAqB,CAAC;AAEhD;;CAEC,GACD,OAAO,MAAMC,gBAAgB,GAAiBH,yBAAyB,CAAC;IACtE;QAAEI,QAAQ,EAAEH,YAAY;QAA0BI,YAAY,EAAE,IAAM,MAAM,CAAC,QAAQ,CAAC;KAAE;IACxF;QAAED,QAAQ,EAAEF,aAAa;QAA0BG,YAAY,EAAE,IAAM,MAAM,CAAC,SAAS,CAAC;KAAE;CAC3F,CAAC,CAAC"}
|
package/dist/test-utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test-utils/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/test-utils/index.ts"],"sourcesContent":["// Copyright 2023 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 './mock-plugin-registry';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test-utils/mock-plugin-registry.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/test-utils/mock-plugin-registry.tsx"],"sourcesContent":["// Copyright 2023 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 { UnknownSpec } from '@perses-dev/core';\nimport { PluginRegistryProps } from '../components';\nimport { PluginModuleResource, Plugin, PluginLoader, PluginImplementation, PluginType } from '../model';\n\nexport type MockPlugin = {\n [T in PluginType]: {\n pluginType: T;\n kind: string;\n plugin: PluginImplementation<T>;\n };\n}[PluginType];\n\n/**\n * Helper for mocking `PluginRegistry` data during tests. Returns props that can be spread on the `PluginRegistry`\n * component so that it will load the mock plugins you provide.\n */\nexport function mockPluginRegistry(...mockPlugins: MockPlugin[]): Omit<PluginRegistryProps, 'children'> {\n const mockPluginResource: PluginModuleResource = {\n kind: 'PluginModule',\n metadata: {\n name: 'Fake Plugin Module for Tests',\n created_at: '',\n updated_at: '',\n version: 0,\n },\n spec: {\n // Add metadata for all mock plugins\n plugins: mockPlugins.map(({ pluginType, kind }) => ({\n pluginType,\n kind,\n display: {\n name: getMockPluginName(pluginType, kind),\n },\n })),\n },\n };\n\n const mockPluginModule: Record<string, Plugin<UnknownSpec>> = {};\n for (const mockPlugin of mockPlugins) {\n // \"Export\" on the module under the same name as the kind the plugin handles\n mockPluginModule[mockPlugin.kind] = mockPlugin.plugin;\n }\n\n const pluginLoader: PluginLoader = {\n getInstalledPlugins() {\n return Promise.resolve([mockPluginResource]);\n },\n importPluginModule(/* resource */) {\n return Promise.resolve(mockPluginModule);\n },\n };\n\n return {\n pluginLoader,\n };\n}\n\n/**\n * The function that's used to generate the display name of mocked plugins in mockPluginRegistry. Can be useful if you\n * need to interact with some UI component that's displaying it.\n */\nexport function getMockPluginName(pluginType: PluginType, kind: string) {\n return `${pluginType} Plugin for ${kind}`;\n}\n"],"names":["mockPluginRegistry","mockPlugins","mockPluginResource","kind","metadata","name","created_at","updated_at","version","spec","plugins","map","pluginType","display","getMockPluginName","mockPluginModule","mockPlugin","plugin","pluginLoader","getInstalledPlugins","Promise","resolve","importPluginModule"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAcjC;;;CAGC,GACD,OAAO,SAASA,kBAAkB,CAAC,GAAGC,WAAW,AAAc,EAAyC;IACtG,MAAMC,kBAAkB,GAAyB;QAC/CC,IAAI,EAAE,cAAc;QACpBC,QAAQ,EAAE;YACRC,IAAI,EAAE,8BAA8B;YACpCC,UAAU,EAAE,EAAE;YACdC,UAAU,EAAE,EAAE;YACdC,OAAO,EAAE,CAAC;SACX;QACDC,IAAI,EAAE;YACJ,oCAAoC;YACpCC,OAAO,EAAET,WAAW,CAACU,GAAG,CAAC,CAAC,EAAEC,UAAU,CAAA,EAAET,IAAI,CAAA,EAAE,GAAM,CAAA;oBAClDS,UAAU;oBACVT,IAAI;oBACJU,OAAO,EAAE;wBACPR,IAAI,EAAES,iBAAiB,CAACF,UAAU,EAAET,IAAI,CAAC;qBAC1C;iBACF,CAAA,AAAC,CAAC;SACJ;KACF,AAAC;IAEF,MAAMY,gBAAgB,GAAwC,EAAE,AAAC;IACjE,KAAK,MAAMC,UAAU,IAAIf,WAAW,CAAE;QACpC,4EAA4E;QAC5Ec,gBAAgB,CAACC,UAAU,CAACb,IAAI,CAAC,GAAGa,UAAU,CAACC,MAAM,CAAC;IACxD,CAAC;IAED,MAAMC,YAAY,GAAiB;QACjCC,mBAAmB,IAAG;YACpB,OAAOC,OAAO,CAACC,OAAO,CAAC;gBAACnB,kBAAkB;aAAC,CAAC,CAAC;QAC/C,CAAC;QACDoB,kBAAkB,IAAiB;YACjC,OAAOF,OAAO,CAACC,OAAO,CAACN,gBAAgB,CAAC,CAAC;QAC3C,CAAC;KACF,AAAC;IAEF,OAAO;QACLG,YAAY;KACb,CAAC;AACJ,CAAC;AAED;;;CAGC,GACD,OAAO,SAASJ,iBAAiB,CAACF,UAAsB,EAAET,IAAY,EAAE;IACtE,OAAO,CAAC,EAAES,UAAU,CAAC,YAAY,EAAET,IAAI,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/plugin-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
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",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"lint:fix": "eslint --fix src --ext .ts,.tsx"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@perses-dev/components": "0.
|
|
31
|
-
"@perses-dev/core": "0.
|
|
30
|
+
"@perses-dev/components": "0.22.0",
|
|
31
|
+
"@perses-dev/core": "0.22.0",
|
|
32
32
|
"immer": "^9.0.15",
|
|
33
33
|
"use-immer": "^0.7.0",
|
|
34
34
|
"use-query-params": "^2.1.2"
|