├── data ├── .gitkeep └── prometheus │ └── prometheus.yaml ├── out └── .gitkeep ├── packages ├── documentation │ ├── static │ │ ├── .nojekyll │ │ └── img │ │ │ ├── favicon.ico │ │ │ ├── docusaurus.png │ │ │ └── docusaurus-social-card.jpg │ ├── .dockerignore │ ├── docs │ │ ├── concepts │ │ │ └── _category_.yaml │ │ ├── guides │ │ │ ├── _category_.yaml │ │ │ ├── developers │ │ │ │ ├── _category_.yaml │ │ │ │ ├── editor │ │ │ │ │ └── _category_.yaml │ │ │ │ └── engine │ │ │ │ │ └── _category_.yaml │ │ │ └── packages │ │ │ │ ├── _category_.yaml │ │ │ │ └── custom.md │ │ ├── technical │ │ │ ├── _category_.yaml │ │ │ └── dataModel.md │ │ ├── getting-started │ │ │ └── _category_.yaml │ │ ├── imgs │ │ │ └── image.png │ │ └── authors.yml │ ├── src │ │ ├── components │ │ │ ├── editor │ │ │ │ └── nodes │ │ │ │ │ └── nodes │ │ │ │ │ ├── logic │ │ │ │ │ └── switch │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── math │ │ │ │ │ ├── abs │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── add │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── generic │ │ │ │ │ ├── input │ │ │ │ │ └── index.ts │ │ │ │ │ └── constant │ │ │ │ │ └── index.ts │ │ │ └── HomepageFeatures │ │ │ │ └── styles.module.css │ │ ├── pages │ │ │ ├── markdown-page.md │ │ │ └── index.module.css │ │ └── theme │ │ │ ├── MDXPage │ │ │ └── index.js │ │ │ └── MDXContent │ │ │ └── index.tsx │ ├── .prettierrc.json │ ├── .eslintignore │ ├── babel.config.js │ ├── .eslintrc.cjs │ ├── .prettierignore │ ├── tsconfig.json │ └── .gitignore ├── vscode-extension │ ├── src │ │ ├── commands.ts │ │ ├── types │ │ │ └── graph-engine-migration.d.ts │ │ ├── nonce.ts │ │ └── test │ │ │ └── extension.test.ts │ ├── .yarnrc │ ├── .prettierrc.json │ ├── .gitignore │ ├── media │ │ ├── icon.png │ │ └── logo.png │ ├── .prettierrc │ ├── app │ │ └── src │ │ │ ├── favicon.ico │ │ │ ├── manifest.json │ │ │ └── data │ │ │ └── nodeTypes │ │ │ └── index.ts │ ├── .vscode-test.mjs │ ├── .eslintignore │ ├── .prettierignore │ ├── .eslintrc.cjs │ ├── .vscodeignore │ ├── .vscode │ │ ├── extensions.json │ │ └── settings.json │ └── vite.config.ts ├── storybook-react │ ├── .gitignore │ ├── .prettierrc.json │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .prettierignore │ ├── readme.md │ ├── .storybook │ │ ├── preview-body.html │ │ └── main.js │ ├── src │ │ └── button │ │ │ ├── button.generated.ts │ │ │ ├── base.css │ │ │ └── button.tsx │ └── CHANGELOG.md ├── nodes-figma │ ├── src │ │ ├── index.ts │ │ ├── schemas │ │ │ └── utils.ts │ │ └── nodes │ │ │ └── index.ts │ ├── .dockerignore │ ├── .prettierrc.json │ ├── .eslintignore │ ├── vitest.config.ts │ ├── .eslintrc.cjs │ ├── tsconfig.docs.json │ ├── .prettierignore │ ├── typedoc.json │ └── readme.md ├── ui │ ├── .dockerignore │ ├── .prettierrc.json │ ├── src │ │ ├── middleware │ │ │ └── index.ts │ │ ├── lib │ │ │ ├── featureFlags.ts │ │ │ └── prisma │ │ │ │ └── index.ts │ │ ├── app │ │ │ ├── editor │ │ │ │ ├── loading.tsx │ │ │ │ └── layout.tsx │ │ │ ├── preview │ │ │ │ ├── clientPage.tsx │ │ │ │ └── page.tsx │ │ │ ├── dashboard │ │ │ │ ├── loading.tsx │ │ │ │ └── layout.tsx │ │ │ ├── healthz │ │ │ │ └── route.ts │ │ │ ├── api │ │ │ │ └── auth │ │ │ │ │ └── [...nextauth] │ │ │ │ │ └── route.ts │ │ │ ├── api-docs │ │ │ │ └── page.tsx │ │ │ ├── page.tsx │ │ │ ├── manifest.json │ │ │ ├── marketplace │ │ │ │ ├── layout.tsx │ │ │ │ ├── clientPage.module.css │ │ │ │ └── graph │ │ │ │ │ └── [id] │ │ │ │ │ └── clientPage.module.css │ │ │ ├── contexts.tsx │ │ │ └── thumbnails │ │ │ │ └── [id] │ │ │ │ └── route.ts │ │ ├── declarations.d.ts │ │ ├── types │ │ │ ├── IExample.tsx │ │ │ └── graph-engine-migration.d.ts │ │ ├── api │ │ │ ├── sdk │ │ │ │ ├── index.ts │ │ │ │ ├── getServerClient.ts │ │ │ │ └── provider.tsx │ │ │ ├── utils │ │ │ │ ├── types.ts │ │ │ │ └── common.ts │ │ │ ├── contracts │ │ │ │ ├── index.ts │ │ │ │ └── ai.ts │ │ │ ├── index.ts │ │ │ ├── controllers │ │ │ │ └── index.ts │ │ │ └── middleware.ts │ │ │ │ └── auth.ts │ │ ├── assets │ │ │ └── svgs │ │ │ │ ├── code-3.svg │ │ │ │ ├── react.svg │ │ │ │ ├── vue.svg │ │ │ │ └── js.svg │ │ ├── components │ │ │ ├── container │ │ │ │ ├── index.tsx │ │ │ │ └── layout.module.css │ │ │ ├── preview │ │ │ │ └── preview.css │ │ │ ├── loader │ │ │ │ └── index.tsx │ │ │ ├── pages │ │ │ │ └── index.module.css │ │ │ └── toast.tsx │ │ ├── image.d.ts │ │ ├── link.d.ts │ │ ├── hooks │ │ │ └── useGetEditor.ts │ │ ├── scripts │ │ │ └── wdyr.ts │ │ └── styles │ │ │ └── styles.css │ ├── .npmrc │ ├── public │ │ ├── favicon.ico │ │ ├── apple-icon.png │ │ ├── thumbnail.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── apple-touch-icon.png │ │ ├── apple-icon-180x180.png │ │ ├── android-chrome-192x192.png │ │ └── android-chrome-512x512.png │ ├── developer-docs │ │ ├── zipkin.png │ │ └── prometheus.png │ ├── .eslintignore │ ├── prisma │ │ └── migrations │ │ │ └── migration_lock.toml │ ├── .editorconfig │ ├── prometheus.yaml │ ├── .prettierignore │ ├── .eslintrc.cjs │ ├── .env │ └── .gitignore ├── graph-editor │ ├── src │ │ ├── data │ │ │ └── version.ts │ │ ├── constants.ts │ │ ├── context │ │ │ └── index.ts │ │ ├── components │ │ │ ├── controls │ │ │ │ ├── index.tsx │ │ │ │ ├── interface.tsx │ │ │ │ ├── withVariadicField.module.css │ │ │ │ ├── color.module.css │ │ │ │ ├── variadicColor.module.css │ │ │ │ ├── default.tsx │ │ │ │ ├── variadicNumber.tsx │ │ │ │ ├── floatCurve.tsx │ │ │ │ └── boolean.tsx │ │ │ ├── toolbar │ │ │ │ ├── groups │ │ │ │ │ └── index.tsx │ │ │ │ ├── buttons │ │ │ │ │ ├── index.ts │ │ │ │ │ └── settings.tsx │ │ │ │ ├── index.tsx │ │ │ │ ├── dropdowns │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.stories.tsx │ │ │ │ └── toolbar.cy.tsx │ │ │ ├── flow │ │ │ │ ├── index.ts │ │ │ │ ├── minimap.d.ts │ │ │ │ ├── types.tsx │ │ │ │ ├── edges │ │ │ │ │ └── types.tsx │ │ │ │ └── nodes │ │ │ │ │ ├── noteNode.module.css │ │ │ │ │ └── loadingNode.tsx │ │ │ ├── panels │ │ │ │ ├── dropPanel │ │ │ │ │ ├── index.ts │ │ │ │ │ └── story.stories.tsx │ │ │ │ ├── debugger │ │ │ │ │ └── index.tsx │ │ │ │ ├── settings │ │ │ │ │ └── story.stories.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── legend │ │ │ │ │ └── story.stories.tsx │ │ │ ├── icons │ │ │ │ └── index.tsx │ │ │ ├── contextMenus │ │ │ │ ├── ContextMenuStyles.tsx │ │ │ │ └── index.tsx │ │ │ ├── DndList.module.css │ │ │ ├── preview │ │ │ │ ├── index.tsx │ │ │ │ ├── mathExpression.tsx │ │ │ │ ├── mathExpression.stories.tsx │ │ │ │ └── colorContrast.stories.tsx │ │ │ ├── curveEditor │ │ │ │ └── override.css │ │ │ ├── colorPicker │ │ │ │ └── index.module.css │ │ │ ├── hotKeys │ │ │ │ └── utils.ts │ │ │ ├── menubar │ │ │ │ └── index.stories.tsx │ │ │ └── index.ts │ │ ├── hooks │ │ │ ├── useLocalGraph.ts │ │ │ ├── index.ts │ │ │ ├── useDispatch.ts │ │ │ ├── useGraph.ts │ │ │ ├── useCanDeleteNode.ts │ │ │ ├── onEnter.ts │ │ │ ├── useRegisterRef.ts │ │ │ └── useSelectAddedNodes.tsx │ │ ├── declarations.d.ts │ │ ├── types │ │ │ ├── css-modules.d.ts │ │ │ ├── index.ts │ │ │ ├── serializedNode.tsx │ │ │ └── controls.ts │ │ ├── editor │ │ │ ├── actions │ │ │ │ ├── selectNode.tsx │ │ │ │ └── clear.ts │ │ │ ├── graphEditor.tsx │ │ │ └── hooks │ │ │ │ └── useAutolayout.ts │ │ ├── redux │ │ │ ├── selectors │ │ │ │ ├── index.ts │ │ │ │ ├── refs.ts │ │ │ │ ├── roots.ts │ │ │ │ └── ui.ts │ │ │ └── models │ │ │ │ ├── root.ts │ │ │ │ ├── index.ts │ │ │ │ └── refs.ts │ │ ├── utils │ │ │ ├── pluralizeValue.ts │ │ │ ├── isActiveElementTextEditable.ts │ │ │ └── stripVariadic.ts │ │ └── ids.ts │ ├── .dockerignore │ ├── .prettierrc.json │ ├── .eslintrc.cjs │ ├── .prettierrc │ ├── .eslintignore │ ├── examples │ │ ├── barebones │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ ├── package.json │ │ │ └── readme.md │ │ └── defaults │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ ├── package.json │ │ │ └── readme.md │ ├── cypress │ │ ├── fixtures │ │ │ └── example.json │ │ ├── tsconfig.json │ │ ├── e2e │ │ │ ├── smoke.cy.ts │ │ │ └── nodes.cy.ts │ │ └── support │ │ │ └── component-index.html │ ├── .prettierignore │ ├── .storybook │ │ ├── preview-body.html │ │ └── preview.module.css │ ├── vite.config.ts │ ├── vitest.config.ts │ ├── postcss.config.js │ ├── scripts │ │ └── extractVersion.mjs │ ├── cypress.config.ts │ └── .gitignore ├── nodes-fs │ ├── .prettierrc.json │ ├── .dockerignore │ ├── src │ │ ├── schemas │ │ │ ├── utils.ts │ │ │ └── index.ts │ │ ├── nodes │ │ │ ├── .DS_Store │ │ │ └── index.ts │ │ ├── index.ts │ │ └── ui │ │ │ ├── index.tsx │ │ │ └── controls │ │ │ ├── index.tsx │ │ │ └── file.tsx │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── tsconfig.docs.json │ ├── .prettierignore │ ├── readme.md │ ├── tests │ │ └── smoke.test.ts │ ├── typedoc.json │ ├── vite.config.mts │ └── tsconfig.prod.json ├── graph-engine │ ├── .dockerignore │ ├── .prettierrc.json │ ├── declaration.d.ts │ ├── src │ │ ├── nodes │ │ │ ├── secret │ │ │ │ └── index.ts │ │ │ ├── .DS_Store │ │ │ ├── gradient │ │ │ │ └── index.ts │ │ │ ├── typography │ │ │ │ └── index.ts │ │ │ ├── accessibility │ │ │ │ └── index.ts │ │ │ ├── search │ │ │ │ └── index.ts │ │ │ ├── color │ │ │ │ └── lib │ │ │ │ │ ├── spaces.ts │ │ │ │ │ └── transparentize.ts │ │ │ ├── css │ │ │ │ └── index.ts │ │ │ ├── logic │ │ │ │ └── index.ts │ │ │ ├── typing │ │ │ │ └── index.ts │ │ │ ├── preview │ │ │ │ ├── index.ts │ │ │ │ ├── curve.ts │ │ │ │ ├── swatch.ts │ │ │ │ ├── colorScale.ts │ │ │ │ ├── number.ts │ │ │ │ └── mathExpression.ts │ │ │ ├── vector2 │ │ │ │ └── index.ts │ │ │ ├── series │ │ │ │ └── index.ts │ │ │ ├── curves │ │ │ │ └── index.ts │ │ │ └── string │ │ │ │ └── index.ts │ │ ├── graph │ │ │ ├── index.ts │ │ │ ├── interfaces.ts │ │ │ └── terminals.ts │ │ ├── programmatic │ │ │ └── index.ts │ │ ├── schemas │ │ │ ├── operators.ts │ │ │ └── utils.ts │ │ ├── constants.ts │ │ ├── types │ │ │ └── index.ts │ │ ├── utils │ │ │ └── precision.ts │ │ ├── index.ts │ │ └── capabilities │ │ │ └── secret.ts │ ├── .eslintignore │ ├── tsconfig.docs.json │ ├── .prettierignore │ ├── vitest.config.ts │ ├── typedoc.json │ ├── .eslintrc.cjs │ ├── tests │ │ ├── suites │ │ │ ├── nodes │ │ │ │ ├── math │ │ │ │ │ ├── abs.test.ts │ │ │ │ │ ├── add.test.ts │ │ │ │ │ ├── pow.test.ts │ │ │ │ │ ├── sub.test.ts │ │ │ │ │ └── multiply.test.ts │ │ │ │ ├── array │ │ │ │ │ ├── length.test.ts │ │ │ │ │ ├── reverse.test.ts │ │ │ │ │ └── push.test.ts │ │ │ │ ├── string │ │ │ │ │ ├── uppercase.test.ts │ │ │ │ │ ├── lowercase.test.ts │ │ │ │ │ ├── split.test.ts │ │ │ │ │ └── join.test.ts │ │ │ │ └── css │ │ │ │ │ └── box.test.ts │ │ │ └── schema │ │ │ │ └── schema.test.ts │ │ └── data │ │ │ └── processed │ │ │ └── noInput.ts │ └── tsconfig.prod.json ├── migrations │ ├── .dockerignore │ ├── .prettierrc.json │ ├── .eslintignore │ ├── src │ │ └── migrations │ │ │ ├── types.ts │ │ │ ├── removePositionAnnotations.ts │ │ │ └── index.ts │ ├── .eslintrc.cjs │ ├── .prettierignore │ ├── tsconfig.prod.json │ └── readme.md ├── nodes-audio │ ├── .dockerignore │ ├── .prettierrc.json │ ├── src │ │ ├── nodes │ │ │ ├── .DS_Store │ │ │ └── base.ts │ │ ├── declarations.d.ts │ │ ├── index.ts │ │ ├── ui │ │ │ └── index.tsx │ │ └── capabilities │ │ │ └── web.ts │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── tsconfig.docs.json │ ├── .prettierignore │ ├── typedoc.json │ └── tsconfig.prod.json ├── nodes-image │ ├── .dockerignore │ ├── src │ │ ├── utils.ts │ │ ├── nodes │ │ │ ├── .DS_Store │ │ │ ├── base.ts │ │ │ └── preview.ts │ │ ├── ui │ │ │ ├── controls │ │ │ │ ├── image.tsx │ │ │ │ └── index.tsx │ │ │ ├── specifics │ │ │ │ └── index.tsx │ │ │ └── index.tsx │ │ ├── index.ts │ │ ├── schemas │ │ │ ├── types.ts │ │ │ └── index.ts │ │ └── capabilities │ │ │ └── imageMagick.ts │ ├── .eslintignore │ ├── .prettierignore │ ├── readme.md │ ├── .eslintrc.cjs │ ├── tsconfig.docs.json │ ├── vite.config.mts │ └── typedoc.json ├── storybook-lit │ ├── .prettierrc.json │ ├── src │ │ ├── vite-env.d.ts │ │ ├── components │ │ │ ├── generated │ │ │ │ ├── styles │ │ │ │ │ ├── knight-dim.css │ │ │ │ │ ├── ninja-dark.css │ │ │ │ │ ├── ninja-dim.css │ │ │ │ │ ├── samurai-dim.css │ │ │ │ │ ├── knight-dark.css │ │ │ │ │ ├── knight-light.css │ │ │ │ │ ├── ninja-light.css │ │ │ │ │ ├── samurai-dark.css │ │ │ │ │ ├── samurai-light.css │ │ │ │ │ └── index.css │ │ │ │ └── tokens │ │ │ │ │ ├── knight-dark.json │ │ │ │ │ ├── knight-dim.json │ │ │ │ │ ├── ninja-dark.json │ │ │ │ │ ├── ninja-dim.json │ │ │ │ │ ├── ninja-light.json │ │ │ │ │ ├── samurai-dark.json │ │ │ │ │ ├── samurai-dim.json │ │ │ │ │ ├── samurai-light.json │ │ │ │ │ └── knight-light.json │ │ │ ├── button.generated.ts │ │ │ └── base.css │ │ └── assets │ │ │ └── lit.svg │ ├── .storybook │ │ ├── preview-head.html │ │ └── preview.ts │ ├── CHANGELOG.md │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .prettierignore │ ├── vite.config.js │ ├── .gitignore │ ├── index.html │ └── tsconfig.json ├── nodes-previews │ ├── .dockerignore │ ├── .prettierrc.json │ ├── src │ │ ├── types │ │ │ └── css.d.ts │ │ ├── color │ │ │ ├── scale │ │ │ │ ├── panel.module.css │ │ │ │ └── node.ts │ │ │ └── swatch │ │ │ │ ├── node.ts │ │ │ │ └── panel.module.css │ │ ├── utils │ │ │ └── index.ts │ │ └── token │ │ │ ├── dimension │ │ │ ├── panel.module.css │ │ │ └── node.ts │ │ │ ├── table │ │ │ ├── node.ts │ │ │ └── panel.module.css │ │ │ ├── typography │ │ │ └── node.ts │ │ │ └── palette │ │ │ └── node.ts │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── readme.md │ ├── tsconfig.docs.json │ ├── .prettierignore │ ├── tests │ │ └── smoke.test.ts │ ├── typedoc.json │ ├── vite.config.mts │ ├── CHANGELOG.md │ └── postcss.config.js ├── nodes-design-tokens │ ├── .dockerignore │ ├── .prettierrc.json │ ├── src │ │ ├── schemas │ │ │ └── utils.ts │ │ ├── nodes │ │ │ ├── .DS_Store │ │ │ ├── arrays │ │ │ │ └── index.ts │ │ │ └── naming │ │ │ │ └── index.ts │ │ ├── index.ts │ │ └── ui │ │ │ ├── nodes │ │ │ └── index.tsx │ │ │ └── icons │ │ │ └── token.tsx │ ├── .eslintignore │ ├── vitest.config.ts │ ├── .eslintrc.cjs │ ├── tsconfig.docs.json │ ├── .prettierignore │ └── typedoc.json ├── vscode-example-workspace │ ├── user.json │ ├── .env │ ├── assets │ │ └── audio │ │ │ ├── CantinaBand3.wav │ │ │ └── PinkPanther30.wav │ ├── .tsgraphrc │ ├── vite.config.ts │ ├── metadata.json │ └── graphs │ │ └── test │ │ └── graph.metadata.json └── prettier-config-custom │ ├── index.js │ └── package.json ├── .npmrc ├── .devcontainer.json ├── .vscode ├── extensions.json └── app-monorepo.code-workspace ├── assets └── resolver-eg.png ├── .prettierignore ├── .husky ├── pre-commit ├── pre-push ├── post-commit ├── post-merge └── post-checkout ├── .eslintignore ├── .gimlet └── k8s │ └── graph-engine │ ├── charts │ └── onechart-0.69.0.tgz │ ├── Chart.lock │ ├── values.yaml │ └── templates │ └── db.yaml ├── .gitignore ├── .dockerignore ├── .eslintrc.cjs ├── docker-compose.yaml ├── .lintstagedrc ├── .env ├── .changeset ├── config.json └── README.md ├── dockercompose.build.yaml ├── adrs ├── 0000-efficient-caching.md └── 0001-strong-typing.md ├── scripts └── diff.js └── patches └── react-virtualized+9.22.5.patch /data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /out/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/documentation/static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/vscode-extension/src/commands.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/storybook-react/.gitignore: -------------------------------------------------------------------------------- 1 | **/generated/** -------------------------------------------------------------------------------- /packages/documentation/.dockerignore: -------------------------------------------------------------------------------- 1 | build 2 | .docusaurus -------------------------------------------------------------------------------- /packages/vscode-extension/.yarnrc: -------------------------------------------------------------------------------- 1 | --ignore-engines true -------------------------------------------------------------------------------- /packages/nodes-figma/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './nodes/index.js'; 2 | -------------------------------------------------------------------------------- /packages/ui/.dockerignore: -------------------------------------------------------------------------------- 1 | out 2 | src-tauri 3 | .next 4 | node_modules -------------------------------------------------------------------------------- /packages/ui/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | progress=false 2 | strict-peer-deps=false 3 | legacy-peer-deps=true 4 | -------------------------------------------------------------------------------- /packages/documentation/docs/concepts/_category_.yaml: -------------------------------------------------------------------------------- 1 | label: 'Concepts' 2 | -------------------------------------------------------------------------------- /packages/documentation/src/components/editor/nodes/nodes/logic/switch/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/graph-editor/src/data/version.ts: -------------------------------------------------------------------------------- 1 | export const version = '4.4.1'; 2 | -------------------------------------------------------------------------------- /packages/nodes-fs/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/documentation/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/graph-editor/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/graph-editor/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/graph-editor/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const MAIN_GRAPH_ID = 'graph1'; 2 | -------------------------------------------------------------------------------- /packages/graph-engine/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/graph-engine/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/migrations/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/migrations/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/nodes-audio/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/nodes-audio/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/nodes-figma/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/nodes-figma/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/nodes-fs/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/nodes-image/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/storybook-lit/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /.devcontainer.json: -------------------------------------------------------------------------------- 1 | {"image":"mcr.microsoft.com/devcontainers/javascript-node","build":{}} -------------------------------------------------------------------------------- /packages/documentation/docs/guides/_category_.yaml: -------------------------------------------------------------------------------- 1 | label: 'Guides' 2 | position: 2 3 | -------------------------------------------------------------------------------- /packages/documentation/docs/guides/developers/_category_.yaml: -------------------------------------------------------------------------------- 1 | label: 'Developer' 2 | -------------------------------------------------------------------------------- /packages/documentation/docs/guides/developers/editor/_category_.yaml: -------------------------------------------------------------------------------- 1 | label: 'Editor' 2 | -------------------------------------------------------------------------------- /packages/documentation/docs/guides/developers/engine/_category_.yaml: -------------------------------------------------------------------------------- 1 | label: 'Engine' 2 | -------------------------------------------------------------------------------- /packages/graph-editor/src/context/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ExternalDataContext.js'; 2 | -------------------------------------------------------------------------------- /packages/nodes-previews/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/nodes-previews/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/storybook-react/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/vscode-extension/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/documentation/docs/technical/_category_.yaml: -------------------------------------------------------------------------------- 1 | label: 'Technical' 2 | position: 8 3 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | jest-coverage 4 | node_modules -------------------------------------------------------------------------------- /packages/nodes-design-tokens/.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@tokens-studio/prettier-config-custom" 2 | -------------------------------------------------------------------------------- /packages/ui/src/middleware/index.ts: -------------------------------------------------------------------------------- 1 | export { auth as middleware } from '@/auth/index.js'; 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /packages/documentation/docs/guides/packages/_category_.yaml: -------------------------------------------------------------------------------- 1 | label: 'Packages' 2 | position: 2 3 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/controls/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './withVariadicField.js'; 2 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/toolbar/groups/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './playControls.js'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/featureFlags.ts: -------------------------------------------------------------------------------- 1 | export const audioEnabled = process.env.NEXT_PUBLIC_FF_AUDIO; 2 | -------------------------------------------------------------------------------- /packages/vscode-extension/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | dist 3 | node_modules 4 | .vscode-test/ 5 | 6 | 7 | build -------------------------------------------------------------------------------- /assets/resolver-eg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/assets/resolver-eg.png -------------------------------------------------------------------------------- /packages/documentation/docs/getting-started/_category_.yaml: -------------------------------------------------------------------------------- 1 | label: 'Getting Started' 2 | position: 1 3 | -------------------------------------------------------------------------------- /packages/graph-editor/src/hooks/useLocalGraph.ts: -------------------------------------------------------------------------------- 1 | export { useLocalGraph } from '../context/graph.js'; 2 | -------------------------------------------------------------------------------- /packages/storybook-lit/.storybook/preview-head.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/ui/.npmrc: -------------------------------------------------------------------------------- 1 | save-exact = true 2 | progress=false 3 | strict-peer-deps=false 4 | legacy-peer-deps=true 5 | -------------------------------------------------------------------------------- /packages/vscode-example-workspace/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme": "default", 3 | "currentGraph": "test" 4 | } 5 | -------------------------------------------------------------------------------- /packages/nodes-fs/src/schemas/utils.ts: -------------------------------------------------------------------------------- 1 | export const arrayOf = type => ({ 2 | type: 'array', 3 | items: type 4 | }); 5 | -------------------------------------------------------------------------------- /packages/nodes-image/src/utils.ts: -------------------------------------------------------------------------------- 1 | export const arrayOf = (type) => ({ 2 | type: "array", 3 | items: type, 4 | }); 5 | -------------------------------------------------------------------------------- /packages/ui/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/favicon.ico -------------------------------------------------------------------------------- /packages/ui/src/app/editor/loading.tsx: -------------------------------------------------------------------------------- 1 | import Loader from '@/components/loader/index.tsx'; 2 | export default Loader; 3 | -------------------------------------------------------------------------------- /packages/ui/src/app/preview/clientPage.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | export { default } from '@/components/preview/index.tsx'; 3 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo -------------------------------------------------------------------------------- /packages/graph-editor/src/components/flow/index.ts: -------------------------------------------------------------------------------- 1 | export * from './wrapper/nodeV2.js'; 2 | export * from './handles.js'; 3 | -------------------------------------------------------------------------------- /packages/graph-editor/src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.svg' { 2 | export = { 3 | src: string, 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /packages/graph-engine/declaration.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.json' { 2 | const value: any; 3 | export default value; 4 | } 5 | -------------------------------------------------------------------------------- /packages/nodes-figma/src/schemas/utils.ts: -------------------------------------------------------------------------------- 1 | export const arrayOf = type => ({ 2 | type: 'array', 3 | items: type 4 | }); 5 | -------------------------------------------------------------------------------- /packages/ui/public/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/apple-icon.png -------------------------------------------------------------------------------- /packages/ui/public/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/thumbnail.png -------------------------------------------------------------------------------- /packages/ui/src/app/dashboard/loading.tsx: -------------------------------------------------------------------------------- 1 | import Loader from '@/components/loader/index.tsx'; 2 | export default Loader; 3 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/panels/dropPanel/index.ts: -------------------------------------------------------------------------------- 1 | export * from './dropPanel.js'; 2 | export * from './data.js'; 3 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/secret/index.ts: -------------------------------------------------------------------------------- 1 | import retrieve from './retrieve.js'; 2 | 3 | export const nodes = [retrieve]; 4 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/src/schemas/utils.ts: -------------------------------------------------------------------------------- 1 | export const arrayOf = type => ({ 2 | type: 'array', 3 | items: type 4 | }); 5 | -------------------------------------------------------------------------------- /packages/nodes-fs/src/nodes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/nodes-fs/src/nodes/.DS_Store -------------------------------------------------------------------------------- /packages/ui/developer-docs/zipkin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/developer-docs/zipkin.png -------------------------------------------------------------------------------- /packages/ui/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/favicon-16x16.png -------------------------------------------------------------------------------- /packages/ui/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/favicon-32x32.png -------------------------------------------------------------------------------- /packages/ui/src/app/healthz/route.ts: -------------------------------------------------------------------------------- 1 | export async function GET() { 2 | return new Response('OK', { 3 | status: 200 4 | }); 5 | } 6 | -------------------------------------------------------------------------------- /packages/graph-editor/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root:true, 3 | extends: ['@tokens-studio/eslint-config-custom'], 4 | }; -------------------------------------------------------------------------------- /packages/nodes-audio/src/nodes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/nodes-audio/src/nodes/.DS_Store -------------------------------------------------------------------------------- /packages/nodes-image/src/nodes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/nodes-image/src/nodes/.DS_Store -------------------------------------------------------------------------------- /packages/ui/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/apple-touch-icon.png -------------------------------------------------------------------------------- /packages/vscode-extension/media/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/vscode-extension/media/icon.png -------------------------------------------------------------------------------- /packages/vscode-extension/media/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/vscode-extension/media/logo.png -------------------------------------------------------------------------------- /packages/documentation/docs/imgs/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/documentation/docs/imgs/image.png -------------------------------------------------------------------------------- /packages/graph-editor/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "singleQuote": true, 4 | "printWidth": 80, 5 | "tabWidth": 2 6 | } 7 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/graph-engine/src/nodes/.DS_Store -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/gradient/index.ts: -------------------------------------------------------------------------------- 1 | import gradientStop from './gradientStop.js'; 2 | 3 | export const nodes = [gradientStop]; 4 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/typography/index.ts: -------------------------------------------------------------------------------- 1 | import baseFontSize from './baseFontSize.js'; 2 | 3 | export const nodes = [baseFontSize]; 4 | -------------------------------------------------------------------------------- /packages/nodes-image/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | coverage/** 3 | storybook-static/** 4 | docs 5 | site 6 | cypress 7 | cli 8 | .rollup.cache 9 | .turbo -------------------------------------------------------------------------------- /packages/ui/developer-docs/prometheus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/developer-docs/prometheus.png -------------------------------------------------------------------------------- /packages/ui/public/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/apple-icon-180x180.png -------------------------------------------------------------------------------- /packages/ui/src/app/api/auth/[...nextauth]/route.ts: -------------------------------------------------------------------------------- 1 | import { handlers } from '@/auth/index.ts'; 2 | 3 | export const { GET, POST } = handlers; 4 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | # Disable as this is no longer working 5 | # yarn run lint-staged 6 | -------------------------------------------------------------------------------- /packages/documentation/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/documentation/static/img/favicon.ico -------------------------------------------------------------------------------- /packages/nodes-image/src/ui/controls/image.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Image = ()=>{ 4 | 5 | return
Image
6 | } -------------------------------------------------------------------------------- /packages/ui/public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /packages/ui/public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/ui/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /packages/vscode-extension/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "singleQuote": true, 4 | "printWidth": 80, 5 | "tabWidth": 2 6 | } 7 | -------------------------------------------------------------------------------- /packages/vscode-extension/app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/vscode-extension/app/src/favicon.ico -------------------------------------------------------------------------------- /packages/documentation/static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/documentation/static/img/docusaurus.png -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/accessibility/index.ts: -------------------------------------------------------------------------------- 1 | import colorBlindness from './colorBlindness.js'; 2 | 3 | export const nodes = [colorBlindness]; 4 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/src/nodes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/nodes-design-tokens/src/nodes/.DS_Store -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/graph-editor/src/components/flow/minimap.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@reactflow/minimap' { 2 | MiniMap = React.FC; 3 | 4 | export { MiniMap }; 5 | } 6 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/icons/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './AppsIcon.js'; 2 | export * from './BezierIcon.js'; 3 | export * from './GrabberIcon.js'; 4 | -------------------------------------------------------------------------------- /packages/nodes-previews/src/types/css.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.module.css' { 2 | const classes: { [key: string]: string }; 3 | export default classes; 4 | } 5 | -------------------------------------------------------------------------------- /packages/vscode-example-workspace/.env: -------------------------------------------------------------------------------- 1 | # This is your .env file for the workspace 2 | # You can use it in conjunction with capabilities which can read env vars 3 | -------------------------------------------------------------------------------- /.gimlet/k8s/graph-engine/charts/onechart-0.69.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/.gimlet/k8s/graph-engine/charts/onechart-0.69.0.tgz -------------------------------------------------------------------------------- /packages/graph-editor/src/components/toolbar/buttons/index.ts: -------------------------------------------------------------------------------- 1 | export * from './download.js'; 2 | export * from './settings.js'; 3 | export * from './upload.js'; 4 | -------------------------------------------------------------------------------- /packages/graph-editor/src/types/css-modules.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.module.css' { 2 | const classes: { [key: string]: string }; 3 | export default classes; 4 | } 5 | -------------------------------------------------------------------------------- /packages/nodes-audio/src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'audio-buffer-from' { 2 | export default function toAudioBuffer(resource: Buffer): AudioBuffer; 3 | } 4 | -------------------------------------------------------------------------------- /packages/storybook-lit/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @tokens-studio/lit-storybook 2 | 3 | ## 1.0.1 4 | 5 | ### Patch Changes 6 | 7 | - f08f85f: Fix clsx and remove classnames. 8 | -------------------------------------------------------------------------------- /packages/documentation/docs/technical/dataModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Data Model 3 | --- 4 | 5 | The data model of a graph is intended to be as flat and simple as possible 6 | -------------------------------------------------------------------------------- /packages/documentation/src/components/editor/nodes/nodes/math/abs/index.ts: -------------------------------------------------------------------------------- 1 | export { default as example0 } from '@site/src/components/editor/raw/nodes/math/abs/0.json'; 2 | -------------------------------------------------------------------------------- /packages/documentation/src/components/editor/nodes/nodes/math/add/index.ts: -------------------------------------------------------------------------------- 1 | export { default as example0 } from '@site/src/components/editor/raw/nodes/math/add/0.json'; 2 | -------------------------------------------------------------------------------- /packages/nodes-fs/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/nodes-image/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache -------------------------------------------------------------------------------- /packages/ui/src/app/preview/page.tsx: -------------------------------------------------------------------------------- 1 | import Inner from './clientPage.tsx'; 2 | 3 | const Page = async () => { 4 | return ; 5 | }; 6 | 7 | export default Page; 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | cli/ 2 | jest-coverage/ 3 | coverage/ 4 | .turbo 5 | node_modules 6 | coverage/ 7 | dist 8 | docs 9 | yarn-error.log 10 | out 11 | data/postgres 12 | *.tsbuildinfo -------------------------------------------------------------------------------- /packages/documentation/src/components/editor/nodes/nodes/generic/input/index.ts: -------------------------------------------------------------------------------- 1 | export { default as example0 } from '@site/src/components/editor/raw/nodes/generic/input/0.json'; 2 | -------------------------------------------------------------------------------- /packages/documentation/static/img/docusaurus-social-card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/documentation/static/img/docusaurus-social-card.jpg -------------------------------------------------------------------------------- /packages/graph-editor/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/graph-engine/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/graph-engine/src/graph/index.ts: -------------------------------------------------------------------------------- 1 | export * from './types.js'; 2 | export * from './topologicSort.js'; 3 | export * from './terminals.js'; 4 | export * from './graph.js'; 5 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/search/index.ts: -------------------------------------------------------------------------------- 1 | import findFirst from './findFirst.js'; 2 | import linear from './linear.js'; 3 | 4 | export const nodes = [linear, findFirst]; 5 | -------------------------------------------------------------------------------- /packages/migrations/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/nodes-audio/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/nodes-figma/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/nodes-fs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './nodes/index.js'; 2 | export * from './schemas/index.js'; 3 | export * from './ui/index.js'; 4 | export * from './capability/fs.js'; 5 | -------------------------------------------------------------------------------- /packages/nodes-previews/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/storybook-lit/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/ui/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md 12 | .next -------------------------------------------------------------------------------- /packages/ui/prisma/migrations/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" -------------------------------------------------------------------------------- /packages/vscode-extension/.vscode-test.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from '@vscode/test-cli'; 2 | 3 | export default defineConfig({ 4 | files: 'out/test/**/*.test.js', 5 | }); 6 | -------------------------------------------------------------------------------- /packages/documentation/src/components/editor/nodes/nodes/generic/constant/index.ts: -------------------------------------------------------------------------------- 1 | export { default as example0 } from '@site/src/components/editor/raw/nodes/generic/constant/0.json'; 2 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/nodes-image/src/ui/specifics/index.tsx: -------------------------------------------------------------------------------- 1 | import ImagePreview from "./image.js"; 2 | 3 | export const specifics = { 4 | 'studio.tokens.image.preview': ImagePreview, 5 | } 6 | -------------------------------------------------------------------------------- /packages/storybook-react/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md -------------------------------------------------------------------------------- /packages/vscode-example-workspace/assets/audio/CantinaBand3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/vscode-example-workspace/assets/audio/CantinaBand3.wav -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/node_modules/** 2 | .turbo 3 | dist 4 | jest-coverage 5 | docs 6 | out 7 | k8s 8 | data 9 | assets 10 | adrs 11 | .yarn 12 | 13 | developer-documentation 14 | **/.next -------------------------------------------------------------------------------- /packages/graph-editor/examples/barebones/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0 3 | } 4 | 5 | #graph-editor { 6 | height: 100vh; 7 | background: var(--color-neutral-canvas-minimal-bg) 8 | } -------------------------------------------------------------------------------- /packages/graph-editor/examples/defaults/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0 3 | } 4 | 5 | #graph-editor { 6 | height: 100vh; 7 | background: var(--color-neutral-canvas-minimal-bg) 8 | } -------------------------------------------------------------------------------- /packages/graph-editor/src/components/contextMenus/ContextMenuStyles.tsx: -------------------------------------------------------------------------------- 1 | import { Item } from 'react-contexify'; 2 | 3 | const ContextMenuItem = Item; 4 | 5 | export { ContextMenuItem }; 6 | -------------------------------------------------------------------------------- /packages/graph-editor/src/editor/actions/selectNode.tsx: -------------------------------------------------------------------------------- 1 | export const selectNode = (dispatch) => { 2 | return (id: string) => { 3 | dispatch.graph.setCurrentNode(id); 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/graph-editor/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useDispatch.js'; 2 | export * from './useGraph.js'; 3 | export * from './useLocalGraph.js'; 4 | export * from './useOpenPanel.js'; 5 | -------------------------------------------------------------------------------- /packages/nodes-audio/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './nodes/index.js'; 2 | export * from './schemas/index.js'; 3 | export * from './capabilities/web.js'; 4 | export * from './ui/index.js'; 5 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './nodes/index.js'; 2 | export * from './schemas/index.js'; 3 | export * from './ui/index.js'; 4 | export * from './utils/index.js'; 5 | -------------------------------------------------------------------------------- /packages/vscode-example-workspace/assets/audio/PinkPanther30.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokens-studio/graph-engine/HEAD/packages/vscode-example-workspace/assets/audio/PinkPanther30.wav -------------------------------------------------------------------------------- /packages/documentation/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | out/** 3 | build/** 4 | coverage/** 5 | storybook-static/** 6 | .docusaurus 7 | docs 8 | site 9 | cypress 10 | cli 11 | .rollup 12 | *.md -------------------------------------------------------------------------------- /packages/documentation/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/controls/interface.tsx: -------------------------------------------------------------------------------- 1 | import { Port } from '@tokens-studio/graph-engine'; 2 | export interface IField { 3 | port: Port; 4 | readOnly?: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /packages/nodes-image/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./nodes/index.js"; 2 | export * from "./schemas/index.js"; 3 | export * from "./capabilities/imageMagick.js"; 4 | export * from "./ui/index.js"; 5 | -------------------------------------------------------------------------------- /packages/vscode-extension/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | build/** 3 | coverage/** 4 | storybook-static/** 5 | .docusaurus 6 | docs 7 | site 8 | cypress 9 | cli 10 | .rollup 11 | *.md 12 | out/** -------------------------------------------------------------------------------- /packages/graph-editor/src/components/DndList.module.css: -------------------------------------------------------------------------------- 1 | .trigger { 2 | cursor: pointer; 3 | } 4 | 5 | .item { 6 | display: block; 7 | } 8 | 9 | .container { 10 | display: block; 11 | } -------------------------------------------------------------------------------- /packages/nodes-image/readme.md: -------------------------------------------------------------------------------- 1 | # Image Processing nodes 2 | 3 | This is an experimental package of image processing nodes that use a wasm converted version of [ImageMagick](https://imagemagick.org/) 4 | -------------------------------------------------------------------------------- /packages/ui/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/color/lib/spaces.ts: -------------------------------------------------------------------------------- 1 | import Color from 'colorjs.io'; 2 | 3 | export const ColorSpaces = Object.keys(Color.spaces); 4 | export type ColorSpace = keyof typeof Color.spaces; 5 | -------------------------------------------------------------------------------- /packages/graph-engine/src/programmatic/index.ts: -------------------------------------------------------------------------------- 1 | export * from './input.js'; 2 | export * from './node.js'; 3 | export * from './edge.js'; 4 | export * from './output.js'; 5 | export * from './port.js'; 6 | -------------------------------------------------------------------------------- /packages/nodes-image/src/schemas/types.ts: -------------------------------------------------------------------------------- 1 | import { MagickReadSettings } from "@imagemagick/magick-wasm"; 2 | 3 | export type Image = { 4 | data: Uint8Array; 5 | settings?: MagickReadSettings; 6 | }; 7 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/toolbar/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './toolbar.js'; 2 | export * from './buttons/index.js'; 3 | export * from './dropdowns/index.js'; 4 | export * from './groups/index.js'; 5 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/src/nodes/arrays/index.ts: -------------------------------------------------------------------------------- 1 | import GroupArrayNode from './group.js'; 2 | import UngroupArrayNode from './ungroup.js'; 3 | 4 | export const nodes = [GroupArrayNode, UngroupArrayNode]; 5 | -------------------------------------------------------------------------------- /packages/ui/src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.svg' { 2 | export = { 3 | blurHeight: number, 4 | blurWidth: number, 5 | height: number, 6 | src: string, 7 | width: number 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /packages/documentation/babel.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | module.exports = { 3 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 4 | plugins: ['@babel/plugin-syntax-import-attributes'] 5 | }; 6 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/toolbar/dropdowns/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './add.js'; 2 | export * from './align.js'; 3 | export * from './help.js'; 4 | export * from './layout.js'; 5 | export * from './zoom.js'; 6 | -------------------------------------------------------------------------------- /packages/migrations/src/migrations/types.ts: -------------------------------------------------------------------------------- 1 | import type { SerializedGraph } from '@tokens-studio/graph-engine'; 2 | 3 | export type UpgradeFunction = ( 4 | graph: SerializedGraph 5 | ) => Promise; 6 | -------------------------------------------------------------------------------- /packages/nodes-figma/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | include: ['tests/**/*.test.[jt]s?(x)'], 6 | globals: true 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/ui/prometheus.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 'otel-collector' 3 | scrape_interval: 10s 4 | static_configs: 5 | - targets: ['otel-collector:8889'] 6 | - targets: ['otel-collector:8888'] -------------------------------------------------------------------------------- /data/prometheus/prometheus.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 'otel-collector' 3 | scrape_interval: 10s 4 | static_configs: 5 | - targets: ['otel-collector:8889'] 6 | - targets: ['otel-collector:8888'] -------------------------------------------------------------------------------- /packages/graph-editor/cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } 6 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | include: ['tests/**/*.test.[jt]s?(x)'], 6 | globals: true 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/migrations/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root:true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/nodes-audio/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/nodes-figma/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root:true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/nodes-fs/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root:true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/nodes-image/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/documentation/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/documentation/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | site 7 | cli 8 | .turbo 9 | .rollup.cache 10 | .rollup 11 | build 12 | storybook-static 13 | .docusaurus 14 | cypress -------------------------------------------------------------------------------- /packages/documentation/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@docusaurus/tsconfig", 4 | "compilerOptions": { 5 | "baseUrl": "." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/graph-engine/src/schemas/operators.ts: -------------------------------------------------------------------------------- 1 | export enum Operator { 2 | EQUAL = '==', 3 | NOT_EQUAL = '!=', 4 | GREATER_THAN = '>', 5 | LESS_THAN = '<', 6 | GREATER_THAN_OR_EQUAL = '>=', 7 | LESS_THAN_OR_EQUAL = '<=' 8 | } 9 | -------------------------------------------------------------------------------- /packages/nodes-fs/tsconfig.docs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["src/**/*"], 7 | "exclude": ["node_modules", "**/*.test.ts", "cypress/**"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/nodes-previews/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root:true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/nodes-previews/readme.md: -------------------------------------------------------------------------------- 1 | # @tokens-studio/graph-engine-nodes-preview 2 | 3 | This is an example of how to implement a preview system with the graph-editor to show reactive previews outside of the editor canvas in panels. 4 | -------------------------------------------------------------------------------- /packages/storybook-lit/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root:true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/storybook-react/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root:true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/ui/src/types/IExample.tsx: -------------------------------------------------------------------------------- 1 | import type { SerializedGraph } from '@tokens-studio/graph-engine'; 2 | export interface IExample { 3 | title: string; 4 | description: string; 5 | file: SerializedGraph; 6 | key: string; 7 | } 8 | -------------------------------------------------------------------------------- /packages/graph-engine/tsconfig.docs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["src/**/*"], 7 | "exclude": ["node_modules", "**/*.test.ts", "cypress/**"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/nodes-audio/tsconfig.docs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["src/**/*"], 7 | "exclude": ["node_modules", "**/*.test.ts", "cypress/**"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root:true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')] 6 | }; -------------------------------------------------------------------------------- /packages/nodes-design-tokens/src/ui/nodes/index.tsx: -------------------------------------------------------------------------------- 1 | import TypographyPreview from './typography.js'; 2 | 3 | export const specifics = { 4 | 'studio.tokens.preview.typography': TypographyPreview 5 | }; 6 | 7 | export default specifics; 8 | -------------------------------------------------------------------------------- /packages/nodes-figma/tsconfig.docs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["src/**/*"], 7 | "exclude": ["node_modules", "**/*.test.ts", "cypress/**"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/nodes-previews/tsconfig.docs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["src/**/*"], 7 | "exclude": ["node_modules", "**/*.test.ts", "cypress/**"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/preview/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './colorCompare.js'; 2 | export * from './colorContrast.js'; 3 | export * from './colorScale.js'; 4 | export * from './mathExpression.js'; 5 | export * from './swatch.js'; 6 | -------------------------------------------------------------------------------- /packages/graph-editor/src/redux/selectors/index.ts: -------------------------------------------------------------------------------- 1 | export * from './graph.js'; 2 | export * from './refs.js'; 3 | export * from './roots.js'; 4 | export * from './registry.js'; 5 | export * from './settings.js'; 6 | export * from './ui.js'; 7 | -------------------------------------------------------------------------------- /packages/graph-editor/src/types/index.ts: -------------------------------------------------------------------------------- 1 | import { TokenType } from '../utils/index.js'; 2 | 3 | export type Token = { 4 | name: string; 5 | value: unknown; 6 | type: TokenType; 7 | }; 8 | 9 | export * from './controls.js'; 10 | -------------------------------------------------------------------------------- /packages/graph-editor/src/types/serializedNode.tsx: -------------------------------------------------------------------------------- 1 | import { Node as FlowNode } from 'reactflow'; 2 | import { Node } from '@tokens-studio/graph-engine'; 3 | 4 | export type SerializedNode = { 5 | engine?: Node; 6 | editor: FlowNode; 7 | }; 8 | -------------------------------------------------------------------------------- /packages/nodes-audio/src/ui/index.tsx: -------------------------------------------------------------------------------- 1 | import { NODE } from '../schemas/index.js'; 2 | import React from 'react'; 3 | import SoundHigh from '@tokens-studio/icons/SoundHigh.js'; 4 | 5 | export const icons = { 6 | [NODE]: 7 | }; 8 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/tsconfig.docs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["src/**/*"], 7 | "exclude": ["node_modules", "**/*.test.ts", "cypress/**"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/nodes-fs/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/graph-editor/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/graph-editor/src/components/flow/types.tsx: -------------------------------------------------------------------------------- 1 | //These are custom node types only used in the POC, so we can ignore them for now. 2 | export const enum NodeTypes { 3 | GROUP = 'studio_tokens_group', 4 | NOTE = 'studio_tokens_note', 5 | } 6 | -------------------------------------------------------------------------------- /packages/graph-editor/src/utils/pluralizeValue.ts: -------------------------------------------------------------------------------- 1 | function pluralizeValue(value: number, singular: string, plural?: string) { 2 | return `${value} ${plural ?? singular + (value !== 1 ? 's' : '')}`; 3 | } 4 | 5 | export default pluralizeValue; 6 | -------------------------------------------------------------------------------- /packages/graph-engine/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/migrations/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/nodes-audio/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/nodes-figma/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/nodes-image/tsconfig.docs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.prod.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["src/**/*"], 7 | "exclude": ["node_modules", "**/*.test.ts", "cypress/**"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/storybook-lit/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/ui/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress 16 | .next -------------------------------------------------------------------------------- /packages/graph-editor/src/hooks/useDispatch.ts: -------------------------------------------------------------------------------- 1 | import { Dispatch } from '../redux/store.js'; 2 | import { useDispatch as ReduxDispatch } from 'react-redux'; 3 | export const useDispatch = () => { 4 | return ReduxDispatch() as T; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/nodes-fs/readme.md: -------------------------------------------------------------------------------- 1 | # @tokens-studio/graph-engine-nodes-fs 2 | 3 | These are experiemental nodes to interact with a file system. The nodes rely on an external system to fulfill the interface required of for the `fs` capability that is exported 4 | -------------------------------------------------------------------------------- /packages/nodes-fs/tests/smoke.test.ts: -------------------------------------------------------------------------------- 1 | import * as lib from '../src/index.js'; 2 | import { describe, expect, test } from 'vitest'; 3 | 4 | describe('smoke', () => { 5 | test('nodes exist', () => { 6 | expect(lib.nodes).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/nodes-previews/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/storybook-react/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/vscode-extension/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/graph-engine/src/constants.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The version of the current package, used to aid with migrations. 3 | * Note this needs to be updated in accordance with changes to internal engine data structures. 4 | */ 5 | export const VERSION = '0.12.0'; 6 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/color/lib/transparentize.ts: -------------------------------------------------------------------------------- 1 | import Color from 'colorjs.io'; 2 | 3 | export function transparentize(color: Color, amount: number): Color { 4 | color.alpha = Math.max(0, Math.min(1, Number(amount))); 5 | return color; 6 | } 7 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | dist 4 | coverage 5 | docs 6 | jest-coverage 7 | site 8 | cli 9 | .turbo 10 | .rollup.cache 11 | .rollup 12 | build 13 | storybook-static 14 | .docusaurus 15 | cypress -------------------------------------------------------------------------------- /packages/nodes-previews/tests/smoke.test.ts: -------------------------------------------------------------------------------- 1 | import * as lib from '../src/index.js'; 2 | import { describe, expect, test } from 'vitest'; 3 | 4 | describe('smoke', () => { 5 | test('nodes exist', () => { 6 | expect(lib.nodes).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/ui/src/api/sdk/index.ts: -------------------------------------------------------------------------------- 1 | import { contract } from '../contracts/index.ts'; 2 | import { initQueryClient } from '@ts-rest/react-query'; 3 | 4 | export const client = initQueryClient(contract, { 5 | baseUrl: '/api/v1', 6 | baseHeaders: {} 7 | }); 8 | -------------------------------------------------------------------------------- /packages/documentation/src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /packages/graph-editor/src/ids.ts: -------------------------------------------------------------------------------- 1 | export const INPUT = 'studio.tokens.generic.input'; 2 | export const OUTPUT = 'studio.tokens.generic.output'; 3 | export const PASSTHROUGH = 'studio.tokens.generic.passthrough'; 4 | export const NOTE = 'studio.tokens.generic.note'; 5 | -------------------------------------------------------------------------------- /packages/nodes-image/vite.config.mts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vitest/config'; 3 | 4 | export default defineConfig({ 5 | test: { 6 | include: ['tests/**/*.test.[jt]s?(x)'], 7 | globals: true 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/documentation/src/theme/MDXPage/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | // import MDXPage from '@theme-original/MDXPage'; 3 | 4 | export default function MDXPageWrapper() { 5 | return
{/* */}
; 6 | } 7 | -------------------------------------------------------------------------------- /.gimlet/k8s/graph-engine/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: onechart 3 | repository: https://chart.onechart.dev 4 | version: 0.69.0 5 | digest: sha256:e316a6ef6f1d10c0e224c6b6f82cd2387102433491814a9b2cbe44ad315c9499 6 | generated: "2024-07-09T22:52:55.5774121+02:00" 7 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/css/index.ts: -------------------------------------------------------------------------------- 1 | import accessibleClamp from './accessibleClamp.js'; 2 | import box from './box.js'; 3 | import cssFunction from './cssFunction.js'; 4 | import map from './map.js'; 5 | 6 | export const nodes = [box, accessibleClamp, cssFunction, map]; 7 | -------------------------------------------------------------------------------- /packages/nodes-fs/src/schemas/index.ts: -------------------------------------------------------------------------------- 1 | import { SchemaObject } from '@tokens-studio/graph-engine'; 2 | 3 | export const FILE = 'https://schemas.tokens.studio/fs/file.json'; 4 | export const FileSchema: SchemaObject = { 5 | $id: FILE, 6 | title: 'File', 7 | type: 'object' 8 | }; 9 | -------------------------------------------------------------------------------- /packages/prettier-config-custom/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: 'none', 4 | tabWidth: 2, 5 | bracketSpacing: true, 6 | useTabs: true, 7 | arrowParens: 'avoid', 8 | jsxSingleQuote: true, 9 | singleQuote: true, 10 | endOfLine: 'lf' 11 | }; 12 | -------------------------------------------------------------------------------- /packages/ui/src/api/utils/types.ts: -------------------------------------------------------------------------------- 1 | import { type Session } from 'next-auth'; 2 | import { TsRestRequest } from '@ts-rest/serverless'; 3 | 4 | export type Context = { 5 | session: Session; 6 | user: string; 7 | }; 8 | 9 | export type ExtendedRequest = TsRestRequest & Context; 10 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/contextMenus/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './ContextMenuStyles.js'; 2 | export * from './edgeContextMenu.js'; 3 | export * from './nodeContextMenu.js'; 4 | export * from './paneContextMenu.js'; 5 | export { SelectionContextMenu } from './selectionContextMenu.js'; 6 | -------------------------------------------------------------------------------- /packages/ui/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')], 6 | rules: { 7 | "@typescript-eslint/no-explicit-any": "off" 8 | }, 9 | }; -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | // This tells ESLint to load the config from the package `@tokens-studio/eslint-config-custom` 4 | extends: ['@tokens-studio/eslint-config-custom'], 5 | settings: { 6 | next: { 7 | rootDir: ['packages/*/'] 8 | } 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/controls/withVariadicField.module.css: -------------------------------------------------------------------------------- 1 | .dndList { 2 | display: flex; 3 | flex-direction: column; 4 | gap: var(--component-spacing-md); 5 | } 6 | 7 | .dndItem { 8 | display: flex; 9 | gap: var(--component-spacing-sm); 10 | align-items: center; 11 | } -------------------------------------------------------------------------------- /packages/nodes-fs/src/ui/index.tsx: -------------------------------------------------------------------------------- 1 | import { FILE } from '../schemas/index.js'; 2 | import EmptyPage from '@tokens-studio/icons/EmptyPage.js'; 3 | import React from 'react'; 4 | 5 | export const icons = { 6 | [FILE]: 7 | }; 8 | 9 | export { controls } from './controls/index.js'; 10 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/knight-dim.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--knight-dim { 6 | --colorsPrimary: #2653BB; 7 | --colorsText: #333333; 8 | --colorsBg: #cccccc; 9 | --borderRadiusRounded: 1em; 10 | } 11 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/ninja-dark.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--ninja-dark { 6 | --colorsPrimary: #13ADAD; 7 | --colorsText: #ffffff; 8 | --colorsBg: #000000; 9 | --borderRadiusRounded: 4px; 10 | } 11 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/ninja-dim.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--ninja-dim { 6 | --colorsPrimary: #13ADAD; 7 | --colorsText: #333333; 8 | --colorsBg: #cccccc; 9 | --borderRadiusRounded: 4px; 10 | } 11 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/samurai-dim.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--samurai-dim { 6 | --colorsPrimary: #17D617; 7 | --colorsText: #333333; 8 | --colorsBg: #cccccc; 9 | --borderRadiusRounded: 0; 10 | } 11 | -------------------------------------------------------------------------------- /packages/vscode-extension/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')], 6 | env: { 7 | browser: true, 8 | node: true 9 | } 10 | }; -------------------------------------------------------------------------------- /packages/graph-editor/src/hooks/useGraph.ts: -------------------------------------------------------------------------------- 1 | import { Graph } from '@tokens-studio/graph-engine'; 2 | import { graphSelector } from '@/redux/selectors/graph.js'; 3 | import { useSelector } from 'react-redux'; 4 | export const useGraph = (): Graph | undefined => { 5 | return useSelector(graphSelector); 6 | }; 7 | -------------------------------------------------------------------------------- /packages/graph-engine/src/graph/interfaces.ts: -------------------------------------------------------------------------------- 1 | export interface ILogger { 2 | log: (message: any) => void; 3 | error: (message: any) => void; 4 | warn: (message: any) => void; 5 | } 6 | 7 | export const baseLogger: ILogger = { 8 | log: () => {}, 9 | error: () => {}, 10 | warn: () => {} 11 | }; 12 | -------------------------------------------------------------------------------- /packages/graph-engine/vitest.config.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vite'; 3 | import tsconfigPaths from 'vite-tsconfig-paths'; 4 | 5 | export default defineConfig({ 6 | test: { 7 | // ... Specify options here. 8 | }, 9 | plugins: [tsconfigPaths()] 10 | }); 11 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/knight-dark.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--knight-dark { 6 | --colorsPrimary: #2653BB; 7 | --colorsText: #ffffff; 8 | --colorsBg: #000000; 9 | --borderRadiusRounded: 1em; 10 | } 11 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/knight-light.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--knight-light { 6 | --colorsPrimary: #2653BB; 7 | --colorsText: #000000; 8 | --colorsBg: #ffffff; 9 | --borderRadiusRounded: 1em; 10 | } 11 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/ninja-light.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--ninja-light { 6 | --colorsPrimary: #13ADAD; 7 | --colorsText: #000000; 8 | --colorsBg: #ffffff; 9 | --borderRadiusRounded: 4px; 10 | } 11 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/samurai-dark.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--samurai-dark { 6 | --colorsPrimary: #17D617; 7 | --colorsText: #ffffff; 8 | --colorsBg: #000000; 9 | --borderRadiusRounded: 0; 10 | } 11 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/samurai-light.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Do not edit directly, this file was auto-generated 3 | */ 4 | 5 | .button--samurai-light { 6 | --colorsPrimary: #17D617; 7 | --colorsText: #000000; 8 | --colorsBg: #ffffff; 9 | --borderRadiusRounded: 0; 10 | } 11 | -------------------------------------------------------------------------------- /packages/ui/src/app/api-docs/page.tsx: -------------------------------------------------------------------------------- 1 | import 'swagger-ui-react/swagger-ui.css'; 2 | import { openApiDocument } from '@/api/index.ts'; 3 | import SwaggerUI from 'swagger-ui-react'; 4 | 5 | const ApiDoc = () => { 6 | return ; 7 | }; 8 | 9 | export default ApiDoc; 10 | -------------------------------------------------------------------------------- /packages/ui/src/types/graph-engine-migration.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@tokens-studio/graph-engine-migration' { 2 | import { SerializedGraph } from '@tokens-studio/graph-engine'; 3 | export function updateGraph( 4 | graph: SerializedGraph, 5 | opts?: { verbose?: boolean } 6 | ): Promise; 7 | } 8 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/panels/debugger/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { Debugger } from '@/components/debugger/index.js'; 4 | import { debugInfo } from '../../debugger/data.js'; 5 | 6 | export const DebugPanel = () => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/storybook-react/readme.md: -------------------------------------------------------------------------------- 1 | # Storybook 2 | 3 | This is a toy example showing how component level theming can work. 4 | 5 | You will need to run `npm run dev` first before running `npm run storybook`. 6 | 7 | This will extract information from your `*.graph.json` files and autogenerate token themeing for you. 8 | -------------------------------------------------------------------------------- /packages/ui/src/assets/svgs/code-3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /packages/vscode-extension/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/** 4 | node_modules/** 5 | src/** 6 | app/** 7 | .gitignore 8 | .yarnrc 9 | esbuild.js 10 | vite.config.ts 11 | vsc-extension-quickstart.md 12 | **/tsconfig.json 13 | **/.eslintrc.json 14 | **/*.map 15 | **/*.ts 16 | **/.vscode-test.* 17 | -------------------------------------------------------------------------------- /packages/graph-editor/.storybook/preview-body.html: -------------------------------------------------------------------------------- 1 | 11 | 12 |
-------------------------------------------------------------------------------- /packages/graph-editor/cypress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["es5", "dom"], 5 | "types": [ 6 | "@4tw/cypress-drag-drop", 7 | "cypress", 8 | "node", 9 | "cypress-react-selector" 10 | ] 11 | }, 12 | "include": ["**/*.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/logic/index.ts: -------------------------------------------------------------------------------- 1 | import and from './and.js'; 2 | import compare from './compare.js'; 3 | import ifNode from './if.js'; 4 | import not from './not.js'; 5 | import or from './or.js'; 6 | import switchNode from './switch.js'; 7 | 8 | export const nodes = [and, compare, ifNode, not, or, switchNode]; 9 | -------------------------------------------------------------------------------- /packages/nodes-image/src/schemas/index.ts: -------------------------------------------------------------------------------- 1 | import { SchemaObject } from "@tokens-studio/graph-engine"; 2 | 3 | export const IMAGE = "https://schemas.tokens.studio/image/image.json"; 4 | export const ImageSchema: SchemaObject = { 5 | $id: IMAGE, 6 | title: "Image", 7 | type: "object", 8 | default: null, 9 | }; 10 | -------------------------------------------------------------------------------- /packages/storybook-lit/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | 3 | // https://vitejs.dev/config/ 4 | export default defineConfig({ 5 | build: { 6 | lib: { 7 | entry: '.storybook/main.ts', 8 | formats: ['es'] 9 | }, 10 | rollupOptions: { 11 | external: /^lit/ 12 | } 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /packages/graph-editor/cypress/e2e/smoke.cy.ts: -------------------------------------------------------------------------------- 1 | context('Smoke', () => { 2 | it('can load the page', () => { 3 | cy.visit('/'); 4 | cy.waitForReact(2000); 5 | cy.react('Editor').should('exist'); 6 | cy.react('DropPanel').should('exist'); 7 | cy.react('GraphToolbar').should('exist'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/storybook-react/.storybook/preview-body.html: -------------------------------------------------------------------------------- 1 | 11 | 12 |
-------------------------------------------------------------------------------- /packages/vscode-example-workspace/.tsgraphrc: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "assets": { 4 | "path": "assets" 5 | }, 6 | "nodes": { 7 | "path": "nodes" 8 | }, 9 | "metadata": { 10 | "path": "metadata.json" 11 | }, 12 | "server": { 13 | "port": 3123 14 | } 15 | } -------------------------------------------------------------------------------- /packages/documentation/docs/authors.yml: -------------------------------------------------------------------------------- 1 | SorsOps: 2 | name: SorsOps 3 | title: Creator of the Graph Engine 4 | url: https://github.com/SorsOps 5 | image_url: https://github.com/SorsOps.png 6 | Mck: 7 | name: MCK 8 | title: Graph architect expert 9 | url: https://github.com/mck 10 | image_url: https://github.com/mck.png -------------------------------------------------------------------------------- /packages/vscode-extension/src/types/graph-engine-migration.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@tokens-studio/graph-engine-migration' { 2 | import { SerializedGraph } from '@tokens-studio/graph-engine'; 3 | export function updateGraph( 4 | graph: SerializedGraph, 5 | opts?: { verbose?: boolean }, 6 | ): Promise; 7 | } 8 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/flow/edges/types.tsx: -------------------------------------------------------------------------------- 1 | import { Position } from '@reactflow/core'; 2 | import type { HTMLAttributes } from 'react'; 3 | 4 | export type EdgeToolbarProps = HTMLAttributes & { 5 | edgeId: string; 6 | isVisible?: boolean; 7 | position?: Position; 8 | offset?: number; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/nodes-fs/src/ui/controls/index.tsx: -------------------------------------------------------------------------------- 1 | import { FILE } from '../../schemas/index.js'; 2 | import { FileField } from './file.js'; 3 | import type { Port } from '@tokens-studio/graph-engine'; 4 | 5 | export const controls = [ 6 | { 7 | matcher: (port: Port) => port.type.$id === FILE, 8 | component: FileField 9 | } 10 | ]; 11 | -------------------------------------------------------------------------------- /packages/vscode-extension/src/nonce.ts: -------------------------------------------------------------------------------- 1 | export function getNonce() { 2 | let text = ''; 3 | const possible = 4 | 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; 5 | for (let i = 0; i < 32; i++) { 6 | text += possible.charAt(Math.floor(Math.random() * possible.length)); 7 | } 8 | return text; 9 | } 10 | -------------------------------------------------------------------------------- /.vscode/app-monorepo.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "name": "✨ @tokens-studio/graph-engine-monorepo", 5 | "path": ".." 6 | }, 7 | { 8 | "name": "📦 tokens-studio-graph-engine", 9 | "path": "../packages/vscode-extension" 10 | } 11 | ], 12 | "settings": { 13 | "adrManager.adrDirectory": "adrs" 14 | } 15 | } -------------------------------------------------------------------------------- /packages/graph-editor/src/editor/actions/clear.ts: -------------------------------------------------------------------------------- 1 | import { Graph } from '@tokens-studio/graph-engine'; 2 | import { ReactFlowInstance } from 'reactflow'; 3 | 4 | export const clear = (reactFlowInstance: ReactFlowInstance, graph: Graph) => { 5 | graph.clear(); 6 | reactFlowInstance.setNodes([]); 7 | reactFlowInstance.setEdges([]); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/graph-engine/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export enum ContrastAlgorithm { 2 | WCAG21 = 'WCAG21', 3 | APCA = 'APCA', 4 | Weber = 'Weber', 5 | Michelson = 'Michelson', 6 | Lstar = 'Lstar', 7 | DeltaPhi = 'DeltaPhi' 8 | } 9 | 10 | export enum ValueSnapMethod { 11 | Floor = 'Floor', 12 | Round = 'Round', 13 | Ceil = 'Ceil' 14 | } 15 | -------------------------------------------------------------------------------- /packages/graph-engine/src/utils/precision.ts: -------------------------------------------------------------------------------- 1 | export function setToPrecision(value: number, precision: number) { 2 | const shift = 10 ** precision; 3 | return Math.round(value * shift) / shift; 4 | } 5 | 6 | export function getDecimalCount(value: number) { 7 | return value == 0 ? 0 : Math.max(0, -Math.floor(Math.log10(Math.abs(value)))); 8 | } 9 | -------------------------------------------------------------------------------- /packages/vscode-extension/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dbaeumer.vscode-eslint", 6 | "connor4312.esbuild-problem-matchers", 7 | "ms-vscode.extension-test-runner" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/styles/index.css: -------------------------------------------------------------------------------- 1 | @import './samurai-light.css'; 2 | @import './samurai-dark.css'; 3 | @import './samurai-dim.css'; 4 | @import './knight-light.css'; 5 | @import './knight-dark.css'; 6 | @import './knight-dim.css'; 7 | @import './ninja-light.css'; 8 | @import './ninja-dark.css'; 9 | @import './ninja-dim.css'; -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } 3 | git lfs pre-push "$@" 4 | -------------------------------------------------------------------------------- /packages/nodes-image/src/ui/index.tsx: -------------------------------------------------------------------------------- 1 | import { IMAGE } from '../schemas/index.js'; 2 | import MediaImage from '@tokens-studio/icons/MediaImage.js'; 3 | import React from 'react'; 4 | 5 | export const icons = { 6 | [IMAGE]: 7 | } 8 | 9 | export { controls } from './controls/index.js' 10 | export { specifics } from './specifics/index.js' -------------------------------------------------------------------------------- /packages/nodes-fs/src/ui/controls/file.tsx: -------------------------------------------------------------------------------- 1 | import { Text } from '@tokens-studio/ui/Text.js'; 2 | import { observer } from 'mobx-react-lite'; 3 | import React from 'react'; 4 | import type { IField } from '@tokens-studio/graph-editor'; 5 | 6 | export const FileField = observer(({ port }: IField) => { 7 | return {port.value ? 'None' : ''}; 8 | }); 9 | -------------------------------------------------------------------------------- /packages/nodes-fs/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "tsconfig": "./tsconfig.docs.json", 4 | "entryPoints": ["./src/index.ts", "./src/nodes/**/*.ts"], 5 | "externalPattern": [ 6 | "**/node_modules/**", 7 | "src/nodes/*+(index|.spec|.e2e).ts" 8 | ], 9 | "excludeExternals": true, 10 | "cleanOutputDir": true 11 | } 12 | -------------------------------------------------------------------------------- /packages/ui/src/components/container/index.tsx: -------------------------------------------------------------------------------- 1 | import { Stack } from '@tokens-studio/ui/Stack.js'; 2 | import styles from './layout.module.css'; 3 | 4 | export const Container = ({ children }) => { 5 | return ( 6 | 7 |
{children}
8 |
9 | ); 10 | }; 11 | -------------------------------------------------------------------------------- /.husky/post-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } 3 | git lfs post-commit "$@" 4 | -------------------------------------------------------------------------------- /.husky/post-merge: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } 3 | git lfs post-merge "$@" 4 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | services: 3 | 4 | postgresql: 5 | image: postgres:13 6 | environment: 7 | POSTGRES_USER: ${POSTGRES_USER} 8 | POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} 9 | POSTGRES_DB: ${POSTGRES_DB} 10 | ports: 11 | - "5432:5432" 12 | volumes: 13 | - ./data/postgres:/var/lib/postgresql/data 14 | -------------------------------------------------------------------------------- /packages/documentation/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | !docs 7 | 8 | # Generated files 9 | .docusaurus 10 | .cache-loader 11 | 12 | # Misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/controls/color.module.css: -------------------------------------------------------------------------------- 1 | .colorButton { 2 | all: unset; 3 | cursor: pointer; 4 | border-radius: var(--component-radii-sm); 5 | width: 26px; 6 | height: 26px; 7 | outline: 1px solid var(--stroke-default); 8 | flex-shrink: 0; 9 | } 10 | 11 | .colorButton:hover { 12 | outline: 1px solid var(--stroke-default); 13 | } -------------------------------------------------------------------------------- /packages/graph-editor/src/redux/selectors/refs.ts: -------------------------------------------------------------------------------- 1 | import { MutableRefObject } from 'react'; 2 | import { createSelector } from 'reselect'; 3 | import { refs } from './roots.js'; 4 | import type { DockLayout } from 'rc-dock'; 5 | 6 | export const dockerSelector = createSelector( 7 | refs, 8 | (state) => state.docker as MutableRefObject, 9 | ); 10 | -------------------------------------------------------------------------------- /packages/graph-engine/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "tsconfig": "./tsconfig.docs.json", 4 | "entryPoints": ["./src/index.ts", "./src/nodes/**/*.ts"], 5 | "externalPattern": [ 6 | "**/node_modules/**", 7 | "src/nodes/*+(index|.spec|.e2e).ts" 8 | ], 9 | "excludeExternals": true, 10 | "cleanOutputDir": true 11 | } 12 | -------------------------------------------------------------------------------- /packages/nodes-audio/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "tsconfig": "./tsconfig.docs.json", 4 | "entryPoints": ["./src/index.ts", "./src/nodes/**/*.ts"], 5 | "externalPattern": [ 6 | "**/node_modules/**", 7 | "src/nodes/*+(index|.spec|.e2e).ts" 8 | ], 9 | "excludeExternals": true, 10 | "cleanOutputDir": true 11 | } 12 | -------------------------------------------------------------------------------- /packages/nodes-figma/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "tsconfig": "./tsconfig.docs.json", 4 | "entryPoints": ["./src/index.ts", "./src/nodes/**/*.ts"], 5 | "externalPattern": [ 6 | "**/node_modules/**", 7 | "src/nodes/*+(index|.spec|.e2e).ts" 8 | ], 9 | "excludeExternals": true, 10 | "cleanOutputDir": true 11 | } 12 | -------------------------------------------------------------------------------- /packages/nodes-previews/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "tsconfig": "./tsconfig.docs.json", 4 | "entryPoints": ["./src/index.ts", "./src/nodes/**/*.ts"], 5 | "externalPattern": [ 6 | "**/node_modules/**", 7 | "src/nodes/*+(index|.spec|.e2e).ts" 8 | ], 9 | "excludeExternals": true, 10 | "cleanOutputDir": true 11 | } 12 | -------------------------------------------------------------------------------- /.husky/post-checkout: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } 3 | git lfs post-checkout "$@" 4 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.js": ["eslint --resolve-plugins-relative-to . --fix", "prettier --write"], 3 | "*.tsx": ["eslint --resolve-plugins-relative-to . --fix", "prettier --write"], 4 | "*.ts": ["eslint --resolve-plugins-relative-to . --fix", "prettier --write"], 5 | "*.md": ["prettier --write"], 6 | "package.json": ["npx prettier-package-json --write package.json"] 7 | } -------------------------------------------------------------------------------- /packages/graph-editor/src/components/curveEditor/override.css: -------------------------------------------------------------------------------- 1 | .MafsView { 2 | 3 | 4 | --mafs-fg: var(--color-accent-base); 5 | --mafs-bg: var(--color-neutral-canvas-subtle-bg); 6 | --mafs-origin-color: var(--color-neutral-canvas-minimal-fg-default); 7 | --mafs-line-color: var(--stroke-default); 8 | --grid-line-subdivision-color: var(--stroke-subtle); 9 | } -------------------------------------------------------------------------------- /packages/nodes-design-tokens/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "tsconfig": "./tsconfig.docs.json", 4 | "entryPoints": ["./src/index.ts", "./src/nodes/**/*.ts"], 5 | "externalPattern": [ 6 | "**/node_modules/**", 7 | "src/nodes/*+(index|.spec|.e2e).ts" 8 | ], 9 | "excludeExternals": true, 10 | "cleanOutputDir": true 11 | } 12 | -------------------------------------------------------------------------------- /packages/ui/src/api/sdk/getServerClient.ts: -------------------------------------------------------------------------------- 1 | import { QueryClient } from '@tanstack/query-core'; 2 | 3 | //Always make a new server client each time to prevent data leaking between requests 4 | export const getServerClient = () => { 5 | return new QueryClient({ 6 | defaultOptions: { 7 | queries: { 8 | staleTime: 60 * 1000 9 | } 10 | } 11 | }); 12 | }; 13 | -------------------------------------------------------------------------------- /packages/ui/src/app/page.tsx: -------------------------------------------------------------------------------- 1 | import { auth } from '@/auth/index.ts'; 2 | import { redirect } from 'next/navigation.js'; 3 | import IndexPage from '@/components/pages/index.tsx'; 4 | 5 | export default async function Index() { 6 | const session = await auth(); 7 | if (session?.user) { 8 | return redirect('/editor'); 9 | } 10 | 11 | return ; 12 | } 13 | -------------------------------------------------------------------------------- /packages/ui/src/components/container/layout.module.css: -------------------------------------------------------------------------------- 1 | .container { 2 | position: relative; 3 | width: 100%; 4 | height: 100%; 5 | overflow: auto; 6 | background: var(--color-neutral-canvas-minimal-bg); 7 | padding-top: var(--component-spacing-2xl); 8 | } 9 | 10 | .holder{ 11 | padding: var(--component-spacing-2xl); 12 | width: 80%; 13 | } -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # Used by docker-compose 2 | POSTGRES_USER=test 3 | POSTGRES_PASSWORD=insecurePassword 4 | POSTGRES_DB=graphengine 5 | 6 | # Whether open telemetry is enabled 7 | OTEL_ENABLED= 8 | OTEL_SERVICE_NAME=graph-engine 9 | OTELCOL_IMG=otel/opentelemetry-collector:0.67.0 10 | # Nodemailer settings 11 | EMAIL_SERVER=smtp://localhost:1025 12 | EMAIL_FROM=noreply@example.com 13 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/controls/variadicColor.module.css: -------------------------------------------------------------------------------- 1 | .colorButton { 2 | all: unset; 3 | cursor: pointer; 4 | border-radius: var(--component-radii-sm); 5 | width: 16px; 6 | height: 16px; 7 | outline: 1px solid var(--stroke-subtle); 8 | flex-shrink: 0; 9 | } 10 | 11 | .colorButton:hover { 12 | outline: 1px solid var(--stroke-default); 13 | } -------------------------------------------------------------------------------- /packages/nodes-audio/src/nodes/base.ts: -------------------------------------------------------------------------------- 1 | import { Node } from '@tokens-studio/graph-engine'; 2 | export class AudioBaseNode extends Node { 3 | //All audio nodes need the web-audio capability 4 | static annotations = { 5 | 'engine.capability.web-audio': true 6 | }; 7 | getAudioCtx(): AudioContext { 8 | return this.getGraph().capabilities['web-audio']; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/nodes-image/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "tsconfig": "./tsconfig.docs.json", 4 | "entryPoints": ["./src/index.ts", "./src/nodes/**/*.ts"], 5 | "externalPattern": [ 6 | "**/node_modules/**", 7 | "src/nodes/*+(index|.spec|.e2e).ts" 8 | ], 9 | "excludeExternals": true, 10 | "cleanOutputDir": true 11 | } 12 | -------------------------------------------------------------------------------- /packages/nodes-previews/src/color/scale/panel.module.css: -------------------------------------------------------------------------------- 1 | .scale { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | justify-content: center; 6 | overflow: auto; 7 | height: 100%; 8 | } 9 | 10 | .swatch { 11 | display: flex; 12 | align-items: center; 13 | justify-content: center; 14 | width: 100%; 15 | min-height: 80px; 16 | } -------------------------------------------------------------------------------- /packages/storybook-lit/.storybook/preview.ts: -------------------------------------------------------------------------------- 1 | import type { Preview } from '@storybook/web-components'; 2 | 3 | const preview: Preview = { 4 | parameters: { 5 | actions: { argTypesRegex: '^on[A-Z].*' }, 6 | controls: { 7 | matchers: { 8 | color: /(background|color)$/i, 9 | date: /Date$/ 10 | } 11 | } 12 | } 13 | }; 14 | 15 | export default preview; 16 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/button.generated.ts: -------------------------------------------------------------------------------- 1 | export const keyOrder = ['theme', 'mode']; 2 | export const defaultValues = { 3 | theme: 'samurai', 4 | mode: 'light' 5 | }; 6 | 7 | export type theme = 'samurai' | 'knight' | 'ninja'; 8 | export type mode = 'light' | 'dark' | 'dim'; 9 | 10 | export type Context = { 11 | theme: theme; 12 | mode: mode; 13 | }; 14 | -------------------------------------------------------------------------------- /packages/storybook-react/src/button/button.generated.ts: -------------------------------------------------------------------------------- 1 | export const keyOrder = ['theme', 'mode']; 2 | export const defaultValues = { 3 | theme: 'samurai', 4 | mode: 'light' 5 | }; 6 | 7 | export type theme = 'samurai' | 'knight' | 'ninja'; 8 | export type mode = 'light' | 'dark' | 'dim'; 9 | 10 | export type Context = { 11 | theme: theme; 12 | mode: mode; 13 | }; 14 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/flow/nodes/noteNode.module.css: -------------------------------------------------------------------------------- 1 | .container { 2 | padding: var(--components-spacing-md); 3 | flex: 1; 4 | min-height: 100px; 5 | min-width: 100px; 6 | } 7 | 8 | .textareaWrapper { 9 | height: 100%; 10 | } 11 | 12 | .textareaWrapper > * { 13 | height: 100%; 14 | } 15 | 16 | .textarea { 17 | height: 100%; 18 | width: 100%; 19 | } -------------------------------------------------------------------------------- /packages/graph-editor/src/redux/selectors/roots.ts: -------------------------------------------------------------------------------- 1 | import { RootState } from '../store.js'; 2 | export const settings = (state: RootState) => state.settings; 3 | export const ui = (state: RootState) => state.ui; 4 | export const graph = (state: RootState) => state.graph; 5 | export const refs = (state: RootState) => state.refs; 6 | export const registry = (state: RootState) => state.registry; 7 | -------------------------------------------------------------------------------- /packages/nodes-previews/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | import { Color, toColor, toHex } from '@tokens-studio/graph-engine'; 2 | 3 | export const arrayOf = (schema: object) => { 4 | return { 5 | type: 'array', 6 | items: schema 7 | }; 8 | }; 9 | 10 | export const castToHex = (col: Color) => { 11 | try { 12 | return toHex(toColor(col)); 13 | } catch { 14 | return ''; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /packages/prettier-config-custom/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tokens-studio/prettier-config-custom", 3 | "version": "0.0.0", 4 | "license": "MPL-2.0", 5 | "publishConfig": { 6 | "access": "public" 7 | }, 8 | "private": true, 9 | "exports": { 10 | ".": "./index.js" 11 | }, 12 | "dependencies": { 13 | "prettier": "^3.3.2" 14 | }, 15 | "files": [ 16 | "index.js" 17 | ] 18 | } -------------------------------------------------------------------------------- /packages/graph-editor/cypress/support/component-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Components App 8 | 9 | 10 |
11 | 12 | -------------------------------------------------------------------------------- /packages/graph-engine/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | root: true, 5 | extends: [require.resolve('@tokens-studio/eslint-config-custom')], 6 | "rules": { 7 | //There are multiple legitimate use cases for the any type in this project 8 | "@typescript-eslint/no-explicit-any": "off" 9 | } 10 | }; -------------------------------------------------------------------------------- /packages/graph-engine/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants.js'; 2 | export * from './types.js'; 3 | export * from './graph/index.js'; 4 | export * from './nodes/index.js'; 5 | export * from './programmatic/index.js'; 6 | export * from './schemas/index.js'; 7 | export * from './annotations/index.js'; 8 | export * from './graph/interfaces.js'; 9 | export * from './nodes/color/lib/utils.js'; 10 | -------------------------------------------------------------------------------- /packages/nodes-fs/vite.config.mts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vitest/config'; 3 | 4 | export default defineConfig({ 5 | test: { 6 | include: ['tests/**/*.test.[jt]s?(x)'], 7 | globals: true, 8 | server: { 9 | deps: { 10 | // to ensure importing CSS files is working 11 | inline: ['@tokens-studio/ui'] 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /packages/storybook-lit/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/typing/index.ts: -------------------------------------------------------------------------------- 1 | import assertDefined from './assertDefined.js'; 2 | import hasValue from './hasValue.js'; 3 | import parseNumber from './parseNumber.js'; 4 | import parseUnit from './parseUnit.js'; 5 | import passUnit from './passUnit.js'; 6 | 7 | export const nodes = [ 8 | assertDefined, 9 | hasValue, 10 | parseNumber, 11 | parseUnit, 12 | passUnit 13 | ]; 14 | -------------------------------------------------------------------------------- /packages/graph-engine/src/schemas/utils.ts: -------------------------------------------------------------------------------- 1 | import { type SchemaObject } from 'ajv'; 2 | 3 | export const extractArray = (schema: SchemaObject): SchemaObject => { 4 | if (schema.type === 'array') { 5 | return schema.items; 6 | } 7 | return schema; 8 | }; 9 | 10 | export const arrayOf = (schema: SchemaObject) => { 11 | return { 12 | type: 'array', 13 | items: schema 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/storybook-react/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @tokens-studio/react-storybook-graph-engine 2 | 3 | ## 1.0.2 4 | 5 | ### Patch Changes 6 | 7 | - f08f85f: Fix clsx and remove classnames. 8 | 9 | ## 1.0.1 10 | 11 | ### Patch Changes 12 | 13 | - 809ef95: Upgrade @tokens-studio dependencies to latest, to avoid un-dedupable shared deps with Studio App and stitches styles from old UI leaking through. 14 | -------------------------------------------------------------------------------- /packages/ui/src/api/contracts/index.ts: -------------------------------------------------------------------------------- 1 | import { aiContract } from './ai.ts'; 2 | import { contract as authContract } from './auth.ts'; 3 | import { graphContract } from './graph.ts'; 4 | import { marketplaceContract } from './marketplace.ts'; 5 | 6 | export const contract = { 7 | ai: aiContract, 8 | graph: graphContract, 9 | auth: authContract, 10 | marketplace: marketplaceContract 11 | }; 12 | -------------------------------------------------------------------------------- /packages/ui/.env: -------------------------------------------------------------------------------- 1 | HOSTNAME=localhost 2 | DATABASE_URL=postgres://test:insecurePassword@localhost:5432/graphengine 3 | AUTH_SECRET=mMDrwG7Cg54aZoDnJz6dZRgRxrt3KG9gDh+UMv2U7ds= 4 | OTEL_SERVICE_NAME=graph-engine 5 | 6 | # Create a new .env.local file in the packages/ui directory and add the following content: 7 | # Note that your callback is locked to a specific port 8 | AUTH_GITHUB_ID=set 9 | AUTH_GITHUB_SECRET=me -------------------------------------------------------------------------------- /packages/ui/src/api/utils/common.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod'; 2 | 3 | export const ErrorResponse = z.object({ 4 | message: z.string() 5 | }); 6 | 7 | export const withCursor = possibleCursor => { 8 | const cursorId = possibleCursor; 9 | let cursorAdd = {}; 10 | if (cursorId) { 11 | cursorAdd = { 12 | cursor: { 13 | id: cursorId 14 | } 15 | }; 16 | } 17 | return cursorAdd; 18 | }; 19 | -------------------------------------------------------------------------------- /packages/ui/src/image.d.ts: -------------------------------------------------------------------------------- 1 | //Not sure why the link is breaking in the next.js package, but this is a workaround to fix it 2 | declare module 'next/image.js' { 3 | interface ImageProps { 4 | src: unknown; 5 | alt?: string; 6 | width?: number; 7 | height?: number; 8 | } 9 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 10 | export = (props: ImageProps) => JSX.Element; 11 | } 12 | -------------------------------------------------------------------------------- /packages/ui/src/api/index.ts: -------------------------------------------------------------------------------- 1 | import { contract } from './contracts/index.ts'; 2 | import { generateOpenApi } from '@ts-rest/open-api'; 3 | 4 | export const openApiDocument = generateOpenApi(contract, { 5 | info: { 6 | title: 'Graph API', 7 | version: '1.0.0', 8 | description: 'The backend API for the graph service' 9 | }, 10 | servers: [ 11 | { 12 | url: '/api/v1' 13 | } 14 | ] 15 | }); 16 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/base.css: -------------------------------------------------------------------------------- 1 | @import url('./generated/styles/index.css'); 2 | 3 | 4 | .button{ 5 | color: var(--colorsText); 6 | background-color: var(--colorsBg); 7 | border: 3px solid var(--colorsPrimary); 8 | border-radius: var(--borderRadiusRounded); 9 | padding: 8px 16px; 10 | font-size: 16px; 11 | cursor: pointer; 12 | transition: background-color 0.2s; 13 | } -------------------------------------------------------------------------------- /packages/storybook-react/src/button/base.css: -------------------------------------------------------------------------------- 1 | @import url('./generated/styles/index.css'); 2 | 3 | 4 | .button{ 5 | color: var(--colorsText); 6 | background-color: var(--colorsBg); 7 | border: 3px solid var(--colorsPrimary); 8 | border-radius: var(--borderRadiusRounded); 9 | padding: 8px 16px; 10 | font-size: 16px; 11 | cursor: pointer; 12 | transition: background-color 0.2s; 13 | } -------------------------------------------------------------------------------- /packages/ui/src/app/editor/layout.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { Stack } from '@tokens-studio/ui/Stack.js'; 4 | import Rail from '@/components/rail.tsx'; 5 | 6 | export default function Layout({ children }) { 7 | return ( 8 | 9 |
10 | 11 |
12 |
{children}
13 |
14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /packages/nodes-image/src/ui/controls/index.tsx: -------------------------------------------------------------------------------- 1 | import { IMAGE } from "../../schemas/index.js" 2 | import { Image } from "./image.js"; 3 | import type { Input, Port } from "@tokens-studio/graph-engine" 4 | 5 | export const controls = [{ 6 | matcher: (port: Port) => { 7 | const inputPort = port as Input; 8 | return inputPort.type.$id == IMAGE 9 | }, 10 | component: Image, 11 | }, 12 | ] 13 | -------------------------------------------------------------------------------- /packages/ui/src/components/preview/preview.css: -------------------------------------------------------------------------------- 1 | .preview-layout{ 2 | height:100%; 3 | } 4 | 5 | .preview-wrapper{ 6 | height:100% !important; 7 | } 8 | 9 | .preview-layout>*{ 10 | height:100% !important 11 | } 12 | 13 | .sp-stack{ 14 | height: 100%; 15 | } 16 | .preview-explorer{ 17 | height: 100%; 18 | } 19 | .preview-explorer>*{ 20 | height: 100%; 21 | max-width: unset !important; 22 | } -------------------------------------------------------------------------------- /packages/ui/src/link.d.ts: -------------------------------------------------------------------------------- 1 | //Not sure why the link is breaking in the next.js package, but this is a workaround to fix it 2 | /* eslint-disable @typescript-eslint/no-unused-vars */ 3 | declare module 'next/link.js' { 4 | import React from 'react'; 5 | 6 | const Link: React.FC<{ 7 | href: string; 8 | children: React.ReactNode; 9 | [key: string]: any; 10 | }> = _ => JSX.Element; 11 | export default Link; 12 | } 13 | -------------------------------------------------------------------------------- /packages/nodes-previews/vite.config.mts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vitest/config'; 3 | 4 | export default defineConfig({ 5 | test: { 6 | include: ['tests/**/*.test.[jt]s?(x)', 'src/**/*.test.[jt]s?(x)'], 7 | globals: true, 8 | server: { 9 | deps: { 10 | // to ensure importing CSS files is working 11 | inline: ['@tokens-studio/ui'] 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /packages/ui/src/app/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tokens Studio Graph", 3 | "short_name": "Graph Editor", 4 | "description": "Tokens Studio Graph Editor as a standalone app", 5 | "start_url": "/", 6 | "display": "standalone", 7 | "background_color": "#fff", 8 | "theme_color": "#fff", 9 | "icons": [ 10 | { 11 | "src": "/favicon.ico", 12 | "sizes": "any", 13 | "type": "image/x-icon" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/vscode-extension/app/src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/graph-editor/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react-swc'; 3 | 4 | import tsconfigPaths from 'vite-tsconfig-paths'; 5 | 6 | // https://vitejs.dev/config/ 7 | export default defineConfig({ 8 | server: { 9 | port: 3001, 10 | }, 11 | mode: 'development', 12 | root: 'examples/defaults', 13 | plugins: [react({ tsDecorators: true }), tsconfigPaths()], 14 | }); 15 | -------------------------------------------------------------------------------- /packages/ui/src/assets/svgs/react.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | React Logo 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/preview/index.ts: -------------------------------------------------------------------------------- 1 | import colorCompare from './colorCompare.js'; 2 | import colorScale from './colorScale.js'; 3 | import curve from './curve.js'; 4 | import mathExpression from './mathExpression.js'; 5 | import number from './number.js'; 6 | import swatch from './swatch.js'; 7 | 8 | export const nodes = [ 9 | colorCompare, 10 | colorScale, 11 | curve, 12 | mathExpression, 13 | number, 14 | swatch 15 | ]; 16 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/knight-dark.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#2653BB", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#ffffff", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#000000", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "1em", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/knight-dim.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#2653BB", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#333333", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#cccccc", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "1em", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/ninja-dark.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#13ADAD", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#ffffff", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#000000", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "4px", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/ninja-dim.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#13ADAD", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#333333", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#cccccc", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "4px", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/ninja-light.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#13ADAD", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#000000", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#ffffff", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "4px", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/samurai-dark.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#17D617", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#ffffff", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#000000", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "0", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/samurai-dim.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#17D617", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#333333", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#cccccc", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "0", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/samurai-light.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#17D617", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#000000", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#ffffff", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "0", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/migrations/tsconfig.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "incremental": true, 6 | "rootDir": "src", 7 | "module": "NodeNext", 8 | "skipLibCheck": true, 9 | "moduleResolution": "NodeNext", 10 | "plugins": [] 11 | }, 12 | "exclude": [ 13 | "cypress.config.ts", 14 | "cypress", 15 | "node_modules", 16 | "**/*.stories.tsx", 17 | "**/*.cy.tsx" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/nodes-audio/tsconfig.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "incremental": true, 6 | "rootDir": "src", 7 | "module": "NodeNext", 8 | "skipLibCheck": true, 9 | "moduleResolution": "NodeNext", 10 | "plugins": [] 11 | }, 12 | "exclude": [ 13 | "cypress.config.ts", 14 | "cypress", 15 | "node_modules", 16 | "**/*.stories.tsx", 17 | "**/*.cy.tsx" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/storybook-lit/src/components/generated/tokens/knight-light.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": { 3 | "primary": { 4 | "value": "#2653BB", 5 | "type": "color" 6 | }, 7 | "text": { 8 | "value": "#000000", 9 | "type": "color" 10 | }, 11 | "bg": { 12 | "value": "#ffffff", 13 | "type": "color" 14 | } 15 | }, 16 | "borderRadius": { 17 | "rounded": { 18 | "value": "1em", 19 | "type": "dimension" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "fixed": [], 6 | "linked": [], 7 | "access": "public", 8 | "baseBranch": "master", 9 | "updateInternalDependencies": "patch", 10 | "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { 11 | "onlyUpdatePeerDependentsWhenOutOfRange": true 12 | }, 13 | "ignore": [] 14 | } -------------------------------------------------------------------------------- /packages/graph-editor/src/hooks/useCanDeleteNode.ts: -------------------------------------------------------------------------------- 1 | import { annotatedDeleteable } from '@tokens-studio/graph-engine'; 2 | import { useLocalGraph } from './useLocalGraph.js'; 3 | 4 | export const useCanDeleteNode = (nodeId: string) => { 5 | const graph = useLocalGraph(); 6 | const node = graph.getNode(nodeId); 7 | 8 | if (node && node.annotations[annotatedDeleteable] === false) { 9 | return false; 10 | } 11 | 12 | return true; 13 | }; 14 | -------------------------------------------------------------------------------- /packages/nodes-figma/readme.md: -------------------------------------------------------------------------------- 1 | # @tokens-studio/graph-engine-nodes-figma 2 | 3 | Figma-specific nodes for the graph engine. 4 | 5 | ## Installation 6 | 7 | `npm install @tokens-studio/graph-engine-nodes-figma` 8 | 9 | ## Available Nodes 10 | 11 | - `scopeNumber`: Generates scope-specific numbering for Figma (implementation pending) 12 | 13 | ## Development 14 | 15 | 1. Build: `npm run build` 16 | 2. Test: `npm run test` 17 | 3. Lint: `npm run lint` 18 | -------------------------------------------------------------------------------- /packages/ui/src/assets/svgs/vue.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /packages/graph-editor/src/utils/isActiveElementTextEditable.ts: -------------------------------------------------------------------------------- 1 | export const isActiveElementTextEditable = () => { 2 | const activeElement = document.activeElement as HTMLElement; 3 | 4 | if (!activeElement) { 5 | return false; 6 | } 7 | 8 | const tagName = activeElement.tagName.toLowerCase(); 9 | const isContentEditable = activeElement.isContentEditable; 10 | 11 | return ['input', 'textarea'].includes(tagName) || isContentEditable; 12 | }; 13 | -------------------------------------------------------------------------------- /packages/nodes-previews/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @tokens-studio/graph-engine-nodes-preview 2 | 3 | ## 1.1.1 4 | 5 | ### Patch Changes 6 | 7 | - 82e2e96: Update to the latest DS version 8 | 9 | ## 1.1.0 10 | 11 | ### Minor Changes 12 | 13 | - 08d51d0: Add typography tokens preview 14 | - 485e01f: Add color palette preview for design tokens 15 | - ae83d50: Add a tokens preview table 16 | 17 | ### Patch Changes 18 | 19 | - f08f85f: Fix clsx and remove classnames. 20 | -------------------------------------------------------------------------------- /packages/nodes-previews/src/color/swatch/node.ts: -------------------------------------------------------------------------------- 1 | import { ColorSchema, Node } from '@tokens-studio/graph-engine'; 2 | 3 | export default class NodeDefinition extends Node { 4 | static title = 'Color Swatch'; 5 | static type = 'studio.tokens.previews.color.swatch'; 6 | static description = 'Previews a single color'; 7 | 8 | constructor(props) { 9 | super(props); 10 | 11 | this.addInput('color', { 12 | type: ColorSchema 13 | }); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/ui/src/components/loader/index.tsx: -------------------------------------------------------------------------------- 1 | export default function Loading() { 2 | return ( 3 |
17 | Loading Data... 18 |
19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /packages/ui/src/components/pages/index.module.css: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | display: grid; 3 | place-items: center; 4 | min-height: 100vh; 5 | } 6 | 7 | .card { 8 | background: var(--color-neutral-canvas-minimal-bg); 9 | padding: var(--component-spacing-xl); 10 | border-radius: var(--component-radii-xl); 11 | max-width: 480px; 12 | display: flex; 13 | flex-direction: column; 14 | align-items: center; 15 | gap: var(--component-spacing-xl); 16 | } 17 | -------------------------------------------------------------------------------- /packages/ui/src/lib/prisma/index.ts: -------------------------------------------------------------------------------- 1 | import { PrismaClient } from '@prisma/client'; 2 | 3 | const prismaClientSingleton = () => { 4 | return new PrismaClient(); 5 | }; 6 | 7 | declare const globalThis: { 8 | prismaGlobal: ReturnType; 9 | } & typeof global; 10 | 11 | export const prisma = globalThis.prismaGlobal ?? prismaClientSingleton(); 12 | 13 | if (process.env.NODE_ENV !== 'production') globalThis.prismaGlobal = prisma; 14 | -------------------------------------------------------------------------------- /packages/graph-editor/src/utils/stripVariadic.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Variadic named handles have the name of the handle followed by [index] where index is a number 3 | * @param name 4 | * @returns 5 | */ 6 | export const stripVariadic = (name: string) => name.split('[')[0]; 7 | 8 | export const getVariadicIndex = (name: string) => { 9 | const index = name.match(/\[(\d+)\]/); 10 | if (index) { 11 | return parseInt(index[1]); 12 | } 13 | return -1; 14 | }; 15 | -------------------------------------------------------------------------------- /packages/ui/src/hooks/useGetEditor.ts: -------------------------------------------------------------------------------- 1 | import globalState from '@/mobx/index.tsx'; 2 | import type { SerializedGraph } from '@tokens-studio/graph-engine'; 3 | 4 | export function useGetEditor() { 5 | async function loadExample(file) { 6 | const editor = globalState.refs.editor; 7 | if (!editor) { 8 | return; 9 | } 10 | 11 | await editor.clear(); 12 | await editor.loadRaw(file as SerializedGraph); 13 | } 14 | 15 | return { loadExample }; 16 | } 17 | -------------------------------------------------------------------------------- /packages/graph-editor/examples/barebones/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/nodes-design-tokens/src/nodes/naming/index.ts: -------------------------------------------------------------------------------- 1 | import alphabetic from './alphabetic.js'; 2 | import alphanumeric from './alphanumeric.js'; 3 | import greekLetter from './greekLetter.js'; 4 | import hierarchyLevel from './hierarchyLevel.js'; 5 | import numeric from './numeric.js'; 6 | import tshirtSize from './tshirtSize.js'; 7 | 8 | export const nodes = [ 9 | alphabetic, 10 | alphanumeric, 11 | greekLetter, 12 | hierarchyLevel, 13 | numeric, 14 | tshirtSize 15 | ]; 16 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/panels/settings/story.stories.tsx: -------------------------------------------------------------------------------- 1 | import { Settings } from './index.js'; 2 | import React from 'react'; 3 | import type { Meta, StoryObj } from '@storybook/react'; 4 | 5 | const meta: Meta = { 6 | title: 'Panels/Settings', 7 | component: Settings, 8 | }; 9 | 10 | export default meta; 11 | type Story = StoryObj; 12 | export const Default: Story = { 13 | render: () => , 14 | args: {}, 15 | }; 16 | -------------------------------------------------------------------------------- /packages/graph-editor/src/components/panels/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './alignment/index.js'; 2 | export * from './debugger/index.js'; 3 | export * from './dropPanel/index.js'; 4 | export * from './graph/index.js'; 5 | export * from './inputs/index.js'; 6 | export * from './legend/index.js'; 7 | export * from './logs/index.js'; 8 | export * from './nodeSettings/index.js'; 9 | export * from './output/index.js'; 10 | export * from './play/index.js'; 11 | export * from './settings/index.js'; 12 | -------------------------------------------------------------------------------- /packages/graph-editor/examples/defaults/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/preview/curve.ts: -------------------------------------------------------------------------------- 1 | import { CurveSchema } from '../../schemas/index.js'; 2 | import { Node } from '../../programmatic/node.js'; 3 | 4 | export default class NodeDefinition extends Node { 5 | static title = 'PreviewCurve'; 6 | static type = 'studio.tokens.preview.curve'; 7 | 8 | static description = 'Previews a curve'; 9 | 10 | constructor(props) { 11 | super(props); 12 | 13 | this.addInput('value', { 14 | type: CurveSchema 15 | }); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/ui/src/api/contracts/ai.ts: -------------------------------------------------------------------------------- 1 | import { SerializedGraph } from '../schemas/graph.ts'; 2 | import { initContract } from '@ts-rest/core'; 3 | import { z } from 'zod'; 4 | 5 | const c = initContract(); 6 | 7 | export const aiContract = c.router({ 8 | getAISummary: { 9 | method: 'POST', 10 | path: '/ai/summarize', 11 | body: z.object({ 12 | graph: SerializedGraph 13 | }), 14 | responses: { 15 | 200: z.object({ 16 | summary: z.string() 17 | }) 18 | } 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /packages/ui/src/app/marketplace/layout.tsx: -------------------------------------------------------------------------------- 1 | import { Container } from '@/components/container/index.tsx'; 2 | import { Stack } from '@tokens-studio/ui/Stack.js'; 3 | import Rail from '@/components/rail.tsx'; 4 | 5 | export default function Layout({ children }) { 6 | return ( 7 | 8 |
9 | 10 |
11 |
12 | {children} 13 |
14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /packages/graph-editor/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import tsconfigPaths from 'vite-tsconfig-paths'; 3 | 4 | export default defineConfig({ 5 | test: { 6 | include: ['src/**/*.test.[jt]s?(x)'], 7 | globals: true, 8 | environment: 'jsdom', 9 | server: { 10 | deps: { 11 | // to ensure importing CSS files is working 12 | inline: ['@tokens-studio/ui'], 13 | }, 14 | }, 15 | }, 16 | plugins: [tsconfigPaths()], 17 | }); 18 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/preview/swatch.ts: -------------------------------------------------------------------------------- 1 | import { ColorSchema } from '../../schemas/index.js'; 2 | import { Node } from '../../programmatic/node.js'; 3 | 4 | export default class NodeDefinition extends Node { 5 | static title = 'Color Swatch'; 6 | static type = 'studio.tokens.preview.swatch'; 7 | 8 | static description = 'Previews a color swatch'; 9 | 10 | constructor(props) { 11 | super(props); 12 | 13 | this.addInput('value', { 14 | type: ColorSchema 15 | }); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/graph-engine/src/nodes/vector2/index.ts: -------------------------------------------------------------------------------- 1 | import add from './add.js'; 2 | import create from './create.js'; 3 | import destructure from './destructure.js'; 4 | import dot from './dot.js'; 5 | import length from './length.js'; 6 | import normalize from './normalize.js'; 7 | import scale from './scale.js'; 8 | import subtract from './subtract.js'; 9 | 10 | export const nodes = [ 11 | add, 12 | create, 13 | destructure, 14 | dot, 15 | length, 16 | normalize, 17 | scale, 18 | subtract 19 | ]; 20 | -------------------------------------------------------------------------------- /dockercompose.build.yaml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | 5 | web: 6 | container_name: web 7 | build: 8 | context: . 9 | dockerfile: ./packages/ui/Dockerfile 10 | restart: always 11 | env_file: 12 | - ./packages/ui/.env 13 | ports: 14 | - 3000:3000 15 | docs: 16 | container_name: docs 17 | build: 18 | context: . 19 | dockerfile: ./packages/documentation/Dockerfile 20 | restart: always 21 | 22 | ports: 23 | - 4000:3000 24 | -------------------------------------------------------------------------------- /packages/storybook-react/src/button/button.tsx: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | import { Context, defaultValues, keyOrder } from './button.generated'; 3 | import { useStyledClass } from '../context'; 4 | import React from 'react'; 5 | 6 | export type ButtonProps = { 7 | children: React.ReactNode; 8 | } & Context; 9 | 10 | export const Button = (props: ButtonProps) => { 11 | const styledClass = useStyledClass('button', keyOrder, defaultValues); 12 | return