@pega/cosmos-react-build 3.0.0-dev.3.0 → 3.0.0-dev.30.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 (274) hide show
  1. package/lib/components/AppHeader/AppHeader.d.ts +4 -2
  2. package/lib/components/AppHeader/AppHeader.d.ts.map +1 -1
  3. package/lib/components/AppHeader/AppHeader.js +12 -10
  4. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts +1 -3
  6. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
  7. package/lib/components/AppHeader/AppHeader.styles.js +5 -22
  8. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
  9. package/lib/components/AppHeader/BranchButton.d.ts.map +1 -1
  10. package/lib/components/AppHeader/BranchButton.js +22 -18
  11. package/lib/components/AppHeader/BranchButton.js.map +1 -1
  12. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.js +21 -20
  14. package/lib/components/AppShell/AppShell.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.styles.js +17 -2
  17. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  18. package/lib/components/AppShell/AppShell.types.d.ts +6 -9
  19. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  21. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +3 -0
  22. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  23. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +173 -42
  24. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  25. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +6 -0
  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/DynamicContentEditor/PegaCustomElement.d.ts +307 -3
  29. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts.map +1 -1
  30. package/lib/components/DynamicContentEditor/PegaCustomElement.js +21 -21
  31. package/lib/components/DynamicContentEditor/PegaCustomElement.js.map +1 -1
  32. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +8 -0
  33. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -0
  34. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +124 -0
  35. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -0
  36. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +8 -0
  37. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -0
  38. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +517 -0
  39. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -0
  40. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +35 -0
  41. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -0
  42. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js +2 -0
  43. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -0
  44. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts +13 -0
  45. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -0
  46. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +46 -0
  47. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -0
  48. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +6 -0
  49. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -0
  50. package/lib/components/ExpressionBuilder/ExpressionBuilder.js +51 -0
  51. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -0
  52. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +14 -0
  53. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -0
  54. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js +81 -0
  55. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -0
  56. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +74 -0
  57. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -0
  58. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js +2 -0
  59. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -0
  60. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts +7 -0
  61. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts.map +1 -0
  62. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js +6 -0
  63. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js.map +1 -0
  64. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +6 -0
  65. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -0
  66. package/lib/components/ExpressionBuilder/ExpressionDetails.js +12 -0
  67. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -0
  68. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +6 -0
  69. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -0
  70. package/lib/components/ExpressionBuilder/ExpressionItem.js +43 -0
  71. package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -0
  72. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +6 -0
  73. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -0
  74. package/lib/components/ExpressionBuilder/ExpressionList.js +32 -0
  75. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -0
  76. package/lib/components/ExpressionBuilder/index.d.ts +8 -0
  77. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -0
  78. package/lib/components/ExpressionBuilder/index.js +6 -0
  79. package/lib/components/ExpressionBuilder/index.js.map +1 -0
  80. package/lib/components/FlowModeller/AddNode.d.ts +11 -9
  81. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  82. package/lib/components/FlowModeller/AddNode.js +9 -3
  83. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  84. package/lib/components/FlowModeller/Connector.d.ts +7 -0
  85. package/lib/components/FlowModeller/Connector.d.ts.map +1 -0
  86. package/lib/components/FlowModeller/Connector.js +71 -0
  87. package/lib/components/FlowModeller/Connector.js.map +1 -0
  88. package/lib/components/FlowModeller/DeletePopover.d.ts +19 -0
  89. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -0
  90. package/lib/components/FlowModeller/DeletePopover.js +136 -0
  91. package/lib/components/FlowModeller/DeletePopover.js.map +1 -0
  92. package/lib/components/FlowModeller/FlowModeller.d.ts +3 -19
  93. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  94. package/lib/components/FlowModeller/FlowModeller.js +187 -63
  95. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  96. package/lib/components/FlowModeller/FlowModeller.types.d.ts +25 -0
  97. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +1 -0
  98. package/lib/components/FlowModeller/FlowModeller.types.js +2 -0
  99. package/lib/components/FlowModeller/FlowModeller.types.js.map +1 -0
  100. package/lib/components/FlowModeller/FlowModellerContext.d.ts +6 -0
  101. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +1 -0
  102. package/lib/components/FlowModeller/FlowModellerContext.js +7 -0
  103. package/lib/components/FlowModeller/FlowModellerContext.js.map +1 -0
  104. package/lib/components/FlowModeller/Node/Node.types.d.ts +22 -9
  105. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  106. package/lib/components/FlowModeller/Node/Node.types.js +2 -3
  107. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  108. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +6 -4
  109. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  110. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +21 -11
  111. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  112. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +1 -1
  113. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  114. package/lib/components/FlowModeller/Node/NodeTemplates.js +43 -19
  115. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  116. package/lib/components/FlowModeller/Node.d.ts +5 -0
  117. package/lib/components/FlowModeller/Node.d.ts.map +1 -0
  118. package/lib/components/FlowModeller/Node.js +22 -0
  119. package/lib/components/FlowModeller/Node.js.map +1 -0
  120. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
  121. package/lib/components/FlowModeller/Renderer/Renderer.js +37 -6
  122. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
  123. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +9 -9
  124. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
  125. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
  126. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +8 -3
  127. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -1
  128. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +7 -1
  129. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  130. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +2 -1
  131. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -1
  132. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +19 -6
  133. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
  134. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +9 -6
  135. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
  136. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +23 -3
  137. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
  138. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +17 -0
  139. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +1 -0
  140. package/lib/components/FlowModeller/Utils/{AddNodeUtils.js → addNodeUtils.js} +58 -35
  141. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -0
  142. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +30 -0
  143. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -0
  144. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +81 -0
  145. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -0
  146. package/lib/components/FlowModeller/helper.d.ts +18 -8
  147. package/lib/components/FlowModeller/helper.d.ts.map +1 -1
  148. package/lib/components/FlowModeller/helper.js +114 -55
  149. package/lib/components/FlowModeller/helper.js.map +1 -1
  150. package/lib/components/FlowModeller/index.d.ts +8 -3
  151. package/lib/components/FlowModeller/index.d.ts.map +1 -1
  152. package/lib/components/FlowModeller/index.js +5 -1
  153. package/lib/components/FlowModeller/index.js.map +1 -1
  154. package/lib/components/ItemLibrary/ItemLibrary.d.ts +8 -6
  155. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  156. package/lib/components/ItemLibrary/ItemLibrary.js +6 -8
  157. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  158. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  159. package/lib/components/LifeCycle/Category.js +17 -13
  160. package/lib/components/LifeCycle/Category.js.map +1 -1
  161. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  162. package/lib/components/LifeCycle/LifeCycle.js +2 -3
  163. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  164. package/lib/components/LifeCycle/LifeCycle.types.d.ts +2 -4
  165. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  166. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  167. package/lib/components/LifeCycle/LifeCycleList.d.ts +1 -1
  168. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  169. package/lib/components/LifeCycle/LifeCycleList.js +3 -2
  170. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  171. package/lib/components/LifeCycle/Stage.d.ts +1 -1
  172. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  173. package/lib/components/LifeCycle/Stage.js +8 -17
  174. package/lib/components/LifeCycle/Stage.js.map +1 -1
  175. package/lib/components/LifeCycle/Step.d.ts +5 -8
  176. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  177. package/lib/components/LifeCycle/Step.js +10 -32
  178. package/lib/components/LifeCycle/Step.js.map +1 -1
  179. package/lib/components/LifeCycle/Task.d.ts +5 -3
  180. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  181. package/lib/components/LifeCycle/Task.js +17 -10
  182. package/lib/components/LifeCycle/Task.js.map +1 -1
  183. package/lib/components/LifeCycle/index.d.ts +1 -2
  184. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  185. package/lib/components/LifeCycle/index.js.map +1 -1
  186. package/lib/components/ObjectPreview/ObjectPreview.d.ts +16 -0
  187. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -0
  188. package/lib/components/ObjectPreview/ObjectPreview.js +25 -0
  189. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -0
  190. package/lib/components/ObjectPreview/index.d.ts +3 -0
  191. package/lib/components/ObjectPreview/index.d.ts.map +1 -0
  192. package/lib/components/ObjectPreview/index.js +3 -0
  193. package/lib/components/ObjectPreview/index.js.map +1 -0
  194. package/lib/components/ObjectSelect/ObjectPicker.d.ts +15 -0
  195. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -0
  196. package/lib/components/ObjectSelect/ObjectPicker.js +40 -0
  197. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -0
  198. package/lib/components/ObjectSelect/ObjectSelect.d.ts +32 -0
  199. package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -0
  200. package/lib/components/ObjectSelect/ObjectSelect.js +41 -0
  201. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -0
  202. package/lib/components/ObjectSelect/ObjectSummary.d.ts +24 -0
  203. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -0
  204. package/lib/components/ObjectSelect/ObjectSummary.js +45 -0
  205. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -0
  206. package/lib/components/ObjectSelect/index.d.ts +3 -0
  207. package/lib/components/ObjectSelect/index.d.ts.map +1 -0
  208. package/lib/components/ObjectSelect/index.js +2 -0
  209. package/lib/components/ObjectSelect/index.js.map +1 -0
  210. package/lib/components/ObjectSelect/useCreateModal.d.ts +34 -0
  211. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -0
  212. package/lib/components/ObjectSelect/useCreateModal.js +61 -0
  213. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -0
  214. package/lib/components/PageTemplates/GalleryPage.js +4 -4
  215. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  216. package/lib/components/PageTemplates/PageTemplates.d.ts +3 -3
  217. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  218. package/lib/components/PageTemplates/PageTemplates.js +45 -37
  219. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  220. package/lib/components/SummaryCard/SummaryCard.d.ts +2 -3
  221. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
  222. package/lib/components/SummaryCard/SummaryCard.js +3 -4
  223. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  224. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -1
  225. package/lib/components/Workbench/ConfigurationPanel.js +4 -15
  226. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
  227. package/lib/components/Workbench/Toolbar.d.ts +1 -5
  228. package/lib/components/Workbench/Toolbar.d.ts.map +1 -1
  229. package/lib/components/Workbench/Toolbar.js +8 -8
  230. package/lib/components/Workbench/Toolbar.js.map +1 -1
  231. package/lib/components/Workbench/UtilityPanel.js +1 -1
  232. package/lib/components/Workbench/UtilityPanel.js.map +1 -1
  233. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  234. package/lib/components/Workbench/Workbench.js +3 -4
  235. package/lib/components/Workbench/Workbench.js.map +1 -1
  236. package/lib/components/Workbench/Workbench.styles.d.ts +1 -1
  237. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  238. package/lib/components/Workbench/Workbench.styles.js +15 -16
  239. package/lib/components/Workbench/Workbench.styles.js.map +1 -1
  240. package/lib/components/Workbench/Workbench.types.d.ts +2 -4
  241. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  242. package/lib/components/Workbench/Workbench.types.js.map +1 -1
  243. package/lib/index.d.ts +6 -1
  244. package/lib/index.d.ts.map +1 -1
  245. package/lib/index.js +6 -1
  246. package/lib/index.js.map +1 -1
  247. package/lib/utils/index.d.ts +2 -0
  248. package/lib/utils/index.d.ts.map +1 -0
  249. package/lib/utils/index.js +2 -0
  250. package/lib/utils/index.js.map +1 -0
  251. package/lib/utils/utils.d.ts +14 -0
  252. package/lib/utils/utils.d.ts.map +1 -0
  253. package/lib/utils/utils.js +13 -0
  254. package/lib/utils/utils.js.map +1 -0
  255. package/package.json +23 -14
  256. package/lib/components/FlowModeller/Renderer/Connectors.d.ts +0 -13
  257. package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +0 -1
  258. package/lib/components/FlowModeller/Renderer/Connectors.js +0 -47
  259. package/lib/components/FlowModeller/Renderer/Connectors.js.map +0 -1
  260. package/lib/components/FlowModeller/Renderer/Nodes.d.ts +0 -9
  261. package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +0 -1
  262. package/lib/components/FlowModeller/Renderer/Nodes.js +0 -25
  263. package/lib/components/FlowModeller/Renderer/Nodes.js.map +0 -1
  264. package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts +0 -16
  265. package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts.map +0 -1
  266. package/lib/components/FlowModeller/Utils/AddNodeUtils.js.map +0 -1
  267. package/lib/components/Visual/Visual.d.ts +0 -17
  268. package/lib/components/Visual/Visual.d.ts.map +0 -1
  269. package/lib/components/Visual/Visual.js +0 -28
  270. package/lib/components/Visual/Visual.js.map +0 -1
  271. package/lib/components/Visual/index.d.ts +0 -3
  272. package/lib/components/Visual/index.d.ts.map +0 -1
  273. package/lib/components/Visual/index.js +0 -3
  274. package/lib/components/Visual/index.js.map +0 -1
@@ -1,4 +1,308 @@
1
- export default class PegaCustomElement extends HTMLElement {
2
- connectedCallback(): void;
3
- }
1
+ export declare const pegaReferenceElementStyle = "pega-reference {\n color:#076bc9;\n cursor:pointer;\n}\npega-reference:hover{\n text-decoration:underline;\n}\npega-reference::before{\n content: '['\n}\npega-reference::after{\n content: ']'\n}";
2
+ export declare const createPegaReferenceElement: (win: typeof globalThis) => {
3
+ new (): {
4
+ connectedCallback(): void;
5
+ accessKey: string;
6
+ readonly accessKeyLabel: string;
7
+ autocapitalize: string;
8
+ dir: string;
9
+ draggable: boolean;
10
+ hidden: boolean;
11
+ innerText: string;
12
+ lang: string;
13
+ readonly offsetHeight: number;
14
+ readonly offsetLeft: number;
15
+ readonly offsetParent: Element | null;
16
+ readonly offsetTop: number;
17
+ readonly offsetWidth: number;
18
+ outerText: string;
19
+ spellcheck: boolean;
20
+ title: string;
21
+ translate: boolean;
22
+ attachInternals(): ElementInternals;
23
+ click(): void;
24
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
25
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
26
+ removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
27
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
28
+ readonly attributes: NamedNodeMap;
29
+ readonly classList: DOMTokenList;
30
+ className: string;
31
+ readonly clientHeight: number;
32
+ readonly clientLeft: number;
33
+ readonly clientTop: number;
34
+ readonly clientWidth: number;
35
+ id: string;
36
+ readonly localName: string;
37
+ readonly namespaceURI: string | null;
38
+ onfullscreenchange: ((this: Element, ev: Event) => any) | null;
39
+ onfullscreenerror: ((this: Element, ev: Event) => any) | null;
40
+ outerHTML: string;
41
+ readonly ownerDocument: Document;
42
+ readonly part: DOMTokenList;
43
+ readonly prefix: string | null;
44
+ readonly scrollHeight: number;
45
+ scrollLeft: number;
46
+ scrollTop: number;
47
+ readonly scrollWidth: number;
48
+ readonly shadowRoot: ShadowRoot | null;
49
+ slot: string;
50
+ readonly tagName: string;
51
+ attachShadow(init: ShadowRootInit): ShadowRoot;
52
+ closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
53
+ closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
54
+ closest<E extends Element = Element>(selectors: string): E | null;
55
+ getAttribute(qualifiedName: string): string | null;
56
+ getAttributeNS(namespace: string | null, localName: string): string | null;
57
+ getAttributeNames(): string[];
58
+ getAttributeNode(qualifiedName: string): Attr | null;
59
+ getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
60
+ getBoundingClientRect(): DOMRect;
61
+ getClientRects(): DOMRectList;
62
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
63
+ getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
64
+ getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
65
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
66
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
67
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
68
+ getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
69
+ hasAttribute(qualifiedName: string): boolean;
70
+ hasAttributeNS(namespace: string | null, localName: string): boolean;
71
+ hasAttributes(): boolean;
72
+ hasPointerCapture(pointerId: number): boolean;
73
+ insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
74
+ insertAdjacentHTML(position: InsertPosition, text: string): void;
75
+ insertAdjacentText(where: InsertPosition, data: string): void;
76
+ matches(selectors: string): boolean;
77
+ releasePointerCapture(pointerId: number): void;
78
+ removeAttribute(qualifiedName: string): void;
79
+ removeAttributeNS(namespace: string | null, localName: string): void;
80
+ removeAttributeNode(attr: Attr): Attr;
81
+ requestFullscreen(options?: FullscreenOptions | undefined): Promise<void>;
82
+ requestPointerLock(): void;
83
+ scroll(options?: ScrollToOptions | undefined): void;
84
+ scroll(x: number, y: number): void;
85
+ scrollBy(options?: ScrollToOptions | undefined): void;
86
+ scrollBy(x: number, y: number): void;
87
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions | undefined): void;
88
+ scrollTo(options?: ScrollToOptions | undefined): void;
89
+ scrollTo(x: number, y: number): void;
90
+ setAttribute(qualifiedName: string, value: string): void;
91
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
92
+ setAttributeNode(attr: Attr): Attr | null;
93
+ setAttributeNodeNS(attr: Attr): Attr | null;
94
+ setPointerCapture(pointerId: number): void;
95
+ toggleAttribute(qualifiedName: string, force?: boolean | undefined): boolean;
96
+ webkitMatchesSelector(selectors: string): boolean;
97
+ readonly baseURI: string;
98
+ readonly childNodes: NodeListOf<ChildNode>;
99
+ readonly firstChild: ChildNode | null;
100
+ readonly isConnected: boolean;
101
+ readonly lastChild: ChildNode | null;
102
+ readonly nextSibling: ChildNode | null;
103
+ readonly nodeName: string;
104
+ readonly nodeType: number;
105
+ nodeValue: string | null;
106
+ readonly parentElement: HTMLElement | null;
107
+ readonly parentNode: ParentNode | null;
108
+ readonly previousSibling: ChildNode | null;
109
+ textContent: string | null;
110
+ appendChild<T extends Node>(node: T): T;
111
+ cloneNode(deep?: boolean | undefined): Node;
112
+ compareDocumentPosition(other: Node): number;
113
+ contains(other: Node | null): boolean;
114
+ getRootNode(options?: GetRootNodeOptions | undefined): Node;
115
+ hasChildNodes(): boolean;
116
+ insertBefore<T_1 extends Node>(node: T_1, child: Node | null): T_1;
117
+ isDefaultNamespace(namespace: string | null): boolean;
118
+ isEqualNode(otherNode: Node | null): boolean;
119
+ isSameNode(otherNode: Node | null): boolean;
120
+ lookupNamespaceURI(prefix: string | null): string | null;
121
+ lookupPrefix(namespace: string | null): string | null;
122
+ normalize(): void;
123
+ removeChild<T_2 extends Node>(child: T_2): T_2;
124
+ replaceChild<T_3 extends Node>(node: Node, child: T_3): T_3;
125
+ readonly ATTRIBUTE_NODE: number;
126
+ readonly CDATA_SECTION_NODE: number;
127
+ readonly COMMENT_NODE: number;
128
+ readonly DOCUMENT_FRAGMENT_NODE: number;
129
+ readonly DOCUMENT_NODE: number;
130
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
131
+ readonly DOCUMENT_POSITION_CONTAINS: number;
132
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
133
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
134
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
135
+ readonly DOCUMENT_POSITION_PRECEDING: number;
136
+ readonly DOCUMENT_TYPE_NODE: number;
137
+ readonly ELEMENT_NODE: number;
138
+ readonly ENTITY_NODE: number;
139
+ readonly ENTITY_REFERENCE_NODE: number;
140
+ readonly NOTATION_NODE: number;
141
+ readonly PROCESSING_INSTRUCTION_NODE: number;
142
+ readonly TEXT_NODE: number;
143
+ dispatchEvent(event: Event): boolean;
144
+ ariaAtomic: string | null;
145
+ ariaAutoComplete: string | null;
146
+ ariaBusy: string | null;
147
+ ariaChecked: string | null;
148
+ ariaColCount: string | null;
149
+ ariaColIndex: string | null;
150
+ ariaColSpan: string | null;
151
+ ariaCurrent: string | null;
152
+ ariaDisabled: string | null;
153
+ ariaExpanded: string | null;
154
+ ariaHasPopup: string | null;
155
+ ariaHidden: string | null;
156
+ ariaKeyShortcuts: string | null;
157
+ ariaLabel: string | null;
158
+ ariaLevel: string | null;
159
+ ariaLive: string | null;
160
+ ariaModal: string | null;
161
+ ariaMultiLine: string | null;
162
+ ariaMultiSelectable: string | null;
163
+ ariaOrientation: string | null;
164
+ ariaPlaceholder: string | null;
165
+ ariaPosInSet: string | null;
166
+ ariaPressed: string | null;
167
+ ariaReadOnly: string | null;
168
+ ariaRequired: string | null;
169
+ ariaRoleDescription: string | null;
170
+ ariaRowCount: string | null;
171
+ ariaRowIndex: string | null;
172
+ ariaRowSpan: string | null;
173
+ ariaSelected: string | null;
174
+ ariaSetSize: string | null;
175
+ ariaSort: string | null;
176
+ ariaValueMax: string | null;
177
+ ariaValueMin: string | null;
178
+ ariaValueNow: string | null;
179
+ ariaValueText: string | null;
180
+ animate(keyframes: PropertyIndexedKeyframes | Keyframe[] | null, options?: number | KeyframeAnimationOptions | undefined): Animation;
181
+ getAnimations(options?: GetAnimationsOptions | undefined): Animation[];
182
+ after(...nodes: (string | Node)[]): void;
183
+ before(...nodes: (string | Node)[]): void;
184
+ remove(): void;
185
+ replaceWith(...nodes: (string | Node)[]): void;
186
+ innerHTML: string;
187
+ readonly nextElementSibling: Element | null;
188
+ readonly previousElementSibling: Element | null;
189
+ readonly childElementCount: number;
190
+ readonly children: HTMLCollection;
191
+ readonly firstElementChild: Element | null;
192
+ readonly lastElementChild: Element | null;
193
+ append(...nodes: (string | Node)[]): void;
194
+ prepend(...nodes: (string | Node)[]): void;
195
+ querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6] | null;
196
+ querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7] | null;
197
+ querySelector<E_1 extends Element = Element>(selectors: string): E_1 | null;
198
+ querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
199
+ querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
200
+ querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
201
+ replaceChildren(...nodes: (string | Node)[]): void;
202
+ readonly assignedSlot: HTMLSlotElement | null;
203
+ oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
204
+ oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
205
+ onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
206
+ readonly style: CSSStyleDeclaration;
207
+ contentEditable: string;
208
+ enterKeyHint: string;
209
+ inputMode: string;
210
+ readonly isContentEditable: boolean;
211
+ onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
212
+ onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
213
+ onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
214
+ onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
215
+ onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
216
+ onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
217
+ onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
218
+ oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
219
+ oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
220
+ onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
221
+ onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
222
+ onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
223
+ oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
224
+ oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
225
+ ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
226
+ ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
227
+ ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
228
+ ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
229
+ ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
230
+ ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
231
+ ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
232
+ ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
233
+ ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
234
+ onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
235
+ onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
236
+ onerror: OnErrorEventHandler;
237
+ onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
238
+ onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
239
+ ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
240
+ oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
241
+ oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
242
+ onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
243
+ onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
244
+ onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
245
+ onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
246
+ onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
247
+ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
248
+ onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
249
+ onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
250
+ onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
251
+ onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
252
+ onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
253
+ onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
254
+ onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
255
+ onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
256
+ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
257
+ onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
258
+ onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
259
+ onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
260
+ onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
261
+ onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
262
+ onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
263
+ onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
264
+ onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
265
+ onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
266
+ onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
267
+ onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
268
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | null;
269
+ onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
270
+ onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
271
+ onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
272
+ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
273
+ onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
274
+ onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
275
+ onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
276
+ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
277
+ onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
278
+ onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
279
+ onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
280
+ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
281
+ onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
282
+ onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
283
+ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
284
+ ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
285
+ ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
286
+ ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
287
+ ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
288
+ ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
289
+ ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
290
+ ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
291
+ ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
292
+ ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
293
+ onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
294
+ onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
295
+ onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
296
+ onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
297
+ onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
298
+ onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
299
+ onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
300
+ autofocus: boolean;
301
+ readonly dataset: DOMStringMap;
302
+ nonce?: string | undefined;
303
+ tabIndex: number;
304
+ blur(): void;
305
+ focus(options?: FocusOptions | undefined): void;
306
+ };
307
+ };
4
308
  //# sourceMappingURL=PegaCustomElement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PegaCustomElement.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,iBAAiB;CAoBlB"}
1
+ {"version":3,"file":"PegaCustomElement.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,4MAYpC,CAAC;AAEH,eAAO,MAAM,0BAA0B,QAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQhE,CAAC"}
@@ -1,23 +1,23 @@
1
- export default class PegaCustomElement extends HTMLElement {
2
- connectedCallback() {
3
- const template = document.createElement('template');
4
- template.innerHTML = `<style>
5
- pega-reference {
6
- color:#076bc9;
7
- cursor:pointer;
8
- }
9
- pega-reference:hover{
10
- text-decoration:underline;
11
- }
12
- pega-reference::before{
13
- content: '['
14
- }
15
- pega-reference::after{
16
- content: ']'
17
- }
18
- </style>`;
19
- const temp = document.importNode(template.content, true);
20
- this.append(temp);
21
- }
1
+ export const pegaReferenceElementStyle = `pega-reference {
2
+ color:#076bc9;
3
+ cursor:pointer;
22
4
  }
5
+ pega-reference:hover{
6
+ text-decoration:underline;
7
+ }
8
+ pega-reference::before{
9
+ content: '['
10
+ }
11
+ pega-reference::after{
12
+ content: ']'
13
+ }`;
14
+ export const createPegaReferenceElement = (win) => {
15
+ return class PegaReferenceElement extends win.HTMLElement {
16
+ connectedCallback() {
17
+ const template = document.createElement('template');
18
+ const temp = document.importNode(template.content, true);
19
+ this.append(temp);
20
+ }
21
+ };
22
+ };
23
23
  //# sourceMappingURL=PegaCustomElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PegaCustomElement.js","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,iBAAiB;QACf,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACpD,QAAQ,CAAC,SAAS,GAAG;;;;;;;;;;;;;;WAcd,CAAC;QACR,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;CACF","sourcesContent":["export default class PegaCustomElement extends HTMLElement {\n connectedCallback() {\n const template = document.createElement('template');\n template.innerHTML = `<style>\n pega-reference {\n color:#076bc9;\n cursor:pointer;\n }\n pega-reference:hover{\n text-decoration:underline;\n }\n pega-reference::before{\n content: '['\n }\n pega-reference::after{\n content: ']'\n }\n </style>`;\n const temp = document.importNode(template.content, true);\n this.append(temp);\n }\n}\n"]}
1
+ {"version":3,"file":"PegaCustomElement.js","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;EAYvC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAsB,EAAE,EAAE;IACnE,OAAO,MAAM,oBAAqB,SAAQ,GAAG,CAAC,WAAW;QACvD,iBAAiB;YACf,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["export const pegaReferenceElementStyle = `pega-reference {\n color:#076bc9;\n cursor:pointer;\n}\npega-reference:hover{\n text-decoration:underline;\n}\npega-reference::before{\n content: '['\n}\npega-reference::after{\n content: ']'\n}`;\n\nexport const createPegaReferenceElement = (win: typeof globalThis) => {\n return class PegaReferenceElement extends win.HTMLElement {\n connectedCallback() {\n const template = document.createElement('template');\n const temp = document.importNode(template.content, true);\n this.append(temp);\n }\n };\n};\n"]}
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent } from 'react';
2
+ import 'codemirror/addon/edit/closebrackets';
3
+ import 'codemirror/addon/hint/show-hint.js';
4
+ import { ForwardProps } from '@pega/cosmos-react-core';
5
+ import { CodeEditorProps } from './CodeEditor.types';
6
+ declare const CodeEditor: FunctionComponent<CodeEditorProps & ForwardProps>;
7
+ export default CodeEditor;
8
+ //# sourceMappingURL=CodeEditor.d.ts.map
@@ -0,0 +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;AAuC5B,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CA4HjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,124 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // cSpell:words unfocus
3
+ import { forwardRef, useRef, useState, useEffect, useImperativeHandle } from 'react';
4
+ import { Controlled as ReactCodeMirror } from 'react-codemirror2';
5
+ import { showHint, defineMode } from 'codemirror';
6
+ import 'codemirror/addon/edit/closebrackets';
7
+ import 'codemirror/addon/hint/show-hint.js';
8
+ import { useConsolidatedRef, useElement } from '@pega/cosmos-react-core';
9
+ import { StyledFormFieldInfo } from '@pega/cosmos-react-core/lib/components/FormField/FormField';
10
+ import { StyledCodeEditor } from './CodeEditor.styles';
11
+ import getCodeSuggestions from './getCodeSuggestions';
12
+ defineMode('expression', () => {
13
+ const tokens = [
14
+ {
15
+ token: /[a-zA-Z_$]*\.[\w$]+/,
16
+ style: 'ex-properties'
17
+ },
18
+ {
19
+ token: /(^@+)(\([\w.-]+:[\w.-]+\))*([\w.]+)(\s*)/,
20
+ style: 'ex-functions'
21
+ }
22
+ ];
23
+ return {
24
+ token(stream) {
25
+ // eslint-disable-next-line no-restricted-syntax
26
+ for (const element of tokens) {
27
+ if (stream.match('#') || stream.match('//'))
28
+ stream.skipToEnd();
29
+ else if (stream.match(element.token))
30
+ return element.style;
31
+ }
32
+ stream.next();
33
+ return null;
34
+ }
35
+ };
36
+ });
37
+ const defaultConfigOptions = {
38
+ lineWrapping: true,
39
+ smartIndent: true,
40
+ autoCloseBrackets: true,
41
+ extraKeys: { Tab: false, 'Shift-Tab': false }
42
+ };
43
+ const CodeEditor = forwardRef(({ fetchSuggestions, autoCompleteTriggers, editorConfigProps, codeEditorHandle, defaultValue = '', loading = false, readOnly, errors, ...props }, ref) => {
44
+ const [value, setCode] = useState(defaultValue);
45
+ const [suggestions, setSuggestions] = useState([]);
46
+ const [codeMirror, setCodeMirror] = useState(null);
47
+ const [autoCompleteTrigger, setAutoCompleteTrigger] = useState('');
48
+ const [codeEditorContainer, setCodeEditorContainer] = useElement();
49
+ const codeEditorConsolidatedRef = useConsolidatedRef(setCodeEditorContainer, ref);
50
+ const mounted = useRef(false);
51
+ useImperativeHandle(codeEditorHandle, () => ({
52
+ insertText: (text) => {
53
+ if (codeMirror) {
54
+ const cur = codeMirror.getCursor();
55
+ codeMirror.replaceRange(text, cur);
56
+ }
57
+ },
58
+ getValue: () => {
59
+ return codeMirror?.getValue();
60
+ }
61
+ }), [codeMirror]);
62
+ const autoComplete = (codeEditor) => {
63
+ const hintOptions = {
64
+ completeSingle: false,
65
+ completeOnSingleClick: true,
66
+ closeOnUnfocus: true,
67
+ suggestions,
68
+ container: codeEditorContainer,
69
+ loading,
70
+ autoCompleteTrigger
71
+ };
72
+ showHint(codeEditor, getCodeSuggestions, hintOptions);
73
+ };
74
+ const onBeforeChange = async (editor, _data, textvalue) => {
75
+ setCode(textvalue);
76
+ const currentCursor = editor.getCursor();
77
+ const textTillCursorPos = editor.getValue().split('\n')[currentCursor.line];
78
+ let start = textTillCursorPos?.lastIndexOf(' ');
79
+ if (start === -1) {
80
+ start = 0;
81
+ }
82
+ const currentWord = textTillCursorPos.substring(start, currentCursor.ch);
83
+ /* Below regex is used to find the query token which is present before the triggering character
84
+ to send update list. */
85
+ const regexp = /[\w$]*(\.+[\w$)(]*)+/g;
86
+ const tokenArray = [...currentWord.matchAll(regexp)];
87
+ const autoCompleteTriggerChar = editor.getTokenAt(currentCursor)
88
+ .string;
89
+ if (!codeMirror?.getTokenAt(codeMirror.getCursor()).string.includes(autoCompleteTrigger))
90
+ setSuggestions([]);
91
+ if (autoCompleteTriggers?.includes(autoCompleteTriggerChar) && fetchSuggestions) {
92
+ setAutoCompleteTrigger(autoCompleteTriggerChar);
93
+ const newSuggestions = [
94
+ ...(await fetchSuggestions(autoCompleteTriggerChar, tokenArray.length === 0 ? '' : tokenArray[tokenArray.length - 1][0]))
95
+ ];
96
+ if (mounted.current)
97
+ setSuggestions(newSuggestions);
98
+ }
99
+ };
100
+ useEffect(() => {
101
+ if (codeMirror && ((suggestions.length > 0 && value.length > 0) || loading)) {
102
+ autoComplete(codeMirror);
103
+ }
104
+ else
105
+ codeMirror?.closeHint();
106
+ }, [suggestions, loading]);
107
+ useEffect(() => {
108
+ mounted.current = true;
109
+ return () => {
110
+ mounted.current = false;
111
+ };
112
+ }, []);
113
+ return (_jsxs(StyledCodeEditor, { container: {
114
+ direction: 'column',
115
+ justify: 'between'
116
+ }, item: {
117
+ grow: 1
118
+ }, ref: codeEditorConsolidatedRef, errors: errors, readOnly: readOnly, isLoading: loading, ...props, children: [_jsx(ReactCodeMirror, { value: value, onBeforeChange: onBeforeChange, options: { ...defaultConfigOptions, ...editorConfigProps }, editorDidMount: editor => {
119
+ editor.setSize('100%', '100%');
120
+ setCodeMirror(editor);
121
+ } }), errors && _jsx(StyledFormFieldInfo, { status: 'error', children: errors })] }));
122
+ });
123
+ export default CodeEditor;
124
+ //# sourceMappingURL=CodeEditor.js.map
@@ -0,0 +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,EA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,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 {\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 AutoCompleteTriggerType,\n CodeEditorProps,\n EditorState,\n SuggestionsType\n} from './CodeEditor.types';\nimport { StyledCodeEditor } from './CodeEditor.styles';\nimport getCodeSuggestions from './getCodeSuggestions';\n\ndefineMode('expression', () => {\n const tokens = [\n {\n token: /[a-zA-Z_$]*\\.[\\w$]+/,\n style: 'ex-properties'\n },\n {\n token: /(^@+)(\\([\\w.-]+:[\\w.-]+\\))*([\\w.]+)(\\s*)/,\n style: 'ex-functions'\n }\n ];\n\n return {\n token(stream) {\n // eslint-disable-next-line no-restricted-syntax\n for (const element of tokens) {\n if (stream.match('#') || stream.match('//')) stream.skipToEnd();\n else if (stream.match(element.token)) return element.style;\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 (\n {\n fetchSuggestions,\n autoCompleteTriggers,\n editorConfigProps,\n codeEditorHandle,\n defaultValue = '',\n loading = false,\n readOnly,\n errors,\n ...props\n }: PropsWithoutRef<CodeEditorProps>,\n ref: CodeEditorProps['ref']\n ) => {\n const [value, setCode] = useState<string>(defaultValue);\n const [suggestions, setSuggestions] = useState<SuggestionsType[]>([]);\n const [codeMirror, setCodeMirror] = useState<Editor | null>(null);\n const [autoCompleteTrigger, setAutoCompleteTrigger] = useState('');\n const [codeEditorContainer, setCodeEditorContainer] = useElement<HTMLDivElement>();\n const codeEditorConsolidatedRef = useConsolidatedRef(setCodeEditorContainer, ref);\n const mounted = useRef(false);\n\n useImperativeHandle<any, EditorState>(\n codeEditorHandle,\n () => ({\n insertText: (text: string) => {\n if (codeMirror) {\n const cur: Position = codeMirror.getCursor();\n codeMirror.replaceRange(text, cur);\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 autoCompleteTrigger\n };\n showHint(codeEditor, getCodeSuggestions, hintOptions);\n };\n\n const onBeforeChange = async (editor: Editor, _data: EditorChange, textvalue: string) => {\n setCode(textvalue);\n const currentCursor = editor.getCursor();\n const textTillCursorPos = editor.getValue().split('\\n')[currentCursor.line];\n let start = textTillCursorPos?.lastIndexOf(' ');\n if (start === -1) {\n start = 0;\n }\n const currentWord = textTillCursorPos.substring(start, currentCursor.ch);\n /* Below regex is used to find the query token which is present before the triggering character\n to send update list. */\n const regexp = /[\\w$]*(\\.+[\\w$)(]*)+/g;\n const tokenArray = [...currentWord.matchAll(regexp)];\n const autoCompleteTriggerChar = editor.getTokenAt(currentCursor)\n .string as AutoCompleteTriggerType;\n\n if (!codeMirror?.getTokenAt(codeMirror.getCursor()).string.includes(autoCompleteTrigger))\n setSuggestions([]);\n\n if (autoCompleteTriggers?.includes(autoCompleteTriggerChar) && fetchSuggestions) {\n setAutoCompleteTrigger(autoCompleteTriggerChar);\n const newSuggestions = [\n ...(await fetchSuggestions(\n autoCompleteTriggerChar,\n tokenArray.length === 0 ? '' : tokenArray[tokenArray.length - 1][0]\n ))\n ];\n if (mounted.current) setSuggestions(newSuggestions);\n }\n };\n\n useEffect(() => {\n if (codeMirror && ((suggestions.length > 0 && value.length > 0) || loading)) {\n autoComplete(codeMirror);\n } else codeMirror?.closeHint();\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 {...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"]}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledLoading: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ 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, {
4
+ isLoading?: boolean | undefined;
5
+ errors?: string | undefined;
6
+ readOnly?: boolean | undefined;
7
+ }, never>;
8
+ //# sourceMappingURL=CodeEditor.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;SAihB5B,CAAC"}