@processmaker/modeler 1.39.9 → 1.39.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/modeler",
3
- "version": "1.39.9",
3
+ "version": "1.39.10",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve --mode development",
6
6
  "test:unit": "vue-cli-service test:unit",
@@ -41,6 +41,7 @@
41
41
  "@fortawesome/fontawesome-free": "^5.11.2",
42
42
  "@fortawesome/fontawesome-svg-core": "^1.2.25",
43
43
  "@fortawesome/free-solid-svg-icons": "^5.11.2",
44
+ "@fortawesome/free-brands-svg-icons": "^6.4.2",
44
45
  "@fortawesome/vue-fontawesome": "^0.1.8",
45
46
  "@processmaker/screen-builder": "2.70.0",
46
47
  "@processmaker/vue-form-elements": "0.45.0",
@@ -61,6 +62,7 @@
61
62
  "mocha-junit-reporter": "^2.0.0",
62
63
  "mustache": "^3.2.1",
63
64
  "popper.js": "^1.16.1",
65
+ "socket.io-client": "^4.7.2",
64
66
  "svg-inline-loader": "^0.8.2",
65
67
  "tinycolor2": "^1.4.2",
66
68
  "vue": "^2.6.12",
@@ -96,7 +98,7 @@
96
98
  "bpmnlint-loader": "^0.1.4",
97
99
  "circular-dependency-plugin": "^5.2.2",
98
100
  "copy-webpack-plugin": "^5.1.1",
99
- "cypress": "10.3.0",
101
+ "cypress": "10.11.0",
100
102
  "eslint": "^7.32.0",
101
103
  "eslint-plugin-cypress": "^2.12.1",
102
104
  "eslint-plugin-jest": "^27.2.3",
@@ -119,8 +121,6 @@
119
121
  "yargs": "^14.2.3"
120
122
  },
121
123
  "peerDependencies": {
122
- "@fortawesome/fontawesome-free": "^5.11.2",
123
- "@fortawesome/fontawesome-svg-core": "^1.2.25",
124
124
  "@fortawesome/free-solid-svg-icons": "^5.11.2",
125
125
  "@fortawesome/vue-fontawesome": "^0.1.8",
126
126
  "@panter/vue-i18next": "^0.15.1",
@@ -0,0 +1,3 @@
1
+ <svg width="27" height="26" viewBox="0 0 27 26" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M11.9667 1.13043C11.9667 0.506113 12.4728 0 13.0971 0C13.7215 0 14.2276 0.506113 14.2276 1.13043V2.853C14.2276 3.47732 13.7215 3.98344 13.0971 3.98344C12.4728 3.98344 11.9667 3.47732 11.9667 2.853V1.13043ZM0.125 14.6969C1.95523 11.8618 7.12293 6.19169 13.1519 6.19169C19.1809 6.19169 24.3127 11.8618 26.125 14.6969V15.3967C25.802 15.9529 25.0139 17.1037 24.5639 17.6037C24.0795 18.142 23.2182 19.0033 22.8414 19.3263C23.4873 20.6361 24.8331 23.3528 25.0484 23.7403C25.3175 24.2248 24.8869 25.5706 23.5411 25.0323C22.4645 24.6016 19.4321 23.4532 18.0505 22.9329C17.1174 23.3635 14.8314 24.2033 13.1519 24.1172C11.0525 24.0095 8.8455 23.7942 5.13121 20.8873C2.15978 18.5619 0.555642 16.2579 0.125 15.3967V14.6969ZM13.1517 20.3494C16.0057 20.3494 18.3194 18.0357 18.3194 15.1817C18.3194 12.3276 16.0057 10.014 13.1517 10.014C10.2977 10.014 7.984 12.3276 7.984 15.1817C7.984 18.0357 10.2977 20.3494 13.1517 20.3494ZM22.5709 3.84806C22.1339 3.40224 21.4182 3.39514 20.9723 3.8322L19.7423 5.03809C19.2965 5.47515 19.2894 6.19087 19.7264 6.63669C20.1635 7.08251 20.8792 7.08961 21.325 6.65255L22.5551 5.44666C23.0009 5.0096 23.008 4.29388 22.5709 3.84806ZM5.42274 3.8056C4.97692 3.36854 4.26121 3.37564 3.82415 3.82146C3.38709 4.26728 3.39419 4.983 3.84001 5.42006L5.07007 6.62595C5.51589 7.06301 6.23161 7.05591 6.66867 6.61009C7.10573 6.16427 7.09863 5.44855 6.65281 5.01149L5.42274 3.8056ZM13.1513 13.1339C13.1513 14.2636 12.2354 15.1794 11.1057 15.1794C10.6291 15.1794 10.1905 15.0164 9.84278 14.7431C9.82415 14.8858 9.81455 15.0314 9.81455 15.1792C9.81455 17.0224 11.3088 18.5167 13.152 18.5167C14.9953 18.5167 16.4895 17.0224 16.4895 15.1792C16.4895 13.3359 14.9953 11.8417 13.152 11.8417C13.0037 11.8417 12.8576 11.8514 12.7143 11.8701C12.988 12.218 13.1513 12.6569 13.1513 13.1339Z" fill="#1572C2"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="133" height="114" viewBox="0 0 133 114" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M101.207 24.4512C101.931 24.9585 102.656 25.4667 103.356 26.0145C108.069 29.6702 111.773 34.4864 114.114 40.0017C117.551 48.0931 117.379 57.7133 117.219 66.6787L117.219 66.6805C117.191 68.217 117.164 69.7343 117.155 71.2214C117.152 71.8663 117.15 72.5231 117.148 73.1895C117.126 82.4292 117.098 93.5395 111.557 101.131C108.765 104.958 105.05 107.468 100.608 108.928C99.0461 109.44 97.4343 109.737 95.8233 110.034L95.8222 110.035C95.4448 110.104 95.0676 110.174 94.691 110.246C91.1321 110.93 87.5595 111.537 83.9598 111.971C80.934 112.336 77.9044 112.684 74.8689 112.965C73.124 113.126 71.3728 113.227 69.6215 113.327L69.6208 113.328L69.6202 113.328C68.9952 113.364 68.3701 113.4 67.7453 113.438C67.4794 113.453 67.2117 113.448 66.944 113.443C66.8102 113.441 66.6764 113.438 66.5428 113.438C66.5221 113.239 66.5117 113.038 66.5116 112.837C66.5114 113.038 66.4786 113.438 66.4786 113.438C66.3462 113.438 66.2135 113.441 66.0805 113.444H66.0799H66.0792H66.079C65.8117 113.45 65.5434 113.455 65.276 113.438C64.6496 113.399 64.0227 113.363 63.3957 113.327H63.3955C61.6466 113.226 59.8969 113.125 58.1524 112.965C55.1189 112.684 52.0892 112.336 49.0615 111.971C45.4637 111.537 41.8893 110.93 38.3304 110.246C37.9517 110.173 37.5722 110.103 37.1925 110.033C35.5842 109.737 33.9735 109.44 32.4151 108.928C27.9728 107.468 24.2582 104.958 21.466 101.131C15.9236 93.5375 15.8959 82.4234 15.8728 73.1824L15.8728 73.1815L15.8728 73.1806C15.8712 72.5172 15.8695 71.8635 15.8659 71.2214C15.8576 69.7288 15.8305 68.2057 15.8031 66.6633C15.6437 57.7023 15.4728 48.0885 18.9092 40.0017C21.2486 34.4838 24.9532 29.6654 29.6676 26.0087C30.3334 25.4879 31.0278 25.0007 31.7228 24.5131L31.7232 24.5129C32.0375 24.2923 32.3521 24.0716 32.6641 23.8477C32.7557 23.7824 32.8498 23.7197 32.962 23.6448L33.0436 23.5904C32.7475 22.7306 32.4571 21.8791 32.1684 21.0327L32.168 21.0314L32.1678 21.0309L32.1673 21.0294L32.1663 21.0265C31.9511 20.3956 31.7369 19.7675 31.5219 19.1408C31.2839 18.4425 31.0444 17.7473 30.8054 17.0535L30.8047 17.0516L30.8042 17.0501C30.5688 16.367 27.7924 8.24763 27.5599 7.56592C26.805 5.33819 27.8207 3.23618 30.0175 2.47003C31.5443 1.93045 33.0724 1.39873 34.6019 0.874867C35.0777 0.710729 35.5809 0.643351 36.0827 0.676622C36.5844 0.709894 37.0747 0.843156 37.5251 1.06872C37.9756 1.29428 38.3773 1.60767 38.7072 1.99081C39.037 2.37395 39.2884 2.81925 39.4469 3.30101L44.3235 17.5476C44.3653 17.6687 44.4082 17.7899 44.454 17.9189L44.4547 17.9209L44.4554 17.9228C44.4923 18.0269 44.5311 18.1362 44.5725 18.2548C51.7234 15.974 59.0241 14.9741 66.5116 14.8837C74.003 14.9741 81.3076 15.974 88.441 18.2607C88.473 18.1691 88.5035 18.083 88.5326 18.0006C88.5884 17.8426 88.6395 17.698 88.6881 17.5535C89.4664 15.2825 93.1479 5.45024 93.9263 3.18191C94.085 2.70031 94.3365 2.25519 94.6665 1.87219C94.9964 1.48919 95.3981 1.1759 95.8485 0.95037C96.2988 0.724841 96.789 0.591537 97.2906 0.55814C97.7923 0.524743 98.2955 0.591916 98.7714 0.755782C100.299 1.28489 101.828 1.8166 103.356 2.35095C105.553 3.12496 106.568 5.21909 105.813 7.44682C105.484 8.42084 102.247 16.9517 101.913 17.9181L101.913 17.9196C101.771 18.3288 101.63 18.7377 101.49 19.1467L99.97 23.5963C100.13 23.6964 100.246 23.7731 100.359 23.8536C100.64 24.0541 100.923 24.2525 101.207 24.4509L101.207 24.451L101.207 24.4512ZM104.004 91.1689C104.424 89.1887 104.714 87.1848 104.961 85.1732C105.266 82.7114 105.432 80.2341 105.459 77.7533C105.476 76.3216 105.405 74.888 105.335 73.4582L105.335 73.4578L105.335 73.4569L105.331 73.3744C105.194 70.803 104.842 68.2479 104.278 65.7365C104.019 64.457 103.537 63.2339 102.856 62.1238C101.698 60.3008 100.065 59.0749 98.1195 58.2164C96.5294 57.5339 94.8593 57.0598 93.1499 56.8059C92.2913 56.6682 91.4279 56.5621 90.5645 56.4561L90.5638 56.456C90.3316 56.4275 90.0994 56.3989 89.8673 56.3698C89.3322 56.3043 88.7975 56.2338 88.2629 56.1633C87.1935 56.0223 86.1242 55.8813 85.0514 55.7805C82.8429 55.5742 80.6402 55.3974 78.4356 55.2756C75.8956 55.1349 73.3538 55.0494 70.8119 54.964L70.8114 54.9639L70.557 54.9554C69.7345 54.9324 68.9101 54.9299 68.0864 54.9274H68.0861H68.0859L68.083 54.9273L68.0802 54.9273C67.7076 54.9262 67.3351 54.925 66.9631 54.922C66.8988 54.9211 66.835 54.9138 66.7712 54.9065C66.6862 54.8967 66.6011 54.8869 66.5155 54.8925C66.4653 54.8958 66.415 54.9002 66.3649 54.9046C66.2655 54.9133 66.1662 54.922 66.068 54.922C65.6867 54.9251 65.3054 54.9254 64.9241 54.9258H64.9237C64.1066 54.9265 63.2899 54.9272 62.4741 54.9554L62.2039 54.9645C59.6688 55.0498 57.1303 55.1352 54.5955 55.2756C52.3811 55.3974 50.1784 55.5742 47.9797 55.7805C46.9058 55.8827 45.8346 56.0235 44.7636 56.1642L44.7622 56.1644C44.2287 56.2344 43.6954 56.3045 43.1618 56.3698C42.9255 56.3995 42.6889 56.4286 42.4522 56.4577L42.45 56.458C41.5921 56.5634 40.7327 56.669 39.8792 56.8059C38.1705 57.0601 36.501 57.5342 34.9116 58.2164C32.9735 59.0749 31.3332 60.3008 30.1754 62.1238C29.4924 63.2331 29.0107 64.4565 28.7531 65.7365C28.1863 68.2483 27.8315 70.8041 27.6926 73.3764L27.6884 73.4605C27.6178 74.8902 27.5469 76.3237 27.5622 77.7553C27.5881 80.2359 27.7525 82.7131 28.0545 85.1751C28.3036 87.1868 28.5915 89.1907 29.0138 91.1709C29.403 92.9507 30.1132 94.5714 31.3488 95.9288C32.3691 97.0157 33.6141 97.8622 34.9952 98.408C36.6582 99.0758 38.3936 99.5427 40.1653 99.7989C42.3303 100.147 44.5005 100.458 46.676 100.732C48.1879 100.921 49.7076 101.046 51.2292 101.15C53.6478 101.317 56.0704 101.484 58.4929 101.577C60.2527 101.642 62.0144 101.662 63.776 101.682H63.7763C64.5039 101.691 65.2316 101.699 65.959 101.71H66.463C66.4824 101.781 66.498 102.196 66.5116 102.832C66.509 102.458 66.5253 102.083 66.5603 101.71H67.0643C67.7917 101.699 68.5191 101.691 69.2465 101.682C71.0078 101.662 72.7691 101.642 74.5303 101.577C76.9529 101.484 79.3735 101.317 81.7941 101.15C83.3138 101.046 84.8354 100.928 86.3473 100.732C88.5214 100.457 90.6917 100.146 92.858 99.7989C94.6271 99.5416 96.3599 99.0741 98.0203 98.4061C99.402 97.8602 100.648 97.0138 101.669 95.9269C102.908 94.5694 103.624 92.9487 104.004 91.1689ZM12.6117 64.137C12.6117 62.3768 12.6039 60.6173 12.5884 58.8584C12.5902 58.6391 12.5674 58.4203 12.5203 58.2062C12.205 56.8782 11.1037 56.0747 9.63851 56.0943C9.20351 56.1 8.76788 56.1081 8.33233 56.1163L8.33145 56.1163L8.33056 56.1164L8.32968 56.1164C8.00434 56.1225 7.67905 56.1286 7.35412 56.1336C7.00312 56.1344 6.6557 56.205 6.33173 56.3414C6.00776 56.4778 5.71359 56.6773 5.46603 56.9285C5.21846 57.1797 5.02235 57.4777 4.88892 57.8055C4.75548 58.1333 4.68733 58.4844 4.68835 58.8387C4.68835 58.9454 4.682 59.0528 4.67488 59.1734C4.67085 59.2416 4.66657 59.3139 4.66305 59.3927C4.46656 59.3927 4.27249 59.3909 4.08033 59.3892C3.70161 59.3857 3.3303 59.3823 2.96241 59.3927C2.6339 59.395 2.307 59.4392 1.9895 59.5243C1.43162 59.6905 0.94332 60.0373 0.599804 60.5112C0.256289 60.9851 0.0766114 61.5598 0.0884393 62.1469V62.1482C0.0884393 63.3874 0.0884393 64.6285 0.102056 65.8696C0.116325 69.4188 0.12995 72.9687 0.142922 76.5191V76.5197C0.142922 77.4782 0.142922 78.4367 0.168213 79.3952C0.165735 79.887 0.301316 80.3694 0.559253 80.7866C0.817189 81.2039 1.18693 81.5388 1.62563 81.7526C2.11666 81.9973 2.6633 82.1057 3.20953 82.0669C3.53396 82.0604 3.85839 82.0624 4.20373 82.0646H4.20447H4.20522H4.20599C4.38604 82.0657 4.57178 82.0669 4.76618 82.0669C4.76618 82.2692 4.76435 82.4624 4.76257 82.6499C4.75916 83.0086 4.75596 83.3463 4.76618 83.6856C4.78253 84.4005 5.07799 85.0799 5.58821 85.5759C6.09844 86.0719 6.78211 86.3443 7.49033 86.3337C8.28227 86.3004 9.07812 86.3102 9.87006 86.3337C10.2396 86.3423 10.607 86.2753 10.9503 86.1368C11.2935 85.9983 11.6055 85.7912 11.8674 85.5278C12.1293 85.2645 12.3358 84.9504 12.4744 84.6045C12.613 84.2585 12.6809 83.8878 12.674 83.5147C12.6457 81.3184 12.6426 79.1211 12.6395 76.9242V76.924C12.6381 75.9475 12.6367 74.971 12.6331 73.9948C12.6344 70.7049 12.6273 67.419 12.6117 64.137ZM48.3787 67.7354C46.143 67.6887 43.9438 68.3128 42.0596 69.5287C40.1754 70.7446 38.6909 72.4976 37.7941 74.5657C36.8973 76.6339 36.6285 78.9241 37.0217 81.1466C37.4149 83.3691 38.4525 85.4238 40.003 87.0506C41.5535 88.6774 43.5473 89.8032 45.7319 90.2853C47.9165 90.7675 50.1937 90.5843 52.2752 89.7591C54.3566 88.9339 56.1488 87.5037 57.4247 85.6496C58.7006 83.7955 59.4028 81.6008 59.4426 79.3435C59.5477 72.7566 54.294 67.8512 48.3787 67.7354ZM131.017 59.5243C130.703 59.44 130.38 59.3958 130.054 59.3927C129.686 59.3784 129.317 59.383 128.939 59.3878C128.746 59.3903 128.551 59.3927 128.352 59.3927C128.35 59.363 128.349 59.3341 128.348 59.3059L128.344 59.2174L128.344 59.2167C128.337 59.0765 128.331 58.9541 128.328 58.8387C128.33 58.1232 128.05 57.4363 127.55 56.9291C127.05 56.4218 126.371 56.1357 125.663 56.1336C125.335 56.1286 125.009 56.1224 124.682 56.1163C124.247 56.1081 123.812 56.1 123.376 56.0943C121.913 56.0747 120.812 56.8801 120.496 58.2062C120.448 58.4201 120.425 58.639 120.428 58.8584C120.419 60.123 120.414 61.3786 120.409 62.6353V62.6383C120.407 63.1375 120.405 63.6368 120.403 64.137L120.362 73.9869C120.359 74.9633 120.357 75.9399 120.356 76.9166V76.9195C120.353 79.1153 120.35 81.3116 120.321 83.5068C120.314 83.88 120.382 84.2506 120.521 84.5966C120.659 84.9426 120.866 85.2566 121.128 85.52C121.39 85.7833 121.702 85.9904 122.045 86.1289C122.388 86.2674 122.756 86.3344 123.125 86.3259C123.919 86.3062 124.715 86.2964 125.507 86.3259C126.215 86.337 126.899 86.0647 127.41 85.5686C127.92 85.0725 128.215 84.3928 128.231 83.6778C128.244 83.3381 128.24 82.9984 128.236 82.6391C128.233 82.452 128.231 82.2595 128.231 82.059H129.788C130.334 82.0981 130.881 81.9896 131.372 81.7447C131.81 81.531 132.181 81.1962 132.439 80.779C132.697 80.3618 132.833 79.8793 132.831 79.3873C132.85 78.6087 132.852 77.8301 132.854 77.0515V77.0501C132.855 76.8705 132.856 76.6909 132.856 76.5113L132.897 65.8618C132.897 65.3559 132.901 64.85 132.904 64.3442C132.909 63.6087 132.915 62.8736 132.909 62.1391C132.919 61.5546 132.74 60.9825 132.399 60.5104C132.057 60.0383 131.572 59.692 131.017 59.5243ZM76.5834 83.5465C78.3995 81.9001 84.8362 78.5247 93.1708 82.3285L96.5844 74.7049C84.7541 69.3057 74.8702 73.8552 71.0467 77.3215L76.5834 83.5465Z" fill="#3270BC"/>
3
+ </svg>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="cog-container" role="menuitem">
2
+ <div class="cog-container" role="menuitem" v-if="!hide">
3
3
  <crown-button
4
4
  v-b-tooltip.hover.viewport.d50="{ customClass: 'no-pointer-events' }"
5
5
  :title="$t('Open Color Palette')"
@@ -102,6 +102,10 @@ export default {
102
102
  type: String,
103
103
  default: '',
104
104
  },
105
+ hide: {
106
+ type: Boolean,
107
+ default: false,
108
+ },
105
109
  },
106
110
  components: { CrownButton, 'sketch-picker': Sketch, IconSelector },
107
111
  data() {
@@ -20,6 +20,7 @@
20
20
  />
21
21
 
22
22
  <crown-color-dropdown
23
+ :hide="hideColorDropdown"
23
24
  :dropdown-open="colorDropdownOpen"
24
25
  :node="node"
25
26
  :showCustomIconPicker="showCustomIconPicker"
@@ -48,6 +49,10 @@ export default {
48
49
  type: Boolean,
49
50
  required: true,
50
51
  },
52
+ hideColorDropdown: {
53
+ type: Boolean,
54
+ default: false,
55
+ },
51
56
  showCustomIconPicker: Boolean,
52
57
  iconName: {
53
58
  type: String,
@@ -33,6 +33,7 @@
33
33
 
34
34
  <crown-dropdowns
35
35
  :dropdown-data="dropdownData"
36
+ :hide-color-dropdown="hideColorDropdown"
36
37
  :boundary-event-dropdown-data="boundaryEventDropdownData"
37
38
  :node="node"
38
39
  :node-registry="nodeRegistry"
@@ -138,6 +139,10 @@ export default {
138
139
  type: Boolean,
139
140
  default: false,
140
141
  },
142
+ hideColorDropdown: {
143
+ type: Boolean,
144
+ default: false,
145
+ },
141
146
  iconName: {
142
147
  type: String,
143
148
  default: '',
@@ -1,24 +1,65 @@
1
1
  import { getDefaultIconColor } from '@/components/nodeColors';
2
+ import { library, icon, findIconDefinition } from '@fortawesome/fontawesome-svg-core';
3
+ import { fas } from '@fortawesome/free-solid-svg-icons';
4
+ import { fab } from '@fortawesome/free-brands-svg-icons';
2
5
 
3
6
  const encodeAsDataUri = (svgString) => {
4
7
  const base64 = btoa(svgString);
5
8
  return `data:image/svg+xml;base64,${base64}`;
6
9
  };
7
10
 
8
- /** returns a data URI encoded re-colored icon */
9
- const coloredIcon = (iconString, node) => {
10
- const svgDocument = (new DOMParser()).parseFromString(iconString, 'text/xml');
11
- const iconColor = node.definition.get('color') || getDefaultIconColor(node);
11
+ const getColorOrDefault = (node) => {
12
+ return node.definition.get('color') || getDefaultIconColor(node);
13
+ };
12
14
 
13
- svgDocument.querySelectorAll('*[fill]:not([fill="none"])').forEach(svgNode => {
14
- svgNode.setAttribute('fill', iconColor);
15
+ const recolorSvg = (svgString, color) => {
16
+ const svgDocument = new DOMParser().parseFromString(svgString, 'text/xml');
17
+ const svgNodesWithFill = svgDocument.querySelectorAll('*[fill]:not([fill="none"])');
18
+ const svgNodesWithStroke = svgDocument.querySelectorAll('*[stroke]:not([stroke="none"])');
19
+
20
+ svgNodesWithFill.forEach((svgNode) => {
21
+ svgNode.setAttribute('fill', color);
15
22
  });
16
23
 
17
- svgDocument.querySelectorAll('*[stroke]:not([stroke="none"])').forEach(svgNode => {
18
- svgNode.setAttribute('stroke', iconColor);
24
+ svgNodesWithStroke.forEach((svgNode) => {
25
+ svgNode.setAttribute('stroke', color);
19
26
  });
20
27
 
21
- return encodeAsDataUri(svgDocument.documentElement.outerHTML);
28
+ return svgDocument.documentElement.outerHTML;
29
+ };
30
+
31
+ const containsSvg = (str) => {
32
+ // Regular expression to match a URL pattern
33
+ const urlPattern = /^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(\/[\w@?^=%&:/~+#-]*)*$/;
34
+
35
+ // Regular expression to check if the string contains '.svg'
36
+ const pathPattern = /\.svg/;
37
+
38
+ // Check if the string contains an SVG root element
39
+ const stringPattern = /<svg[^>]*>/;
40
+
41
+ const encodedStringPattern = str.startsWith('<xml') && /<svg[^>]*>/.test(str);
42
+
43
+ // Check if the variable is a string and either a URL or contains '.svg'
44
+ return typeof str === 'string' && (urlPattern.test(str) || pathPattern.test(str) || stringPattern.test(str) || encodedStringPattern);
45
+ };
46
+
47
+ const coloredIcon = (iconString, node) => {
48
+ if (!containsSvg(iconString)) {
49
+ // If the input is not an SVG, add Font Awesome icons and extract the SVG
50
+ library.add(fas, fab);
51
+
52
+ const [prefix ] = iconString.split(' ');
53
+ const [, iconName] = iconString.split('-');
54
+ const iconDefinition = findIconDefinition({ prefix, iconName });
55
+ const svg = icon(iconDefinition).html;
56
+ iconString = svg[0];
57
+ }
58
+
59
+ const iconColor = getColorOrDefault(node);
60
+ const recoloredSvg = recolorSvg(iconString, iconColor);
61
+
62
+ return encodeAsDataUri(recoloredSvg);
22
63
  };
23
64
 
24
65
  export default coloredIcon;
@@ -3,7 +3,7 @@
3
3
  <b-col
4
4
  id="inspector"
5
5
  class="pl-0 h-100 overflow-hidden inspector-column"
6
- :class="[{ 'ignore-pointer': canvasDragPosition }]"
6
+ :class="[{ 'ignore-pointer': canvasDragPosition, 'ai-inspector': isAiInspector }]"
7
7
  data-test="inspector-column"
8
8
  >
9
9
  <b-card
@@ -15,7 +15,7 @@
15
15
  <template #header>
16
16
  <div class="inspector-header">
17
17
  <div class="inspector-header-title">
18
- {{ $t('Configuration') }}
18
+ {{ inspectorHeaderTitle }}
19
19
  </div>
20
20
  <button
21
21
  type="button"
@@ -79,6 +79,7 @@ Vue.component('FormDatePicker', FormDatePicker);
79
79
  Vue.component('FormMultiSelect', FormMultiSelect);
80
80
 
81
81
  export default {
82
+ components: { },
82
83
  props: ['nodeRegistry', 'moddle', 'processNode', 'parentHeight', 'canvasDragPosition', 'definitions'],
83
84
  data() {
84
85
  return {
@@ -103,6 +104,16 @@ export default {
103
104
  'highlightedNode.definition.assignmentRules'(current, previous) { this.handleAssignmentChanges(current, previous); },
104
105
  },
105
106
  computed: {
107
+ inspectorHeaderTitle() {
108
+ if (this.data.implementation === 'package-ai/processmaker-ai-assistant') {
109
+ return this.$t('AI Assistant');
110
+ }
111
+
112
+ return this.$t('Configuration');
113
+ },
114
+ isAiInspector() {
115
+ return this.data.implementation === 'package-ai/processmaker-ai-assistant';
116
+ },
106
117
  highlightedNode() {
107
118
  return store.getters.highlightedNodes[0];
108
119
  },
@@ -72,7 +72,7 @@ import NoPreviewAvailable from '@/components/inspectors/NoPreviewAvailable';
72
72
 
73
73
  export default {
74
74
  props: ['nodeRegistry', 'visible'],
75
- components: {NoPreviewAvailable},
75
+ components: { NoPreviewAvailable },
76
76
  data() {
77
77
  return {
78
78
  data: {},
@@ -50,6 +50,8 @@
50
50
  <div ref="paper" data-test="paper" class="main-paper" />
51
51
  </b-col>
52
52
 
53
+ <WelcomeMessage v-if="showWelcomeMessage"/>
54
+
53
55
  <InspectorButton
54
56
  ref="inspector-button"
55
57
  v-if="showComponent && showInspectorButton"
@@ -156,7 +158,7 @@
156
158
  />
157
159
  </b-row>
158
160
 
159
- <RemoteCursor
161
+ <RemoteCursor
160
162
  v-for="player in players"
161
163
  :cursor-color="player.color"
162
164
  :username="player.name"
@@ -174,6 +176,7 @@ import { dia } from 'jointjs';
174
176
  import boundaryEventConfig from '../nodes/boundaryEvent';
175
177
  import BpmnModdle from 'bpmn-moddle';
176
178
  import ExplorerRail from '../rails/explorer-rail/explorer';
179
+ import WelcomeMessage from '../welcome/WelcomeMessage.vue';
177
180
  import { isJSON } from 'lodash-contrib';
178
181
  import pull from 'lodash/pull';
179
182
  import remove from 'lodash/remove';
@@ -237,6 +240,7 @@ export default {
237
240
  ProcessmakerModelerGenericFlow,
238
241
  Selection,
239
242
  RailBottom,
243
+ WelcomeMessage,
240
244
  RemoteCursor,
241
245
  },
242
246
  props: {
@@ -361,9 +365,11 @@ export default {
361
365
  canvasScale(canvasScale) {
362
366
  this.paperManager.scale = canvasScale;
363
367
  },
364
-
365
368
  },
366
369
  computed: {
370
+ showWelcomeMessage() {
371
+ return !this.selectedNode && !this.nodes.length && !store.getters.isReadOnly;
372
+ },
367
373
  noElementsSelected() {
368
374
  return this.highlightedNodes.filter(node => !node.isType('processmaker-modeler-process')).length === 0;
369
375
  },
@@ -524,7 +530,7 @@ export default {
524
530
  async close() {
525
531
  this.$emit('close');
526
532
  },
527
- async saveBpmn() {
533
+ async saveBpmn(redirectTo = null) {
528
534
  const svg = document.querySelector('.mini-paper svg');
529
535
  const css = 'text { font-family: sans-serif; }';
530
536
  const style = document.createElement('style');
@@ -533,8 +539,7 @@ export default {
533
539
  svg.appendChild(style);
534
540
  const xml = await this.getXmlFromDiagram();
535
541
  const svgString = (new XMLSerializer()).serializeToString(svg);
536
-
537
- this.$emit('saveBpmn', { xml, svg: svgString });
542
+ this.$emit('saveBpmn', { xml, svg: svgString, redirectUrl: redirectTo });
538
543
  },
539
544
  borderOutline(nodeId) {
540
545
  return this.decorations.borderOutline && this.decorations.borderOutline[nodeId];
@@ -722,6 +727,7 @@ export default {
722
727
 
723
728
  this.parsers[bpmnType].default.push(defaultParser);
724
729
  });
730
+ nodeTypesStore.commit('setNodeTypes', this.nodeTypes);
725
731
  },
726
732
  registerPmBlock(pmBlockNode, customParser) {
727
733
  const defaultParser = () => pmBlockNode.id;
@@ -1028,7 +1034,7 @@ export default {
1028
1034
  });
1029
1035
  },
1030
1036
  handleDrop(data) {
1031
- const { clientX, clientY, control} = data;
1037
+ const { clientX, clientY, control } = data;
1032
1038
  if (this.isMultiplayer) {
1033
1039
  window.ProcessMaker.EventBus.$emit('multiplayer-addNode', {
1034
1040
  clientX,
@@ -1063,7 +1069,7 @@ export default {
1063
1069
  if (selected) {
1064
1070
  this.highlightNode(newNode);
1065
1071
  }
1066
-
1072
+
1067
1073
  await this.addNode(newNode, id, selected);
1068
1074
  if (!nodeThatWillBeReplaced) {
1069
1075
  return;
@@ -1081,7 +1087,7 @@ export default {
1081
1087
 
1082
1088
  return newNode;
1083
1089
  },
1084
-
1090
+
1085
1091
  setShapeCenterUnderCursor(diagram) {
1086
1092
  diagram.bounds.x -= (diagram.bounds.width / 2);
1087
1093
  diagram.bounds.y -= (diagram.bounds.height / 2);
@@ -1100,7 +1106,7 @@ export default {
1100
1106
 
1101
1107
  const targetProcess = node.getTargetProcess(this.processes, this.processNode);
1102
1108
  addNodeToProcess(node, targetProcess);
1103
- node.setIds(this.nodeIdGenerator, id);
1109
+ node.setIds(this.nodeIdGenerator, id);
1104
1110
 
1105
1111
  this.planeElements.push(node.diagram);
1106
1112
  store.commit('addNode', node);
@@ -1122,7 +1128,6 @@ export default {
1122
1128
  // Select the node after it has been added to the store (does not apply to flows)
1123
1129
  this.selectNewNode(node);
1124
1130
  }
1125
-
1126
1131
 
1127
1132
  return new Promise(resolve => {
1128
1133
  setTimeout(() => {
@@ -1212,6 +1217,39 @@ export default {
1212
1217
  });
1213
1218
  });
1214
1219
  },
1220
+ replaceAiNode({ node, typeToReplaceWith, assetId, assetName, redirectTo }) {
1221
+ this.performSingleUndoRedoTransaction(async() => {
1222
+ await this.paperManager.performAtomicAction(async() => {
1223
+ const { x: clientX, y: clientY } = this.paper.localToClientPoint(node.diagram.bounds);
1224
+ const newNode = await this.handleDrop({
1225
+ clientX, clientY,
1226
+ control: { type: typeToReplaceWith },
1227
+ nodeThatWillBeReplaced: node,
1228
+ });
1229
+
1230
+ if (typeToReplaceWith === 'processmaker-modeler-task') {
1231
+ newNode.definition.screenRef = assetId;
1232
+ newNode.definition.name = assetName;
1233
+ }
1234
+
1235
+ if (typeToReplaceWith === 'processmaker-modeler-script-task') {
1236
+ newNode.definition.scriptRef = assetId;
1237
+ newNode.definition.name = assetName;
1238
+ }
1239
+
1240
+ if (typeToReplaceWith === 'processmaker-modeler-call-activity') {
1241
+ newNode.definition.name = assetName;
1242
+ newNode.definition.calledElement = `ProcessId-${assetId}`;
1243
+ newNode.definition.config = `{"calledElement":"ProcessId-${assetId}","processId":${assetId},"startEvent":"node_1","name":${assetId}}`;
1244
+ }
1245
+
1246
+ await this.removeNode(node, { removeRelationships: false });
1247
+ this.highlightNode(newNode);
1248
+ this.selectNewNode(newNode);
1249
+ this.saveBpmn(redirectTo);
1250
+ });
1251
+ });
1252
+ },
1215
1253
  replaceGenericFlow({ actualFlow, genericFlow, targetNode }) {
1216
1254
  this.performSingleUndoRedoTransaction(async() => {
1217
1255
  await this.paperManager.performAtomicAction(async() => {
@@ -1404,6 +1442,9 @@ export default {
1404
1442
  this.dragStart = null;
1405
1443
  this.isSelecting = false;
1406
1444
  },
1445
+ redirect(redirectTo) {
1446
+ window.location = redirectTo;
1447
+ },
1407
1448
  enableMultiplayer() {
1408
1449
  this.isMultiplayer = true;
1409
1450
  },
@@ -1582,6 +1623,16 @@ export default {
1582
1623
  addWarnings: warnings => this.$emit('warnings', warnings),
1583
1624
  addBreadcrumbs: breadcrumbs => this.breadcrumbData.push(breadcrumbs),
1584
1625
  });
1626
+
1627
+ this.$root.$on('replace-ai-node', (data) => {
1628
+ this.replaceAiNode(data);
1629
+ });
1630
+
1631
+ window.ProcessMaker.EventBus.$on('save-changes', (redirectUrl) => {
1632
+ if (redirectUrl) {
1633
+ this.redirect(redirectUrl);
1634
+ }
1635
+ });
1585
1636
  },
1586
1637
  };
1587
1638
  </script>
@@ -11,6 +11,9 @@ export default shapes.standard.Rectangle.extend({
11
11
  }, {
12
12
  tagName: 'image',
13
13
  selector: 'image',
14
+ }, {
15
+ tagName: 'i',
16
+ selector: 'icon',
14
17
  },
15
18
  markersMarkup('topLeft'),
16
19
  markersMarkup('topCenter'),
@@ -25,6 +28,7 @@ export default shapes.standard.Rectangle.extend({
25
28
  size: { width: 100, height: 60 },
26
29
  attrs: {
27
30
  'image': { 'ref-x': 4, 'ref-y': 4, ref: 'rect', width: 16, height: 16, 'data-test': 'nodeIcon' },
31
+ 'icon': { ref: 'rect', 'ref-x': 4, 'ref-y': 4, width: 16, height: 16, 'data-test': 'nodeCustomIcon' },
28
32
  ...markersAttrs('topLeft', { 'ref-y': 4, ref: 'rect' }),
29
33
  ...markersAttrs('topCenter', { 'ref-y': 4, ref: 'rect' }),
30
34
  ...markersAttrs('topRight', { 'ref-y': 4, 'ref-x': 96, ref: 'rect' }, -1),
@@ -13,6 +13,7 @@
13
13
  :is-rendering="isRendering"
14
14
  :boundary-event-dropdown-data="boundaryEventDropdownData"
15
15
  :dropdown-data="dropdownData"
16
+ :hide-color-dropdown="hideColorDropdown"
16
17
  :showCustomIconPicker="true"
17
18
  :iconName="this.iconName"
18
19
  @set-custom-icon-name="setCustomIconName"
@@ -87,6 +88,7 @@ export default {
87
88
  ],
88
89
  boundaryEventDropdownData,
89
90
  anchorPointFunction: getRectangleAnchorPoint,
91
+ hideColorDropdown:false,
90
92
  };
91
93
  },
92
94
  computed: {
@@ -18,7 +18,8 @@
18
18
  @click="onClickHandler($event, item)"
19
19
  :data-test="item.type"
20
20
  >
21
- <inline-svg :src="item.icon" :alt=item.label />
21
+ <i v-if="!containsSvg(item.icon)" :class="item.icon" class="fa-lg"/>
22
+ <inline-svg v-else :src="item.icon" :alt=item.label />
22
23
  <div class="control-submenu-list-label">
23
24
  {{ item.label }}
24
25
  </div>
@@ -35,7 +36,7 @@
35
36
  <div class="control-submenu-options">
36
37
  <span />
37
38
  </div>
38
-
39
+ <i v-if="!containsSvg(data.icon)" :class="data.icon" class="fa-lg"/>
39
40
  <inline-svg :src="data.icon" />
40
41
  </a>
41
42
  </popper>
@@ -44,7 +45,8 @@
44
45
  :title="$t(data.label)"
45
46
  v-b-tooltip.hover.viewport.d50="{ customClass: 'no-pointer-events' }"
46
47
  >
47
- <inline-svg :src=data.icon />
48
+ <i v-if="!containsSvg(data.icon)" :class="data.icon" class="fa-lg"/>
49
+ <inline-svg :src="data.icon" />
48
50
  </a>
49
51
  </template>
50
52
 
@@ -52,8 +54,10 @@
52
54
  import Popper from 'vue-popperjs';
53
55
  import 'vue-popperjs/dist/vue-popper.css';
54
56
  import InlineSvg from 'vue-inline-svg';
57
+ import iconHelper from '@/mixins/iconHelper';
55
58
 
56
59
  export default ({
60
+ mixins: [iconHelper],
57
61
  props: {
58
62
  data: { type: Object },
59
63
  selectedItem: { type: String },
@@ -3,10 +3,11 @@ import pinIcon from '@/assets/pin-angle.svg';
3
3
  import pinFillIcon from '@/assets/pin-angle-fill.svg';
4
4
  import nodeTypesStore from '@/nodeTypesStore';
5
5
  import clickAndDrop from '@/mixins/clickAndDrop';
6
+ import iconHelper from '@/mixins/iconHelper';
6
7
 
7
8
  export default {
8
9
  name: 'NodeTypesLoop',
9
- mixins: [clickAndDrop],
10
+ mixins: [clickAndDrop, iconHelper],
10
11
  data() {
11
12
  return {
12
13
  pinIcon,
@@ -57,13 +58,15 @@ export default {
57
58
  <template v-for="object in filteredNodes">
58
59
  <div
59
60
  class="node-types__item"
61
+ :class="{'node-types__item__highlight': object.type === 'processmaker-ai-assistant'}"
60
62
  :data-test="object.type"
61
63
  :key="object.id"
62
64
  @mouseover="showPin = true"
63
65
  @mouseleave="showPin = false"
64
66
  @click.self="onClickHandler($event, object)"
65
67
  >
66
- <img class="node-types__item__icon" :src="object.icon" :alt="$t(object.label)">
68
+ <i v-if="!containsSvg(object.icon)" :class="object.icon" class="fa-lg"/>
69
+ <img v-else class="node-types__item__icon" :src="object.icon" :alt="$t(object.label)">
67
70
  <span>{{ $t(object.label) }}</span>
68
71
  <img
69
72
  v-if="nodeTypeAlreadyPinned(object, object.type)"
@@ -88,13 +91,15 @@ export default {
88
91
  <template v-for="pinnedObject in pinnedObjects">
89
92
  <div
90
93
  class="node-types__item"
94
+ :class="{'node-types__item__highlight': pinnedObject.type === 'processmaker-ai-assistant'}"
91
95
  :data-test="pinnedObject.type"
92
96
  :key="pinnedObject.id"
93
97
  @mouseover="showPin = true"
94
98
  @mouseleave="showPin = false"
95
99
  @click.stop="onClickHandler($event, pinnedObject)"
96
100
  >
97
- <img class="node-types__item__icon" :src="pinnedObject.icon" :alt="$t(pinnedObject.label)">
101
+ <i v-if="!containsSvg(pinnedObject.icon)" :class="pinnedObject.icon" class="fa-lg"/>
102
+ <img v-else class="node-types__item__icon" :src="pinnedObject.icon" :alt="$t(pinnedObject.label)">
98
103
  <span>{{ $t(pinnedObject.label) }}</span>
99
104
  <img
100
105
  :src="pinFillIcon"
@@ -110,13 +115,15 @@ export default {
110
115
  <template v-for="nodeType in unpinnedObjects">
111
116
  <div
112
117
  class="node-types__item"
118
+ :class="{'node-types__item__highlight': nodeType.type === 'processmaker-ai-assistant'}"
113
119
  :data-test="nodeType.type"
114
120
  :key="nodeType.id"
115
121
  @mouseover="showPin = true"
116
122
  @mouseleave="showPin = false"
117
123
  @click.stop="onClickHandler($event, nodeType)"
118
124
  >
119
- <img class="node-types__item__icon" :src="nodeType.icon" :alt="$t(nodeType.label)">
125
+ <i v-if="!containsSvg(nodeType.icon)" :class="nodeType.icon" class="fa-lg"/>
126
+ <img v-else class="node-types__item__icon" :src="nodeType.icon" :alt="$t(nodeType.label)">
120
127
  <span>{{ $t(nodeType.label) }}</span>
121
128
  <img
122
129
  :src="pinIcon"
@@ -154,6 +161,9 @@ export default {
154
161
  width: 1.5rem;
155
162
  height: 1.5rem;
156
163
  }
164
+ &__highlight {
165
+ background-color: #FFF4D3;
166
+ }
157
167
  span {
158
168
  margin-left: 0.8rem;
159
169
  font-size: 13px;
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <div class="message d-flex flex-column w-100 align-items-center">
3
+ <div class="d-flex justify-content-center align-items-center flex-column justify-content-center">
4
+ <div class="w-100">
5
+ {{
6
+ $t("To start, click and drop objects to build the process you like.")
7
+ }}
8
+ </div>
9
+ <div class="justify-content-center align-items-center w-100 text-center my-4">
10
+ <div class="text-align-center d-flex text-center justify-content-center align-items-center">
11
+ <div class="hyphen" />
12
+ or
13
+ <div class="hyphen" />
14
+ </div>
15
+ </div>
16
+ </div>
17
+ <b-button class="new-process-btn d-flex flex-row p-2 align-items-center" @click="onClick">
18
+ <inline-svg :src="proceC2Icon" class="mx-2 ai-icon" />
19
+ <div class="mr-3">{{ $t("Kick-start a new process with our generative AI") }}</div>
20
+ <span class="fa fa-chevron-right" />
21
+ </b-button>
22
+ </div>
23
+ </template>
24
+ <script>
25
+ import InlineSvg from 'vue-inline-svg';
26
+
27
+ export default {
28
+ name: 'WelcomeMessage',
29
+ components: {
30
+ InlineSvg,
31
+ },
32
+ data() {
33
+ return {
34
+ proceC2Icon: require('@/assets/proceC2.svg'),
35
+ };
36
+ },
37
+ methods: {},
38
+ };
39
+ </script>
40
+ <style>
41
+ .message {
42
+ color: #5f666d;
43
+ font-style: italic;
44
+ line-height: 27px;
45
+ word-wrap: break-word;
46
+ position: absolute;
47
+ display: flex;
48
+ justify-content: center;
49
+ align-items: center;
50
+ left: 0;
51
+ border: 0 none;
52
+ z-index: 1;
53
+ font-size: 110%;
54
+ font-weight: 100;
55
+ height: calc(100% - 130px);
56
+ }
57
+
58
+ .hyphen {
59
+ transform: rotate(0deg);
60
+ transform-origin: 0 0;
61
+ border: 1px #5f666d solid;
62
+ width: 30px;
63
+ margin: 5px 13px 0px 13px;
64
+ }
65
+ .new-process-btn {
66
+ color: #0872C2;
67
+ border-color: #0872C2;
68
+ background-color: #ffffff;
69
+ box-shadow: 0 3px 9px -3px #c2c2c2;
70
+ }
71
+
72
+ .new-process-btn:hover {
73
+ background-color: #edf7ff;
74
+ color: #0872C2;
75
+ border-color: #0872C2;
76
+ }
77
+
78
+ .ai-icon {
79
+ width: 22px;
80
+ height: 22px;
81
+ }
82
+ </style>