diff --git a/packages/app/package.json b/packages/app/package.json index eb0be4c..7a5ab7f 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -18,7 +18,7 @@ "@codemirror/search": "^6.5.6", "@codemirror/state": "^6.4.1", "@codemirror/view": "^6.34.1", - "@codeui/kit": "link:/Users/riccardoperra/WebstormProjects/codeui/packages/kit/", + "@codeui/kit": "^0.1.4", "@corvu/resizable": "^0.2.3", "@kobalte/core": "^0.13.6", "@kobalte/utils": "^0.9.1", diff --git a/packages/app/src/components/Editor/store/plugins/githubYamlManager.ts b/packages/app/src/components/Editor/store/plugins/githubYamlManager.ts index 2c13b02..97a3613 100644 --- a/packages/app/src/components/Editor/store/plugins/githubYamlManager.ts +++ b/packages/app/src/components/Editor/store/plugins/githubYamlManager.ts @@ -1,5 +1,4 @@ import {type GenericStoreApi, makePlugin} from 'statebuilder'; -import type {YAMLDocument, YamlDocumentSessionPlugin} from './yamlSession'; import YAML, {Pair, Scalar, YAMLMap, YAMLSeq} from 'yaml'; import type { JobEnvironment, @@ -7,7 +6,9 @@ import type { WorkflowDispatchInput, WorkflowStructureEnvItem, WorkflowStructureJobStep, + WorkflowTypesTriggerEvent, } from '../editor.types'; +import type {YAMLDocument, YamlDocumentSessionPlugin} from './yamlSession'; export const withGithubYamlManager = () => { return makePlugin.typed()( @@ -81,6 +82,29 @@ export const withGithubYamlManager = () => { }); }; + const setEventTriggerTypes = (data: WorkflowTypesTriggerEvent) => { + yamlSession.updater(yaml => { + modifyOnField(yaml, true, on => { + const map = new YAML.YAMLMap(); + + if (data.types?.length) { + map.set(new YAML.Scalar('types'), data.types); + on.set(new YAML.Scalar(data.type as string), map); + } else { + on.set(new YAML.Scalar(data.type as string), map); + } + }); + }); + }; + + const deleteEventTriggerTypes = (data: WorkflowTypesTriggerEvent) => { + yamlSession.updater(yaml => { + modifyOnField(yaml, true, on => { + on.delete(data.type); + }); + }); + }; + const setWorkflowDispatch = ( index: number, data: WorkflowDispatchInput, @@ -540,10 +564,12 @@ export const withGithubYamlManager = () => { return { yamlSession: Object.assign(_.yamlSession, { - deleteWorkflowDispatchItem, setEnvironmentVariable, deleteEnvironmentVariable, setWorkflowDispatch, + deleteWorkflowDispatchItem, + setEventTriggerTypes, + deleteEventTriggerTypes, addNewJob, removeJob, setJobId, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 595882c..7189a37 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,8 +56,8 @@ importers: specifier: ^6.34.1 version: 6.34.1 '@codeui/kit': - specifier: link:/Users/riccardoperra/WebstormProjects/codeui/packages/kit/ - version: link:../../../codeui/packages/kit + specifier: ^0.1.4 + version: 0.1.4(@types/node@22.7.4)(solid-js@1.9.2)(terser@5.34.1)(vite@5.4.8(@types/node@22.7.4)(terser@5.34.1)) '@corvu/resizable': specifier: ^0.2.3 version: 0.2.3(solid-js@1.9.2) @@ -585,6 +585,11 @@ packages: '@codemirror/view@6.34.1': resolution: {integrity: sha512-t1zK/l9UiRqwUNPm+pdIT0qzJlzuVckbTEMVNFhfWkGiBQClstzg+78vedCvLSX0xJEZ6lwZbPpnljL7L6iwMQ==} + '@codeui/kit@0.1.4': + resolution: {integrity: sha512-8ahnGgWnpiy2n9cNofuLzrMCqAfHuUX6ifecVXp9xB7RFTX24evuLMqjP2C7VBs4MxlOQeDY3QOv8mQiu4+XiQ==} + peerDependencies: + solid-js: ^1.7.0 + '@corvu/resizable@0.2.3': resolution: {integrity: sha512-UwpObxqKlx1mc3G496Daz9NjK25Gx1V5fB8zIGazbq5tJs7aU8RjPW4png5OoNpMyxV7GQWjQtVc59zaAEVAJg==} peerDependencies: @@ -1198,6 +1203,11 @@ packages: peerDependencies: solid-js: ^1.8.8 + '@kobalte/vanilla-extract@0.5.0': + resolution: {integrity: sha512-7a7e/3N4snvDbdenU31zOxmNfjdpx6ZxpU7a4lURPIA83suC6RhKTg+vZETwkeHqzzTb7+pUtIo/lHJ645eFPg==} + peerDependencies: + '@vanilla-extract/css': ^1.13.0 + '@lezer/common@1.2.2': resolution: {integrity: sha512-Z+R3hN6kXbgBWAuejUNPihylAL1Z5CaFqnIe0nTX8Ej+XlIy3EGtXxn6WtLMO+os2hRkQvm2yvaGMYliUzlJaw==} @@ -1220,9 +1230,41 @@ packages: resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} hasBin: true + '@maskito/core@3.1.2': + resolution: {integrity: sha512-1AsSBYZ8GxZ6xDhkwcGaMVrTm5oQpBscYX5CeJMG2IUG93pV8EUcEdzpD3bZc2G9DhpjjcM1xVRyWS9ynfckeA==} + + '@maskito/kit@3.1.2': + resolution: {integrity: sha512-zSEMwCmp0EUS9wwZUP4EJp90g/diay4DM0Mtayg4k+ep+lT3kRffUrTsXj4Noa60OO4875h0k29QCwI/oIVEqA==} + peerDependencies: + '@maskito/core': ^3.1.2 + '@mdx-js/mdx@3.0.1': resolution: {integrity: sha512-eIQ4QTrOWyL3LWEe/bu6Taqzq2HQvHcyTMaOrI95P2/LmJE7AsfPfgJGuFLPVqBUE1BC1rik3VIhU+s9u72arA==} + '@motionone/animation@10.18.0': + resolution: {integrity: sha512-9z2p5GFGCm0gBsZbi8rVMOAJCtw1WqBTIPw3ozk06gDvZInBPIsQcHgYogEJ4yuHJ+akuW8g1SEIOpTOvYs8hw==} + + '@motionone/dom@10.18.0': + resolution: {integrity: sha512-bKLP7E0eyO4B2UaHBBN55tnppwRnaE3KFfh3Ps9HhnAkar3Cb69kUCJY9as8LrccVYKgHA+JY5dOQqJLOPhF5A==} + + '@motionone/easing@10.18.0': + resolution: {integrity: sha512-VcjByo7XpdLS4o9T8t99JtgxkdMcNWD3yHU/n6CLEz3bkmKDRZyYQ/wmSf6daum8ZXqfUAgFeCZSpJZIMxaCzg==} + + '@motionone/generators@10.18.0': + resolution: {integrity: sha512-+qfkC2DtkDj4tHPu+AFKVfR/C30O1vYdvsGYaR13W/1cczPrrcjdvYCj0VLFuRMN+lP1xvpNZHCRNM4fBzn1jg==} + + '@motionone/solid@10.16.4': + resolution: {integrity: sha512-xS3vDhWgTB7xdSYnOTs69Ai09WWjuG6bbz2E+NjP7DswD3X2jLZNNTFmf8GTGhj7UeFHiZgtERIjvpGgZTuEiQ==} + deprecated: Motion One for Solid is deprecated. Use solid-motionone instead https://github.com/solidjs-community/solid-motionone + peerDependencies: + solid-js: ^1.5.0 + + '@motionone/types@10.17.1': + resolution: {integrity: sha512-KaC4kgiODDz8hswCrS0btrVrzyU2CSQKO7Ps90ibBVSQmjkrt2teqta6/sOG59v7+dPnKMAg13jyqtMKV2yJ7A==} + + '@motionone/utils@10.18.0': + resolution: {integrity: sha512-3XVF7sgyTSI2KWvTf6uLlBJ5iAgRgmvp3bpuOiQJvInd4nZ19ET8lX5unn30SlmRH7hXbBbH+Gxd0m0klJ3Xtw==} + '@mswjs/interceptors@0.35.9': resolution: {integrity: sha512-SSnyl/4ni/2ViHKkiZb8eajA/eN1DNFaHjhGiLUdZvDz6PKF4COSf/17xqSz64nOo2Ia29SA6B2KNCsyCbVmaQ==} engines: {node: '>=18'} @@ -1432,6 +1474,9 @@ packages: '@qualified/vscode-snippet-parser@0.1.0': resolution: {integrity: sha512-I595ZBk/xCJC1dj1i6llEdyeHAWS2NJgiNOFoK3nGw5NJcUIqB4kiPpuIAG/wu71UnZBeXrWvOlrviDqzvUtrQ==} + '@radix-ui/colors@3.0.0': + resolution: {integrity: sha512-FUOsGBkHrYJwCSEtWRCIfQbZG7q1e6DgxCIOe1SUQzDe/7rXXeA47s8yCn6fuTNQAj1Zq4oTFi9Yjp3wzElcxg==} + '@railway/cli@3.14.0': resolution: {integrity: sha512-iHImm47pwyZ3t6y+0sWaOcf7IZXNa15K6G5AFyO+CMhT4a0nibC2njoSFGaETXRIPcI9jc2OkKC8V1JUPlO7ug==} engines: {node: '>=16.0.0'} @@ -1641,6 +1686,11 @@ packages: peerDependencies: solid-js: ^1.6.12 + '@solid-primitives/pagination@0.3.0': + resolution: {integrity: sha512-B9R2tVAEwGyXGF/533b46d7fXHU//eHUOt4CxwESwV3RhtP0wYScrV882i2eHGQuryZfQH2jbubvjMQyQbTMgA==} + peerDependencies: + solid-js: ^1.6.12 + '@solid-primitives/props@3.1.11': resolution: {integrity: sha512-jZAKWwvDRHjiydIumDgMj68qviIbowQ1ci7nkEAgzgvanNkhKSQV8iPgR2jMk1uv7S2ZqXYHslVQTgJel/TEyg==} peerDependencies: @@ -1683,6 +1733,11 @@ packages: solid-start: optional: true + '@solid-primitives/transition-group@1.0.5': + resolution: {integrity: sha512-G3FuqvL13kQ55WzWPX2ewiXdZ/1iboiX53195sq7bbkDbXqP6TYKiadwEdsaDogW5rPnPYAym3+xnsNplQJRKQ==} + peerDependencies: + solid-js: ^1.6.12 + '@solid-primitives/trigger@1.1.0': resolution: {integrity: sha512-00BbAiXV66WwjHuKZc3wr0+GLb9C24mMUmi3JdTpNFgHBbrQGrIHubmZDg36c5/7wH+E0GQtOOanwQS063PO+A==} peerDependencies: @@ -1709,6 +1764,14 @@ packages: '@swc/helpers@0.5.13': resolution: {integrity: sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==} + '@tanstack/solid-virtual@3.10.8': + resolution: {integrity: sha512-4dmUYIjjIVRFmpm7qha1tEDk5L6yzCEh63gTCUlo9ECXz7n3gvY95YQsrFNO020en5gXIUPHIzMBd56qqafyhQ==} + peerDependencies: + solid-js: ^1.3.0 + + '@tanstack/virtual-core@3.10.8': + resolution: {integrity: sha512-PBu00mtt95jbKFi6Llk9aik8bnR3tR/oQP1o3TSi+iG//+Q2RTIzCEgKkHG8BB86kxMNW6O8wku+Lmi+QFR6jA==} + '@types/acorn@4.0.6': resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} @@ -3140,6 +3203,9 @@ packages: headers-polyfill@4.0.3: resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} + hey-listen@1.0.8: + resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} + hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -3921,6 +3987,9 @@ packages: modern-ahocorasick@1.0.1: resolution: {integrity: sha512-yoe+JbhTClckZ67b2itRtistFKf8yPYelHLc7e5xAwtNAXxM6wJTUx2C7QeVSJFDzKT7bCIFyBVybPMKvmB9AA==} + motion@10.18.0: + resolution: {integrity: sha512-MVAZZmwM/cp77BrNe1TxTMldxRPjwBNHheU5aPToqT4rJdZxLiADk58H+a0al5jKLxkB0OdgNq6DiVn11cjvIQ==} + mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -4219,6 +4288,10 @@ packages: pkg-types@1.2.0: resolution: {integrity: sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==} + polished@4.3.1: + resolution: {integrity: sha512-OBatVyC/N7SCW/FaDHrSd+vn0o5cS855TOmYi4OkdWUMSJCET/xip//ch8xGUvtr3i44X9LVyWwQlRMTN3pwSA==} + engines: {node: '>=10'} + postcss-load-config@6.0.1: resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} engines: {node: '>= 18'} @@ -5927,6 +6000,41 @@ snapshots: style-mod: 4.1.2 w3c-keyname: 2.2.8 + '@codeui/kit@0.1.4(@types/node@22.7.4)(solid-js@1.9.2)(terser@5.34.1)(vite@5.4.8(@types/node@22.7.4)(terser@5.34.1))': + dependencies: + '@kobalte/core': 0.13.6(solid-js@1.9.2) + '@kobalte/utils': 0.9.1(solid-js@1.9.2) + '@kobalte/vanilla-extract': 0.5.0(@vanilla-extract/css@1.16.0) + '@maskito/core': 3.1.2 + '@maskito/kit': 3.1.2(@maskito/core@3.1.2) + '@motionone/solid': 10.16.4(solid-js@1.9.2) + '@radix-ui/colors': 3.0.0 + '@solid-primitives/pagination': 0.3.0(solid-js@1.9.2) + '@solid-primitives/scheduled': 1.4.3(solid-js@1.9.2) + '@tanstack/solid-virtual': 3.10.8(solid-js@1.9.2) + '@tanstack/virtual-core': 3.10.8 + '@vanilla-extract/css': 1.16.0 + '@vanilla-extract/dynamic': 2.1.2 + '@vanilla-extract/recipes': 0.5.5(@vanilla-extract/css@1.16.0) + '@vanilla-extract/vite-plugin': 4.0.17(patch_hash=i44zwkor6nbxyrubqgkogc6t64)(@types/node@22.7.4)(terser@5.34.1)(vite@5.4.8(@types/node@22.7.4)(terser@5.34.1)) + example-basic: link:packages/app + motion: 10.18.0 + polished: 4.3.1 + solid-js: 1.9.2 + statebuilder: 0.6.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - vite + '@corvu/resizable@0.2.3(solid-js@1.9.2)': dependencies: '@corvu/utils': 0.4.2(solid-js@1.9.2) @@ -6466,6 +6574,10 @@ snapshots: '@solid-primitives/utils': 6.2.3(solid-js@1.9.2) solid-js: 1.9.2 + '@kobalte/vanilla-extract@0.5.0(@vanilla-extract/css@1.16.0)': + dependencies: + '@vanilla-extract/css': 1.16.0 + '@lezer/common@1.2.2': {} '@lezer/highlight@1.2.1': @@ -6513,6 +6625,12 @@ snapshots: - encoding - supports-color + '@maskito/core@3.1.2': {} + + '@maskito/kit@3.1.2(@maskito/core@3.1.2)': + dependencies: + '@maskito/core': 3.1.2 + '@mdx-js/mdx@3.0.1': dependencies: '@types/estree': 1.0.6 @@ -6541,6 +6659,50 @@ snapshots: transitivePeerDependencies: - supports-color + '@motionone/animation@10.18.0': + dependencies: + '@motionone/easing': 10.18.0 + '@motionone/types': 10.17.1 + '@motionone/utils': 10.18.0 + tslib: 2.7.0 + + '@motionone/dom@10.18.0': + dependencies: + '@motionone/animation': 10.18.0 + '@motionone/generators': 10.18.0 + '@motionone/types': 10.17.1 + '@motionone/utils': 10.18.0 + hey-listen: 1.0.8 + tslib: 2.7.0 + + '@motionone/easing@10.18.0': + dependencies: + '@motionone/utils': 10.18.0 + tslib: 2.7.0 + + '@motionone/generators@10.18.0': + dependencies: + '@motionone/types': 10.17.1 + '@motionone/utils': 10.18.0 + tslib: 2.7.0 + + '@motionone/solid@10.16.4(solid-js@1.9.2)': + dependencies: + '@motionone/dom': 10.18.0 + '@motionone/utils': 10.18.0 + '@solid-primitives/props': 3.1.11(solid-js@1.9.2) + '@solid-primitives/refs': 1.0.8(solid-js@1.9.2) + '@solid-primitives/transition-group': 1.0.5(solid-js@1.9.2) + solid-js: 1.9.2 + + '@motionone/types@10.17.1': {} + + '@motionone/utils@10.18.0': + dependencies: + '@motionone/types': 10.17.1 + hey-listen: 1.0.8 + tslib: 2.7.0 + '@mswjs/interceptors@0.35.9': dependencies: '@open-draft/deferred-promise': 2.2.0 @@ -6768,6 +6930,8 @@ snapshots: '@qualified/vscode-snippet-parser@0.1.0': {} + '@radix-ui/colors@3.0.0': {} + '@railway/cli@3.14.0': dependencies: '@napi-rs/triples': 1.2.0 @@ -6939,6 +7103,11 @@ snapshots: '@solid-primitives/utils': 6.2.3(solid-js@1.9.2) solid-js: 1.9.2 + '@solid-primitives/pagination@0.3.0(solid-js@1.9.2)': + dependencies: + '@solid-primitives/utils': 6.2.3(solid-js@1.9.2) + solid-js: 1.9.2 + '@solid-primitives/props@3.1.11(solid-js@1.9.2)': dependencies: '@solid-primitives/utils': 6.2.3(solid-js@1.9.2) @@ -6976,6 +7145,10 @@ snapshots: '@solid-primitives/utils': 6.2.3(solid-js@1.9.2) solid-js: 1.9.2 + '@solid-primitives/transition-group@1.0.5(solid-js@1.9.2)': + dependencies: + solid-js: 1.9.2 + '@solid-primitives/trigger@1.1.0(solid-js@1.9.2)': dependencies: '@solid-primitives/utils': 6.2.3(solid-js@1.9.2) @@ -7023,6 +7196,13 @@ snapshots: dependencies: tslib: 2.7.0 + '@tanstack/solid-virtual@3.10.8(solid-js@1.9.2)': + dependencies: + '@tanstack/virtual-core': 3.10.8 + solid-js: 1.9.2 + + '@tanstack/virtual-core@3.10.8': {} + '@types/acorn@4.0.6': dependencies: '@types/estree': 1.0.6 @@ -8714,6 +8894,8 @@ snapshots: headers-polyfill@4.0.3: {} + hey-listen@1.0.8: {} + hookable@5.5.3: {} html-encoding-sniffer@4.0.0: @@ -9858,6 +10040,13 @@ snapshots: modern-ahocorasick@1.0.1: {} + motion@10.18.0: + dependencies: + '@motionone/animation': 10.18.0 + '@motionone/dom': 10.18.0 + '@motionone/types': 10.17.1 + '@motionone/utils': 10.18.0 + mri@1.2.0: {} ms@2.0.0: {} @@ -10225,6 +10414,10 @@ snapshots: mlly: 1.7.1 pathe: 1.1.2 + polished@4.3.1: + dependencies: + '@babel/runtime': 7.25.6 + postcss-load-config@6.0.1(jiti@2.0.0)(postcss@8.4.47)(tsx@4.19.1)(yaml@2.5.1): dependencies: lilconfig: 3.1.2