@jbrowse/plugin-config 2.0.1 → 2.1.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.
Files changed (68) hide show
  1. package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +28 -19
  2. package/dist/ConfigurationEditorWidget/components/CallbackEditor.js.map +1 -1
  3. package/dist/ConfigurationEditorWidget/components/ColorEditor.js +6 -21
  4. package/dist/ConfigurationEditorWidget/components/ColorEditor.js.map +1 -1
  5. package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +5 -1
  6. package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -1
  7. package/dist/ConfigurationEditorWidget/components/JsonEditor.d.ts +9 -7
  8. package/dist/ConfigurationEditorWidget/components/JsonEditor.js +34 -18
  9. package/dist/ConfigurationEditorWidget/components/JsonEditor.js.map +1 -1
  10. package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +7 -5
  11. package/dist/ConfigurationEditorWidget/components/SlotEditor.js +28 -18
  12. package/dist/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -1
  13. package/dist/ConfigurationEditorWidget/index.d.ts +10 -3
  14. package/dist/ConfigurationEditorWidget/index.js +4 -3
  15. package/dist/ConfigurationEditorWidget/index.js.map +1 -1
  16. package/dist/ConfigurationEditorWidget/model.d.ts +3 -2
  17. package/dist/ConfigurationEditorWidget/model.js +1 -0
  18. package/dist/ConfigurationEditorWidget/model.js.map +1 -1
  19. package/dist/FromConfigAdapter/FromConfigSequenceAdapter.js +1 -9
  20. package/dist/FromConfigAdapter/FromConfigSequenceAdapter.js.map +1 -1
  21. package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +28 -19
  22. package/esm/ConfigurationEditorWidget/components/CallbackEditor.js.map +1 -1
  23. package/esm/ConfigurationEditorWidget/components/ColorEditor.js +6 -21
  24. package/esm/ConfigurationEditorWidget/components/ColorEditor.js.map +1 -1
  25. package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +5 -1
  26. package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -1
  27. package/esm/ConfigurationEditorWidget/components/JsonEditor.d.ts +9 -7
  28. package/esm/ConfigurationEditorWidget/components/JsonEditor.js +38 -22
  29. package/esm/ConfigurationEditorWidget/components/JsonEditor.js.map +1 -1
  30. package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +7 -5
  31. package/esm/ConfigurationEditorWidget/components/SlotEditor.js +33 -27
  32. package/esm/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -1
  33. package/esm/ConfigurationEditorWidget/index.d.ts +10 -3
  34. package/esm/ConfigurationEditorWidget/index.js +4 -3
  35. package/esm/ConfigurationEditorWidget/index.js.map +1 -1
  36. package/esm/ConfigurationEditorWidget/model.d.ts +3 -2
  37. package/esm/ConfigurationEditorWidget/model.js +2 -1
  38. package/esm/ConfigurationEditorWidget/model.js.map +1 -1
  39. package/esm/FromConfigAdapter/FromConfigSequenceAdapter.js +1 -9
  40. package/esm/FromConfigAdapter/FromConfigSequenceAdapter.js.map +1 -1
  41. package/package.json +3 -4
  42. package/src/ConfigurationEditorWidget/components/CallbackEditor.tsx +44 -45
  43. package/src/ConfigurationEditorWidget/components/ColorEditor.tsx +6 -28
  44. package/src/ConfigurationEditorWidget/components/{ConfigurationEditor.test.js → ConfigurationEditor.test.tsx} +0 -0
  45. package/src/ConfigurationEditorWidget/components/ConfigurationEditor.tsx +5 -1
  46. package/src/ConfigurationEditorWidget/components/JsonEditor.tsx +84 -0
  47. package/src/ConfigurationEditorWidget/components/SlotEditor.tsx +484 -0
  48. package/src/ConfigurationEditorWidget/components/__snapshots__/{ConfigurationEditor.test.js.snap → ConfigurationEditor.test.tsx.snap} +120 -101
  49. package/src/ConfigurationEditorWidget/index.tsx +25 -0
  50. package/src/ConfigurationEditorWidget/{model.js → model.ts} +4 -2
  51. package/src/FromConfigAdapter/FromConfigSequenceAdapter.ts +1 -9
  52. package/dist/ConfigurationEditorWidget/components/CodeEditor.d.ts +0 -5
  53. package/dist/ConfigurationEditorWidget/components/CodeEditor.js +0 -85
  54. package/dist/ConfigurationEditorWidget/components/CodeEditor.js.map +0 -1
  55. package/dist/ConfigurationEditorWidget/components/ColorPicker.d.ts +0 -7
  56. package/dist/ConfigurationEditorWidget/components/ColorPicker.js +0 -69
  57. package/dist/ConfigurationEditorWidget/components/ColorPicker.js.map +0 -1
  58. package/esm/ConfigurationEditorWidget/components/CodeEditor.d.ts +0 -5
  59. package/esm/ConfigurationEditorWidget/components/CodeEditor.js +0 -42
  60. package/esm/ConfigurationEditorWidget/components/CodeEditor.js.map +0 -1
  61. package/esm/ConfigurationEditorWidget/components/ColorPicker.d.ts +0 -7
  62. package/esm/ConfigurationEditorWidget/components/ColorPicker.js +0 -26
  63. package/esm/ConfigurationEditorWidget/components/ColorPicker.js.map +0 -1
  64. package/src/ConfigurationEditorWidget/components/CodeEditor.tsx +0 -59
  65. package/src/ConfigurationEditorWidget/components/ColorPicker.tsx +0 -43
  66. package/src/ConfigurationEditorWidget/components/JsonEditor.js +0 -52
  67. package/src/ConfigurationEditorWidget/components/SlotEditor.js +0 -376
  68. package/src/ConfigurationEditorWidget/index.js +0 -20
@@ -414,6 +414,11 @@ exports[`ConfigurationEditor widget renders all the different types of built-in
414
414
  <div
415
415
  class="MuiCardContent-root css-46bh2p-MuiCardContent-root"
416
416
  >
417
+ <label
418
+ class="MuiInputLabel-root MuiInputLabel-animated MuiFormLabel-root MuiFormLabel-colorPrimary css-9npbnl-MuiFormLabel-root-MuiInputLabel-root"
419
+ >
420
+ stringArrayMapTest
421
+ </label>
417
422
  <ul
418
423
  class="MuiList-root css-1mk9mw3-MuiList-root"
419
424
  >
@@ -741,47 +746,55 @@ exports[`ConfigurationEditor widget renders all the different types of built-in
741
746
  class="tss-1962tgi-paperContent"
742
747
  >
743
748
  <div
744
- class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-wb57ya-MuiFormControl-root-MuiTextField-root"
749
+ style="display: flex;"
745
750
  >
746
- <label
747
- class="MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-root MuiFormLabel-colorPrimary MuiFormLabel-filled css-1sumxir-MuiFormLabel-root-MuiInputLabel-root"
748
- data-shrink="true"
749
- for="mui-11"
750
- id="mui-11-label"
751
- >
752
- colorTest
753
- </label>
754
751
  <div
755
- class="MuiOutlinedInput-root MuiInputBase-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-md26zr-MuiInputBase-root-MuiOutlinedInput-root"
756
- style="color: rgb(57, 100, 148); border-right-width: 25px; border-right-style: solid; border-right-color: #396494;"
752
+ class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-wb57ya-MuiFormControl-root-MuiTextField-root"
757
753
  >
758
- <input
759
- aria-describedby="mui-11-helper-text"
760
- aria-invalid="false"
761
- class="MuiOutlinedInput-input MuiInputBase-input css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input"
762
- id="mui-11"
763
- type="text"
764
- value="#396494"
765
- />
766
- <fieldset
767
- aria-hidden="true"
768
- class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
754
+ <label
755
+ class="MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-root MuiFormLabel-colorPrimary MuiFormLabel-filled css-1sumxir-MuiFormLabel-root-MuiInputLabel-root"
756
+ data-shrink="true"
757
+ for="mui-11"
758
+ id="mui-11-label"
769
759
  >
770
- <legend
771
- class="css-1in441m"
760
+ colorTest
761
+ </label>
762
+ <div
763
+ class="MuiOutlinedInput-root MuiInputBase-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-md26zr-MuiInputBase-root-MuiOutlinedInput-root"
764
+ >
765
+ <input
766
+ aria-describedby="mui-11-helper-text"
767
+ aria-invalid="false"
768
+ class="MuiOutlinedInput-input MuiInputBase-input css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input"
769
+ id="mui-11"
770
+ type="text"
771
+ value="#396494"
772
+ />
773
+ <fieldset
774
+ aria-hidden="true"
775
+ class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
772
776
  >
773
- <span>
774
- colorTest
775
- </span>
776
- </legend>
777
- </fieldset>
777
+ <legend
778
+ class="css-1in441m"
779
+ >
780
+ <span>
781
+ colorTest
782
+ </span>
783
+ </legend>
784
+ </fieldset>
785
+ </div>
786
+ <p
787
+ class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled css-1wc848c-MuiFormHelperText-root"
788
+ id="mui-11-helper-text"
789
+ >
790
+ colorTest
791
+ </p>
778
792
  </div>
779
- <p
780
- class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled css-1wc848c-MuiFormHelperText-root"
781
- id="mui-11-helper-text"
793
+ <div
794
+ style="margin-top: 10px;"
782
795
  >
783
- colorTest
784
- </p>
796
+ <div />
797
+ </div>
785
798
  </div>
786
799
  </div>
787
800
  <div
@@ -1019,17 +1032,10 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch
1019
1032
  class="tss-1962tgi-paperContent"
1020
1033
  >
1021
1034
  <div
1022
- class="MuiFormControl-root css-1nrlq1o-MuiFormControl-root"
1035
+ class="tss-15g9652-callbackContainer"
1023
1036
  >
1024
- <label
1025
- class="MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-root MuiFormLabel-colorPrimary css-1sumxir-MuiFormLabel-root-MuiInputLabel-root"
1026
- data-shrink="true"
1027
- for="callback-editor"
1028
- >
1029
- mouseover
1030
- </label>
1031
1037
  <div
1032
- class="MuiFormControl-root MuiTextField-root tss-1gornm3-callbackEditor css-1u3bzj6-MuiFormControl-root-MuiTextField-root"
1038
+ class="MuiFormControl-root MuiTextField-root tss-46fzrl-callbackEditor css-1u3bzj6-MuiFormControl-root-MuiTextField-root"
1033
1039
  >
1034
1040
  <div
1035
1041
  class="MuiOutlinedInput-root MuiInputBase-root MuiInputBase-colorPrimary MuiInputBase-formControl MuiInputBase-multiline css-dpjnhs-MuiInputBase-root-MuiOutlinedInput-root"
@@ -1065,33 +1071,31 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch
1065
1071
  </fieldset>
1066
1072
  </div>
1067
1073
  </div>
1068
- <p
1069
- class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained css-1wc848c-MuiFormHelperText-root"
1070
- >
1074
+ <p>
1071
1075
  what to display in a given mouseover
1072
1076
  </p>
1073
- </div>
1074
- <button
1075
- class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorPrimary MuiIconButton-sizeMedium css-1kuq5xv-MuiButtonBase-root-MuiIconButton-root"
1076
- data-mui-internal-clone-element="true"
1077
- tabindex="0"
1078
- type="button"
1079
- >
1080
- <svg
1081
- aria-hidden="true"
1082
- class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root"
1083
- data-testid="HelpIcon"
1084
- focusable="false"
1085
- viewBox="0 0 24 24"
1077
+ <button
1078
+ class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorPrimary MuiIconButton-sizeMedium css-1kuq5xv-MuiButtonBase-root-MuiIconButton-root"
1079
+ data-mui-internal-clone-element="true"
1080
+ tabindex="0"
1081
+ type="button"
1086
1082
  >
1087
- <path
1088
- d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
1083
+ <svg
1084
+ aria-hidden="true"
1085
+ class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root"
1086
+ data-testid="HelpIcon"
1087
+ focusable="false"
1088
+ viewBox="0 0 24 24"
1089
+ >
1090
+ <path
1091
+ d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
1092
+ />
1093
+ </svg>
1094
+ <span
1095
+ class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
1089
1096
  />
1090
- </svg>
1091
- <span
1092
- class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
1093
- />
1094
- </button>
1097
+ </button>
1098
+ </div>
1095
1099
  </div>
1096
1100
  <div
1097
1101
  class="tss-8lz2mt-slotModeSwitch"
@@ -1242,7 +1246,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch
1242
1246
  </div>
1243
1247
  </div>
1244
1248
  <div
1245
- class="MuiFormGroup-root css-dmmspl-MuiFormGroup-root"
1249
+ class="MuiFormGroup-root tss-vdq470-noOverflow css-dmmspl-MuiFormGroup-root"
1246
1250
  >
1247
1251
  <div
1248
1252
  class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 tss-en0npb-paper css-1ps6pg7-MuiPaper-root"
@@ -1251,47 +1255,62 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch
1251
1255
  class="tss-1962tgi-paperContent"
1252
1256
  >
1253
1257
  <div
1254
- class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-wb57ya-MuiFormControl-root-MuiTextField-root"
1258
+ style="display: flex;"
1255
1259
  >
1256
- <label
1257
- class="MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-root MuiFormLabel-colorPrimary MuiFormLabel-filled css-1sumxir-MuiFormLabel-root-MuiInputLabel-root"
1258
- data-shrink="true"
1259
- for="mui-17"
1260
- id="mui-17-label"
1261
- >
1262
- color
1263
- </label>
1264
1260
  <div
1265
- class="MuiOutlinedInput-root MuiInputBase-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-md26zr-MuiInputBase-root-MuiOutlinedInput-root"
1266
- style="color: rgb(255, 0, 255); border-right-width: 25px; border-right-style: solid; border-right-color: #f0f;"
1261
+ class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-wb57ya-MuiFormControl-root-MuiTextField-root"
1267
1262
  >
1268
- <input
1269
- aria-describedby="mui-17-helper-text"
1270
- aria-invalid="false"
1271
- class="MuiOutlinedInput-input MuiInputBase-input css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input"
1272
- id="mui-17"
1273
- type="text"
1274
- value="#f0f"
1275
- />
1276
- <fieldset
1277
- aria-hidden="true"
1278
- class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
1263
+ <label
1264
+ class="MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-root MuiFormLabel-colorPrimary MuiFormLabel-filled css-1sumxir-MuiFormLabel-root-MuiInputLabel-root"
1265
+ data-shrink="true"
1266
+ for="mui-17"
1267
+ id="mui-17-label"
1279
1268
  >
1280
- <legend
1281
- class="css-1in441m"
1269
+ color
1270
+ </label>
1271
+ <div
1272
+ class="MuiOutlinedInput-root MuiInputBase-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-md26zr-MuiInputBase-root-MuiOutlinedInput-root"
1273
+ >
1274
+ <input
1275
+ aria-describedby="mui-17-helper-text"
1276
+ aria-invalid="false"
1277
+ class="MuiOutlinedInput-input MuiInputBase-input css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input"
1278
+ id="mui-17"
1279
+ type="text"
1280
+ value="#f0f"
1281
+ />
1282
+ <fieldset
1283
+ aria-hidden="true"
1284
+ class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
1282
1285
  >
1283
- <span>
1284
- color
1285
- </span>
1286
- </legend>
1287
- </fieldset>
1286
+ <legend
1287
+ class="css-1in441m"
1288
+ >
1289
+ <span>
1290
+ color
1291
+ </span>
1292
+ </legend>
1293
+ </fieldset>
1294
+ </div>
1295
+ <p
1296
+ class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled css-1wc848c-MuiFormHelperText-root"
1297
+ id="mui-17-helper-text"
1298
+ >
1299
+ the color of each feature in a pileup alignment
1300
+ </p>
1288
1301
  </div>
1289
- <p
1290
- class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled css-1wc848c-MuiFormHelperText-root"
1291
- id="mui-17-helper-text"
1302
+ <div
1303
+ style="margin-top: 10px;"
1292
1304
  >
1293
- the color of each feature in a pileup alignment
1294
- </p>
1305
+ <div
1306
+ class="tss-7h64ut-picker"
1307
+ >
1308
+ <div
1309
+ class="tss-hl2wx9-swatch"
1310
+ style="background-color: rgb(255, 0, 255);"
1311
+ />
1312
+ </div>
1313
+ </div>
1295
1314
  </div>
1296
1315
  </div>
1297
1316
  <div
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import { observer } from 'mobx-react'
3
+ import { isStateTreeNode, getType } from 'mobx-state-tree'
4
+ import { ConfigurationSchema } from '@jbrowse/core/configuration'
5
+
6
+ export { default as stateModelFactory } from './model'
7
+ export const configSchema = ConfigurationSchema('ConfigurationEditorWidget', {})
8
+ export const HeadingComponent = observer(
9
+ ({ model }: { model?: { target: { type: string } } }) => {
10
+ if (model?.target) {
11
+ if (model.target.type) {
12
+ return <>{`${model.target.type} settings`}</>
13
+ }
14
+ if (isStateTreeNode(model.target)) {
15
+ const type = getType(model.target)
16
+ if (type?.name) {
17
+ return (
18
+ <>{`${type.name.replace('ConfigurationSchema', '')} settings`}</>
19
+ )
20
+ }
21
+ }
22
+ }
23
+ return <>Settings</>
24
+ },
25
+ )
@@ -1,7 +1,8 @@
1
1
  import { types } from 'mobx-state-tree'
2
2
  import { ElementId } from '@jbrowse/core/util/types/mst'
3
+ import PluginManager from '@jbrowse/core/PluginManager'
3
4
 
4
- export default pluginManager =>
5
+ export default (pluginManager: PluginManager) =>
5
6
  types
6
7
  .model('ConfigurationEditorWidget', {
7
8
  id: ElementId,
@@ -13,7 +14,8 @@ export default pluginManager =>
13
14
  ),
14
15
  })
15
16
  .actions(self => ({
16
- setTarget(newTarget) {
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ setTarget(newTarget: any) {
17
19
  self.target = newTarget
18
20
  },
19
21
  }))
@@ -15,16 +15,8 @@ export default class FromConfigSequenceAdapter
15
15
  * @returns Observable of Feature objects in the region
16
16
  */
17
17
  getFeatures(region: NoAssemblyRegion) {
18
- // TODO: restore commented version below once TSDX supports Rollup v2
19
- // xref: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#bug-fixes-45
20
- // return ObservableCreate<Feature>(async observer => {
21
- // const feats = await super.getFeatures(region).pipe(toArray()).toPromise()
22
- const superGetFeatures = super.getFeatures
23
18
  return ObservableCreate<Feature>(async observer => {
24
- const feats = await superGetFeatures
25
- .call(this, region)
26
- .pipe(toArray())
27
- .toPromise()
19
+ const feats = await super.getFeatures(region).pipe(toArray()).toPromise()
28
20
  const feat = feats[0]
29
21
  observer.next(
30
22
  new SimpleFeature({
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export default function CodeEditor({ contents, setContents, }: {
3
- contents: string;
4
- setContents: (arg: string) => void;
5
- }): JSX.Element;
@@ -1,85 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __read = (this && this.__read) || function (o, n) {
26
- var m = typeof Symbol === "function" && o[Symbol.iterator];
27
- if (!m) return o;
28
- var i = m.call(o), r, ar = [], e;
29
- try {
30
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
31
- }
32
- catch (error) { e = { error: error }; }
33
- finally {
34
- try {
35
- if (r && !r.done && (m = i["return"])) m.call(i);
36
- }
37
- finally { if (e) throw e.error; }
38
- }
39
- return ar;
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- var react_1 = __importStar(require("react"));
43
- var material_1 = require("@mui/material");
44
- var mui_1 = require("tss-react/mui");
45
- // fontSize and fontFamily have to match between Editor and SyntaxHighlighter
46
- var fontSize = '12px';
47
- // Optimize by using system default fonts: https://css-tricks.com/snippets/css/font-stacks/
48
- var fontFamily = 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace';
49
- var useStyles = (0, mui_1.makeStyles)()(function (theme) { return ({
50
- callbackEditor: {
51
- fontFamily: fontFamily,
52
- fontSize: fontSize,
53
- background: theme.palette.background.default,
54
- overflowX: 'auto',
55
- marginTop: '16px',
56
- border: '1px solid rgba(0,0,0,0.42)',
57
- },
58
- textAreaFont: {
59
- fontFamily: fontFamily,
60
- },
61
- }); });
62
- function CodeEditor(_a) {
63
- var contents = _a.contents, setContents = _a.setContents;
64
- var classes = useStyles().classes;
65
- var _b = __read((0, react_1.useState)(), 2), error = _b[0], setCodeError = _b[1];
66
- var _c = __read((0, react_1.useState)(contents), 2), val = _c[0], setVal = _c[1];
67
- (0, react_1.useEffect)(function () {
68
- try {
69
- JSON.parse(contents);
70
- setCodeError(undefined);
71
- setContents(val);
72
- }
73
- catch (e) {
74
- console.error({ e: e });
75
- setCodeError(e);
76
- }
77
- }, [val, contents, setContents]);
78
- return (react_1.default.createElement(material_1.TextField, { className: classes.callbackEditor, value: contents, onChange: function (event) { return setVal(event.target.value); }, style: { background: error ? '#fdd' : undefined }, InputProps: {
79
- classes: {
80
- input: classes.textAreaFont,
81
- },
82
- } }));
83
- }
84
- exports.default = CodeEditor;
85
- //# sourceMappingURL=CodeEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/CodeEditor.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAkD;AAClD,0CAAyC;AACzC,qCAA0C;AAE1C,6EAA6E;AAC7E,IAAM,QAAQ,GAAG,MAAM,CAAA;AACvB,2FAA2F;AAC3F,IAAM,UAAU,GACd,sNAAsN,CAAA;AAExN,IAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC,UAAA,KAAK,IAAI,OAAA,CAAC;IACvC,cAAc,EAAE;QACd,UAAU,YAAA;QACV,QAAQ,UAAA;QACR,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO;QAC5C,SAAS,EAAE,MAAM;QACjB,SAAS,EAAE,MAAM;QACjB,MAAM,EAAE,4BAA4B;KACrC;IACD,YAAY,EAAE;QACZ,UAAU,YAAA;KACX;CACF,CAAC,EAZsC,CAYtC,CAAC,CAAA;AAEH,SAAwB,UAAU,CAAC,EAMlC;QALC,QAAQ,cAAA,EACR,WAAW,iBAAA;IAKH,IAAA,OAAO,GAAK,SAAS,EAAE,QAAhB,CAAgB;IACzB,IAAA,KAAA,OAAwB,IAAA,gBAAQ,GAAW,IAAA,EAA1C,KAAK,QAAA,EAAE,YAAY,QAAuB,CAAA;IAC3C,IAAA,KAAA,OAAgB,IAAA,gBAAQ,EAAC,QAAQ,CAAC,IAAA,EAAjC,GAAG,QAAA,EAAE,MAAM,QAAsB,CAAA;IACxC,IAAA,iBAAS,EAAC;QACR,IAAI;YACF,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;YACpB,YAAY,CAAC,SAAS,CAAC,CAAA;YACvB,WAAW,CAAC,GAAG,CAAC,CAAA;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAA,EAAE,CAAC,CAAA;YACpB,YAAY,CAAC,CAAC,CAAC,CAAA;SAChB;IACH,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAA;IAEhC,OAAO,CACL,8BAAC,oBAAS,IACR,SAAS,EAAE,OAAO,CAAC,cAAc,EACjC,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,UAAA,KAAK,IAAI,OAAA,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAA1B,CAA0B,EAC7C,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,EACjD,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,KAAK,EAAE,OAAO,CAAC,YAAY;aAC5B;SACF,GACD,CACH,CAAA;AACH,CAAC;AAlCD,6BAkCC"}
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { Color, ColorResult } from 'react-color';
3
- export declare function ColorPicker(props: {
4
- color: Color;
5
- onChange: (color: ColorResult) => void;
6
- }): JSX.Element;
7
- export default ColorPicker;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __read = (this && this.__read) || function (o, n) {
26
- var m = typeof Symbol === "function" && o[Symbol.iterator];
27
- if (!m) return o;
28
- var i = m.call(o), r, ar = [], e;
29
- try {
30
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
31
- }
32
- catch (error) { e = { error: error }; }
33
- finally {
34
- try {
35
- if (r && !r.done && (m = i["return"])) m.call(i);
36
- }
37
- finally { if (e) throw e.error; }
38
- }
39
- return ar;
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.ColorPicker = void 0;
43
- var react_1 = __importStar(require("react"));
44
- var mui_1 = require("tss-react/mui");
45
- var react_color_1 = require("react-color");
46
- var useStyles = (0, mui_1.makeStyles)()({
47
- popover: {
48
- position: 'absolute',
49
- zIndex: 2,
50
- },
51
- cover: {
52
- position: 'fixed',
53
- top: 0,
54
- right: 0,
55
- bottom: 0,
56
- left: 0,
57
- },
58
- });
59
- function ColorPicker(props) {
60
- var color = props.color, onChange = props.onChange;
61
- var classes = useStyles().classes;
62
- var _a = __read((0, react_1.useState)(true), 2), displayColorPicker = _a[0], setDisplayColorPicker = _a[1];
63
- return (react_1.default.createElement("div", null, displayColorPicker ? (react_1.default.createElement("div", { className: classes.popover },
64
- react_1.default.createElement("div", { role: "presentation", className: classes.cover, onClick: function () { return setDisplayColorPicker(false); } }),
65
- react_1.default.createElement(react_color_1.ChromePicker, { color: color, onChange: onChange }))) : null));
66
- }
67
- exports.ColorPicker = ColorPicker;
68
- exports.default = ColorPicker;
69
- //# sourceMappingURL=ColorPicker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/ColorPicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAuC;AACvC,qCAA0C;AAC1C,2CAA8D;AAE9D,IAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC;IAC7B,OAAO,EAAE;QACP,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;KACV;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO;QACjB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAA;AAEF,SAAgB,WAAW,CAAC,KAG3B;IACS,IAAA,KAAK,GAAe,KAAK,MAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAU;IACzB,IAAA,OAAO,GAAK,SAAS,EAAE,QAAhB,CAAgB;IACzB,IAAA,KAAA,OAA8C,IAAA,gBAAQ,EAAC,IAAI,CAAC,IAAA,EAA3D,kBAAkB,QAAA,EAAE,qBAAqB,QAAkB,CAAA;IAElE,OAAO,CACL,2CACG,kBAAkB,CAAC,CAAC,CAAC,CACpB,uCAAK,SAAS,EAAE,OAAO,CAAC,OAAO;QAC7B,uCACE,IAAI,EAAC,cAAc,EACnB,SAAS,EAAE,OAAO,CAAC,KAAK,EACxB,OAAO,EAAE,cAAM,OAAA,qBAAqB,CAAC,KAAK,CAAC,EAA5B,CAA4B,GAC3C;QACF,8BAAC,0BAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC9C,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAA;AACH,CAAC;AAtBD,kCAsBC;AAED,kBAAe,WAAW,CAAA"}
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export default function CodeEditor({ contents, setContents, }: {
3
- contents: string;
4
- setContents: (arg: string) => void;
5
- }): JSX.Element;
@@ -1,42 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { TextField } from '@mui/material';
3
- import { makeStyles } from 'tss-react/mui';
4
- // fontSize and fontFamily have to match between Editor and SyntaxHighlighter
5
- const fontSize = '12px';
6
- // Optimize by using system default fonts: https://css-tricks.com/snippets/css/font-stacks/
7
- const fontFamily = 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace';
8
- const useStyles = makeStyles()(theme => ({
9
- callbackEditor: {
10
- fontFamily,
11
- fontSize,
12
- background: theme.palette.background.default,
13
- overflowX: 'auto',
14
- marginTop: '16px',
15
- border: '1px solid rgba(0,0,0,0.42)',
16
- },
17
- textAreaFont: {
18
- fontFamily,
19
- },
20
- }));
21
- export default function CodeEditor({ contents, setContents, }) {
22
- const { classes } = useStyles();
23
- const [error, setCodeError] = useState();
24
- const [val, setVal] = useState(contents);
25
- useEffect(() => {
26
- try {
27
- JSON.parse(contents);
28
- setCodeError(undefined);
29
- setContents(val);
30
- }
31
- catch (e) {
32
- console.error({ e });
33
- setCodeError(e);
34
- }
35
- }, [val, contents, setContents]);
36
- return (React.createElement(TextField, { className: classes.callbackEditor, value: contents, onChange: event => setVal(event.target.value), style: { background: error ? '#fdd' : undefined }, InputProps: {
37
- classes: {
38
- input: classes.textAreaFont,
39
- },
40
- } }));
41
- }
42
- //# sourceMappingURL=CodeEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/CodeEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,MAAM,CAAA;AACvB,2FAA2F;AAC3F,MAAM,UAAU,GACd,sNAAsN,CAAA;AAExN,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvC,cAAc,EAAE;QACd,UAAU;QACV,QAAQ;QACR,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO;QAC5C,SAAS,EAAE,MAAM;QACjB,SAAS,EAAE,MAAM;QACjB,MAAM,EAAE,4BAA4B;KACrC;IACD,YAAY,EAAE;QACZ,UAAU;KACX;CACF,CAAC,CAAC,CAAA;AAEH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,QAAQ,EACR,WAAW,GAIZ;IACC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAA;IAC/B,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAW,CAAA;IACjD,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;IACxC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI;YACF,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;YACpB,YAAY,CAAC,SAAS,CAAC,CAAA;YACvB,WAAW,CAAC,GAAG,CAAC,CAAA;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;YACpB,YAAY,CAAC,CAAC,CAAC,CAAA;SAChB;IACH,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAA;IAEhC,OAAO,CACL,oBAAC,SAAS,IACR,SAAS,EAAE,OAAO,CAAC,cAAc,EACjC,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7C,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,EACjD,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,KAAK,EAAE,OAAO,CAAC,YAAY;aAC5B;SACF,GACD,CACH,CAAA;AACH,CAAC"}
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { Color, ColorResult } from 'react-color';
3
- export declare function ColorPicker(props: {
4
- color: Color;
5
- onChange: (color: ColorResult) => void;
6
- }): JSX.Element;
7
- export default ColorPicker;
@@ -1,26 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { makeStyles } from 'tss-react/mui';
3
- import { ChromePicker } from 'react-color';
4
- const useStyles = makeStyles()({
5
- popover: {
6
- position: 'absolute',
7
- zIndex: 2,
8
- },
9
- cover: {
10
- position: 'fixed',
11
- top: 0,
12
- right: 0,
13
- bottom: 0,
14
- left: 0,
15
- },
16
- });
17
- export function ColorPicker(props) {
18
- const { color, onChange } = props;
19
- const { classes } = useStyles();
20
- const [displayColorPicker, setDisplayColorPicker] = useState(true);
21
- return (React.createElement("div", null, displayColorPicker ? (React.createElement("div", { className: classes.popover },
22
- React.createElement("div", { role: "presentation", className: classes.cover, onClick: () => setDisplayColorPicker(false) }),
23
- React.createElement(ChromePicker, { color: color, onChange: onChange }))) : null));
24
- }
25
- export default ColorPicker;
26
- //# sourceMappingURL=ColorPicker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/ConfigurationEditorWidget/components/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAA;AAE9D,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC;IAC7B,OAAO,EAAE;QACP,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;KACV;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO;QACjB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAA;AAEF,MAAM,UAAU,WAAW,CAAC,KAG3B;IACC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IACjC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAA;IAC/B,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAElE,OAAO,CACL,iCACG,kBAAkB,CAAC,CAAC,CAAC,CACpB,6BAAK,SAAS,EAAE,OAAO,CAAC,OAAO;QAC7B,6BACE,IAAI,EAAC,cAAc,EACnB,SAAS,EAAE,OAAO,CAAC,KAAK,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,GAC3C;QACF,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC9C,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAA;AACH,CAAC;AAED,eAAe,WAAW,CAAA"}