From 813f33c5179f123f7191c93251b66b5fc252497b Mon Sep 17 00:00:00 2001 From: SorsOps <80043879+SorsOps@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:18:27 +0200 Subject: [PATCH 1/7] Fix issue with squash node not indexing correctly (#226) * Fix issue with squash node not indexing correctly * Add changeset --- .changeset/sweet-stingrays-call.md | 6 ++++++ .../src/components/flow/nodes/sets/squashNode.tsx | 12 ++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 .changeset/sweet-stingrays-call.md diff --git a/.changeset/sweet-stingrays-call.md b/.changeset/sweet-stingrays-call.md new file mode 100644 index 00000000..665cf734 --- /dev/null +++ b/.changeset/sweet-stingrays-call.md @@ -0,0 +1,6 @@ +--- +"@tokens-studio/graph-editor": patch +"@tokens-studio/graph-engine": patch +--- + +Fix issue with squash node indexing diff --git a/packages/graph-editor/src/components/flow/nodes/sets/squashNode.tsx b/packages/graph-editor/src/components/flow/nodes/sets/squashNode.tsx index da00ace7..45cc5ce4 100644 --- a/packages/graph-editor/src/components/flow/nodes/sets/squashNode.tsx +++ b/packages/graph-editor/src/components/flow/nodes/sets/squashNode.tsx @@ -7,18 +7,14 @@ import { node } from '@tokens-studio/graph-engine/nodes/set/flatten.js'; const SquashNode = () => { const { input } = useNode(); - const [nextId, setNextId] = useState(0); - const ref = useRef(input?.input?.length || 0); - useEffect(() => { - ref.current += 1; - //We don't care about the values, just the length - }, [input.input?.length || 0]); + const [nextId, setNextId] = useState(() => input.inputs.length); const newHandle = useMemo(() => { - setNextId(ref.current++); + setNextId(nextId + 1); + return nextId + 1; //We don't care about the values, just the length - }, []); + }, [input.inputs]); const handles = useMemo(() => { return input.inputs.map((input, index) => { From 5b38f7e18499bcdabaf7a513c98579b4a4b256f2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:25:07 +0200 Subject: [PATCH 2/7] Version Packages (#227) Co-authored-by: github-actions[bot] --- .changeset/sweet-stingrays-call.md | 6 ------ packages/graph-editor/CHANGELOG.md | 8 ++++++++ packages/graph-editor/package.json | 2 +- packages/graph-engine/CHANGELOG.md | 6 ++++++ packages/graph-engine/package.json | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 .changeset/sweet-stingrays-call.md diff --git a/.changeset/sweet-stingrays-call.md b/.changeset/sweet-stingrays-call.md deleted file mode 100644 index 665cf734..00000000 --- a/.changeset/sweet-stingrays-call.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@tokens-studio/graph-editor": patch -"@tokens-studio/graph-engine": patch ---- - -Fix issue with squash node indexing diff --git a/packages/graph-editor/CHANGELOG.md b/packages/graph-editor/CHANGELOG.md index 1b8231a0..67eb53ae 100644 --- a/packages/graph-editor/CHANGELOG.md +++ b/packages/graph-editor/CHANGELOG.md @@ -1,5 +1,13 @@ # @tokens-studio/graph-editor +## 2.9.5 + +### Patch Changes + +- 813f33c: Fix issue with squash node indexing +- Updated dependencies [813f33c] + - @tokens-studio/graph-engine@0.17.5 + ## 2.9.4 ### Patch Changes diff --git a/packages/graph-editor/package.json b/packages/graph-editor/package.json index 0bfb94fe..effb6fc9 100644 --- a/packages/graph-editor/package.json +++ b/packages/graph-editor/package.json @@ -1,7 +1,7 @@ { "private": false, "name": "@tokens-studio/graph-editor", - "version": "2.9.4", + "version": "2.9.5", "description": "UI for the graph engine", "author": "andrew@hyma.io", "type": "module", diff --git a/packages/graph-engine/CHANGELOG.md b/packages/graph-engine/CHANGELOG.md index c14f852d..19930a48 100644 --- a/packages/graph-engine/CHANGELOG.md +++ b/packages/graph-engine/CHANGELOG.md @@ -1,5 +1,11 @@ # @tokens-studio/graph-engine +## 0.17.5 + +### Patch Changes + +- 813f33c: Fix issue with squash node indexing + ## 0.17.4 ### Patch Changes diff --git a/packages/graph-engine/package.json b/packages/graph-engine/package.json index a0db93e6..4a11f55a 100644 --- a/packages/graph-engine/package.json +++ b/packages/graph-engine/package.json @@ -1,6 +1,6 @@ { "name": "@tokens-studio/graph-engine", - "version": "0.17.4", + "version": "0.17.5", "description": "An execution engine to handle Token Studios generators and resolvers", "license": "MIT", "author": "andrew@hyma.io", From bdc94f20c30e04399142d58477e00ef0c322c4b8 Mon Sep 17 00:00:00 2001 From: popdrazvan Date: Mon, 26 Feb 2024 11:32:57 +0200 Subject: [PATCH 3/7] Refactor editor layout and menu --- .changeset/many-starfishes-relax.md | 6 ++ packages/graph-editor/src/editor/index.tsx | 100 ++++++++---------- packages/graph-editor/src/index.css | 1 + .../ui/src/components/editorMenu/index.tsx | 2 +- 4 files changed, 53 insertions(+), 56 deletions(-) create mode 100644 .changeset/many-starfishes-relax.md diff --git a/.changeset/many-starfishes-relax.md b/.changeset/many-starfishes-relax.md new file mode 100644 index 00000000..9594eed2 --- /dev/null +++ b/.changeset/many-starfishes-relax.md @@ -0,0 +1,6 @@ +--- +"@tokens-studio/graph-editor": minor +"@tokens-studio/graph-engine-ui": minor +--- + +Prevent toolpanel from covering canvas diff --git a/packages/graph-editor/src/editor/index.tsx b/packages/graph-editor/src/editor/index.tsx index 88a08b9a..b7c74ecb 100644 --- a/packages/graph-editor/src/editor/index.tsx +++ b/packages/graph-editor/src/editor/index.tsx @@ -70,7 +70,7 @@ const snapGridCoords: SnapGrid = [16, 16]; const defaultViewport = { x: 0, y: 0, zoom: 1.5 }; const panOnDrag = [1, 2]; -const noop = () => {}; +const noop = () => { }; const edgeTypes = { custom: CustomEdge, @@ -509,67 +509,57 @@ export const EditorApp = React.forwardRef( return ( <> - - - {showMenu && ( - - {props.menuContent} - - - )} - {showNodesPanel && ( - - - - - - )} - + + {showMenu && ( + + {props.menuContent} + + + )} + {showNodesPanel && ( + + + + )} + ( {props.children} - + - + Date: Thu, 21 Mar 2024 11:04:05 +0530 Subject: [PATCH 4/7] Add pointer-events to css map node --- .../graph-editor/src/components/flow/nodes/output/cssMapNode.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/graph-editor/src/components/flow/nodes/output/cssMapNode.tsx b/packages/graph-editor/src/components/flow/nodes/output/cssMapNode.tsx index 63523163..9c0aa40b 100644 --- a/packages/graph-editor/src/components/flow/nodes/output/cssMapNode.tsx +++ b/packages/graph-editor/src/components/flow/nodes/output/cssMapNode.tsx @@ -84,6 +84,7 @@ const keys = [ 'paddingLeft', 'paddingRight', 'paddingTop', + 'pointer-events', 'position', 'right', 'rotate', From f954273bc1118cc263ada819bc976a6667bb88de Mon Sep 17 00:00:00 2001 From: Vaibhav Bhosale Date: Thu, 21 Mar 2024 11:14:08 +0530 Subject: [PATCH 5/7] add changeset --- .changeset/tough-hornets-agree.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tough-hornets-agree.md diff --git a/.changeset/tough-hornets-agree.md b/.changeset/tough-hornets-agree.md new file mode 100644 index 00000000..aec0804e --- /dev/null +++ b/.changeset/tough-hornets-agree.md @@ -0,0 +1,5 @@ +--- +"@tokens-studio/graph-editor": minor +--- + +Add pointer-events to css map From e3bddf7cd82bf508910eeaed201c634ec433ad00 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 21 Mar 2024 06:18:47 +0000 Subject: [PATCH 6/7] Version Packages --- .changeset/many-starfishes-relax.md | 6 ------ .changeset/tough-hornets-agree.md | 5 ----- packages/graph-editor/CHANGELOG.md | 7 +++++++ packages/graph-editor/package.json | 2 +- packages/ui/CHANGELOG.md | 12 ++++++++++++ packages/ui/package.json | 2 +- 6 files changed, 21 insertions(+), 13 deletions(-) delete mode 100644 .changeset/many-starfishes-relax.md delete mode 100644 .changeset/tough-hornets-agree.md diff --git a/.changeset/many-starfishes-relax.md b/.changeset/many-starfishes-relax.md deleted file mode 100644 index 9594eed2..00000000 --- a/.changeset/many-starfishes-relax.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@tokens-studio/graph-editor": minor -"@tokens-studio/graph-engine-ui": minor ---- - -Prevent toolpanel from covering canvas diff --git a/.changeset/tough-hornets-agree.md b/.changeset/tough-hornets-agree.md deleted file mode 100644 index aec0804e..00000000 --- a/.changeset/tough-hornets-agree.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tokens-studio/graph-editor": minor ---- - -Add pointer-events to css map diff --git a/packages/graph-editor/CHANGELOG.md b/packages/graph-editor/CHANGELOG.md index 67eb53ae..75f73f72 100644 --- a/packages/graph-editor/CHANGELOG.md +++ b/packages/graph-editor/CHANGELOG.md @@ -1,5 +1,12 @@ # @tokens-studio/graph-editor +## 2.10.0 + +### Minor Changes + +- bdc94f2: Prevent toolpanel from covering canvas +- f954273: Add pointer-events to css map + ## 2.9.5 ### Patch Changes diff --git a/packages/graph-editor/package.json b/packages/graph-editor/package.json index effb6fc9..cc66df0e 100644 --- a/packages/graph-editor/package.json +++ b/packages/graph-editor/package.json @@ -1,7 +1,7 @@ { "private": false, "name": "@tokens-studio/graph-editor", - "version": "2.9.5", + "version": "2.10.0", "description": "UI for the graph engine", "author": "andrew@hyma.io", "type": "module", diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index dcc6ae6c..2edb0882 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,17 @@ # @tokens-studio/graph-engine-ui +## 2.2.0 + +### Minor Changes + +- bdc94f2: Prevent toolpanel from covering canvas + +### Patch Changes + +- Updated dependencies [bdc94f2] +- Updated dependencies [f954273] + - @tokens-studio/graph-editor@2.10.0 + ## 2.1.3 ### Patch Changes diff --git a/packages/ui/package.json b/packages/ui/package.json index a6309a2f..30250c28 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@tokens-studio/graph-engine-ui", - "version": "2.1.3", + "version": "2.2.0", "description": "UI for the graph engine", "author": "andrew@hyma.io", "type": "module", From 199ba25041759e204f6aee78c357cb86d8baf0ff Mon Sep 17 00:00:00 2001 From: SorsOps <80043879+sorsOps@users.noreply.github.com> Date: Mon, 27 May 2024 12:10:42 +0200 Subject: [PATCH 7/7] Update colorjs.io to get around hex code transformation during prod builds --- .vscode/settings.json | 2 +- packages/graph-engine/package.json | 3 +- .../src/nodes/color/contrastingFromSet.ts | 1 - yarn.lock | 70 ++----------------- 4 files changed, 9 insertions(+), 67 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2c402aab..e1bc8515 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "eslint.options": { "extensions": [ diff --git a/packages/graph-engine/package.json b/packages/graph-engine/package.json index 4a11f55a..bbee7bae 100644 --- a/packages/graph-engine/package.json +++ b/packages/graph-engine/package.json @@ -42,7 +42,7 @@ "chroma-js": "^2.4.2", "color-blind": "^0.1.3", "color-namer": "^1.4.0", - "colorjs.io": "^0.4.3", + "colorjs.io": "^0.5.0", "culori": "^3.1.2", "dot-prop": "^8.0.2", "extract-colors": "^4.0.2", @@ -52,7 +52,6 @@ "mdn-data": "^2.3.0", "poline": "^0.7.0", "postcss-value-parser": "^4.2.0", - "react-mosaic-component": "^6.0.1", "reactflow": "^11.9.4", "semver-compare": "^1.0.0", "token-transformer": "^0.0.33" diff --git a/packages/graph-engine/src/nodes/color/contrastingFromSet.ts b/packages/graph-engine/src/nodes/color/contrastingFromSet.ts index b175a734..e2d8c6da 100644 --- a/packages/graph-engine/src/nodes/color/contrastingFromSet.ts +++ b/packages/graph-engine/src/nodes/color/contrastingFromSet.ts @@ -1,7 +1,6 @@ import { sortTokens } from "#/utils/sortTokens.js"; import { NodeDefinition, NodeTypes } from "../../types.js"; import { SingleToken } from "@tokens-studio/types"; -import Color from "colorjs.io"; export const type = NodeTypes.CONTRASTING_FROM_SET; diff --git a/yarn.lock b/yarn.lock index ea835554..c160511d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5933,7 +5933,7 @@ classcat@^5.0.3, classcat@^5.0.4: resolved "https://registry.yarnpkg.com/classcat/-/classcat-5.0.4.tgz#e12d1dfe6df6427f260f03b80dc63571a5107ba6" integrity sha512-sbpkOw6z413p+HDGcBENe498WM9woqWHiJxCq7nvmxe9WmrUmqfAcxpIwAiMtM5Q3AhYkzXcNQHqsWq0mND51g== -classnames@2.3.2, classnames@^2.3.2: +classnames@2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924" integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw== @@ -6081,10 +6081,10 @@ colorette@^2.0.19, colorette@^2.0.20: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== -colorjs.io@^0.4.3: - version "0.4.5" - resolved "https://registry.yarnpkg.com/colorjs.io/-/colorjs.io-0.4.5.tgz#7775f787ff90aca7a38f6edb7b7c0f8cce1e6418" - integrity sha512-yCtUNCmge7llyfd/Wou19PMAcf5yC3XXhgFoAh6zsO2pGswhUPBaaUh8jzgHnXtXuZyFKzXZNAnyF5i+apICow== +colorjs.io@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/colorjs.io/-/colorjs.io-0.5.0.tgz#b1034184b4812b54e28c5082029fbd8ca53aa532" + integrity sha512-qekjTiBLM3F/sXKks/ih5aWaHIGu+Ftel0yKEvmpbKvmxpNOhojKgha5uiWEUOqEpRjC1Tq3nJRT7WgdBOxIGg== combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" @@ -6914,11 +6914,6 @@ dnd-core@^16.0.1: "@react-dnd/invariant" "^4.0.1" redux "^4.2.0" -dnd-multi-backend@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/dnd-multi-backend/-/dnd-multi-backend-8.0.1.tgz#118311b998c0e142013de3aea8fc9ed8e9e7108d" - integrity sha512-2HLUzxU32ol+COX8klzwy41mA3wOPuSH+08vGmN9WfyrlM3cMcRWFYRStUJkR3obGVUUuQxEtg0m50VxMCHafA== - doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" @@ -8816,11 +8811,6 @@ immediate@~3.0.5: resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== -immutability-helper@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/immutability-helper/-/immutability-helper-3.1.1.tgz#2b86b2286ed3b1241c9e23b7b21e0444f52f77b7" - integrity sha512-Q0QaXjPjwIju/28TsugCHNEASwoCcJSyJV3uO1sOIQGI0jKgm9f41Lvz0DZj3n46cNCyAZTsEYoY4C2bVRUzyQ== - immutable@^4.0.0: version "4.3.4" resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f" @@ -12476,15 +12466,6 @@ quick-lru@^4.0.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== -rdndmb-html5-to-touch@^8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/rdndmb-html5-to-touch/-/rdndmb-html5-to-touch-8.0.1.tgz#fbb08d92238e15710e302bfe3eb6ad956d3eb5a3" - integrity sha512-p2va3HLxCMbSeuD4o8z+iJAetxmbzWgrI1x1PDvt2A0QMWRUt7JZ9jGCi+6a/00NVDAxfxuc58euKR91UMo4Lg== - dependencies: - dnd-multi-backend "^8.0.1" - react-dnd-html5-backend "^16.0.1" - react-dnd-touch-backend "^16.0.1" - react-color@2.19.3: version "2.19.3" resolved "https://registry.yarnpkg.com/react-color/-/react-color-2.19.3.tgz#ec6c6b4568312a3c6a18420ab0472e146aa5683d" @@ -12510,35 +12491,14 @@ react-contexify@^6.0.0: dependencies: clsx "^1.2.1" -react-dnd-html5-backend@16.0.1, react-dnd-html5-backend@^16.0.1: +react-dnd-html5-backend@16.0.1: version "16.0.1" resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-16.0.1.tgz#87faef15845d512a23b3c08d29ecfd34871688b6" integrity sha512-Wu3dw5aDJmOGw8WjH1I1/yTH+vlXEL4vmjk5p+MHxP8HuHJS1lAGeIdG/hze1AvNeXWo/JgULV87LyQOr+r5jw== dependencies: dnd-core "^16.0.1" -react-dnd-multi-backend@^8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/react-dnd-multi-backend/-/react-dnd-multi-backend-8.0.1.tgz#99f29926faf7115baf4a493bc63dd124a0203b74" - integrity sha512-+/7mFkWk4HIpQsd4d8lKB8aStafv9wgpvbkQrPWF4JeTA1j2IPAdPTOiHI5bvpyoLA5BGD02u8cgxtY/gZQpjg== - dependencies: - dnd-multi-backend "^8.0.1" - react-dnd-preview "^8.0.1" - -react-dnd-preview@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/react-dnd-preview/-/react-dnd-preview-8.0.1.tgz#11ce1f769a1a7dac821f7fa286789bc3bf213ed6" - integrity sha512-CsQwvWXLXGN9DoRzHC79DbCF42AXJdoUDMxnIF7TvA/xE6Hm+cVl6kPQIYz1UL755/JNSD2/WHuILuU40k29rw== - -react-dnd-touch-backend@^16.0.1: - version "16.0.1" - resolved "https://registry.yarnpkg.com/react-dnd-touch-backend/-/react-dnd-touch-backend-16.0.1.tgz#e73f8169e2b9fac0f687970f875cac0a4d02d6e2" - integrity sha512-NonoCABzzjyWGZuDxSG77dbgMZ2Wad7eQiCd/ECtsR2/NBLTjGksPUx9UPezZ1nQ/L7iD130Tz3RUshL/ClKLA== - dependencies: - "@react-dnd/invariant" "^4.0.1" - dnd-core "^16.0.1" - -react-dnd@16.0.1, react-dnd@^16.0.1: +react-dnd@16.0.1: version "16.0.1" resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-16.0.1.tgz#2442a3ec67892c60d40a1559eef45498ba26fa37" integrity sha512-QeoM/i73HHu2XF9aKksIUuamHPDvRglEwdHL4jsp784BgUuWcg6mzfxT0QDdQz8Wj0qyRKx2eMg8iZtWvU4E2Q== @@ -12647,22 +12607,6 @@ react-live@4.0.1: sucrase "^3.31.0" use-editable "^2.3.3" -react-mosaic-component@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/react-mosaic-component/-/react-mosaic-component-6.0.1.tgz#0b1ef6381141129e69788216d49747c307aca112" - integrity sha512-jzlttpxW2TSIaZyJeF60X0nP441udDugMfYrgOftehdolP3EMukUW7GOnRDDRIBuP4RdfL9YICqgDs0PG7dsrw== - dependencies: - classnames "^2.3.2" - immutability-helper "^3.1.1" - lodash "^4.17.21" - prop-types "^15.8.1" - rdndmb-html5-to-touch "^8.0.0" - react-dnd "^16.0.1" - react-dnd-html5-backend "^16.0.1" - react-dnd-multi-backend "^8.0.0" - react-dnd-touch-backend "^16.0.1" - uuid "^9.0.0" - react-native-get-random-values@^1.4.0: version "1.9.0" resolved "https://registry.yarnpkg.com/react-native-get-random-values/-/react-native-get-random-values-1.9.0.tgz#6cb30511c406922e75fe73833dc1812a85bfb37e"