@pega/cosmos-react-build 5.0.0-dev.5.0 → 5.0.0-dev.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/lib/components/AppShell/AppShell.d.ts +2 -2
  2. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  3. package/lib/components/AppShell/AppShell.js.map +1 -1
  4. package/lib/components/AppShell/AppShell.types.d.ts +4 -4
  5. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  6. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  7. package/lib/components/AppShell/AppShellContext.d.ts +1 -1
  8. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  9. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  10. package/lib/components/AppShell/Header/AppHeader.d.ts +3 -3
  11. package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
  12. package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
  13. package/lib/components/AppShell/Header/AppHeader.types.d.ts +4 -4
  14. package/lib/components/AppShell/Header/AppHeader.types.d.ts.map +1 -1
  15. package/lib/components/AppShell/Header/AppHeader.types.js.map +1 -1
  16. package/lib/components/AppShell/Header/BranchButton.d.ts +4 -3
  17. package/lib/components/AppShell/Header/BranchButton.d.ts.map +1 -1
  18. package/lib/components/AppShell/Header/BranchButton.js.map +1 -1
  19. package/lib/components/AppShell/NavigationList.d.ts +2 -2
  20. package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
  21. package/lib/components/AppShell/NavigationList.js.map +1 -1
  22. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +3 -3
  23. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  24. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  25. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +3 -3
  26. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
  27. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js.map +1 -1
  28. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +3 -3
  29. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
  30. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
  31. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +1 -1
  32. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
  33. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  34. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +3 -3
  35. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
  36. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
  37. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts +2 -2
  38. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
  39. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
  40. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +3 -3
  41. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
  42. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
  43. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +1 -1
  44. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
  45. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -1
  46. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -3
  47. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
  48. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
  49. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts +1 -1
  50. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts.map +1 -1
  51. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js.map +1 -1
  52. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +3 -3
  53. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
  54. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
  55. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +3 -3
  56. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -1
  57. package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -1
  58. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +3 -3
  59. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
  60. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
  61. package/lib/components/FlowModeller/AddNode.d.ts +2 -2
  62. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  63. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  64. package/lib/components/FlowModeller/Connector.d.ts +2 -2
  65. package/lib/components/FlowModeller/Connector.d.ts.map +1 -1
  66. package/lib/components/FlowModeller/Connector.js.map +1 -1
  67. package/lib/components/FlowModeller/DeletePopover.d.ts +4 -4
  68. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -1
  69. package/lib/components/FlowModeller/DeletePopover.js.map +1 -1
  70. package/lib/components/FlowModeller/FlowModeller.d.ts +2 -2
  71. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  72. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  73. package/lib/components/FlowModeller/FlowModeller.types.d.ts +5 -5
  74. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +1 -1
  75. package/lib/components/FlowModeller/FlowModeller.types.js.map +1 -1
  76. package/lib/components/FlowModeller/FlowModellerContext.d.ts +2 -2
  77. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +1 -1
  78. package/lib/components/FlowModeller/FlowModellerContext.js.map +1 -1
  79. package/lib/components/FlowModeller/Node/Node.types.d.ts +4 -4
  80. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  81. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  82. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +1 -1
  83. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  84. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  85. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +2 -2
  86. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  87. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  88. package/lib/components/FlowModeller/Node.d.ts +2 -2
  89. package/lib/components/FlowModeller/Node.d.ts.map +1 -1
  90. package/lib/components/FlowModeller/Node.js.map +1 -1
  91. package/lib/components/FlowModeller/Renderer/Renderer.d.ts +2 -2
  92. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
  93. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
  94. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +3 -3
  95. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
  96. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
  97. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +1 -1
  98. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -1
  99. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
  100. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +2 -1
  101. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
  102. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
  103. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +4 -3
  104. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +1 -1
  105. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -1
  106. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +2 -2
  107. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -1
  108. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -1
  109. package/lib/components/FlowModeller/helper.d.ts +4 -4
  110. package/lib/components/FlowModeller/helper.d.ts.map +1 -1
  111. package/lib/components/FlowModeller/helper.js.map +1 -1
  112. package/lib/components/ItemLibrary/ItemLibrary.d.ts +3 -3
  113. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  114. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  115. package/lib/components/LifeCycle/Category.d.ts +3 -3
  116. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  117. package/lib/components/LifeCycle/Category.js.map +1 -1
  118. package/lib/components/LifeCycle/LifeCycle.d.ts +3 -3
  119. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  120. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  121. package/lib/components/LifeCycle/LifeCycle.types.d.ts +4 -4
  122. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  123. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  124. package/lib/components/LifeCycle/LifeCycleContext.d.ts +1 -1
  125. package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
  126. package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
  127. package/lib/components/LifeCycle/LifeCycleList.d.ts +3 -3
  128. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  129. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  130. package/lib/components/LifeCycle/Stage.d.ts +3 -3
  131. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  132. package/lib/components/LifeCycle/Stage.js.map +1 -1
  133. package/lib/components/LifeCycle/Step.d.ts +4 -4
  134. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  135. package/lib/components/LifeCycle/Step.js.map +1 -1
  136. package/lib/components/LifeCycle/Task.d.ts +3 -3
  137. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  138. package/lib/components/LifeCycle/Task.js.map +1 -1
  139. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +3 -3
  140. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
  141. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
  142. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts +2 -2
  143. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts.map +1 -1
  144. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js.map +1 -1
  145. package/lib/components/ObjectPreview/ObjectPreview.d.ts +3 -3
  146. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -1
  147. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -1
  148. package/lib/components/ObjectSelect/ObjectPicker.d.ts +2 -2
  149. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
  150. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  151. package/lib/components/ObjectSelect/ObjectSelect.d.ts +5 -5
  152. package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -1
  153. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -1
  154. package/lib/components/ObjectSelect/ObjectSummary.d.ts +3 -3
  155. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -1
  156. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
  157. package/lib/components/ObjectSelect/useCreateModal.d.ts +2 -2
  158. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -1
  159. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -1
  160. package/lib/components/PageBanner/PageBanner.d.ts +2 -2
  161. package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
  162. package/lib/components/PageBanner/PageBanner.js.map +1 -1
  163. package/lib/components/PageTemplates/GalleryPage.d.ts +4 -4
  164. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
  165. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  166. package/lib/components/PageTemplates/PageTemplates.d.ts +2 -2
  167. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  168. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  169. package/lib/components/PageTemplates/ShowcasePage.d.ts +3 -3
  170. package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
  171. package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
  172. package/lib/components/SummaryCard/SummaryCard.d.ts +3 -2
  173. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
  174. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  175. package/lib/components/Workbench/ConfigurationPanel.d.ts +2 -2
  176. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -1
  177. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
  178. package/lib/components/Workbench/Toolbar.d.ts +2 -2
  179. package/lib/components/Workbench/Toolbar.d.ts.map +1 -1
  180. package/lib/components/Workbench/Toolbar.js.map +1 -1
  181. package/lib/components/Workbench/UtilityPanel.d.ts +2 -2
  182. package/lib/components/Workbench/UtilityPanel.d.ts.map +1 -1
  183. package/lib/components/Workbench/UtilityPanel.js.map +1 -1
  184. package/lib/components/Workbench/Workbench.d.ts +3 -3
  185. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  186. package/lib/components/Workbench/Workbench.js.map +1 -1
  187. package/lib/components/Workbench/Workbench.types.d.ts +2 -2
  188. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  189. package/lib/components/Workbench/Workbench.types.js.map +1 -1
  190. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAUf,OAAO,qCAAqC,CAAC;AAC7C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAkC,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvF,OAAO,EAEL,eAAe,EAGhB,MAAM,oBAAoB,CAAC;AA0E5B,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CAsJjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAIhE,OAAO,qCAAqC,CAAC;AAC7C,OAAO,oCAAoC,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,KAAK,EAEV,eAAe,EAGhB,MAAM,oBAAoB,CAAC;AA0E5B,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CAsJjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":";AAAA,uBAAuB;AACvB,OAAO,EACL,UAAU,EAGV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,mBAAmB,EACpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EACL,QAAQ,EACR,UAAU,EAKX,MAAM,YAAY,CAAC;AACpB,OAAO,qCAAqC,CAAC;AAC7C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAgB,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAA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AE,MAAM,CAAC,CAAC;oBAC/B,aAAa,CAAC,MAAM,CAAC,CAAC;gBACxB,CAAC,GACD,EACD,MAAM,IAAI,KAAC,mBAAmB,IAAC,MAAM,EAAC,OAAO,YAAE,MAAM,GAAuB,IAC5D,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["// cspell:words unfocus\nimport {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useRef,\n useState,\n useEffect,\n useImperativeHandle\n} from 'react';\nimport { Controlled as ReactCodeMirror } from 'react-codemirror2';\nimport {\n showHint,\n defineMode,\n Editor,\n Position,\n EditorChange,\n EditorConfiguration\n} from 'codemirror';\nimport 'codemirror/addon/edit/closebrackets';\nimport 'codemirror/addon/hint/show-hint.js';\n\nimport { useConsolidatedRef, useElement, ForwardProps } from '@pega/cosmos-react-core';\nimport { StyledFormFieldInfo } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport {\n AutoCompleteTriggerChar,\n CodeEditorProps,\n EditorState,\n SuggestionType\n} from './CodeEditor.types';\nimport { StyledCodeEditor } from './CodeEditor.styles';\nimport getCodeSuggestions from './getCodeSuggestions';\n\ndefineMode('expression', () => {\n const tokens = [\n // Below regex is used to identify the context\n { token: /\\w+@/, style: 'ex-context' },\n // Below regex is used to identify the RuleType\n { token: /\\w+:/, style: 'ex-context' },\n // Below regex is used to identify the RuleName\n { token: /\\w+[(]/, style: 'ex-ruleName' },\n // Below regex is used to identify the delimeters\n { token: /[:.(),]/, style: 'ex-delimeter' },\n // Below regex is used to identify the operators\n { token: /[-+\\\\/*=<>@]+/, style: 'ex-operator' },\n // Below regex is used to identify the spaces\n { token: / /, style: 'ex-space' }\n ];\n\n return {\n startState() {\n return { inString: false };\n },\n token(stream, state) {\n // Used to identify the constants in the expression\n const nextChar = stream.peek();\n if (!state.inString && (nextChar === \"'\" || nextChar === '\"')) {\n stream.next(); // Skip quote\n state.inString = true; // Update state\n }\n\n if (state.inString) {\n if (nextChar && stream.skipTo(nextChar)) {\n // Quote found on this line\n stream.next(); // Skip quote\n state.inString = false; // Clear flag\n } else {\n stream.skipToEnd(); // Rest of line is string\n }\n return nextChar === '\"' ? 'ex-constant' : 'ex-context'; // Token style\n }\n\n if (stream.peek() === '.') {\n stream.next();\n if (stream.match(/.\\w+\\(/)) return 'ex-delimeter';\n }\n\n // Used to match the regex in the expression\n for (const element of tokens) {\n const match = stream.match(element.token, false);\n if (match) {\n if (stream.pos === stream.start) {\n stream.next();\n }\n return element.style;\n }\n }\n stream.next();\n return null;\n }\n };\n});\n\nconst defaultConfigOptions: Pick<\n EditorConfiguration,\n 'lineWrapping' | 'smartIndent' | 'autoCloseBrackets' | 'extraKeys'\n> = {\n lineWrapping: true,\n smartIndent: true,\n autoCloseBrackets: true,\n extraKeys: { Tab: false, 'Shift-Tab': false }\n};\n\nconst CodeEditor: FunctionComponent<CodeEditorProps & ForwardProps> = forwardRef(\n function CodeEditor(\n {\n fetchSuggestions,\n autoCompleteTriggers,\n editorConfigProps,\n codeEditorHandle,\n defaultValue = '',\n loading = false,\n readOnly,\n errors,\n onChange,\n ...props\n }: PropsWithoutRef<CodeEditorProps>,\n ref: CodeEditorProps['ref']\n ) {\n const [value, setCode] = useState<string>(defaultValue);\n const [suggestions, setSuggestions] = useState<SuggestionType[]>([]);\n const [codeMirror, setCodeMirror] = useState<Editor | null>(null);\n const [codeEditorContainer, setCodeEditorContainer] = useElement<HTMLDivElement>();\n const codeEditorConsolidatedRef = useConsolidatedRef(setCodeEditorContainer, ref);\n const [suggestionTrigger, setSuggestionTrigger] = useState<{\n character: AutoCompleteTriggerChar;\n cursorPosition: Position;\n } | null>(null);\n const [popover, showPopover] = useState(false);\n const mounted = useRef(false);\n\n useImperativeHandle<any, EditorState>(\n codeEditorHandle,\n () => ({\n insertText: (text: string) => {\n if (codeMirror) {\n if (codeMirror.getSelection()) {\n codeMirror.replaceSelection(text);\n } else {\n const cur: Position = codeMirror.getCursor();\n codeMirror.replaceRange(text, cur);\n }\n }\n },\n getValue: () => {\n return codeMirror?.getValue();\n }\n }),\n [codeMirror]\n );\n\n const autoComplete = (codeEditor: Editor) => {\n const hintOptions = {\n completeSingle: false,\n completeOnSingleClick: true,\n closeOnUnfocus: true,\n suggestions,\n container: codeEditorContainer,\n loading,\n triggerCharacterCursorPos: suggestionTrigger?.cursorPosition\n };\n showHint(codeEditor, getCodeSuggestions, hintOptions);\n };\n\n const onBeforeChange = async (editor: Editor, _data: EditorChange, textvalue: string) => {\n setCode(textvalue);\n onChange?.(textvalue);\n const currentCursor = editor.getCursor();\n const currentCharacter = editor\n .getTokenAt(currentCursor)\n .string.trim() as AutoCompleteTriggerChar;\n\n let newSuggestions: SuggestionType[] = [];\n\n if (autoCompleteTriggers?.includes(currentCharacter) && fetchSuggestions) {\n setSuggestionTrigger({\n character: currentCharacter,\n cursorPosition: currentCursor\n });\n\n newSuggestions = [\n ...(await fetchSuggestions(currentCharacter, {\n line: currentCursor.line,\n ch: currentCursor.ch\n }))\n ];\n if (mounted.current) {\n setSuggestions(newSuggestions);\n }\n }\n };\n\n useEffect(() => {\n if (!popover) return;\n const isSuggestionTriggerPresent =\n suggestionTrigger &&\n codeMirror\n ?.getTokenAt(suggestionTrigger.cursorPosition)\n .string.includes(suggestionTrigger.character);\n\n if (!isSuggestionTriggerPresent) {\n codeMirror?.closeHint();\n showPopover(false);\n setSuggestionTrigger(null);\n }\n }, [onBeforeChange]);\n\n useEffect(() => {\n if (codeMirror && (suggestionTrigger || loading)) {\n autoComplete(codeMirror);\n showPopover(true);\n } else {\n codeMirror?.closeHint();\n showPopover(false);\n }\n }, [suggestions, loading]);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n return (\n <StyledCodeEditor\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1\n }}\n ref={codeEditorConsolidatedRef}\n errors={errors}\n readOnly={readOnly}\n isLoading={loading}\n suggestions={suggestions}\n {...props}\n >\n <ReactCodeMirror\n value={value}\n onBeforeChange={onBeforeChange}\n options={{ ...defaultConfigOptions, ...editorConfigProps }}\n editorDidMount={editor => {\n editor.setSize('100%', '100%');\n setCodeMirror(editor);\n }}\n />\n {errors && <StyledFormFieldInfo status='error'>{errors}</StyledFormFieldInfo>}\n </StyledCodeEditor>\n );\n }\n);\n\nexport default CodeEditor;\n"]}
1
+ {"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":";AAAA,uBAAuB;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4DAA4D,CAAC;AAQjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,UAAU,CAAC,YAAY,EAAE,GAAG,EAAE;IAC5B,MAAM,MAAM,GAAG;QACb,8CAA8C;QAC9C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE;QACtC,+CAA+C;QAC/C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE;QACtC,+CAA+C;QAC/C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE;QACzC,iDAAiD;QACjD,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE;QAC3C,g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AC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3B,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,MAAC,gBAAgB,IACf,SAAS,EAAE;YACT,SAAS,EAAE,QAAQ;YACnB,OAAO,EAAE,SAAS;SACnB,EACD,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;SACR,EACD,GAAG,EAAE,yBAAyB,EAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,EAClB,WAAW,EAAE,WAAW,KACpB,KAAK,aAET,KAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,iBAAiB,EAAE,EAC1D,cAAc,EAAE,MAAM,CAAC,EAAE;oBACvB,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;oBAC/B,aAAa,CAAC,MAAM,CAAC,CAAC;gBACxB,CAAC,GACD,EACD,MAAM,IAAI,KAAC,mBAAmB,IAAC,MAAM,EAAC,OAAO,YAAE,MAAM,GAAuB,IAC5D,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["// cspell:words unfocus\nimport { forwardRef, useRef, useState, useEffect, useImperativeHandle } from 'react';\nimport type { FunctionComponent, PropsWithoutRef } from 'react';\nimport { Controlled as ReactCodeMirror } from 'react-codemirror2';\nimport { showHint, defineMode } from 'codemirror';\nimport type { Editor, Position, EditorChange, EditorConfiguration } from 'codemirror';\nimport 'codemirror/addon/edit/closebrackets';\nimport 'codemirror/addon/hint/show-hint.js';\n\nimport { useConsolidatedRef, useElement } from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport { StyledFormFieldInfo } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type {\n AutoCompleteTriggerChar,\n CodeEditorProps,\n EditorState,\n SuggestionType\n} from './CodeEditor.types';\nimport { StyledCodeEditor } from './CodeEditor.styles';\nimport getCodeSuggestions from './getCodeSuggestions';\n\ndefineMode('expression', () => {\n const tokens = [\n // Below regex is used to identify the context\n { token: /\\w+@/, style: 'ex-context' },\n // Below regex is used to identify the RuleType\n { token: /\\w+:/, style: 'ex-context' },\n // Below regex is used to identify the RuleName\n { token: /\\w+[(]/, style: 'ex-ruleName' },\n // Below regex is used to identify the delimeters\n { token: /[:.(),]/, style: 'ex-delimeter' },\n // Below regex is used to identify the operators\n { token: /[-+\\\\/*=<>@]+/, style: 'ex-operator' },\n // Below regex is used to identify the spaces\n { token: / /, style: 'ex-space' }\n ];\n\n return {\n startState() {\n return { inString: false };\n },\n token(stream, state) {\n // Used to identify the constants in the expression\n const nextChar = stream.peek();\n if (!state.inString && (nextChar === \"'\" || nextChar === '\"')) {\n stream.next(); // Skip quote\n state.inString = true; // Update state\n }\n\n if (state.inString) {\n if (nextChar && stream.skipTo(nextChar)) {\n // Quote found on this line\n stream.next(); // Skip quote\n state.inString = false; // Clear flag\n } else {\n stream.skipToEnd(); // Rest of line is string\n }\n return nextChar === '\"' ? 'ex-constant' : 'ex-context'; // Token style\n }\n\n if (stream.peek() === '.') {\n stream.next();\n if (stream.match(/.\\w+\\(/)) return 'ex-delimeter';\n }\n\n // Used to match the regex in the expression\n for (const element of tokens) {\n const match = stream.match(element.token, false);\n if (match) {\n if (stream.pos === stream.start) {\n stream.next();\n }\n return element.style;\n }\n }\n stream.next();\n return null;\n }\n };\n});\n\nconst defaultConfigOptions: Pick<\n EditorConfiguration,\n 'lineWrapping' | 'smartIndent' | 'autoCloseBrackets' | 'extraKeys'\n> = {\n lineWrapping: true,\n smartIndent: true,\n autoCloseBrackets: true,\n extraKeys: { Tab: false, 'Shift-Tab': false }\n};\n\nconst CodeEditor: FunctionComponent<CodeEditorProps & ForwardProps> = forwardRef(\n function CodeEditor(\n {\n fetchSuggestions,\n autoCompleteTriggers,\n editorConfigProps,\n codeEditorHandle,\n defaultValue = '',\n loading = false,\n readOnly,\n errors,\n onChange,\n ...props\n }: PropsWithoutRef<CodeEditorProps>,\n ref: CodeEditorProps['ref']\n ) {\n const [value, setCode] = useState<string>(defaultValue);\n const [suggestions, setSuggestions] = useState<SuggestionType[]>([]);\n const [codeMirror, setCodeMirror] = useState<Editor | null>(null);\n const [codeEditorContainer, setCodeEditorContainer] = useElement<HTMLDivElement>();\n const codeEditorConsolidatedRef = useConsolidatedRef(setCodeEditorContainer, ref);\n const [suggestionTrigger, setSuggestionTrigger] = useState<{\n character: AutoCompleteTriggerChar;\n cursorPosition: Position;\n } | null>(null);\n const [popover, showPopover] = useState(false);\n const mounted = useRef(false);\n\n useImperativeHandle<any, EditorState>(\n codeEditorHandle,\n () => ({\n insertText: (text: string) => {\n if (codeMirror) {\n if (codeMirror.getSelection()) {\n codeMirror.replaceSelection(text);\n } else {\n const cur: Position = codeMirror.getCursor();\n codeMirror.replaceRange(text, cur);\n }\n }\n },\n getValue: () => {\n return codeMirror?.getValue();\n }\n }),\n [codeMirror]\n );\n\n const autoComplete = (codeEditor: Editor) => {\n const hintOptions = {\n completeSingle: false,\n completeOnSingleClick: true,\n closeOnUnfocus: true,\n suggestions,\n container: codeEditorContainer,\n loading,\n triggerCharacterCursorPos: suggestionTrigger?.cursorPosition\n };\n showHint(codeEditor, getCodeSuggestions, hintOptions);\n };\n\n const onBeforeChange = async (editor: Editor, _data: EditorChange, textvalue: string) => {\n setCode(textvalue);\n onChange?.(textvalue);\n const currentCursor = editor.getCursor();\n const currentCharacter = editor\n .getTokenAt(currentCursor)\n .string.trim() as AutoCompleteTriggerChar;\n\n let newSuggestions: SuggestionType[] = [];\n\n if (autoCompleteTriggers?.includes(currentCharacter) && fetchSuggestions) {\n setSuggestionTrigger({\n character: currentCharacter,\n cursorPosition: currentCursor\n });\n\n newSuggestions = [\n ...(await fetchSuggestions(currentCharacter, {\n line: currentCursor.line,\n ch: currentCursor.ch\n }))\n ];\n if (mounted.current) {\n setSuggestions(newSuggestions);\n }\n }\n };\n\n useEffect(() => {\n if (!popover) return;\n const isSuggestionTriggerPresent =\n suggestionTrigger &&\n codeMirror\n ?.getTokenAt(suggestionTrigger.cursorPosition)\n .string.includes(suggestionTrigger.character);\n\n if (!isSuggestionTriggerPresent) {\n codeMirror?.closeHint();\n showPopover(false);\n setSuggestionTrigger(null);\n }\n }, [onBeforeChange]);\n\n useEffect(() => {\n if (codeMirror && (suggestionTrigger || loading)) {\n autoComplete(codeMirror);\n showPopover(true);\n } else {\n codeMirror?.closeHint();\n showPopover(false);\n }\n }, [suggestions, loading]);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n return (\n <StyledCodeEditor\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1\n }}\n ref={codeEditorConsolidatedRef}\n errors={errors}\n readOnly={readOnly}\n isLoading={loading}\n suggestions={suggestions}\n {...props}\n >\n <ReactCodeMirror\n value={value}\n onBeforeChange={onBeforeChange}\n options={{ ...defaultConfigOptions, ...editorConfigProps }}\n editorDidMount={editor => {\n editor.setSize('100%', '100%');\n setCodeMirror(editor);\n }}\n />\n {errors && <StyledFormFieldInfo status='error'>{errors}</StyledFormFieldInfo>}\n </StyledCodeEditor>\n );\n }\n);\n\nexport default CodeEditor;\n"]}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SuggestionType } from './CodeEditor.types';
2
+ import type { SuggestionType } from './CodeEditor.types';
3
3
  export declare const StyledLoading: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
4
  export declare const StyledCodeEditor: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FlexProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {
5
5
  isLoading?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;iBAId,cAAc,EAAE;SA4hB9B,CAAC"}
1
+ {"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;iBAId,cAAc,EAAE;SA4hB9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAI7F,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEtC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAM1C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EACV,cAAc,EAAE,EACd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scrollbar 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.interactive};\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 ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n li.CodeMirror-hint-active {\n background-color: ${activeColor};\n }\n `}\n `;\n }\n);\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAI7F,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEtC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,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AC,CACF,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","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 type { 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.interactive};\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 ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n li.CodeMirror-hint-active {\n background-color: ${activeColor};\n }\n `}\n `;\n }\n);\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n"]}
@@ -1,6 +1,6 @@
1
- import { Ref } from 'react';
2
- import { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';
3
- import { MenuItemProps } from '@pega/cosmos-react-core';
1
+ import type { Ref } from 'react';
2
+ import type { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';
3
+ import type { MenuItemProps } from '@pega/cosmos-react-core';
4
4
  export type AutoCompleteTriggerChar = '@' | '.' | ':';
5
5
  export type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;
6
6
  export interface EditorState {
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.types.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/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;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"}
@@ -1 +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 type CursorPosition = Pick<Position, 'ch' | 'line'>;\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 cursorPosition: CursorPosition\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"]}
1
+ {"version":3,"file":"CodeEditor.types.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\nimport type { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';\n\nimport type { 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 type CursorPosition = Pick<Position, 'ch' | 'line'>;\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 cursorPosition: CursorPosition\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"]}
@@ -1,5 +1,5 @@
1
- import { Editor } from 'codemirror';
2
- import { EditorHintOptions } from './CodeEditor.types';
1
+ import type { Editor } from 'codemirror';
2
+ import type { EditorHintOptions } from './CodeEditor.types';
3
3
  declare const getCodeSuggestions: (codeMirror: Editor, { suggestions, loading, triggerCharacterCursorPos }: EditorHintOptions) => {
4
4
  list: {
5
5
  text: string;
@@ -1 +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"}
1
+ {"version":3,"file":"getCodeSuggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAKzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,QAAA,MAAM,kBAAkB,eACV,MAAM,uDAQf,iBAAiB;;cASZ,MAAM;qBACC,MAAM;0BACD,aAAa,KAAK,IAAI;;;;CA8C3C,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getCodeSuggestions.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":";;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAU,GAAG,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,QAAQ,MAAM,sDAAsD,CAA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AE,CAAC,OAAsB,EAAE,EAAE;oBACjC,QAAQ,CAAC,MAAM,CAAC,eAAC,QAAQ,OAAK,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAC,UAAU,GAAG,EAAE,OAAO,CAAC,CAAC;gBACjF,CAAC;aACF,CAAC;QACJ,CAAC,CAAC;aACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;KACzF;IAED,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,yBAAyB,CAAC,EAAE,GAAG,CAAC,CAAC;QACjE,EAAE,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import ReactDOM from 'react-dom';\nimport { Editor, Pos } from 'codemirror';\n\nimport { Progress, Flex, EmptyState } from '@pega/cosmos-react-core';\nimport MenuItem from '@pega/cosmos-react-core/lib/components/Menu/MenuItem';\n\nimport { EditorHintOptions } from './CodeEditor.types';\nimport { StyledLoading } from './CodeEditor.styles';\n\nconst getCodeSuggestions = (\n codeMirror: Editor,\n {\n suggestions = [],\n loading = false,\n triggerCharacterCursorPos = {\n ch: 0,\n line: 0\n }\n }: EditorHintOptions\n) => {\n const currentPosition = codeMirror.getCursor();\n const filterQuery = codeMirror\n .getValue()\n .split('\\n')\n [triggerCharacterCursorPos.line]?.substring(triggerCharacterCursorPos.ch, currentPosition.ch);\n\n let filteredList: {\n text: string;\n displayText: string;\n render: (element: HTMLLIElement) => void;\n }[] = [];\n\n if (loading || suggestions.length === 0) {\n filteredList = [\n {\n text: '',\n displayText: '',\n render: (element: HTMLLIElement) => {\n ReactDOM.render(\n <Flex\n container={{\n justify: 'center',\n pad: 1\n }}\n >\n {loading ? (\n <Progress variant='ring' placement='inline' visible={loading} as={StyledLoading} />\n ) : (\n <EmptyState />\n )}\n </Flex>,\n element\n );\n }\n }\n ];\n } else {\n filteredList = suggestions\n .map(hint => {\n return {\n text: hint.id,\n displayText: hint.primary,\n render: (element: HTMLLIElement) => {\n ReactDOM.render(<MenuItem {...hint} key={hint.id} role='menuitem' />, element);\n }\n };\n })\n .filter(item => item.displayText.toLowerCase().startsWith(filterQuery.toLowerCase()));\n }\n\n return {\n list: filteredList,\n from: Pos(currentPosition.line, triggerCharacterCursorPos.ch - 1),\n to: Pos(currentPosition.line, currentPosition.ch)\n };\n};\n\nexport default getCodeSuggestions;\n"]}
1
+ {"version":3,"file":"getCodeSuggestions.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":";;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,QAAQ,MAAM,sDAAsD,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,kBAAkB,GAAG,CACzB,UAAkB,EAClB,EACE,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG,KAAK,EACf,yBAAyB,GAAG;IAC1B,EAAE,EAAE,CAAC;IACL,IAAI,EAAE,CAAC;CACR,EACiB,EACpB,EAAE;IACF,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IAC/C,MAAM,WAAW,GAAG,UAAU;SAC3B,QAAQ,EAAE;SACV,KAAK,CAAC,IAAI,CAAC,CACX,yBAAyB,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,yBAAyB,CAAC,EAAE,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;I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AC,CAAC;QACjE,EAAE,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import ReactDOM from 'react-dom';\nimport { Pos } from 'codemirror';\nimport type { Editor } from 'codemirror';\n\nimport { Progress, Flex, EmptyState } from '@pega/cosmos-react-core';\nimport MenuItem from '@pega/cosmos-react-core/lib/components/Menu/MenuItem';\n\nimport type { EditorHintOptions } from './CodeEditor.types';\nimport { StyledLoading } from './CodeEditor.styles';\n\nconst getCodeSuggestions = (\n codeMirror: Editor,\n {\n suggestions = [],\n loading = false,\n triggerCharacterCursorPos = {\n ch: 0,\n line: 0\n }\n }: EditorHintOptions\n) => {\n const currentPosition = codeMirror.getCursor();\n const filterQuery = codeMirror\n .getValue()\n .split('\\n')\n [triggerCharacterCursorPos.line]?.substring(triggerCharacterCursorPos.ch, currentPosition.ch);\n\n let filteredList: {\n text: string;\n displayText: string;\n render: (element: HTMLLIElement) => void;\n }[] = [];\n\n if (loading || suggestions.length === 0) {\n filteredList = [\n {\n text: '',\n displayText: '',\n render: (element: HTMLLIElement) => {\n ReactDOM.render(\n <Flex\n container={{\n justify: 'center',\n pad: 1\n }}\n >\n {loading ? (\n <Progress variant='ring' placement='inline' visible={loading} as={StyledLoading} />\n ) : (\n <EmptyState />\n )}\n </Flex>,\n element\n );\n }\n }\n ];\n } else {\n filteredList = suggestions\n .map(hint => {\n return {\n text: hint.id,\n displayText: hint.primary,\n render: (element: HTMLLIElement) => {\n ReactDOM.render(<MenuItem {...hint} key={hint.id} role='menuitem' />, element);\n }\n };\n })\n .filter(item => item.displayText.toLowerCase().startsWith(filterQuery.toLowerCase()));\n }\n\n return {\n list: filteredList,\n from: Pos(currentPosition.line, triggerCharacterCursorPos.ch - 1),\n to: Pos(currentPosition.line, currentPosition.ch)\n };\n};\n\nexport default getCodeSuggestions;\n"]}
@@ -1,6 +1,6 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
3
- import { ExpressionBuilderProps } from './ExpressionBuilder.types';
1
+ import type { FunctionComponent } from 'react';
2
+ import type { ForwardProps } from '@pega/cosmos-react-core';
3
+ import type { ExpressionBuilderProps } from './ExpressionBuilder.types';
4
4
  declare const ExpressionBuilder: FunctionComponent<ExpressionBuilderProps & ForwardProps>;
5
5
  export default ExpressionBuilder;
6
6
  //# sourceMappingURL=ExpressionBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAuB,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOxF,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CAiH/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"ExpressionBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAuB,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAO7F,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CAiH/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionBuilder.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV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;wBACjB,IAAI,EAAE,YAAY;wBAClB,QAAQ;qBACT,EACD,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,gBACN,CAAC,CAAC,mBAAmB,CAAC,GAClC,GACG,IACF,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useImperativeHandle,\n useMemo,\n useRef\n} from 'react';\n\nimport {\n Flex,\n ForwardProps,\n SearchInput,\n useI18n,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\n\nimport { ExpressionItemProps, ExpressionBuilderProps } from './ExpressionBuilder.types';\nimport { EditorState } from './CodeEditor/CodeEditor.types';\nimport ExpressionList from './ExpressionList';\nimport { StyledExpressionBuilder } from './ExpressionBuilder.styles';\nimport CodeEditor from './CodeEditor/CodeEditor';\nimport ExpressionBuilderContext from './ExpressionBuilderContext';\n\nconst ExpressionBuilder: FunctionComponent<ExpressionBuilderProps & ForwardProps> = forwardRef(\n function ExpressionBuilder(\n {\n list,\n search,\n errors,\n defaultValue,\n handle,\n fetchSuggestions,\n loading,\n readOnly,\n onChange,\n ...restProps\n }: PropsWithoutRef<ExpressionBuilderProps>,\n ref: ExpressionBuilderProps['ref']\n ) {\n const t = useI18n();\n const codeEditorHandle = useRef<EditorState>(null);\n\n const getExpression = () => {\n return codeEditorHandle.current?.getValue() || '';\n };\n\n useImperativeHandle(\n handle,\n () => ({\n getExpression\n }),\n [getExpression]\n );\n\n const addExpression = (expression: string) => {\n codeEditorHandle.current?.insertText(expression);\n };\n const onItemAdd = (id: ExpressionItemProps['id']) => {\n list.onItemAdd(id, addExpression);\n };\n\n const ctxValue = useMemo(\n () => ({\n accent: search.accent\n }),\n [search.accent]\n );\n\n return (\n <Flex\n {...restProps}\n as={StyledExpressionBuilder}\n ref={ref}\n container={{\n justify: 'between',\n colGap: 2,\n pad: 1\n }}\n item={{\n grow: 1\n }}\n >\n {!readOnly && (\n <VisuallyHiddenText aria-live='polite' role='status'>\n {t('results_count', [list.items?.length || 0], { count: list.items?.length || 0 })}\n </VisuallyHiddenText>\n )}\n {/* Column 1 */}\n {!readOnly && (\n <Flex\n container={{\n direction: 'column',\n justify: 'between',\n gap: 1\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n >\n <SearchInput {...search} />\n <ExpressionBuilderContext.Provider value={ctxValue}>\n <ExpressionList {...list} onItemAdd={onItemAdd} />\n </ExpressionBuilderContext.Provider>\n </Flex>\n )}\n {/* Column 2 */}\n <Flex\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n >\n <CodeEditor\n fetchSuggestions={fetchSuggestions}\n codeEditorHandle={codeEditorHandle}\n autoCompleteTriggers={['.', '@', ':']}\n editorConfigProps={{\n mode: 'expression',\n readOnly\n }}\n defaultValue={defaultValue}\n loading={loading}\n errors={errors}\n readOnly={readOnly}\n onChange={onChange}\n aria-label={t('expression_editor')}\n />\n </Flex>\n </Flex>\n );\n }\n);\n\nexport default ExpressionBuilder;\n"]}
1
+ {"version":3,"file":"ExpressionBuilder.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAKzF,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,iBAAiB,GAA6D,UA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AQ,YACjD,CAAC,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,EAAE,CAAC,GAC/D,CACtB,EAEA,CAAC,QAAQ,IAAI,CACZ,MAAC,IAAI,IACH,SAAS,EAAE;oBACT,SAAS,EAAE,QAAQ;oBACnB,OAAO,EAAE,SAAS;oBAClB,GAAG,EAAE,CAAC;iBACP,EACD,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC;oBACP,KAAK,EAAE,KAAK;iBACb,aAED,KAAC,WAAW,OAAK,MAAM,GAAI,EAC3B,KAAC,wBAAwB,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YAChD,KAAC,cAAc,OAAK,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,GAChB,IAC/B,CACR,EAED,KAAC,IAAI,IACH,SAAS,EAAE;oBACT,SAAS,EAAE,QAAQ;oBACnB,OAAO,EAAE,SAAS;iBACnB,EACD,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC;oBACP,KAAK,EAAE,KAAK;iBACb,YAED,KAAC,UAAU,IACT,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACrC,iBAAiB,EAAE;wBACjB,IAAI,EAAE,YAAY;wBAClB,QAAQ;qBACT,EACD,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,gBACN,CAAC,CAAC,mBAAmB,CAAC,GAClC,GACG,IACF,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef } from 'react';\n\nimport { Flex, SearchInput, useI18n, VisuallyHiddenText } from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\n\nimport type { ExpressionItemProps, ExpressionBuilderProps } from './ExpressionBuilder.types';\nimport type { EditorState } from './CodeEditor/CodeEditor.types';\nimport ExpressionList from './ExpressionList';\nimport { StyledExpressionBuilder } from './ExpressionBuilder.styles';\nimport CodeEditor from './CodeEditor/CodeEditor';\nimport ExpressionBuilderContext from './ExpressionBuilderContext';\n\nconst ExpressionBuilder: FunctionComponent<ExpressionBuilderProps & ForwardProps> = forwardRef(\n function ExpressionBuilder(\n {\n list,\n search,\n errors,\n defaultValue,\n handle,\n fetchSuggestions,\n loading,\n readOnly,\n onChange,\n ...restProps\n }: PropsWithoutRef<ExpressionBuilderProps>,\n ref: ExpressionBuilderProps['ref']\n ) {\n const t = useI18n();\n const codeEditorHandle = useRef<EditorState>(null);\n\n const getExpression = () => {\n return codeEditorHandle.current?.getValue() || '';\n };\n\n useImperativeHandle(\n handle,\n () => ({\n getExpression\n }),\n [getExpression]\n );\n\n const addExpression = (expression: string) => {\n codeEditorHandle.current?.insertText(expression);\n };\n const onItemAdd = (id: ExpressionItemProps['id']) => {\n list.onItemAdd(id, addExpression);\n };\n\n const ctxValue = useMemo(\n () => ({\n accent: search.accent\n }),\n [search.accent]\n );\n\n return (\n <Flex\n {...restProps}\n as={StyledExpressionBuilder}\n ref={ref}\n container={{\n justify: 'between',\n colGap: 2,\n pad: 1\n }}\n item={{\n grow: 1\n }}\n >\n {!readOnly && (\n <VisuallyHiddenText aria-live='polite' role='status'>\n {t('results_count', [list.items?.length || 0], { count: list.items?.length || 0 })}\n </VisuallyHiddenText>\n )}\n {/* Column 1 */}\n {!readOnly && (\n <Flex\n container={{\n direction: 'column',\n justify: 'between',\n gap: 1\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n >\n <SearchInput {...search} />\n <ExpressionBuilderContext.Provider value={ctxValue}>\n <ExpressionList {...list} onItemAdd={onItemAdd} />\n </ExpressionBuilderContext.Provider>\n </Flex>\n )}\n {/* Column 2 */}\n <Flex\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n >\n <CodeEditor\n fetchSuggestions={fetchSuggestions}\n codeEditorHandle={codeEditorHandle}\n autoCompleteTriggers={['.', '@', ':']}\n editorConfigProps={{\n mode: 'expression',\n readOnly\n }}\n defaultValue={defaultValue}\n loading={loading}\n errors={errors}\n readOnly={readOnly}\n onChange={onChange}\n aria-label={t('expression_editor')}\n />\n </Flex>\n </Flex>\n );\n }\n);\n\nexport default ExpressionBuilder;\n"]}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ExpressionItemProps } from './ExpressionBuilder.types';
2
+ import type { ExpressionItemProps } from './ExpressionBuilder.types';
3
3
  export declare const StyledPrimaryText: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
4
4
  export declare const StyledExpressionSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
5
  export declare const StyledExpressionList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionBuilder.styles.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.styles.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,eAAO,MAAM,iBAAiB,mOAE7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,yGAKlC,CAAC;AAIH,eAAO,MAAM,oBAAoB,wGAIhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yGASlC,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAQ5B,CAAC;AAIH,eAAO,MAAM,sBAAsB,yGAIjC,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAAe,CAAC;AAIpD,eAAO,MAAM,2BAA2B,yGAQtC,CAAC;AAIH,eAAO,MAAM,oBAAoB;cACrB,mBAAmB,CAAC,UAAU,CAAC;SAuBzC,CAAC"}
1
+ {"version":3,"file":"ExpressionBuilder.styles.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.styles.ts"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,eAAO,MAAM,iBAAiB,mOAE7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,yGAKlC,CAAC;AAIH,eAAO,MAAM,oBAAoB,wGAIhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yGASlC,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAQ5B,CAAC;AAIH,eAAO,MAAM,sBAAsB,yGAIjC,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAAe,CAAC;AAIpD,eAAO,MAAM,2BAA2B,yGAQtC,CAAC;AAIH,eAAO,MAAM,oBAAoB;cACrB,mBAAmB,CAAC,UAAU,CAAC;SAuBzC,CAAC"}
@@ -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,EACL,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,IAAI,EACL,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE5C,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,IAAI,C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B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEpD,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,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;;;MAGhD,WAAW;sCACqB,KAAK,CAAC,IAAI,CAAC,OAAO;eACzC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;;GAElD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n StyledButton,\n StyledLabel,\n StyledText,\n Text\n} from '@pega/cosmos-react-core';\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});\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"]}
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,EACL,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,IAAI,EACL,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE5C,CAAC;AAEF,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,CAAA;;wBAEY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;4BACpC,KAAK,CAAC,IAAI,CAAC,OAAO;;0BAEpB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,UAAU,KAAK,CAAC,IAAI,CAAC,OAAO;sBAC9D,KAAK,CA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E,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;;;MAGhD,WAAW;sCACqB,KAAK,CAAC,IAAI,CAAC,OAAO;eACzC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;;GAElD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n StyledButton,\n StyledLabel,\n StyledText,\n Text\n} from '@pega/cosmos-react-core';\n\nimport type { 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});\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"]}
@@ -1,6 +1,6 @@
1
- import { ComponentType, Ref } from 'react';
2
- import { BaseProps, EmptyStateProps, OmitStrict, SearchInputProps, FieldValueListProps, MenuProps } from '@pega/cosmos-react-core';
3
- import { CodeEditorProps } from './CodeEditor/CodeEditor.types';
1
+ import type { ComponentType, Ref } from 'react';
2
+ import type { BaseProps, EmptyStateProps, OmitStrict, SearchInputProps, FieldValueListProps, MenuProps } from '@pega/cosmos-react-core';
3
+ import type { CodeEditorProps } from './CodeEditor/CodeEditor.types';
4
4
  export interface ExpressionItemProps {
5
5
  /** Id of the item */
6
6
  id: string;
@@ -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,MAAM,OAAO,CAAC;AAE3C,OAAO,EACL,SAAS,EACT,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,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,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,UAAU,CAAC,mBAAmB,EAAE,OAAO,GAAG,UAAU,GAAG,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E,MAAM,CAAC;IACX,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC3B,aAAa,EAAE,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,wCAAwC;IACxC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjD,sCAAsC;IACtC,YAAY,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,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,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,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,mB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,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;KACjG,CAAC;IACF,yBAAyB;IACzB,MAAM,EAAE,IAAI,CACV,QAAQ,CAAC,gBAAgB,CAAC,EAC1B,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,OAAO,CAC1D,GACC,IAAI,CAAC,gBAAgB,EAAE,eAAe,CAAC,GACvC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAE5B,wBAAwB;IACxB,MAAM,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC3B,aAAa,EAAE,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,wCAAwC;IACxC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjD,sCAAsC;IACtC,YAAY,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,qCAAqC;IACrC,WAAW,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;IACjC,2BAA2B;IAC3B,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB"}
@@ -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 FieldValueListProps,\n MenuProps\n} from '@pega/cosmos-react-core';\n\nimport { CodeEditorProps } from './CodeEditor/CodeEditor.types';\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<HTMLUListElement>;\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\n extends BaseProps,\n OmitStrict<CodeEditorProps, 'ref' | 'codeEditorHandle'> {\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 /** 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 type { ComponentType, Ref } from 'react';\n\nimport type {\n BaseProps,\n EmptyStateProps,\n OmitStrict,\n SearchInputProps,\n FieldValueListProps,\n MenuProps\n} from '@pega/cosmos-react-core';\n\nimport type { CodeEditorProps } from './CodeEditor/CodeEditor.types';\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<HTMLUListElement>;\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\n extends BaseProps,\n OmitStrict<CodeEditorProps, 'ref' | 'codeEditorHandle'> {\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 /** 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,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { MenuProps } from '@pega/cosmos-react-core';
2
+ import type { MenuProps } from '@pega/cosmos-react-core';
3
3
  declare const ExpressionBuilderContext: import("react").Context<{
4
4
  accent: MenuProps['accent'];
5
5
  }>;
@@ -1 +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"}
1
+ {"version":3,"file":"ExpressionBuilderContext.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilderContext.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,QAAA,MAAM,wBAAwB;YAA2B,SAAS,CAAC,QAAQ,CAAC;EAE1E,CAAC;AAEH,eAAe,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionBuilderContext.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilderContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,MAAM,wBAAwB,GAAG,aAAa,CAAkC;IAC9E,MAAM,EAAE,SAAS;CAClB,CAAC,CAAC;AAEH,eAAe,wBAAwB,CAAC","sourcesContent":["import { createContext } from 'react';\n\nimport { MenuProps } from '@pega/cosmos-react-core';\n\nconst ExpressionBuilderContext = createContext<{ accent: MenuProps['accent'] }>({\n accent: undefined\n});\n\nexport default ExpressionBuilderContext;\n"]}
1
+ {"version":3,"file":"ExpressionBuilderContext.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilderContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,MAAM,wBAAwB,GAAG,aAAa,CAAkC;IAC9E,MAAM,EAAE,SAAS;CAClB,CAAC,CAAC;AAEH,eAAe,wBAAwB,CAAC","sourcesContent":["import { createContext } from 'react';\n\nimport type { MenuProps } from '@pega/cosmos-react-core';\n\nconst ExpressionBuilderContext = createContext<{ accent: MenuProps['accent'] }>({\n accent: undefined\n});\n\nexport default ExpressionBuilderContext;\n"]}
@@ -1,6 +1,6 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
3
- import { ExpressionDetailsProps } from './ExpressionBuilder.types';
1
+ import type { FunctionComponent } from 'react';
2
+ import type { ForwardProps } from '@pega/cosmos-react-core';
3
+ import type { ExpressionDetailsProps } from './ExpressionBuilder.types';
4
4
  declare const ExpressionDetails: FunctionComponent<ExpressionDetailsProps & ForwardProps>;
5
5
  export default ExpressionDetails;
6
6
  //# sourceMappingURL=ExpressionDetails.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAwB,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AAE5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CAiC/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"ExpressionDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionDetails.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOxE,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CAiC/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionDetails.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,IAAI,EAAgB,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAG5F,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,iBAAiB,GAA6D,UAAU,CAC5F,SAAS,iBAAiB,CACxB,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,EACpD,GAAkC;IAElC,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,CACL,MAAC,IAAI,OACC,SAAS,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,EAAE,EAAE,uBAAuB,aAE3B,KAAC,cAAc,IAAC,MAAM,EAAE,OAAO,GAAI,EAClC,YAAY,IAAI,CACf,MAAC,iBAAiB,eAChB,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,mBAAmB,CAAC,GAAQ,EAClD,KAAC,cAAc,IAAC,MAAM,EAAE,YAAY,GAAI,IACtB,CACrB,EACA,WAAW,IAAI,CACd,MAAC,sBAAsB,eACrB,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,kBAAkB,CAAC,GAAQ,EACjD,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,YAC7C,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,EAAE;4BAC7D,OAAO,KAAC,QAAQ,OAAc,aAAa,IAArB,EAAE,CAAuB,CAAC;wBAClD,CAAC,CAAC,GACG,IACgB,CAC1B,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { forwardRef, FunctionComponent } from 'react';\n\nimport { FieldValueList, Flex, ForwardProps, Text, useI18n } from '@pega/cosmos-react-core';\n\nimport { ExpressionDetailsProps } from './ExpressionBuilder.types';\nimport {\n StyledExpressionDetails,\n StyledInputParamsGroup,\n StyledParamsGroup\n} from './ExpressionBuilder.styles';\n\nconst ExpressionDetails: FunctionComponent<ExpressionDetailsProps & ForwardProps> = forwardRef(\n function ExpressionDetails(\n { primary, inputParams, outputParams, ...restProps },\n ref: ExpressionDetailsProps['ref']\n ) {\n const t = useI18n();\n return (\n <Flex\n {...restProps}\n ref={ref}\n container={{ direction: 'column' }}\n as={StyledExpressionDetails}\n >\n <FieldValueList fields={primary} />\n {outputParams && (\n <StyledParamsGroup>\n <Text variant='h4'>{t('output_parameters')}</Text>\n <FieldValueList fields={outputParams} />\n </StyledParamsGroup>\n )}\n {inputParams && (\n <StyledInputParamsGroup>\n <Text variant='h4'>{t('input_parameters')}</Text>\n <Flex container={{ direction: 'column', gap: 1 }}>\n {inputParams.map(({ id, renderer: Renderer, rendererProps }) => {\n return <Renderer key={id} {...rendererProps} />;\n })}\n </Flex>\n </StyledInputParamsGroup>\n )}\n </Flex>\n );\n }\n);\n\nexport default ExpressionDetails;\n"]}
1
+ {"version":3,"file":"ExpressionDetails.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAI9E,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,iBAAiB,GAA6D,UAAU,CAC5F,SAAS,iBAAiB,CACxB,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,EACpD,GAAkC;IAElC,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,CACL,MAAC,IAAI,OACC,SAAS,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,EAAE,EAAE,uBAAuB,aAE3B,KAAC,cAAc,IAAC,MAAM,EAAE,OAAO,GAAI,EAClC,YAAY,IAAI,CACf,MAAC,iBAAiB,eAChB,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,mBAAmB,CAAC,GAAQ,EAClD,KAAC,cAAc,IAAC,MAAM,EAAE,YAAY,GAAI,IACtB,CACrB,EACA,WAAW,IAAI,CACd,MAAC,sBAAsB,eACrB,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,kBAAkB,CAAC,GAAQ,EACjD,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,YAC7C,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,EAAE;4BAC7D,OAAO,KAAC,QAAQ,OAAc,aAAa,IAArB,EAAE,CAAuB,CAAC;wBAClD,CAAC,CAAC,GACG,IACgB,CAC1B,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent } from 'react';\n\nimport { FieldValueList, Flex, Text, useI18n } from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\n\nimport type { ExpressionDetailsProps } from './ExpressionBuilder.types';\nimport {\n StyledExpressionDetails,\n StyledInputParamsGroup,\n StyledParamsGroup\n} from './ExpressionBuilder.styles';\n\nconst ExpressionDetails: FunctionComponent<ExpressionDetailsProps & ForwardProps> = forwardRef(\n function ExpressionDetails(\n { primary, inputParams, outputParams, ...restProps },\n ref: ExpressionDetailsProps['ref']\n ) {\n const t = useI18n();\n return (\n <Flex\n {...restProps}\n ref={ref}\n container={{ direction: 'column' }}\n as={StyledExpressionDetails}\n >\n <FieldValueList fields={primary} />\n {outputParams && (\n <StyledParamsGroup>\n <Text variant='h4'>{t('output_parameters')}</Text>\n <FieldValueList fields={outputParams} />\n </StyledParamsGroup>\n )}\n {inputParams && (\n <StyledInputParamsGroup>\n <Text variant='h4'>{t('input_parameters')}</Text>\n <Flex container={{ direction: 'column', gap: 1 }}>\n {inputParams.map(({ id, renderer: Renderer, rendererProps }) => {\n return <Renderer key={id} {...rendererProps} />;\n })}\n </Flex>\n </StyledInputParamsGroup>\n )}\n </Flex>\n );\n }\n);\n\nexport default ExpressionDetails;\n"]}
@@ -1,6 +1,6 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
3
- import { ExpressionItemProps } from './ExpressionBuilder.types';
1
+ import type { FunctionComponent } from 'react';
2
+ import type { ForwardProps } from '@pega/cosmos-react-core';
3
+ import type { ExpressionItemProps } from './ExpressionBuilder.types';
4
4
  declare const ExpressionItem: FunctionComponent<ExpressionItemProps & ForwardProps>;
5
5
  export default ExpressionItem;
6
6
  //# sourceMappingURL=ExpressionItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionItem.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAE/D,OAAO,EAIL,YAAY,EASb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAYhE,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAsGzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ExpressionItem.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAe/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAYrE,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAsGzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionItem.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EACL,MAAM,EACN,cAAc,EACd,IAAI,EAEJ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,oEAAoE,CAAC;AACrG,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAGnG,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAE5C,MAAM,cAAc,GAA0D,CAAC,EAC7E,EAAE,EACF,OAAO,EACP,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,GAAG,SAAS,EACb,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAC;IAExD,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;QACpC,IAAI,MAAM,EAAE;YACV,MAAM,WAAW,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YACzE,OAAO,uBAAuB,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I,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, useContext, useMemo } from 'react';\n\nimport {\n Button,\n ExpandCollapse,\n Flex,\n ForwardProps,\n Icon,\n Mark,\n registerIcon,\n replaceMatchWithElement,\n StyledLabel,\n Text,\n useDirection,\n useI18n\n} from '@pega/cosmos-react-core';\nimport * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\n\nimport { ExpressionItemProps } from './ExpressionBuilder.types';\nimport {\n StyledPrimaryText,\n StyledExpandCollapseContent,\n StyledExpressionSummary,\n StyledExpressionItem\n} from './ExpressionBuilder.styles';\nimport ExpressionDetails from './ExpressionDetails';\nimport ExpressionBuilderContext from './ExpressionBuilderContext';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nconst ExpressionItem: FunctionComponent<ExpressionItemProps & ForwardProps> = ({\n id,\n primary,\n type,\n onAdd,\n onExpand,\n onCollapse,\n details,\n matchedField,\n expanded = false,\n ...restProps\n}) => {\n const { end: caretDirection } = useDirection();\n const t = useI18n();\n\n const { accent } = useContext(ExpressionBuilderContext);\n\n const accentedText = (text: string) => {\n if (accent) {\n const accentRegex = typeof accent === 'function' ? accent(text) : accent;\n return replaceMatchWithElement(text, accentRegex, str => {\n return <Mark>{str}</Mark>;\n });\n }\n return text;\n };\n\n const caretIcon = useMemo(() => {\n return expanded ? 'caret-down' : `caret-${caretDirection}`;\n }, [expanded, caretDirection]);\n\n const accentedMeta = matchedField && !expanded ? accentedText(matchedField.value) : undefined;\n\n return (\n <StyledExpressionItem expanded={expanded}>\n <Flex\n {...restProps}\n as={StyledExpressionSummary}\n id={id}\n container={{ gap: 1, alignItems: 'start' }}\n >\n <Button\n icon\n variant='simple'\n onClick={\n onCollapse || onExpand\n ? () => {\n if (expanded) {\n onCollapse?.(id);\n } else {\n onExpand?.(id);\n }\n }\n : undefined\n }\n aria-label={`${type}: ${primary}`}\n aria-expanded={expanded}\n label={expanded ? t('collapse') : t('expand')}\n >\n <Icon name={caretIcon} />\n </Button>\n\n <Flex container={{ alignItems: 'start', direction: 'column' }} item={{ grow: 1 }}>\n <StyledPrimaryText variant='primary'>\n {!matchedField ? accentedText(primary) : primary}\n </StyledPrimaryText>\n {accentedMeta ? (\n <div>\n <StyledLabel as='span'>{matchedField?.name}:</StyledLabel>\n {accentedMeta}\n </div>\n ) : (\n <Text variant='secondary'>{type}</Text>\n )}\n </Flex>\n\n {!expanded && (\n <Button\n icon\n variant='simple'\n onClick={() => onAdd(id)}\n aria-label={t('add_noun', [`${type}: ${primary}`])}\n label={t('add')}\n >\n <Icon name='plus' />\n </Button>\n )}\n </Flex>\n <ExpandCollapse collapsed={!expanded}>\n <Flex as={StyledExpandCollapseContent} container={{ direction: 'column' }}>\n {details && <ExpressionDetails {...details} />}\n <Button\n variant='primary'\n onClick={() => onAdd(id)}\n aria-label={t('add_noun', [`${type}: ${primary}`])}\n >\n {t('add')}\n </Button>\n </Flex>\n </ExpandCollapse>\n </StyledExpressionItem>\n );\n};\n\nexport default ExpressionItem;\n"]}
1
+ {"version":3,"file":"ExpressionItem.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EACL,MAAM,EACN,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,OAAO,EACR,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,cAAc,MAAM,oEAAoE,CAAC;AACrG,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAGnG,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,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,KAAC,MAAM,IACL,IAAI,QACJ,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,gBACZ,CAAC,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,EAClD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAEf,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,CACV,IACI,EACP,KAAC,cAAc,IAAC,SAAS,EAAE,CAAC,QAAQ,YAClC,MAAC,IAAI,IAAC,EAAE,EAAE,2BAA2B,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aACtE,OAAO,IAAI,KAAC,iBAAiB,OAAK,OAAO,GAAI,EAC9C,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,gBACZ,CAAC,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,YAEjD,CAAC,CAAC,KAAK,CAAC,GACF,IACJ,GACQ,IACI,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { useContext, useMemo } from 'react';\nimport type { FunctionComponent } from 'react';\n\nimport {\n Button,\n ExpandCollapse,\n Flex,\n Icon,\n Mark,\n registerIcon,\n replaceMatchWithElement,\n StyledLabel,\n Text,\n useDirection,\n useI18n\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\n\nimport type { ExpressionItemProps } from './ExpressionBuilder.types';\nimport {\n StyledPrimaryText,\n StyledExpandCollapseContent,\n StyledExpressionSummary,\n StyledExpressionItem\n} from './ExpressionBuilder.styles';\nimport ExpressionDetails from './ExpressionDetails';\nimport ExpressionBuilderContext from './ExpressionBuilderContext';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nconst ExpressionItem: FunctionComponent<ExpressionItemProps & ForwardProps> = ({\n id,\n primary,\n type,\n onAdd,\n onExpand,\n onCollapse,\n details,\n matchedField,\n expanded = false,\n ...restProps\n}) => {\n const { end: caretDirection } = useDirection();\n const t = useI18n();\n\n const { accent } = useContext(ExpressionBuilderContext);\n\n const accentedText = (text: string) => {\n if (accent) {\n const accentRegex = typeof accent === 'function' ? accent(text) : accent;\n return replaceMatchWithElement(text, accentRegex, str => {\n return <Mark>{str}</Mark>;\n });\n }\n return text;\n };\n\n const caretIcon = useMemo(() => {\n return expanded ? 'caret-down' : `caret-${caretDirection}`;\n }, [expanded, caretDirection]);\n\n const accentedMeta = matchedField && !expanded ? accentedText(matchedField.value) : undefined;\n\n return (\n <StyledExpressionItem expanded={expanded}>\n <Flex\n {...restProps}\n as={StyledExpressionSummary}\n id={id}\n container={{ gap: 1, alignItems: 'start' }}\n >\n <Button\n icon\n variant='simple'\n onClick={\n onCollapse || onExpand\n ? () => {\n if (expanded) {\n onCollapse?.(id);\n } else {\n onExpand?.(id);\n }\n }\n : undefined\n }\n aria-label={`${type}: ${primary}`}\n aria-expanded={expanded}\n label={expanded ? t('collapse') : t('expand')}\n >\n <Icon name={caretIcon} />\n </Button>\n\n <Flex container={{ alignItems: 'start', direction: 'column' }} item={{ grow: 1 }}>\n <StyledPrimaryText variant='primary'>\n {!matchedField ? accentedText(primary) : primary}\n </StyledPrimaryText>\n {accentedMeta ? (\n <div>\n <StyledLabel as='span'>{matchedField?.name}:</StyledLabel>\n {accentedMeta}\n </div>\n ) : (\n <Text variant='secondary'>{type}</Text>\n )}\n </Flex>\n\n {!expanded && (\n <Button\n icon\n variant='simple'\n onClick={() => onAdd(id)}\n aria-label={t('add_noun', [`${type}: ${primary}`])}\n label={t('add')}\n >\n <Icon name='plus' />\n </Button>\n )}\n </Flex>\n <ExpandCollapse collapsed={!expanded}>\n <Flex as={StyledExpandCollapseContent} container={{ direction: 'column' }}>\n {details && <ExpressionDetails {...details} />}\n <Button\n variant='primary'\n onClick={() => onAdd(id)}\n aria-label={t('add_noun', [`${type}: ${primary}`])}\n >\n {t('add')}\n </Button>\n </Flex>\n </ExpandCollapse>\n </StyledExpressionItem>\n );\n};\n\nexport default ExpressionItem;\n"]}
@@ -1,6 +1,6 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
3
- import { ExpressionListProps } from './ExpressionBuilder.types';
1
+ import type { FunctionComponent } from 'react';
2
+ import type { ForwardProps } from '@pega/cosmos-react-core';
3
+ import type { ExpressionListProps } from './ExpressionBuilder.types';
4
4
  declare const ExpressionList: FunctionComponent<ExpressionListProps & ForwardProps>;
5
5
  export default ExpressionList;
6
6
  //# sourceMappingURL=ExpressionList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionList.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAc,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAuB,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIrF,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CA+CzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ExpressionList.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAuB,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAI1F,QAAA,MAA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ClC,cAAc,EAAE,CAAC,EAAE,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,oBAAoB,OAAK,SAAS,EAAE,GAAG,EAAE,GAAG,YAC1C,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC3B,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACf,OAAO,CACL,eAAC,cAAc,OACT,IAAI,EACR,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,EAC9B,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EACzC,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAC3B,CACH,CAAC;QACJ,CAAC,CAAC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IAAC,OAAO,EAAE,SAAS,GAAI,CACnC,GACoB,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, useState } from 'react';\n\nimport { EmptyState, ForwardProps } from '@pega/cosmos-react-core';\n\nimport { ExpressionItemProps, ExpressionListProps } from './ExpressionBuilder.types';\nimport ExpressionItem from './ExpressionItem';\nimport { StyledExpressionList } from './ExpressionBuilder.styles';\n\nconst ExpressionList: FunctionComponent<ExpressionListProps & ForwardProps> = forwardRef(\n function ExpressionList(\n { items, emptyText, onItemAdd, onItemExpand, onItemCollapse, details, ...restProps },\n ref: ExpressionListProps['ref']\n ) {\n const [expandedItems, setExpandedItems] = useState<ExpressionItemProps['id'][]>([]);\n\n const handleItemExpand = (id: ExpressionItemProps['id']) => {\n setExpandedItems(prev => {\n const itemIndex = prev.indexOf(id);\n if (itemIndex !== -1) return prev;\n onItemExpand?.(id);\n return [...prev, id];\n });\n };\n\n const handleItemCollapse = (id: ExpressionItemProps['id']) => {\n setExpandedItems(prev => {\n const itemIndex = prev.indexOf(id);\n if (itemIndex === -1) return prev;\n onItemCollapse?.(id);\n return prev.filter(itemId => itemId !== id);\n });\n };\n\n return (\n <StyledExpressionList {...restProps} ref={ref}>\n {items && items.length > 0 ? (\n items.map(item => {\n return (\n <ExpressionItem\n {...item}\n onAdd={onItemAdd}\n onExpand={handleItemExpand}\n onCollapse={handleItemCollapse}\n expanded={expandedItems.includes(item.id)}\n key={item.id}\n details={details?.[item.id]}\n />\n );\n })\n ) : (\n <EmptyState message={emptyText} />\n )}\n </StyledExpressionList>\n );\n }\n);\n\nexport default ExpressionList;\n"]}
1
+ {"version":3,"file":"ExpressionList.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,cAAc,GAA0D,UAAU,CACtF,SAAS,cAAc,CACrB,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,EACpF,GAA+B;IAE/B,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAA8B,EAAE,CAAC,CAAC;IAEpF,MAAM,gBAAgB,GAAG,CAAC,EAA6B,EAAE,EAAE;QACzD,gBAAgB,CAAC,IAAI,CAAC,EAAE;YACtB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;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AC","sourcesContent":["import { forwardRef, useState } from 'react';\nimport type { FunctionComponent } from 'react';\n\nimport { EmptyState } from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\n\nimport type { ExpressionItemProps, ExpressionListProps } from './ExpressionBuilder.types';\nimport ExpressionItem from './ExpressionItem';\nimport { StyledExpressionList } from './ExpressionBuilder.styles';\n\nconst ExpressionList: FunctionComponent<ExpressionListProps & ForwardProps> = forwardRef(\n function ExpressionList(\n { items, emptyText, onItemAdd, onItemExpand, onItemCollapse, details, ...restProps },\n ref: ExpressionListProps['ref']\n ) {\n const [expandedItems, setExpandedItems] = useState<ExpressionItemProps['id'][]>([]);\n\n const handleItemExpand = (id: ExpressionItemProps['id']) => {\n setExpandedItems(prev => {\n const itemIndex = prev.indexOf(id);\n if (itemIndex !== -1) return prev;\n onItemExpand?.(id);\n return [...prev, id];\n });\n };\n\n const handleItemCollapse = (id: ExpressionItemProps['id']) => {\n setExpandedItems(prev => {\n const itemIndex = prev.indexOf(id);\n if (itemIndex === -1) return prev;\n onItemCollapse?.(id);\n return prev.filter(itemId => itemId !== id);\n });\n };\n\n return (\n <StyledExpressionList {...restProps} ref={ref}>\n {items && items.length > 0 ? (\n items.map(item => {\n return (\n <ExpressionItem\n {...item}\n onAdd={onItemAdd}\n onExpand={handleItemExpand}\n onCollapse={handleItemCollapse}\n expanded={expandedItems.includes(item.id)}\n key={item.id}\n details={details?.[item.id]}\n />\n );\n })\n ) : (\n <EmptyState message={emptyText} />\n )}\n </StyledExpressionList>\n );\n }\n);\n\nexport default ExpressionList;\n"]}
@@ -1,5 +1,5 @@
1
- import { FC, MouseEvent } from 'react';
2
- import { PlottedGraphNode } from './Renderer/Utils/GraphLayout';
1
+ import type { FC, MouseEvent } from 'react';
2
+ import type { PlottedGraphNode } from './Renderer/Utils/GraphLayout';
3
3
  export declare const StyledDot: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, import("styled-components").DefaultTheme, {
4
4
  highlight?: boolean | undefined;
5
5
  }, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"AddNode.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/AddNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAmC,MAAM,OAAO,CAAC;AAYxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,eAAO,MAAM,SAAS;;SAWpB,CAAC;AAIH,eAAO,MAAM,UAAU,0LAEtB,CAAC;AAEF,eAAO,MAAM,aAAa,yGASxB,CAAC;AAIH,eAAO,MAAM,YAAY,qOA0BvB,CAAC;AAIH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC;IAC9B,cAAc,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB;eAA6B,OAAO;SAQnE,CAAC;AAIH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,GAAG,WAAW,CAAC,CAgC5E,CAAC"}
1
+ {"version":3,"file":"AddNode.d.ts","sourceRoot":"","sources":["../../../src/components/FlowModeller/AddNode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAY5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,eAAO,MAAM,SAAS;;SAWpB,CAAC;AAIH,eAAO,MAAM,UAAU,0LAEtB,CAAC;AAEF,eAAO,MAAM,aAAa,yGASxB,CAAC;AAIH,eAAO,MAAM,YAAY,qOA0BvB,CAAC;AAIH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,OAAO,CAA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