@pega/cosmos-react-build 3.0.0-dev.26.0 → 3.0.0-dev.27.2

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 (32) hide show
  1. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +8 -0
  2. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -0
  3. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +100 -0
  4. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -0
  5. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts +13 -0
  6. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -0
  7. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +27 -0
  8. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -0
  9. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
  10. package/lib/components/ExpressionBuilder/ExpressionBuilder.js +16 -42
  11. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
  12. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +3 -1
  13. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
  14. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js +474 -9
  15. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -1
  16. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +33 -3
  17. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
  18. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
  19. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts +7 -0
  20. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts.map +1 -0
  21. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js +6 -0
  22. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js.map +1 -0
  23. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -1
  24. package/lib/components/ExpressionBuilder/ExpressionItem.js +22 -6
  25. package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -1
  26. package/lib/components/ExpressionBuilder/index.d.ts +2 -1
  27. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
  28. package/lib/components/ExpressionBuilder/index.js +1 -0
  29. package/lib/components/ExpressionBuilder/index.js.map +1 -1
  30. package/lib/components/FlowModeller/FlowModeller.js +2 -2
  31. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  32. package/package.json +6 -3
@@ -1,7 +1,10 @@
1
+ // cSpell:words vscrollbar hscrollbar
1
2
  import styled, { css } from 'styled-components';
2
- import { defaultThemeProp, StyledButton, StyledText } from '@pega/cosmos-react-core';
3
+ import { defaultThemeProp, StyledButton, StyledLabel, StyledText, Text } from '@pega/cosmos-react-core';
3
4
  import StyledTextArea from '@pega/cosmos-react-core/lib/components/TextArea/TextArea.styles';
4
- import { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';
5
+ export const StyledPrimaryText = styled(Text) `
6
+ word-break: break-word;
7
+ `;
5
8
  export const StyledExpressionSummary = styled.div(({ theme }) => {
6
9
  return css `
7
10
  padding-block: ${theme.base.spacing};
@@ -16,6 +19,7 @@ export const StyledExpressionList = styled.ul `
16
19
  `;
17
20
  export const StyledExpressionBuilder = styled.div(({ theme }) => {
18
21
  return css `
22
+ position: relative;
19
23
  background-color: ${theme.base.palette['primary-background']};
20
24
  min-height: calc(30 * ${theme.base.spacing});
21
25
  max-height: 100%;
@@ -28,13 +32,6 @@ export const StyledExpressionBuilder = styled.div(({ theme }) => {
28
32
  `;
29
33
  });
30
34
  StyledExpressionBuilder.defaultProps = defaultThemeProp;
31
- export const StyledExpressionEditor = styled.div(() => {
32
- return css `
33
- ${StyledFormField} {
34
- flex-grow: 1;
35
- }
36
- `;
37
- });
38
35
  export const StyledParamsGroup = styled.div(({ theme }) => {
39
36
  return css `
40
37
  margin-block-start: calc(2 * ${theme.base.spacing});
@@ -79,7 +76,475 @@ export const StyledExpressionItem = styled.li(({ theme, expanded }) => {
79
76
  ${StyledExpressionDetails} {
80
77
  padding-block-end: calc(2 * ${theme.base.spacing});
81
78
  }
79
+
80
+ ${StyledLabel} {
81
+ margin-inline-end: calc(0.5 * ${theme.base.spacing});
82
+ color: ${theme.base.palette['foreground-color']};
83
+ }
82
84
  `;
83
85
  });
84
86
  StyledExpressionItem.defaultProps = defaultThemeProp;
87
+ export const StyledCodeEditor = styled.div(({ theme }) => {
88
+ return css `
89
+ /* PADDING */
90
+
91
+ .CodeMirror-lines {
92
+ cursor: text;
93
+ min-height: 0.063rem; /* prevents collapsing before first draw */
94
+ padding: 0.25rem 0; /* Vertical padding around content */
95
+ }
96
+
97
+ .CodeMirror-scrollbar-filler,
98
+ .CodeMirror-gutter-filler {
99
+ background-color: white; /* The little square between H and V scrollbars */
100
+ }
101
+
102
+ /* GUTTER */
103
+
104
+ .CodeMirror-gutters {
105
+ position: absolute;
106
+ left: 0;
107
+ top: 0;
108
+ min-height: 100%;
109
+ z-index: 3;
110
+ border-right: 0.063rem solid #dddddd;
111
+ background-color: #f7f7f7;
112
+ white-space: nowrap;
113
+ }
114
+ .CodeMirror-linenumber {
115
+ padding: 0 0.125rem 0 0.313rem;
116
+ min-width: 1.25rem;
117
+ text-align: right;
118
+ color: #999999;
119
+ white-space: nowrap;
120
+ }
121
+
122
+ .CodeMirror-guttermarker {
123
+ color: black;
124
+ }
125
+ .CodeMirror-guttermarker-subtle {
126
+ color: #999999;
127
+ }
128
+
129
+ /* CURSOR */
130
+
131
+ .CodeMirror-cursor {
132
+ position: absolute;
133
+ pointer-events: none;
134
+ border-left: 0.0625rem solid ${theme.base.palette['border-line']};
135
+ border-right: none;
136
+ width: 0;
137
+ }
138
+
139
+ /* Shown when moving in bi-directional text */
140
+ .CodeMirror div.CodeMirror-secondarycursor {
141
+ border-left: 0.063rem solid silver;
142
+ }
143
+ .cm-fat-cursor-mark {
144
+ background-color: rgba(20, 255, 20, 0.5);
145
+ -webkit-animation: blink 1.06s steps(1) infinite;
146
+ -moz-animation: blink 1.06s steps(1) infinite;
147
+ animation: blink 1.06s steps(1) infinite;
148
+ }
149
+ .cm-animate-fat-cursor {
150
+ width: auto;
151
+ border: 0;
152
+ -webkit-animation: blink 1.06s steps(1) infinite;
153
+ -moz-animation: blink 1.06s steps(1) infinite;
154
+ animation: blink 1.06s steps(1) infinite;
155
+ background-color: #77ee77;
156
+ }
157
+ @-moz-keyframes blink {
158
+ 50% {
159
+ background-color: transparent;
160
+ }
161
+ }
162
+ @-webkit-keyframes blink {
163
+ 50% {
164
+ background-color: transparent;
165
+ }
166
+ }
167
+ @keyframes blink {
168
+ 50% {
169
+ background-color: transparent;
170
+ }
171
+ }
172
+
173
+ .cm-tab {
174
+ display: inline-block;
175
+ text-decoration: inherit;
176
+ }
177
+
178
+ .CodeMirror-rulers {
179
+ position: absolute;
180
+ left: 0;
181
+ right: 0;
182
+ top: -3.125rem;
183
+ bottom: 0;
184
+ overflow: hidden;
185
+ }
186
+ .CodeMirror-ruler {
187
+ border-left: 0.063rem solid #cccccc;
188
+ top: 0;
189
+ bottom: 0;
190
+ position: absolute;
191
+ }
192
+
193
+ /* DEFAULT THEME */
194
+
195
+ .cm-s-default .cm-header {
196
+ color: blue;
197
+ }
198
+ .cm-negative {
199
+ color: #dd4444;
200
+ }
201
+ .cm-positive {
202
+ color: #229922;
203
+ }
204
+ .cm-strong {
205
+ font-weight: bold;
206
+ }
207
+ .cm-s-default .cm-quote {
208
+ color: #009900;
209
+ }
210
+ .cm-em {
211
+ font-style: italic;
212
+ }
213
+ .cm-link {
214
+ text-decoration: underline;
215
+ }
216
+ .cm-strikethrough {
217
+ text-decoration: line-through;
218
+ }
219
+
220
+ .cm-s-default .cm-keyword {
221
+ color: #770088;
222
+ }
223
+ .cm-s-default .cm-atom {
224
+ color: #221199;
225
+ }
226
+ .cm-s-default .cm-number {
227
+ color: #116644;
228
+ }
229
+ .cm-s-default .cm-def {
230
+ color: #0000ff;
231
+ }
232
+ .cm-s-default .cm-variable-2 {
233
+ color: #0055aa;
234
+ }
235
+ .cm-s-default .cm-variable-3,
236
+ .cm-s-default .cm-type {
237
+ color: #008855;
238
+ }
239
+ .cm-s-default .cm-comment {
240
+ color: #aa5500;
241
+ }
242
+ .cm-s-default .cm-string {
243
+ color: #aa1111;
244
+ }
245
+ .cm-s-default .cm-string-2 {
246
+ color: #ff5500;
247
+ }
248
+ .cm-s-default .cm-meta {
249
+ color: #555555;
250
+ }
251
+ .cm-s-default .cm-qualifier {
252
+ color: #555555;
253
+ }
254
+ .cm-s-default .cm-builtin {
255
+ color: #3300aa;
256
+ }
257
+ .cm-s-default .cm-bracket {
258
+ color: #999977;
259
+ }
260
+ .cm-s-default .cm-tag {
261
+ color: #117700;
262
+ }
263
+ .cm-s-default .cm-attribute {
264
+ color: #0000cc;
265
+ }
266
+ .cm-s-default .cm-hr {
267
+ color: #999999;
268
+ }
269
+ .cm-s-default .cm-link {
270
+ color: #0000cc;
271
+ }
272
+
273
+ .cm-s-default .cm-error {
274
+ color: #ff0000;
275
+ }
276
+ .cm-invalidchar {
277
+ color: #ff0000;
278
+ }
279
+
280
+ .CodeMirror-composing {
281
+ border-bottom: 0.125rem solid;
282
+ }
283
+
284
+ /* Default styles for common addons */
285
+
286
+ div.CodeMirror span.CodeMirror-matchingbracket {
287
+ color: #00bb00;
288
+ }
289
+ div.CodeMirror span.CodeMirror-nonmatchingbracket {
290
+ color: #aa2222;
291
+ }
292
+ .CodeMirror-matchingtag {
293
+ background: rgba(255, 150, 0, 0.3);
294
+ }
295
+ .CodeMirror-activeline-background {
296
+ background: #e8f2ff;
297
+ }
298
+
299
+ /* STOP */
300
+
301
+ /* The rest of this file contains styles related to the mechanics of
302
+ the editor. You probably shouldn't touch them. */
303
+
304
+ .CodeMirror-scroll {
305
+ overflow: scroll !important;
306
+ margin-bottom: -3.125rem;
307
+ margin-right: -3.125rem;
308
+ padding-bottom: 3.125rem;
309
+ height: 100%;
310
+ outline: none; /* Prevent dragging from highlighting the element */
311
+ position: relative;
312
+ }
313
+ .CodeMirror-sizer {
314
+ position: relative;
315
+ border-right: 3.125rem solid transparent;
316
+ }
317
+
318
+ /* The fake, visible scrollbars. Used to force redraw during scrolling
319
+ before actual scrolling happens, thus preventing shaking and
320
+ flickering artifacts. */
321
+ .CodeMirror-vscrollbar,
322
+ .CodeMirror-hscrollbar,
323
+ .CodeMirror-scrollbar-filler,
324
+ .CodeMirror-gutter-filler {
325
+ position: absolute;
326
+ z-index: 6;
327
+ display: none;
328
+ }
329
+ .CodeMirror-vscrollbar {
330
+ right: 0;
331
+ top: 0;
332
+ overflow-x: hidden;
333
+ overflow-y: scroll;
334
+ }
335
+ .CodeMirror-hscrollbar {
336
+ bottom: 0;
337
+ left: 0;
338
+ overflow-y: hidden;
339
+ overflow-x: scroll;
340
+ }
341
+ .CodeMirror-scrollbar-filler {
342
+ right: 0;
343
+ bottom: 0;
344
+ }
345
+ .CodeMirror-gutter-filler {
346
+ left: 0;
347
+ bottom: 0;
348
+ }
349
+ .CodeMirror-gutter {
350
+ white-space: normal;
351
+ height: 100%;
352
+ display: inline-block;
353
+ vertical-align: top;
354
+ margin-bottom: -3.125rem;
355
+ }
356
+ .CodeMirror-gutter-wrapper {
357
+ position: absolute;
358
+ z-index: 4;
359
+ background: none !important;
360
+ border: none !important;
361
+ }
362
+ .CodeMirror-gutter-background {
363
+ position: absolute;
364
+ top: 0;
365
+ bottom: 0;
366
+ z-index: 4;
367
+ }
368
+ .CodeMirror-gutter-elt {
369
+ position: absolute;
370
+ cursor: default;
371
+ z-index: 4;
372
+ }
373
+ .CodeMirror-gutter-wrapper ::selection {
374
+ background-color: transparent;
375
+ }
376
+ .CodeMirror-gutter-wrapper ::-moz-selection {
377
+ background-color: transparent;
378
+ }
379
+
380
+ .CodeMirror pre.CodeMirror-line,
381
+ .CodeMirror pre.CodeMirror-line-like {
382
+ /* Reset some styles that the rest of the page might have set */
383
+ -moz-border-radius: 0;
384
+ -webkit-border-radius: 0;
385
+ border-radius: 0;
386
+ border-width: 0;
387
+ background: transparent;
388
+ font-family: inherit;
389
+ font-size: inherit;
390
+ margin: 0;
391
+ white-space: pre;
392
+ word-wrap: normal;
393
+ line-height: inherit;
394
+ color: inherit;
395
+ z-index: 2;
396
+ position: relative;
397
+ overflow: visible;
398
+ -webkit-tap-highlight-color: transparent;
399
+ -webkit-font-variant-ligatures: contextual;
400
+ font-variant-ligatures: contextual;
401
+ }
402
+ .CodeMirror-wrap pre.CodeMirror-line,
403
+ .CodeMirror-wrap pre.CodeMirror-line-like {
404
+ word-wrap: break-word;
405
+ white-space: pre-wrap;
406
+ word-break: normal;
407
+ }
408
+
409
+ .CodeMirror-linebackground {
410
+ position: absolute;
411
+ left: 0;
412
+ right: 0;
413
+ top: 0;
414
+ bottom: 0;
415
+ z-index: 0;
416
+ }
417
+
418
+ .CodeMirror-linewidget {
419
+ position: relative;
420
+ z-index: 2;
421
+ padding: 0.006rem; /* Force widget margins to stay inside of the container */
422
+ }
423
+
424
+ .CodeMirror-rtl pre {
425
+ direction: rtl;
426
+ }
427
+
428
+ .CodeMirror-code {
429
+ outline: none;
430
+ }
431
+
432
+ /* Force content-box sizing for the elements where we expect it */
433
+ .CodeMirror-scroll,
434
+ .CodeMirror-sizer,
435
+ .CodeMirror-gutter,
436
+ .CodeMirror-linenumber {
437
+ -moz-box-sizing: content-box;
438
+ box-sizing: content-box;
439
+ }
440
+
441
+ .CodeMirror-measure {
442
+ position: absolute;
443
+ width: 100%;
444
+ height: 0;
445
+ overflow: hidden;
446
+ visibility: hidden;
447
+ }
448
+
449
+ .CodeMirror-measure pre {
450
+ position: static;
451
+ }
452
+
453
+ div.CodeMirror-dragcursors {
454
+ visibility: visible;
455
+ }
456
+
457
+ .CodeMirror-selected {
458
+ background: #d9d9d9;
459
+ }
460
+ .CodeMirror-focused .CodeMirror-selected {
461
+ background: #d7d4f0;
462
+ }
463
+ .CodeMirror-crosshair {
464
+ cursor: crosshair;
465
+ }
466
+ .CodeMirror-line::selection,
467
+ .CodeMirror-line > span::selection,
468
+ .CodeMirror-line > span > span::selection {
469
+ background: #d7d4f0;
470
+ }
471
+ .CodeMirror-line::-moz-selection,
472
+ .CodeMirror-line > span::-moz-selection,
473
+ .CodeMirror-line > span > span::-moz-selection {
474
+ background: #d7d4f0;
475
+ }
476
+
477
+ .cm-searching {
478
+ background-color: rgba(255, 255, 0, 0.4);
479
+ }
480
+
481
+ /* Used to force a border model for a node */
482
+ .cm-force-border {
483
+ padding-right: 0.006rem;
484
+ }
485
+
486
+ /* See issue #2901 */
487
+ .cm-tab-wrap-hack::after {
488
+ content: '';
489
+ }
490
+
491
+ /* Help users use markselection to safely style text background */
492
+ span.CodeMirror-selectedtext {
493
+ background: none;
494
+ }
495
+
496
+ .CodeMirror {
497
+ overflow: hidden;
498
+ font-family: monospace;
499
+ height: 18.75rem;
500
+ direction: ltr;
501
+ position: absolute;
502
+ background-color: ${theme.base.palette['background-color']};
503
+ color: ${theme.base.palette['foreground-color']};
504
+ max-height: 98%;
505
+ max-width: 49%;
506
+ border: 0.0625rem solid ${theme.base.palette['border-line']};
507
+ border-radius: calc(0.5 * ${theme.base['border-radius']});
508
+ }
509
+ .cm-ex-properties {
510
+ color: ${theme.base.palette.success};
511
+ }
512
+ .cm-ex-functions {
513
+ color: ${theme.base.palette.warn};
514
+ }
515
+ .CodeMirror-hints {
516
+ position: absolute;
517
+ z-index: 10;
518
+ overflow: hidden;
519
+ list-style: none;
520
+ margin: 0;
521
+ padding: 0.125rem;
522
+ -webkit-box-shadow: 0.125rem 0.188rem 0.313rem rgba(0, 0, 0, 0.2);
523
+ -moz-box-shadow: 0.125rem 0.188rem 0.313rem rgba(0, 0, 0, 0.2);
524
+ box-shadow: 0.125rem 0.188rem 0.313rem rgba(0, 0, 0, 0.2);
525
+ border-radius: 0.188rem;
526
+ border: 0.063rem solid silver;
527
+ background: white;
528
+ font-size: 90%;
529
+ font-family: monospace;
530
+ max-height: 20em;
531
+ overflow-y: auto;
532
+ }
533
+
534
+ .CodeMirror-hint {
535
+ margin: 0;
536
+ padding: 0 0.25rem;
537
+ border-radius: 0.125rem;
538
+ white-space: pre;
539
+ color: black;
540
+ cursor: pointer;
541
+ }
542
+
543
+ li.CodeMirror-hint-active {
544
+ background: #0088ff;
545
+ color: white;
546
+ }
547
+ `;
548
+ });
549
+ StyledCodeEditor.defaultProps = defaultThemeProp;
85
550
  //# sourceMappingURL=ExpressionBuilder.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionBuilder.styles.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,cAAc,MAAM,iEAAiE,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAI7F,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,IAAI,CAAC,OAAO;iCACN,KAAK,CAAC,IAAI,CAAC,OAAO;GAChD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;CAI5C,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CA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AAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClE,OAAO,GAAG,CAAA;+BACmB,KAAK,CAAC,IAAI,CAAC,OAAO;kCACf,KAAK,CAAC,IAAI,CAAC,OAAO;MAC9C,YAAY;;;GAGf,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,2BAA2B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAE1C,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzB,OAAO,GAAG,CAAA;;wBAEY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;MAC1D,QAAQ;QACV,GAAG,CAAA;0BACmB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;KAC/D;;;uCAGkC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;;MAGlE,uBAAuB;oCACO,KAAK,CAAC,IAAI,CAAC,OAAO;;GAEnD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, StyledButton, StyledText } from '@pega/cosmos-react-core';\nimport StyledTextArea from '@pega/cosmos-react-core/lib/components/TextArea/TextArea.styles';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport { ExpressionItemProps } from './ExpressionBuilder.types';\n\nexport const StyledExpressionSummary = styled.div(({ theme }) => {\n return css`\n padding-block: ${theme.base.spacing};\n padding-inline: calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledExpressionSummary.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionList = styled.ul`\n overflow-y: auto;\n flex-grow: 1;\n list-style: none;\n`;\n\nexport const StyledExpressionBuilder = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['primary-background']};\n min-height: calc(30 * ${theme.base.spacing});\n max-height: 100%;\n max-width: calc(2 * ${theme.base['content-width'].lg} + 4 * ${theme.base.spacing});\n min-width: calc(${theme.base['content-width'].lg} + 4 * ${theme.base.spacing});\n\n ${StyledTextArea} {\n flex-grow: 1;\n }\n `;\n});\n\nStyledExpressionBuilder.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionEditor = styled.div(() => {\n return css`\n ${StyledFormField} {\n flex-grow: 1;\n }\n `;\n});\n\nexport const StyledParamsGroup = styled.div(({ theme }) => {\n return css`\n margin-block-start: calc(2 * ${theme.base.spacing});\n\n ${StyledText} {\n margin-block-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledParamsGroup.defaultProps = defaultThemeProp;\n\nexport const StyledInputParamsGroup = styled(StyledParamsGroup)(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].lg};\n `;\n});\n\nStyledInputParamsGroup.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionDetails = styled.div``;\n\nStyledExpressionDetails.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseContent = styled.div(({ theme }) => {\n return css`\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block-end: calc(2 * ${theme.base.spacing});\n ${StyledButton} {\n align-self: flex-end;\n }\n `;\n});\n\nStyledExpandCollapseContent.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionItem = styled.li<{\n expanded: ExpressionItemProps['expanded'];\n}>(({ theme, expanded }) => {\n return css`\n list-style: none;\n background-color: ${theme.base.palette['primary-background']};\n ${expanded &&\n css`\n background-color: ${theme.base.palette['secondary-background']};\n `}\n\n :not(:last-child) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n\n ${StyledExpressionDetails} {\n padding-block-end: calc(2 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledExpressionItem.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"ExpressionBuilder.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,IAAI,CAAC,eAAe,CAAC;;;eAG9C,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;;;eAG1B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCnC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["// cSpell:words vscrollbar hscrollbar\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n StyledButton,\n StyledLabel,\n StyledText,\n Text\n} from '@pega/cosmos-react-core';\nimport StyledTextArea from '@pega/cosmos-react-core/lib/components/TextArea/TextArea.styles';\n\nimport { ExpressionItemProps } from './ExpressionBuilder.types';\n\nexport const StyledPrimaryText = styled(Text)`\n word-break: break-word;\n`;\n\nexport const StyledExpressionSummary = styled.div(({ theme }) => {\n return css`\n padding-block: ${theme.base.spacing};\n padding-inline: calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledExpressionSummary.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionList = styled.ul`\n overflow-y: auto;\n flex-grow: 1;\n list-style: none;\n`;\n\nexport const StyledExpressionBuilder = styled.div(({ theme }) => {\n return css`\n position: relative;\n background-color: ${theme.base.palette['primary-background']};\n min-height: calc(30 * ${theme.base.spacing});\n max-height: 100%;\n max-width: calc(2 * ${theme.base['content-width'].lg} + 4 * ${theme.base.spacing});\n min-width: calc(${theme.base['content-width'].lg} + 4 * ${theme.base.spacing});\n\n ${StyledTextArea} {\n flex-grow: 1;\n }\n `;\n});\n\nStyledExpressionBuilder.defaultProps = defaultThemeProp;\n\nexport const StyledParamsGroup = styled.div(({ theme }) => {\n return css`\n margin-block-start: calc(2 * ${theme.base.spacing});\n\n ${StyledText} {\n margin-block-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledParamsGroup.defaultProps = defaultThemeProp;\n\nexport const StyledInputParamsGroup = styled(StyledParamsGroup)(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].lg};\n `;\n});\n\nStyledInputParamsGroup.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionDetails = styled.div``;\n\nStyledExpressionDetails.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseContent = styled.div(({ theme }) => {\n return css`\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block-end: calc(2 * ${theme.base.spacing});\n ${StyledButton} {\n align-self: flex-end;\n }\n `;\n});\n\nStyledExpandCollapseContent.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionItem = styled.li<{\n expanded: ExpressionItemProps['expanded'];\n}>(({ theme, expanded }) => {\n return css`\n list-style: none;\n background-color: ${theme.base.palette['primary-background']};\n ${expanded &&\n css`\n background-color: ${theme.base.palette['secondary-background']};\n `}\n\n :not(:last-child) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n\n ${StyledExpressionDetails} {\n padding-block-end: calc(2 * ${theme.base.spacing});\n }\n\n ${StyledLabel} {\n margin-inline-end: calc(0.5 * ${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n }\n `;\n});\n\nStyledExpressionItem.defaultProps = defaultThemeProp;\n\nexport const StyledCodeEditor = styled.div(({ theme }) => {\n return css`\n /* PADDING */\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 0.063rem; /* prevents collapsing before first draw */\n padding: 0.25rem 0; /* Vertical padding around content */\n }\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n position: absolute;\n left: 0;\n top: 0;\n min-height: 100%;\n z-index: 3;\n border-right: 0.063rem solid #dddddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n }\n .CodeMirror-linenumber {\n padding: 0 0.125rem 0 0.313rem;\n min-width: 1.25rem;\n text-align: right;\n color: #999999;\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: black;\n }\n .CodeMirror-guttermarker-subtle {\n color: #999999;\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-left: 0.0625rem solid ${theme.base.palette['border-line']};\n border-right: none;\n width: 0;\n }\n\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 0.063rem solid silver;\n }\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #77ee77;\n }\n @-moz-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @-webkit-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -3.125rem;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 0.063rem solid #cccccc;\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-s-default .cm-header {\n color: blue;\n }\n .cm-negative {\n color: #dd4444;\n }\n .cm-positive {\n color: #229922;\n }\n .cm-strong {\n font-weight: bold;\n }\n .cm-s-default .cm-quote {\n color: #009900;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .cm-s-default .cm-keyword {\n color: #770088;\n }\n .cm-s-default .cm-atom {\n color: #221199;\n }\n .cm-s-default .cm-number {\n color: #116644;\n }\n .cm-s-default .cm-def {\n color: #0000ff;\n }\n .cm-s-default .cm-variable-2 {\n color: #0055aa;\n }\n .cm-s-default .cm-variable-3,\n .cm-s-default .cm-type {\n color: #008855;\n }\n .cm-s-default .cm-comment {\n color: #aa5500;\n }\n .cm-s-default .cm-string {\n color: #aa1111;\n }\n .cm-s-default .cm-string-2 {\n color: #ff5500;\n }\n .cm-s-default .cm-meta {\n color: #555555;\n }\n .cm-s-default .cm-qualifier {\n color: #555555;\n }\n .cm-s-default .cm-builtin {\n color: #3300aa;\n }\n .cm-s-default .cm-bracket {\n color: #999977;\n }\n .cm-s-default .cm-tag {\n color: #117700;\n }\n .cm-s-default .cm-attribute {\n color: #0000cc;\n }\n .cm-s-default .cm-hr {\n color: #999999;\n }\n .cm-s-default .cm-link {\n color: #0000cc;\n }\n\n .cm-s-default .cm-error {\n color: #ff0000;\n }\n .cm-invalidchar {\n color: #ff0000;\n }\n\n .CodeMirror-composing {\n border-bottom: 0.125rem solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: #00bb00;\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: #aa2222;\n }\n .CodeMirror-matchingtag {\n background: rgba(255, 150, 0, 0.3);\n }\n .CodeMirror-activeline-background {\n background: #e8f2ff;\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror-scroll {\n overflow: scroll !important;\n margin-bottom: -3.125rem;\n margin-right: -3.125rem;\n padding-bottom: 3.125rem;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 3.125rem solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n }\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n .CodeMirror-gutter-filler {\n left: 0;\n bottom: 0;\n }\n .CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -3.125rem;\n }\n .CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n }\n .CodeMirror-gutter-background {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 4;\n }\n .CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n }\n .CodeMirror-gutter-wrapper ::selection {\n background-color: transparent;\n }\n .CodeMirror-gutter-wrapper ::-moz-selection {\n background-color: transparent;\n }\n\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n }\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.006rem; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: #d9d9d9;\n }\n .CodeMirror-focused .CodeMirror-selected {\n background: #d7d4f0;\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n .CodeMirror-line::selection,\n .CodeMirror-line > span::selection,\n .CodeMirror-line > span > span::selection {\n background: #d7d4f0;\n }\n .CodeMirror-line::-moz-selection,\n .CodeMirror-line > span::-moz-selection,\n .CodeMirror-line > span > span::-moz-selection {\n background: #d7d4f0;\n }\n\n .cm-searching {\n background-color: rgba(255, 255, 0, 0.4);\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.006rem;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack::after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n .CodeMirror {\n overflow: hidden;\n font-family: monospace;\n height: 18.75rem;\n direction: ltr;\n position: absolute;\n background-color: ${theme.base.palette['background-color']};\n color: ${theme.base.palette['foreground-color']};\n max-height: 98%;\n max-width: 49%;\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n }\n .cm-ex-properties {\n color: ${theme.base.palette.success};\n }\n .cm-ex-functions {\n color: ${theme.base.palette.warn};\n }\n .CodeMirror-hints {\n position: absolute;\n z-index: 10;\n overflow: hidden;\n list-style: none;\n margin: 0;\n padding: 0.125rem;\n -webkit-box-shadow: 0.125rem 0.188rem 0.313rem rgba(0, 0, 0, 0.2);\n -moz-box-shadow: 0.125rem 0.188rem 0.313rem rgba(0, 0, 0, 0.2);\n box-shadow: 0.125rem 0.188rem 0.313rem rgba(0, 0, 0, 0.2);\n border-radius: 0.188rem;\n border: 0.063rem solid silver;\n background: white;\n font-size: 90%;\n font-family: monospace;\n max-height: 20em;\n overflow-y: auto;\n }\n\n .CodeMirror-hint {\n margin: 0;\n padding: 0 0.25rem;\n border-radius: 0.125rem;\n white-space: pre;\n color: black;\n cursor: pointer;\n }\n\n li.CodeMirror-hint-active {\n background: #0088ff;\n color: white;\n }\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n"]}
@@ -1,5 +1,6 @@
1
1
  import { ComponentType, Ref } from 'react';
2
- import { BaseProps, EmptyStateProps, OmitStrict, SearchInputProps, TextAreaProps, FieldValueListProps } from '@pega/cosmos-react-core';
2
+ import { ShowHintOptions, EditorConfiguration } from 'codemirror';
3
+ import { BaseProps, EmptyStateProps, OmitStrict, SearchInputProps, TextAreaProps, FieldValueListProps, MenuProps } from '@pega/cosmos-react-core';
3
4
  export interface ExpressionItemProps {
4
5
  /** Id of the item */
5
6
  id: string;
@@ -17,6 +18,11 @@ export interface ExpressionItemProps {
17
18
  expanded?: boolean;
18
19
  /** Expression details to show in expanded view */
19
20
  details?: ExpressionDetailsProps;
21
+ /** Matched field to be shown in expression item collapsed mode during search */
22
+ matchedField?: {
23
+ name: string;
24
+ value: string;
25
+ };
20
26
  }
21
27
  export interface ExpressionListProps extends BaseProps {
22
28
  ref?: Ref<HTMLDivElement>;
@@ -39,6 +45,11 @@ export interface HandleValue {
39
45
  /** Returns the expression value */
40
46
  getExpression: () => string;
41
47
  }
48
+ export declare type AutoCompleteTriggerType = '@' | '.';
49
+ export declare type SuggestionsType = {
50
+ label: string;
51
+ value: string;
52
+ };
42
53
  export interface ExpressionBuilderProps extends BaseProps {
43
54
  ref?: Ref<HTMLDivElement>;
44
55
  /** Expression items list */
@@ -46,13 +57,19 @@ export interface ExpressionBuilderProps extends BaseProps {
46
57
  onItemAdd: (id: ExpressionItemProps['id'], addExpression: (expression: string) => void) => void;
47
58
  };
48
59
  /** Search input props */
49
- search: Pick<Required<SearchInputProps>, 'filters' | 'onFilterChange' | 'onSearchChange' | 'value'> & Pick<SearchInputProps, 'defaultFilter'>;
50
- /** Default expression to set in the text area */
60
+ search: Pick<Required<SearchInputProps>, 'filters' | 'onFilterChange' | 'onSearchChange' | 'value'> & Pick<SearchInputProps, 'defaultFilter'> & Pick<MenuProps, 'accent'>;
61
+ /** Default expression to set in the code editor */
51
62
  defaultValue?: string;
52
63
  /** Compiled error message */
53
64
  errors?: TextAreaProps['info'];
54
65
  /** Imperative handle */
55
66
  handle?: Ref<HandleValue>;
67
+ /** Fetches suggestion list for suggestions popover */
68
+ fetchSuggestions?: (autoCompleteTrigger: AutoCompleteTriggerType) => Promise<SuggestionsType[]>;
69
+ /** characters which triggers suggestions */
70
+ autoCompleteTriggers?: AutoCompleteTriggerType[];
71
+ /** Code editor configuration props */
72
+ editorConfigProps?: EditorConfiguration;
56
73
  }
57
74
  export interface InputParams<P> {
58
75
  id: string;
@@ -69,4 +86,17 @@ export interface ExpressionDetailsProps extends BaseProps {
69
86
  /** Ref to the component */
70
87
  ref?: Ref<HTMLElement>;
71
88
  }
89
+ export declare type EditorState = {
90
+ getValue: () => string | undefined;
91
+ insertText: (text: string) => void;
92
+ };
93
+ export interface CodeEditorProps extends OmitStrict<ExpressionBuilderProps, 'list' | 'search'> {
94
+ ref?: Ref<HTMLDivElement>;
95
+ codeEditorHandle: Ref<EditorState>;
96
+ /** Default expression to set in the code editor */
97
+ defaultValue?: string;
98
+ }
99
+ export interface EditorHintOptions extends ShowHintOptions {
100
+ suggestions?: SuggestionsType[];
101
+ }
72
102
  //# sourceMappingURL=ExpressionBuilder.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionBuilder.types.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE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qCAAqC;IACrC,WAAW,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;IACjC,2BAA2B;IAC3B,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB"}
1
+ {"version":3,"file":"ExpressionBuilder.types.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EACL,SAAS,EACT,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,KAAK,EAAE,CAAC,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC/C,gCAAgC;IAChC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACnD,kCAAkC;IAClC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACrD,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,gFAAgF;IAChF,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD;AAED,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,GAAG,CA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AAC,sBAAsB,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5F,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,gBAAgB,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACnC,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionBuilder.types.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ComponentType, Ref } from 'react';\n\nimport {\n BaseProps,\n EmptyStateProps,\n OmitStrict,\n SearchInputProps,\n TextAreaProps,\n FieldValueListProps\n} from '@pega/cosmos-react-core';\n\nexport interface ExpressionItemProps {\n /** Id of the item */\n id: string;\n /** Item name to be displayed as rule name */\n primary: string;\n /** Type of expression item. Eg: Decision, When, Automation etc. */\n type: string;\n /** Callback for add event */\n onAdd: (id: ExpressionItemProps['id']) => void;\n /** Callback for expand event */\n onExpand?: (id: ExpressionItemProps['id']) => void;\n /** Callback for collapse event */\n onCollapse?: (id: ExpressionItemProps['id']) => void;\n /** Show the expanded details */\n expanded?: boolean;\n /** Expression details to show in expanded view */\n details?: ExpressionDetailsProps;\n}\n\nexport interface ExpressionListProps extends BaseProps {\n ref?: Ref<HTMLDivElement>;\n /** Expression builder items */\n items?: OmitStrict<ExpressionItemProps, 'onAdd' | 'onExpand' | 'onCollapse' | 'details'>[];\n /** Callback for item add */\n onItemAdd: ExpressionItemProps['onAdd'];\n /** Callback for item expand */\n onItemExpand?: ExpressionItemProps['onExpand'];\n /** Callback for item collapse */\n onItemCollapse?: ExpressionItemProps['onCollapse'];\n /** No items */\n emptyText?: EmptyStateProps['message'];\n /** Expanded items data */\n details: {\n [id: string]: ExpressionDetailsProps;\n };\n}\n\nexport interface HandleValue {\n /** Returns the expression value */\n getExpression: () => string;\n}\n\nexport interface ExpressionBuilderProps extends BaseProps {\n ref?: Ref<HTMLDivElement>;\n /** Expression items list */\n list: OmitStrict<ExpressionListProps, 'ref' | 'onItemAdd'> & {\n onItemAdd: (id: ExpressionItemProps['id'], addExpression: (expression: string) => void) => void;\n };\n /** Search input props */\n search: Pick<\n Required<SearchInputProps>,\n 'filters' | 'onFilterChange' | 'onSearchChange' | 'value'\n > &\n Pick<SearchInputProps, 'defaultFilter'>;\n\n /** Default expression to set in the text area */\n defaultValue?: string;\n /** Compiled error message */\n errors?: TextAreaProps['info'];\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n}\n\nexport interface InputParams<P> {\n id: string;\n renderer: ComponentType<P>;\n rendererProps: P;\n}\n\nexport interface ExpressionDetailsProps extends BaseProps {\n /** Primary details of the expression */\n primary: Required<FieldValueListProps['fields']>;\n /** Output params of the expression */\n outputParams?: Required<FieldValueListProps['fields']>;\n /** Input params of the expression */\n inputParams?: InputParams<any>[];\n /** Ref to the component */\n ref?: Ref<HTMLElement>;\n}\n"]}
1
+ {"version":3,"file":"ExpressionBuilder.types.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ComponentType, Ref } from 'react';\nimport { ShowHintOptions, EditorConfiguration } from 'codemirror';\n\nimport {\n BaseProps,\n EmptyStateProps,\n OmitStrict,\n SearchInputProps,\n TextAreaProps,\n FieldValueListProps,\n MenuProps\n} from '@pega/cosmos-react-core';\n\nexport interface ExpressionItemProps {\n /** Id of the item */\n id: string;\n /** Item name to be displayed as rule name */\n primary: string;\n /** Type of expression item. Eg: Decision, When, Automation etc. */\n type: string;\n /** Callback for add event */\n onAdd: (id: ExpressionItemProps['id']) => void;\n /** Callback for expand event */\n onExpand?: (id: ExpressionItemProps['id']) => void;\n /** Callback for collapse event */\n onCollapse?: (id: ExpressionItemProps['id']) => void;\n /** Show the expanded details */\n expanded?: boolean;\n /** Expression details to show in expanded view */\n details?: ExpressionDetailsProps;\n /** Matched field to be shown in expression item collapsed mode during search */\n matchedField?: { name: string; value: string };\n}\n\nexport interface ExpressionListProps extends BaseProps {\n ref?: Ref<HTMLDivElement>;\n /** Expression builder items */\n items?: OmitStrict<ExpressionItemProps, 'onAdd' | 'onExpand' | 'onCollapse' | 'details'>[];\n /** Callback for item add */\n onItemAdd: ExpressionItemProps['onAdd'];\n /** Callback for item expand */\n onItemExpand?: ExpressionItemProps['onExpand'];\n /** Callback for item collapse */\n onItemCollapse?: ExpressionItemProps['onCollapse'];\n /** No items */\n emptyText?: EmptyStateProps['message'];\n /** Expanded items data */\n details: {\n [id: string]: ExpressionDetailsProps;\n };\n}\n\nexport interface HandleValue {\n /** Returns the expression value */\n getExpression: () => string;\n}\n\nexport type AutoCompleteTriggerType = '@' | '.';\n\nexport type SuggestionsType = { label: string; value: string };\n\nexport interface ExpressionBuilderProps extends BaseProps {\n ref?: Ref<HTMLDivElement>;\n /** Expression items list */\n list: OmitStrict<ExpressionListProps, 'ref' | 'onItemAdd'> & {\n onItemAdd: (id: ExpressionItemProps['id'], addExpression: (expression: string) => void) => void;\n };\n /** Search input props */\n search: Pick<\n Required<SearchInputProps>,\n 'filters' | 'onFilterChange' | 'onSearchChange' | 'value'\n > &\n Pick<SearchInputProps, 'defaultFilter'> &\n Pick<MenuProps, 'accent'>;\n\n /** Default expression to set in the code editor */\n defaultValue?: string;\n /** Compiled error message */\n errors?: TextAreaProps['info'];\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n /** Fetches suggestion list for suggestions popover */\n fetchSuggestions?: (autoCompleteTrigger: AutoCompleteTriggerType) => Promise<SuggestionsType[]>;\n /** characters which triggers suggestions */\n autoCompleteTriggers?: AutoCompleteTriggerType[];\n /** Code editor configuration props */\n editorConfigProps?: EditorConfiguration;\n}\n\nexport interface InputParams<P> {\n id: string;\n renderer: ComponentType<P>;\n rendererProps: P;\n}\n\nexport interface ExpressionDetailsProps extends BaseProps {\n /** Primary details of the expression */\n primary: Required<FieldValueListProps['fields']>;\n /** Output params of the expression */\n outputParams?: Required<FieldValueListProps['fields']>;\n /** Input params of the expression */\n inputParams?: InputParams<any>[];\n /** Ref to the component */\n ref?: Ref<HTMLElement>;\n}\n\nexport type EditorState = {\n getValue: () => string | undefined;\n insertText: (text: string) => void;\n};\n\nexport interface CodeEditorProps extends OmitStrict<ExpressionBuilderProps, 'list' | 'search'> {\n ref?: Ref<HTMLDivElement>;\n codeEditorHandle: Ref<EditorState>;\n /** Default expression to set in the code editor */\n defaultValue?: string;\n}\n\nexport interface EditorHintOptions extends ShowHintOptions {\n suggestions?: SuggestionsType[];\n}\n"]}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { MenuProps } from '@pega/cosmos-react-core';
3
+ declare const ExpressionBuilderContext: import("react").Context<{
4
+ accent: MenuProps['accent'];
5
+ }>;
6
+ export default ExpressionBuilderContext;
7
+ //# sourceMappingURL=ExpressionBuilderContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionBuilderContext.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilderContext.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,QAAA,MAAM,wBAAwB;YAA2B,SAAS,CAAC,QAAQ,CAAC;EAE1E,CAAC;AAEH,eAAe,wBAAwB,CAAC"}