@pega/cosmos-react-build 3.0.0-dev.9.1 → 3.0.0-rc.10

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 (240) hide show
  1. package/lib/components/AppHeader/AppHeader.d.ts +1 -1
  2. package/lib/components/AppHeader/AppHeader.d.ts.map +1 -1
  3. package/lib/components/AppHeader/AppHeader.js +7 -6
  4. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts +1 -2
  6. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
  7. package/lib/components/AppHeader/AppHeader.styles.js +10 -12
  8. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
  9. package/lib/components/AppHeader/BranchButton.d.ts.map +1 -1
  10. package/lib/components/AppHeader/BranchButton.js +22 -18
  11. package/lib/components/AppHeader/BranchButton.js.map +1 -1
  12. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.js +19 -2
  14. package/lib/components/AppShell/AppShell.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.styles.js +1 -3
  17. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  18. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  19. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +50 -38
  20. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  21. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +2 -2
  22. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
  23. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js.map +1 -1
  24. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +8 -0
  25. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -0
  26. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +192 -0
  27. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -0
  28. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +10 -0
  29. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -0
  30. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +530 -0
  31. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -0
  32. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +35 -0
  33. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -0
  34. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js +2 -0
  35. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -0
  36. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts +13 -0
  37. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -0
  38. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +51 -0
  39. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -0
  40. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +6 -0
  41. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -0
  42. package/lib/components/ExpressionBuilder/ExpressionBuilder.js +51 -0
  43. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -0
  44. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +14 -0
  45. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -0
  46. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js +81 -0
  47. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -0
  48. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +74 -0
  49. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -0
  50. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js +2 -0
  51. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -0
  52. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts +7 -0
  53. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts.map +1 -0
  54. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js +6 -0
  55. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js.map +1 -0
  56. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +6 -0
  57. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -0
  58. package/lib/components/ExpressionBuilder/ExpressionDetails.js +12 -0
  59. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -0
  60. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +6 -0
  61. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -0
  62. package/lib/components/ExpressionBuilder/ExpressionItem.js +39 -0
  63. package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -0
  64. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +6 -0
  65. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -0
  66. package/lib/components/ExpressionBuilder/ExpressionList.js +32 -0
  67. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -0
  68. package/lib/components/ExpressionBuilder/index.d.ts +8 -0
  69. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -0
  70. package/lib/components/ExpressionBuilder/index.js +6 -0
  71. package/lib/components/ExpressionBuilder/index.js.map +1 -0
  72. package/lib/components/FlowModeller/AddNode.d.ts +2 -2
  73. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  74. package/lib/components/FlowModeller/AddNode.js +26 -7
  75. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  76. package/lib/components/FlowModeller/Connector.d.ts +3 -3
  77. package/lib/components/FlowModeller/Connector.d.ts.map +1 -1
  78. package/lib/components/FlowModeller/Connector.js +41 -4
  79. package/lib/components/FlowModeller/Connector.js.map +1 -1
  80. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -1
  81. package/lib/components/FlowModeller/DeletePopover.js +56 -25
  82. package/lib/components/FlowModeller/DeletePopover.js.map +1 -1
  83. package/lib/components/FlowModeller/FlowModeller.d.ts +3 -23
  84. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  85. package/lib/components/FlowModeller/FlowModeller.js +94 -17
  86. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  87. package/lib/components/FlowModeller/FlowModeller.types.d.ts +27 -0
  88. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +1 -0
  89. package/lib/components/FlowModeller/FlowModeller.types.js +2 -0
  90. package/lib/components/FlowModeller/FlowModeller.types.js.map +1 -0
  91. package/lib/components/FlowModeller/FlowModellerContext.d.ts +11 -0
  92. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +1 -0
  93. package/lib/components/FlowModeller/FlowModellerContext.js +8 -0
  94. package/lib/components/FlowModeller/FlowModellerContext.js.map +1 -0
  95. package/lib/components/FlowModeller/Node/Node.types.d.ts +13 -4
  96. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  97. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  98. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  99. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +17 -8
  100. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  101. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +1 -1
  102. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  103. package/lib/components/FlowModeller/Node/NodeTemplates.js +25 -12
  104. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  105. package/lib/components/FlowModeller/Node.d.ts.map +1 -1
  106. package/lib/components/FlowModeller/Node.js +3 -4
  107. package/lib/components/FlowModeller/Node.js.map +1 -1
  108. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
  109. package/lib/components/FlowModeller/Renderer/Renderer.js +37 -6
  110. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
  111. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +3 -9
  112. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
  113. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
  114. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +5 -0
  115. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -1
  116. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  117. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +2 -1
  118. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -1
  119. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +19 -6
  120. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
  121. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +1 -2
  122. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
  123. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
  124. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +6 -5
  125. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +1 -1
  126. package/lib/components/FlowModeller/Utils/addNodeUtils.js +57 -34
  127. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -1
  128. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +3 -2
  129. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -1
  130. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +11 -1
  131. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -1
  132. package/lib/components/FlowModeller/helper.d.ts +21 -2
  133. package/lib/components/FlowModeller/helper.d.ts.map +1 -1
  134. package/lib/components/FlowModeller/helper.js +91 -45
  135. package/lib/components/FlowModeller/helper.js.map +1 -1
  136. package/lib/components/FlowModeller/index.d.ts +4 -3
  137. package/lib/components/FlowModeller/index.d.ts.map +1 -1
  138. package/lib/components/FlowModeller/index.js.map +1 -1
  139. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  140. package/lib/components/ItemLibrary/ItemLibrary.js +1 -4
  141. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  142. package/lib/components/LifeCycle/Category.d.ts +3 -20
  143. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  144. package/lib/components/LifeCycle/Category.js +15 -12
  145. package/lib/components/LifeCycle/Category.js.map +1 -1
  146. package/lib/components/LifeCycle/LifeCycle.d.ts +3 -19
  147. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  148. package/lib/components/LifeCycle/LifeCycle.js +14 -10
  149. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  150. package/lib/components/LifeCycle/LifeCycle.types.d.ts +70 -2
  151. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  152. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  153. package/lib/components/LifeCycle/LifeCycleContext.d.ts +9 -0
  154. package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -0
  155. package/lib/components/LifeCycle/LifeCycleContext.js +7 -0
  156. package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -0
  157. package/lib/components/LifeCycle/LifeCycleList.d.ts +1 -5
  158. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  159. package/lib/components/LifeCycle/LifeCycleList.js +3 -3
  160. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  161. package/lib/components/LifeCycle/Stage.d.ts +7 -25
  162. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  163. package/lib/components/LifeCycle/Stage.js +81 -128
  164. package/lib/components/LifeCycle/Stage.js.map +1 -1
  165. package/lib/components/LifeCycle/Step.d.ts +11 -29
  166. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  167. package/lib/components/LifeCycle/Step.js +71 -136
  168. package/lib/components/LifeCycle/Step.js.map +1 -1
  169. package/lib/components/LifeCycle/Task.d.ts +9 -34
  170. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  171. package/lib/components/LifeCycle/Task.js +58 -98
  172. package/lib/components/LifeCycle/Task.js.map +1 -1
  173. package/lib/components/LifeCycle/index.d.ts +2 -2
  174. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  175. package/lib/components/LifeCycle/index.js.map +1 -1
  176. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +9 -0
  177. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -0
  178. package/lib/components/MobileBuildSummary/MobileBuildSummary.js +44 -0
  179. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -0
  180. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts +29 -0
  181. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts.map +1 -0
  182. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js +2 -0
  183. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js.map +1 -0
  184. package/lib/components/MobileBuildSummary/index.d.ts +3 -0
  185. package/lib/components/MobileBuildSummary/index.d.ts.map +1 -0
  186. package/lib/components/MobileBuildSummary/index.js +2 -0
  187. package/lib/components/MobileBuildSummary/index.js.map +1 -0
  188. package/lib/components/ObjectPreview/ObjectPreview.d.ts +1 -1
  189. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -1
  190. package/lib/components/ObjectPreview/ObjectPreview.js +1 -1
  191. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -1
  192. package/lib/components/ObjectSelect/ObjectPicker.d.ts +9 -5
  193. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
  194. package/lib/components/ObjectSelect/ObjectPicker.js +19 -5
  195. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  196. package/lib/components/ObjectSelect/ObjectSelect.d.ts +10 -5
  197. package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -1
  198. package/lib/components/ObjectSelect/ObjectSelect.js +24 -8
  199. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -1
  200. package/lib/components/ObjectSelect/ObjectSummary.d.ts +6 -4
  201. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -1
  202. package/lib/components/ObjectSelect/ObjectSummary.js +28 -33
  203. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
  204. package/lib/components/ObjectSelect/useCreateModal.d.ts +34 -0
  205. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -0
  206. package/lib/components/ObjectSelect/useCreateModal.js +61 -0
  207. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -0
  208. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  209. package/lib/components/PageTemplates/PageTemplates.js +26 -8
  210. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  211. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -1
  212. package/lib/components/Workbench/ConfigurationPanel.js +4 -14
  213. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
  214. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  215. package/lib/components/Workbench/Workbench.js +2 -2
  216. package/lib/components/Workbench/Workbench.js.map +1 -1
  217. package/lib/components/Workbench/Workbench.styles.d.ts +1 -0
  218. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  219. package/lib/components/Workbench/Workbench.styles.js +4 -0
  220. package/lib/components/Workbench/Workbench.styles.js.map +1 -1
  221. package/lib/components/Workbench/Workbench.types.d.ts +2 -2
  222. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  223. package/lib/components/Workbench/Workbench.types.js.map +1 -1
  224. package/lib/index.d.ts +3 -0
  225. package/lib/index.d.ts.map +1 -1
  226. package/lib/index.js +3 -0
  227. package/lib/index.js.map +1 -1
  228. package/package.json +11 -8
  229. package/lib/components/FlowModeller/Renderer/Connectors.d.ts +0 -15
  230. package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +0 -1
  231. package/lib/components/FlowModeller/Renderer/Connectors.js +0 -49
  232. package/lib/components/FlowModeller/Renderer/Connectors.js.map +0 -1
  233. package/lib/components/FlowModeller/Renderer/Nodes.d.ts +0 -11
  234. package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +0 -1
  235. package/lib/components/FlowModeller/Renderer/Nodes.js +0 -31
  236. package/lib/components/FlowModeller/Renderer/Nodes.js.map +0 -1
  237. package/lib/components/ObjectSelect/ObjectConfig.d.ts +0 -18
  238. package/lib/components/ObjectSelect/ObjectConfig.d.ts.map +0 -1
  239. package/lib/components/ObjectSelect/ObjectConfig.js +0 -14
  240. package/lib/components/ObjectSelect/ObjectConfig.js.map +0 -1
@@ -0,0 +1,530 @@
1
+ // cSpell:words vscrollbar hscrollbar
2
+ import styled, { css } from 'styled-components';
3
+ import { mix } from 'polished';
4
+ import { defaultThemeProp, calculateFontSize, Flex } from '@pega/cosmos-react-core';
5
+ import { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';
6
+ export const StyledLoading = styled.div `
7
+ font-size: 1.5rem;
8
+ `;
9
+ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'form-control': { ':read-only': { 'background-color': readOnlyBackgroundColor } }, 'form-field': { error: { 'status-color': errorBackground } } } }, errors, isLoading, suggestions, readOnly }) => {
10
+ const activeColor = mix(0.85, base.palette['primary-background'], base.palette.interactive);
11
+ const hoverColor = mix(0.95, base.palette['primary-background'], base.palette.interactive);
12
+ const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);
13
+ return css `
14
+ position: relative;
15
+ max-height: 100%;
16
+ overflow-y: auto;
17
+ ${StyledFormField} {
18
+ flex-grow: 1;
19
+ }
20
+
21
+ /* PADDING */
22
+ .react-codemirror2 {
23
+ flex-grow: 1;
24
+ min-height: 3.75rem;
25
+ overflow-y: auto;
26
+ ${readOnly &&
27
+ css `
28
+ max-height: 5.625rem;
29
+ `}
30
+ }
31
+
32
+ .CodeMirror-lines {
33
+ cursor: text;
34
+ min-height: 0.063rem; /* prevents collapsing before first draw */
35
+ padding: ${base.spacing};
36
+ }
37
+
38
+ .CodeMirror-scrollbar-filler,
39
+ .CodeMirror-gutter-filler {
40
+ background-color: white; /* The little square between H and V scrollbars */
41
+ }
42
+
43
+ /* GUTTER */
44
+
45
+ .CodeMirror-gutters {
46
+ position: absolute;
47
+ left: 0;
48
+ top: 0;
49
+ min-height: 100%;
50
+ z-index: 3;
51
+ border-right: 0.063rem solid #dddddd;
52
+ background-color: #f7f7f7;
53
+ white-space: nowrap;
54
+ }
55
+ .CodeMirror-linenumber {
56
+ padding: 0 0.125rem 0 0.313rem;
57
+ min-width: 1.25rem;
58
+ text-align: right;
59
+ color: #999999;
60
+ white-space: nowrap;
61
+ }
62
+
63
+ .CodeMirror-guttermarker {
64
+ color: black;
65
+ }
66
+ .CodeMirror-guttermarker-subtle {
67
+ color: #999999;
68
+ }
69
+
70
+ /* CURSOR */
71
+
72
+ .CodeMirror-cursor {
73
+ position: absolute;
74
+ pointer-events: none;
75
+ border-left: 0.0625rem solid ${base.palette.dark};
76
+ border-right: none;
77
+ width: 0;
78
+ ${readOnly &&
79
+ css `
80
+ display: none;
81
+ `}
82
+ }
83
+
84
+ /* Shown when moving in bi-directional text */
85
+ .CodeMirror div.CodeMirror-secondarycursor {
86
+ border-left: 0.063rem solid silver;
87
+ }
88
+ .cm-fat-cursor-mark {
89
+ background-color: rgba(20, 255, 20, 0.5);
90
+ -webkit-animation: blink 1.06s steps(1) infinite;
91
+ -moz-animation: blink 1.06s steps(1) infinite;
92
+ animation: blink 1.06s steps(1) infinite;
93
+ }
94
+ .cm-animate-fat-cursor {
95
+ width: auto;
96
+ border: 0;
97
+ -webkit-animation: blink 1.06s steps(1) infinite;
98
+ -moz-animation: blink 1.06s steps(1) infinite;
99
+ animation: blink 1.06s steps(1) infinite;
100
+ background-color: #77ee77;
101
+ }
102
+ @-moz-keyframes blink {
103
+ 50% {
104
+ background-color: transparent;
105
+ }
106
+ }
107
+ @-webkit-keyframes blink {
108
+ 50% {
109
+ background-color: transparent;
110
+ }
111
+ }
112
+ @keyframes blink {
113
+ 50% {
114
+ background-color: transparent;
115
+ }
116
+ }
117
+
118
+ .cm-tab {
119
+ display: inline-block;
120
+ text-decoration: inherit;
121
+ }
122
+
123
+ .CodeMirror-rulers {
124
+ position: absolute;
125
+ left: 0;
126
+ right: 0;
127
+ top: -3.125rem;
128
+ bottom: 0;
129
+ overflow: hidden;
130
+ }
131
+ .CodeMirror-ruler {
132
+ border-left: 0.063rem solid #cccccc;
133
+ top: 0;
134
+ bottom: 0;
135
+ position: absolute;
136
+ }
137
+
138
+ /* DEFAULT THEME */
139
+
140
+ .cm-s-default .cm-header {
141
+ color: blue;
142
+ }
143
+ .cm-negative {
144
+ color: #dd4444;
145
+ }
146
+ .cm-positive {
147
+ color: #229922;
148
+ }
149
+ .cm-strong {
150
+ font-weight: bold;
151
+ }
152
+ .cm-s-default .cm-quote {
153
+ color: #009900;
154
+ }
155
+ .cm-em {
156
+ font-style: italic;
157
+ }
158
+ .cm-link {
159
+ text-decoration: underline;
160
+ }
161
+ .cm-strikethrough {
162
+ text-decoration: line-through;
163
+ }
164
+
165
+ .cm-s-default .cm-keyword {
166
+ color: #770088;
167
+ }
168
+ .cm-s-default .cm-atom {
169
+ color: #221199;
170
+ }
171
+ .cm-s-default .cm-number {
172
+ color: #116644;
173
+ }
174
+ .cm-s-default .cm-def {
175
+ color: #0000ff;
176
+ }
177
+ .cm-s-default .cm-variable-2 {
178
+ color: #0055aa;
179
+ }
180
+ .cm-s-default .cm-variable-3,
181
+ .cm-s-default .cm-type {
182
+ color: #008855;
183
+ }
184
+ .cm-s-default .cm-comment {
185
+ color: #aa5500;
186
+ }
187
+ .cm-s-default .cm-string {
188
+ color: #aa1111;
189
+ }
190
+ .cm-s-default .cm-string-2 {
191
+ color: #ff5500;
192
+ }
193
+ .cm-s-default .cm-meta {
194
+ color: #555555;
195
+ }
196
+ .cm-s-default .cm-qualifier {
197
+ color: #555555;
198
+ }
199
+ .cm-s-default .cm-builtin {
200
+ color: #3300aa;
201
+ }
202
+ .cm-s-default .cm-bracket {
203
+ color: #999977;
204
+ }
205
+ .cm-s-default .cm-tag {
206
+ color: #117700;
207
+ }
208
+ .cm-s-default .cm-attribute {
209
+ color: #0000cc;
210
+ }
211
+ .cm-s-default .cm-hr {
212
+ color: #999999;
213
+ }
214
+ .cm-s-default .cm-link {
215
+ color: #0000cc;
216
+ }
217
+
218
+ .cm-s-default .cm-error {
219
+ color: #ff0000;
220
+ }
221
+ .cm-invalidchar {
222
+ color: #ff0000;
223
+ }
224
+
225
+ .CodeMirror-composing {
226
+ border-bottom: 0.125rem solid;
227
+ }
228
+
229
+ /* Default styles for common addons */
230
+
231
+ div.CodeMirror span.CodeMirror-matchingbracket {
232
+ color: #00bb00;
233
+ }
234
+ div.CodeMirror span.CodeMirror-nonmatchingbracket {
235
+ color: #aa2222;
236
+ }
237
+ .CodeMirror-matchingtag {
238
+ background: rgba(255, 150, 0, 0.3);
239
+ }
240
+ .CodeMirror-activeline-background {
241
+ background: #e8f2ff;
242
+ }
243
+
244
+ /* STOP */
245
+
246
+ /* The rest of this file contains styles related to the mechanics of
247
+ the editor. You probably shouldn't touch them. */
248
+
249
+ .CodeMirror-scroll {
250
+ overflow: scroll !important;
251
+ margin-bottom: -3.125rem;
252
+ margin-right: -3.125rem;
253
+ padding-bottom: 3.125rem;
254
+ height: 100%;
255
+ outline: none; /* Prevent dragging from highlighting the element */
256
+ position: relative;
257
+ }
258
+ .CodeMirror-sizer {
259
+ position: relative;
260
+ border-right: 3.125rem solid transparent;
261
+ }
262
+
263
+ /* The fake, visible scrollbars. Used to force redraw during scrolling
264
+ before actual scrolling happens, thus preventing shaking and
265
+ flickering artifacts. */
266
+ .CodeMirror-vscrollbar,
267
+ .CodeMirror-hscrollbar,
268
+ .CodeMirror-scrollbar-filler,
269
+ .CodeMirror-gutter-filler {
270
+ position: absolute;
271
+ z-index: 6;
272
+ display: none;
273
+ }
274
+ .CodeMirror-vscrollbar {
275
+ right: 0;
276
+ top: 0;
277
+ overflow-x: hidden;
278
+ overflow-y: scroll;
279
+ }
280
+ .CodeMirror-hscrollbar {
281
+ bottom: 0;
282
+ left: 0;
283
+ overflow-y: hidden;
284
+ overflow-x: scroll;
285
+ }
286
+ .CodeMirror-scrollbar-filler {
287
+ right: 0;
288
+ bottom: 0;
289
+ }
290
+ .CodeMirror-gutter-filler {
291
+ left: 0;
292
+ bottom: 0;
293
+ }
294
+ .CodeMirror-gutter {
295
+ white-space: normal;
296
+ height: 100%;
297
+ display: inline-block;
298
+ vertical-align: top;
299
+ margin-bottom: -3.125rem;
300
+ }
301
+ .CodeMirror-gutter-wrapper {
302
+ position: absolute;
303
+ z-index: 4;
304
+ background: none !important;
305
+ border: none !important;
306
+ }
307
+ .CodeMirror-gutter-background {
308
+ position: absolute;
309
+ top: 0;
310
+ bottom: 0;
311
+ z-index: 4;
312
+ }
313
+ .CodeMirror-gutter-elt {
314
+ position: absolute;
315
+ cursor: default;
316
+ z-index: 4;
317
+ }
318
+ .CodeMirror-gutter-wrapper ::selection {
319
+ background-color: transparent;
320
+ }
321
+ .CodeMirror-gutter-wrapper ::-moz-selection {
322
+ background-color: transparent;
323
+ }
324
+
325
+ .CodeMirror pre.CodeMirror-line,
326
+ .CodeMirror pre.CodeMirror-line-like {
327
+ /* Reset some styles that the rest of the page might have set */
328
+ -moz-border-radius: 0;
329
+ -webkit-border-radius: 0;
330
+ border-radius: 0;
331
+ border-width: 0;
332
+ background: transparent;
333
+ font-family: inherit;
334
+ font-size: inherit;
335
+ margin: 0;
336
+ white-space: pre;
337
+ word-wrap: normal;
338
+ line-height: inherit;
339
+ color: inherit;
340
+ z-index: 2;
341
+ position: relative;
342
+ overflow: visible;
343
+ -webkit-tap-highlight-color: transparent;
344
+ -webkit-font-variant-ligatures: contextual;
345
+ font-variant-ligatures: contextual;
346
+ }
347
+ .CodeMirror-wrap pre.CodeMirror-line,
348
+ .CodeMirror-wrap pre.CodeMirror-line-like {
349
+ word-wrap: break-word;
350
+ white-space: pre-wrap;
351
+ word-break: normal;
352
+ }
353
+
354
+ .CodeMirror-linebackground {
355
+ position: absolute;
356
+ left: 0;
357
+ right: 0;
358
+ top: 0;
359
+ bottom: 0;
360
+ z-index: 0;
361
+ }
362
+
363
+ .CodeMirror-linewidget {
364
+ position: relative;
365
+ z-index: 2;
366
+ padding: 0.006rem; /* Force widget margins to stay inside of the container */
367
+ }
368
+
369
+ .CodeMirror-rtl pre {
370
+ direction: rtl;
371
+ }
372
+
373
+ .CodeMirror-code {
374
+ outline: none;
375
+ }
376
+
377
+ /* Force content-box sizing for the elements where we expect it */
378
+ .CodeMirror-scroll,
379
+ .CodeMirror-sizer,
380
+ .CodeMirror-gutter,
381
+ .CodeMirror-linenumber {
382
+ -moz-box-sizing: content-box;
383
+ box-sizing: content-box;
384
+ }
385
+
386
+ .CodeMirror-measure {
387
+ position: absolute;
388
+ width: 100%;
389
+ height: 0;
390
+ overflow: hidden;
391
+ visibility: hidden;
392
+ }
393
+
394
+ .CodeMirror-measure pre {
395
+ position: static;
396
+ }
397
+
398
+ div.CodeMirror-dragcursors {
399
+ visibility: visible;
400
+ }
401
+
402
+ .CodeMirror-selected {
403
+ background: #d9d9d9;
404
+ }
405
+ .CodeMirror-focused .CodeMirror-selected {
406
+ background: #d7d4f0;
407
+ }
408
+ .CodeMirror-focused {
409
+ border-color: ${base.palette.interactive} !important;
410
+ }
411
+ .CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {
412
+ visibility: hidden;
413
+ }
414
+ .CodeMirror-crosshair {
415
+ cursor: crosshair;
416
+ }
417
+ .CodeMirror-line::selection,
418
+ .CodeMirror-line > span::selection,
419
+ .CodeMirror-line > span > span::selection {
420
+ background: #d7d4f0;
421
+ }
422
+ .CodeMirror-line::-moz-selection,
423
+ .CodeMirror-line > span::-moz-selection,
424
+ .CodeMirror-line > span > span::-moz-selection {
425
+ background: #d7d4f0;
426
+ }
427
+
428
+ .cm-searching {
429
+ background-color: rgba(255, 255, 0, 0.4);
430
+ }
431
+
432
+ /* Used to force a border model for a node */
433
+ .cm-force-border {
434
+ padding-right: 0.006rem;
435
+ }
436
+
437
+ /* See issue #2901 */
438
+ .cm-tab-wrap-hack::after {
439
+ content: '';
440
+ }
441
+
442
+ /* Help users use markselection to safely style text background */
443
+ span.CodeMirror-selectedtext {
444
+ background: none;
445
+ }
446
+
447
+ .CodeMirror {
448
+ overflow: hidden;
449
+ font-family: monospace;
450
+ direction: ltr;
451
+ position: relative;
452
+ background-color: ${base.palette['background-color']};
453
+ color: ${base.palette['foreground-color']};
454
+ border: 0.0625rem solid ${base.palette['border-line']};
455
+ border-radius: calc(0.5 * ${base['border-radius']});
456
+ ${errors &&
457
+ css `
458
+ border-color: ${errorBackground};
459
+ `}
460
+ ${readOnly &&
461
+ css `
462
+ background-color: ${readOnlyBackgroundColor};
463
+ `}
464
+ }
465
+
466
+ .cm-ex-context {
467
+ color: ${base.palette['brand-primary']};
468
+ }
469
+ .cm-ex-operator {
470
+ color: ${base.palette.warn};
471
+ font-weight: bold;
472
+ }
473
+ .cm-ex-ruleName {
474
+ color: ${base.palette.success};
475
+ }
476
+ .cm-ex-delimeter {
477
+ color: ${base.palette['foreground-color']};
478
+ }
479
+ .cm-ex-constant {
480
+ color: ${base.palette.pending};
481
+ }
482
+
483
+ .CodeMirror-hints {
484
+ position: absolute;
485
+ z-index: 10;
486
+ transition: height ${base.animation.speed} ${base.animation.timing.ease};
487
+ padding: 0;
488
+ border-radius: calc(0.5 * ${base['border-radius']});
489
+ box-shadow: ${base.shadow.low};
490
+ border: 0.0625rem solid ${base.palette['border-line']};
491
+ background-color: ${base.palette['primary-background']};
492
+ font-size: ${fontSizes.s};
493
+ max-height: 12rem;
494
+ overflow-y: auto;
495
+ min-width: 8rem;
496
+ }
497
+
498
+ .CodeMirror-hint {
499
+ ${(isLoading || suggestions?.length === 0) &&
500
+ css `
501
+ pointer-events: none;
502
+ `}
503
+ min-height: 1.2rem;
504
+ width: calc(1.5 * ${base['content-width'].xs});
505
+ cursor: pointer;
506
+ @media (pointer: coarse) {
507
+ min-height: 1.2rem;
508
+ }
509
+ line-height: 1.2rem;
510
+ &:focus-within {
511
+ background-color: ${activeColor};
512
+ }
513
+
514
+ &:hover:not([aria-disabled='true']) {
515
+ background-color: ${hoverColor};
516
+ }
517
+ padding-inline: ${base.spacing};
518
+ }
519
+
520
+ li.CodeMirror-hint-active {
521
+ ${!isLoading &&
522
+ suggestions?.length > 0 &&
523
+ css `
524
+ background-color: ${activeColor};
525
+ `}
526
+ }
527
+ `;
528
+ });
529
+ StyledCodeEditor.defaultProps = defaultThemeProp;
530
+ //# sourceMappingURL=CodeEditor.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"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","sourcesContent":["// cSpell:words vscrollbar hscrollbar\nimport styled, { css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { defaultThemeProp, calculateFontSize, Flex } from '@pega/cosmos-react-core';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport { SuggestionType } from './CodeEditor.types';\n\nexport const StyledLoading = styled.div`\n font-size: 1.5rem;\n`;\n\nexport const StyledCodeEditor = styled(Flex)<{\n isLoading?: boolean;\n errors?: string;\n readOnly?: boolean;\n suggestions: SuggestionType[];\n}>(\n ({\n theme: {\n base,\n components: {\n 'form-control': {\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'form-field': {\n error: { 'status-color': errorBackground }\n }\n }\n },\n errors,\n isLoading,\n suggestions,\n readOnly\n }) => {\n const activeColor = mix(0.85, base.palette['primary-background'], base.palette.interactive);\n\n const hoverColor = mix(0.95, base.palette['primary-background'], base.palette.interactive);\n\n const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);\n return css`\n position: relative;\n max-height: 100%;\n overflow-y: auto;\n ${StyledFormField} {\n flex-grow: 1;\n }\n\n /* PADDING */\n .react-codemirror2 {\n flex-grow: 1;\n min-height: 3.75rem;\n overflow-y: auto;\n ${readOnly &&\n css`\n max-height: 5.625rem;\n `}\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 0.063rem; /* prevents collapsing before first draw */\n padding: ${base.spacing};\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 ${base.palette.dark};\n border-right: none;\n width: 0;\n ${readOnly &&\n css`\n display: none;\n `}\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-focused {\n border-color: ${base.palette.interactive} !important;\n }\n .CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {\n visibility: hidden;\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 direction: ltr;\n position: relative;\n background-color: ${base.palette['background-color']};\n color: ${base.palette['foreground-color']};\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: calc(0.5 * ${base['border-radius']});\n ${errors &&\n css`\n border-color: ${errorBackground};\n `}\n ${readOnly &&\n css`\n background-color: ${readOnlyBackgroundColor};\n `}\n }\n\n .cm-ex-context {\n color: ${base.palette['brand-primary']};\n }\n .cm-ex-operator {\n color: ${base.palette.warn};\n font-weight: bold;\n }\n .cm-ex-ruleName {\n color: ${base.palette.success};\n }\n .cm-ex-delimeter {\n color: ${base.palette['foreground-color']};\n }\n .cm-ex-constant {\n color: ${base.palette.pending};\n }\n\n .CodeMirror-hints {\n position: absolute;\n z-index: 10;\n transition: height ${base.animation.speed} ${base.animation.timing.ease};\n padding: 0;\n border-radius: calc(0.5 * ${base['border-radius']});\n box-shadow: ${base.shadow.low};\n border: 0.0625rem solid ${base.palette['border-line']};\n background-color: ${base.palette['primary-background']};\n font-size: ${fontSizes.s};\n max-height: 12rem;\n overflow-y: auto;\n min-width: 8rem;\n }\n\n .CodeMirror-hint {\n ${(isLoading || suggestions?.length === 0) &&\n css`\n pointer-events: none;\n `}\n min-height: 1.2rem;\n width: calc(1.5 * ${base['content-width'].xs});\n cursor: pointer;\n @media (pointer: coarse) {\n min-height: 1.2rem;\n }\n line-height: 1.2rem;\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n padding-inline: ${base.spacing};\n }\n\n li.CodeMirror-hint-active {\n ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n background-color: ${activeColor};\n `}\n }\n `;\n }\n);\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n"]}
@@ -0,0 +1,35 @@
1
+ import { Ref } from 'react';
2
+ import { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';
3
+ import { MenuItemProps } from '@pega/cosmos-react-core';
4
+ export declare type AutoCompleteTriggerChar = '@' | '.' | ':';
5
+ export declare type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;
6
+ export interface EditorState {
7
+ getValue: () => string | undefined;
8
+ insertText: (text: string) => void;
9
+ }
10
+ export interface CodeEditorProps {
11
+ /** Default expression to set in the code editor */
12
+ defaultValue?: string;
13
+ /** Compiled error message */
14
+ errors?: string;
15
+ /** Enable read only mode */
16
+ readOnly?: boolean;
17
+ /** Fetches suggestion list for suggestions popover */
18
+ fetchSuggestions?: (autoCompleteTrigger: AutoCompleteTriggerChar, queryString: string) => Promise<SuggestionType[]>;
19
+ /** characters which triggers suggestions */
20
+ autoCompleteTriggers?: AutoCompleteTriggerChar[];
21
+ /** Code editor configuration props */
22
+ editorConfigProps?: EditorConfiguration;
23
+ /** To show loader for intellisense popover */
24
+ loading?: boolean;
25
+ /** Called when editor content changes. */
26
+ onChange?: (expression: string) => void;
27
+ codeEditorHandle: Ref<EditorState>;
28
+ ref?: Ref<HTMLDivElement>;
29
+ }
30
+ export interface EditorHintOptions extends ShowHintOptions {
31
+ suggestions?: SuggestionType[];
32
+ loading?: boolean;
33
+ triggerCharacterCursorPos?: Position;
34
+ }
35
+ //# sourceMappingURL=CodeEditor.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeEditor.types.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,uBAAuB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtD,oBAAY,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,WAAW,GAAG,IAAI,CAAC,CAAC;AAEjF,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACnC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,CACjB,mBAAmB,EAAE,uBAAuB,EAC5C,WAAW,EAAE,MAAM,KAChB,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC/B,4CAA4C;IAC5C,oBAAoB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACjD,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;IACxC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,QAAQ,CAAC;CACtC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CodeEditor.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeEditor.types.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref } from 'react';\nimport { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';\n\nimport { MenuItemProps } from '@pega/cosmos-react-core';\n\nexport type AutoCompleteTriggerChar = '@' | '.' | ':';\n\nexport type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;\n\nexport interface EditorState {\n getValue: () => string | undefined;\n insertText: (text: string) => void;\n}\n\nexport interface CodeEditorProps {\n /** Default expression to set in the code editor */\n defaultValue?: string;\n /** Compiled error message */\n errors?: string;\n /** Enable read only mode */\n readOnly?: boolean;\n /** Fetches suggestion list for suggestions popover */\n fetchSuggestions?: (\n autoCompleteTrigger: AutoCompleteTriggerChar,\n queryString: string\n ) => Promise<SuggestionType[]>;\n /** characters which triggers suggestions */\n autoCompleteTriggers?: AutoCompleteTriggerChar[];\n /** Code editor configuration props */\n editorConfigProps?: EditorConfiguration;\n /** To show loader for intellisense popover */\n loading?: boolean;\n /** Called when editor content changes. */\n onChange?: (expression: string) => void;\n codeEditorHandle: Ref<EditorState>;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface EditorHintOptions extends ShowHintOptions {\n suggestions?: SuggestionType[];\n loading?: boolean;\n triggerCharacterCursorPos?: Position;\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { Editor } from 'codemirror';
2
+ import { EditorHintOptions } from './CodeEditor.types';
3
+ declare const getCodeSuggestions: (codeMirror: Editor, { suggestions, loading, triggerCharacterCursorPos }: EditorHintOptions) => {
4
+ list: {
5
+ text: string;
6
+ displayText: string;
7
+ render: (element: HTMLLIElement) => void;
8
+ }[];
9
+ from: import("codemirror").Position;
10
+ to: import("codemirror").Position;
11
+ };
12
+ export default getCodeSuggestions;
13
+ //# sourceMappingURL=getCodeSuggestions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCodeSuggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAO,MAAM,YAAY,CAAC;AAKzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD,QAAA,MAAM,kBAAkB,eACV,MAAM,uDAQf,iBAAiB;;cASZ,MAAM;qBACC,MAAM;0BACD,aAAa,KAAK,IAAI;;;;CA8C3C,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { createElement as _createElement } from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import ReactDOM from 'react-dom';
4
+ import { Pos } from 'codemirror';
5
+ import { Progress, Flex, EmptyState } from '@pega/cosmos-react-core';
6
+ import MenuItem from '@pega/cosmos-react-core/lib/components/Menu/MenuItem';
7
+ import { StyledLoading } from './CodeEditor.styles';
8
+ const getCodeSuggestions = (codeMirror, { suggestions = [], loading = false, triggerCharacterCursorPos = {
9
+ ch: 0,
10
+ line: 0
11
+ } }) => {
12
+ const currentPosition = codeMirror.getCursor();
13
+ const filterQuery = codeMirror
14
+ .getValue()
15
+ .split('\n')[triggerCharacterCursorPos.line]?.substring(triggerCharacterCursorPos.ch, currentPosition.ch);
16
+ let filteredList = [];
17
+ if (loading || suggestions.length === 0) {
18
+ filteredList = [
19
+ {
20
+ text: '',
21
+ displayText: '',
22
+ render: (element) => {
23
+ ReactDOM.render(_jsx(Flex, { container: {
24
+ justify: 'center',
25
+ pad: 1
26
+ }, children: loading ? (_jsx(Progress, { variant: 'ring', placement: 'inline', visible: loading, as: StyledLoading })) : (_jsx(EmptyState, {})) }), element);
27
+ }
28
+ }
29
+ ];
30
+ }
31
+ else {
32
+ filteredList = suggestions
33
+ .map(hint => {
34
+ return {
35
+ text: hint.id,
36
+ displayText: hint.primary,
37
+ render: (element) => {
38
+ ReactDOM.render(_createElement(MenuItem, { ...hint, key: hint.id, role: 'menuitem' }), element);
39
+ }
40
+ };
41
+ })
42
+ .filter(item => item.displayText.toLowerCase().startsWith(filterQuery.toLowerCase()));
43
+ }
44
+ return {
45
+ list: filteredList,
46
+ from: Pos(currentPosition.line, triggerCharacterCursorPos.ch - 1),
47
+ to: Pos(currentPosition.line, currentPosition.ch)
48
+ };
49
+ };
50
+ export default getCodeSuggestions;
51
+ //# sourceMappingURL=getCodeSuggestions.js.map