Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
_build shoudln't be commited
Oleg Isonen4e4750cbb789
diff --git a/apps/designer/api/_build/_assets/base-GPJXMV5J.css b/apps/designer/api/_build/_assets/base-GPJXMV5J.cssdeleted file mode 100644index 293d3b1f13..0000000000--- a/apps/designer/api/_build/_assets/base-GPJXMV5J.css+++ /dev/null@@ -1,3 +0,0 @@-body {- margin: 0;-}diff --git a/apps/designer/api/_build/_assets/base-TI2ZAOSA.css b/apps/designer/api/_build/_assets/base-TI2ZAOSA.cssdeleted file mode 100644index 422135010c..0000000000--- a/apps/designer/api/_build/_assets/base-TI2ZAOSA.css+++ /dev/null@@ -1,4 +0,0 @@-body {- margin: 0;- overflow: hidden;-}diff --git a/apps/designer/api/_build/_assets/canvas-GPJXMV5J.css b/apps/designer/api/_build/_assets/canvas-GPJXMV5J.cssdeleted file mode 100644index 293d3b1f13..0000000000--- a/apps/designer/api/_build/_assets/canvas-GPJXMV5J.css+++ /dev/null@@ -1,3 +0,0 @@-body {- margin: 0;-}diff --git a/apps/designer/api/_build/_assets/canvas-WVKW2N3W.css b/apps/designer/api/_build/_assets/canvas-WVKW2N3W.cssdeleted file mode 100644index 2a1488ce39..0000000000--- a/apps/designer/api/_build/_assets/canvas-WVKW2N3W.css+++ /dev/null@@ -1,5 +0,0 @@-body {- margin: 0;- font-family: var(--fonts-sans);- font-size: var(--fontSizes-1);-}diff --git a/apps/designer/api/_build/_assets/dashboard-55DNWN2R.css b/apps/designer/api/_build/_assets/dashboard-55DNWN2R.cssdeleted file mode 100644index e69de29bb2..0000000000diff --git a/apps/designer/api/_build/_assets/dashboard-CLBMC4UB.css b/apps/designer/api/_build/_assets/dashboard-CLBMC4UB.cssdeleted file mode 100644index 422135010c..0000000000--- a/apps/designer/api/_build/_assets/dashboard-CLBMC4UB.css+++ /dev/null@@ -1,4 +0,0 @@-body {- margin: 0;- overflow: hidden;-}diff --git a/apps/designer/api/_build/_assets/dashboard-TI2ZAOSA.css b/apps/designer/api/_build/_assets/dashboard-TI2ZAOSA.cssdeleted file mode 100644index 422135010c..0000000000--- a/apps/designer/api/_build/_assets/dashboard-TI2ZAOSA.css+++ /dev/null@@ -1,4 +0,0 @@-body {- margin: 0;- overflow: hidden;-}diff --git a/apps/designer/api/_build/_assets/dashboard-XMYFQPQX.css b/apps/designer/api/_build/_assets/dashboard-XMYFQPQX.cssdeleted file mode 100644index 778f302cf4..0000000000--- a/apps/designer/api/_build/_assets/dashboard-XMYFQPQX.css+++ /dev/null@@ -1,6 +0,0 @@-body {- margin: 0;- overflow: hidden;- font-family: var(--fonts-sans);- font-size: var(--fontSizes-1);-}diff --git a/apps/designer/api/_build/_assets/designer-2O6YY226.css b/apps/designer/api/_build/_assets/designer-2O6YY226.cssdeleted file mode 100644index 211c0dc4cc..0000000000--- a/apps/designer/api/_build/_assets/designer-2O6YY226.css+++ /dev/null@@ -1,6 +0,0 @@-body {- margin: 0;- overflow: hidden;- font-family: var(--fonts-sans);- line-height: var(--font-sizes-1);-}diff --git a/apps/designer/api/_build/_assets/designer-5RBMB3IY.css b/apps/designer/api/_build/_assets/designer-5RBMB3IY.cssdeleted file mode 100644index 724fcdb5a1..0000000000--- a/apps/designer/api/_build/_assets/designer-5RBMB3IY.css+++ /dev/null@@ -1,6 +0,0 @@-body {- margin: 0;- overflow: hidden;- font-family: var(--fonts-sans);- line-height: var(--font-Sizes-1);-}diff --git a/apps/designer/api/_build/_assets/designer-5SMAKVCA.css b/apps/designer/api/_build/_assets/designer-5SMAKVCA.cssdeleted file mode 100644index 7341e5be1b..0000000000--- a/apps/designer/api/_build/_assets/designer-5SMAKVCA.css+++ /dev/null@@ -1,6 +0,0 @@-body {- margin: 0;- overflow: hidden;- font-family: var(--fonts-sans);- line-height: 1;-}diff --git a/apps/designer/api/_build/_assets/designer-IRVRLHCU.css b/apps/designer/api/_build/_assets/designer-IRVRLHCU.cssdeleted file mode 100644index a131147ea5..0000000000--- a/apps/designer/api/_build/_assets/designer-IRVRLHCU.css+++ /dev/null@@ -1,5 +0,0 @@-body {- margin: 0;- overflow: hidden;- font-family: var(--fonts-sans);-}diff --git a/apps/designer/api/_build/_assets/designer-POMYNNAR.css b/apps/designer/api/_build/_assets/designer-POMYNNAR.cssdeleted file mode 100644index 95c091e864..0000000000--- a/apps/designer/api/_build/_assets/designer-POMYNNAR.css+++ /dev/null@@ -1,6 +0,0 @@-body {- margin: 0;- overflow: hidden;- font-family: var(--fonts-sans);- line-height: var(--fontSizes-1);-}diff --git a/apps/designer/api/_build/_assets/designer-TI2ZAOSA.css b/apps/designer/api/_build/_assets/designer-TI2ZAOSA.cssdeleted file mode 100644index 422135010c..0000000000--- a/apps/designer/api/_build/_assets/designer-TI2ZAOSA.css+++ /dev/null@@ -1,4 +0,0 @@-body {- margin: 0;- overflow: hidden;-}diff --git a/apps/designer/api/_build/_assets/designer-XMYFQPQX.css b/apps/designer/api/_build/_assets/designer-XMYFQPQX.cssdeleted file mode 100644index 778f302cf4..0000000000--- a/apps/designer/api/_build/_assets/designer-XMYFQPQX.css+++ /dev/null@@ -1,6 +0,0 @@-body {- margin: 0;- overflow: hidden;- font-family: var(--fonts-sans);- font-size: var(--fontSizes-1);-}diff --git a/apps/designer/api/_build/_assets/inter-775NUFJE.css b/apps/designer/api/_build/_assets/inter-775NUFJE.cssdeleted file mode 100644index bd89bb898d..0000000000--- a/apps/designer/api/_build/_assets/inter-775NUFJE.css+++ /dev/null@@ -1,85 +0,0 @@-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 900;- font-display: swap;- src: url("/fonts/Inter-Black.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 700;- font-display: swap;- src: url("/fonts/Inter-Bold.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 800;- font-display: swap;- src: url("/fonts/Inter-ExtraBold.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLight.ttf") format("truetype");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-Thin.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-ThinItalic.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLight.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 300;- font-display: swap;- src: url("/fonts/Inter-Light.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 500;- font-display: swap;- src: url("/fonts/Inter-Medium.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 400;- font-display: swap;- src: url("/fonts/Inter-Regular.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 600;- font-display: swap;- src: url("/fonts/Inter-SemiBold.ttf") format("truetype");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-Thin.ttf") format("truetype");-}diff --git a/apps/designer/api/_build/_assets/inter-F543XCTT.css b/apps/designer/api/_build/_assets/inter-F543XCTT.cssdeleted file mode 100644index 0485a6826b..0000000000--- a/apps/designer/api/_build/_assets/inter-F543XCTT.css+++ /dev/null@@ -1,85 +0,0 @@-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 900;- font-display: swap;- src: url("/fonts/Inter-Black.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 700;- font-display: swap;- src: url("/fonts/Inter-Bold.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 800;- font-display: swap;- src: url("/fonts/Inter-ExtraBold.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLight.ttf") format("ttf");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-Thin.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-ThinItalic.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLight.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 300;- font-display: swap;- src: url("/fonts/Inter-Light.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 500;- font-display: swap;- src: url("/fonts/Inter-Medium.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 400;- font-display: swap;- src: url("/fonts/Inter-Regular.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 600;- font-display: swap;- src: url("/fonts/Inter-SemiBold.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-Thin.ttf") format("ttf");-}diff --git a/apps/designer/api/_build/_assets/inter-O2W556LN.css b/apps/designer/api/_build/_assets/inter-O2W556LN.cssdeleted file mode 100644index 09108429b8..0000000000--- a/apps/designer/api/_build/_assets/inter-O2W556LN.css+++ /dev/null@@ -1,188 +0,0 @@-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-Thin.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-ThinItalic.ttf") format("ttf");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLight.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLightItalic.ttf") format("ttf");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 300;- font-display: swap;- src: url("/fonts/Inter-Light.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 300;- font-display: swap;- src: url("/fonts/Inter-LightItalic.ttf") format("ttf");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 400;- font-display: swap;- src: url("/fonts/Inter-Regular.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 400;- font-display: swap;- src: url("/fonts/Inter-Italic.ttf") format("ttf");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 500;- font-display: swap;- src: url("/fonts/Inter-Medium.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 500;- font-display: swap;- src: url("/fonts/Inter-MediumItalic.ttf") format("ttf");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 600;- font-display: swap;- src: url("/fonts/Inter-SemiBold.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 600;- font-display: swap;- src: url("/fonts/Inter-SemiBoldItalic.ttf") format("ttf"),- url("/fonts/Inter-SemiBoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 700;- font-display: swap;- src: url("/fonts/Inter-Bold.ttf") format("ttf"),- url("/fonts/Inter-Bold.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 700;- font-display: swap;- src: url("/fonts/Inter-BoldItalic.ttf") format("ttf"),- url("/fonts/Inter-BoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 800;- font-display: swap;- src: url("/fonts/Inter-ExtraBold.ttf") format("ttf"),- url("/fonts/Inter-ExtraBold.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 800;- font-display: swap;- src: url("/fonts/Inter-ExtraBoldItalic.ttf") format("ttf"),- url("/fonts/Inter-ExtraBoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 900;- font-display: swap;- src: url("/fonts/Inter-Black.ttf") format("ttf"),- url("/fonts/Inter-Black.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 900;- font-display: swap;- src: url("/fonts/Inter-BlackItalic.ttf") format("ttf"),- url("/fonts/Inter-BlackItalic.woff?v=3.19") format("woff");-}--/* -------------------------------------------------------- Variable font.- Usage:-- html { font-family: 'Inter', sans-serif; }- @supports (font-variation-settings: normal) {- html { font-family: 'Inter var', sans-serif; }- }- */-@font-face {- font-family: "Inter var";- font-weight: 100 900;- font-display: swap;- font-style: normal;- font-named-instance: "Regular";- src: url("/fonts/Inter-roman.var.ttf") format("ttf");-}-@font-face {- font-family: "Inter var";- font-weight: 100 900;- font-display: swap;- font-style: italic;- font-named-instance: "Italic";- src: url("/fonts/Inter-italic.var.ttf") format("ttf");-}--/* --------------------------------------------------------------------------- [EXPERIMENTAL] Multi-axis, single variable font.-- Slant axis is not yet widely supported (as of February 2019) and thus this- multi-axis single variable font is opt-in rather than the default.-- When using this, you will probably need to set font-variation-settings- explicitly, e.g.-- * { font-variation-settings: "slnt" 0deg }- .italic { font-variation-settings: "slnt" 10deg }-- */-@font-face {- font-family: "Inter var experimental";- font-weight: 100 900;- font-display: swap;- font-style: oblique 0deg 10deg;- src: url("/fonts/Inter.var.ttf") format("ttf");-}diff --git a/apps/designer/api/_build/_assets/inter-PJXJHL6K.css b/apps/designer/api/_build/_assets/inter-PJXJHL6K.cssdeleted file mode 100644index 768a8a282f..0000000000--- a/apps/designer/api/_build/_assets/inter-PJXJHL6K.css+++ /dev/null@@ -1,196 +0,0 @@-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-Thin.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-ThinItalic.ttf") format("ttf");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLight.ttf") format("ttf");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLightItalic.ttf") format("ttf"),- url("/fonts/Inter-ExtraLightItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 300;- font-display: swap;- src: url("/fonts/Inter-Light.ttf") format("ttf"),- url("/fonts/Inter-Light.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 300;- font-display: swap;- src: url("/fonts/Inter-LightItalic.ttf") format("ttf"),- url("/fonts/Inter-LightItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 400;- font-display: swap;- src: url("/fonts/Inter-Regular.ttf") format("ttf"),- url("/fonts/Inter-Regular.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 400;- font-display: swap;- src: url("/fonts/Inter-Italic.ttf") format("ttf"),- url("/fonts/Inter-Italic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 500;- font-display: swap;- src: url("/fonts/Inter-Medium.ttf") format("ttf"),- url("/fonts/Inter-Medium.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 500;- font-display: swap;- src: url("/fonts/Inter-MediumItalic.ttf") format("ttf"),- url("/fonts/Inter-MediumItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 600;- font-display: swap;- src: url("/fonts/Inter-SemiBold.ttf") format("ttf"),- url("/fonts/Inter-SemiBold.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 600;- font-display: swap;- src: url("/fonts/Inter-SemiBoldItalic.ttf") format("ttf"),- url("/fonts/Inter-SemiBoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 700;- font-display: swap;- src: url("/fonts/Inter-Bold.ttf") format("ttf"),- url("/fonts/Inter-Bold.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 700;- font-display: swap;- src: url("/fonts/Inter-BoldItalic.ttf") format("ttf"),- url("/fonts/Inter-BoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 800;- font-display: swap;- src: url("/fonts/Inter-ExtraBold.ttf") format("ttf"),- url("/fonts/Inter-ExtraBold.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 800;- font-display: swap;- src: url("/fonts/Inter-ExtraBoldItalic.ttf") format("ttf"),- url("/fonts/Inter-ExtraBoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 900;- font-display: swap;- src: url("/fonts/Inter-Black.ttf") format("ttf"),- url("/fonts/Inter-Black.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 900;- font-display: swap;- src: url("/fonts/Inter-BlackItalic.ttf") format("ttf"),- url("/fonts/Inter-BlackItalic.woff?v=3.19") format("woff");-}--/* -------------------------------------------------------- Variable font.- Usage:-- html { font-family: 'Inter', sans-serif; }- @supports (font-variation-settings: normal) {- html { font-family: 'Inter var', sans-serif; }- }- */-@font-face {- font-family: "Inter var";- font-weight: 100 900;- font-display: swap;- font-style: normal;- font-named-instance: "Regular";- src: url("/fonts/Inter-roman.var.ttf") format("ttf");-}-@font-face {- font-family: "Inter var";- font-weight: 100 900;- font-display: swap;- font-style: italic;- font-named-instance: "Italic";- src: url("/fonts/Inter-italic.var.ttf") format("ttf");-}--/* --------------------------------------------------------------------------- [EXPERIMENTAL] Multi-axis, single variable font.-- Slant axis is not yet widely supported (as of February 2019) and thus this- multi-axis single variable font is opt-in rather than the default.-- When using this, you will probably need to set font-variation-settings- explicitly, e.g.-- * { font-variation-settings: "slnt" 0deg }- .italic { font-variation-settings: "slnt" 10deg }-- */-@font-face {- font-family: "Inter var experimental";- font-weight: 100 900;- font-display: swap;- font-style: oblique 0deg 10deg;- src: url("/fonts/Inter.var.ttf") format("ttf");-}diff --git a/apps/designer/api/_build/_assets/inter-SG5LZ2GR.css b/apps/designer/api/_build/_assets/inter-SG5LZ2GR.cssdeleted file mode 100644index 508fc4f57f..0000000000--- a/apps/designer/api/_build/_assets/inter-SG5LZ2GR.css+++ /dev/null@@ -1,199 +0,0 @@-@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-Thin.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-Thin.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 100;- font-display: swap;- src: url("/fonts/Inter-ThinItalic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-ThinItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLight.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-ExtraLight.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 200;- font-display: swap;- src: url("/fonts/Inter-ExtraLightItalic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-ExtraLightItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 300;- font-display: swap;- src: url("/fonts/Inter-Light.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-Light.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 300;- font-display: swap;- src: url("/fonts/Inter-LightItalic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-LightItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 400;- font-display: swap;- src: url("/fonts/Inter-Regular.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-Regular.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 400;- font-display: swap;- src: url("/fonts/Inter-Italic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-Italic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 500;- font-display: swap;- src: url("/fonts/Inter-Medium.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-Medium.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 500;- font-display: swap;- src: url("/fonts/Inter-MediumItalic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-MediumItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 600;- font-display: swap;- src: url("/fonts/Inter-SemiBold.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-SemiBold.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 600;- font-display: swap;- src: url("/fonts/Inter-SemiBoldItalic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-SemiBoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 700;- font-display: swap;- src: url("/fonts/Inter-Bold.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-Bold.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 700;- font-display: swap;- src: url("/fonts/Inter-BoldItalic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-BoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 800;- font-display: swap;- src: url("/fonts/Inter-ExtraBold.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-ExtraBold.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 800;- font-display: swap;- src: url("/fonts/Inter-ExtraBoldItalic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-ExtraBoldItalic.woff?v=3.19") format("woff");-}--@font-face {- font-family: "Inter";- font-style: normal;- font-weight: 900;- font-display: swap;- src: url("/fonts/Inter-Black.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-Black.woff?v=3.19") format("woff");-}-@font-face {- font-family: "Inter";- font-style: italic;- font-weight: 900;- font-display: swap;- src: url("/fonts/Inter-BlackItalic.woff2?v=3.19") format("woff2"),- url("/fonts/Inter-BlackItalic.woff?v=3.19") format("woff");-}--/* -------------------------------------------------------- Variable font.- Usage:-- html { font-family: 'Inter', sans-serif; }- @supports (font-variation-settings: normal) {- html { font-family: 'Inter var', sans-serif; }- }- */-@font-face {- font-family: "Inter var";- font-weight: 100 900;- font-display: swap;- font-style: normal;- font-named-instance: "Regular";- src: url("/fonts/Inter-roman.var.woff2?v=3.19") format("woff2");-}-@font-face {- font-family: "Inter var";- font-weight: 100 900;- font-display: swap;- font-style: italic;- font-named-instance: "Italic";- src: url("/fonts/Inter-italic.var.woff2?v=3.19") format("woff2");-}--/* --------------------------------------------------------------------------- [EXPERIMENTAL] Multi-axis, single variable font.-- Slant axis is not yet widely supported (as of February 2019) and thus this- multi-axis single variable font is opt-in rather than the default.-- When using this, you will probably need to set font-variation-settings- explicitly, e.g.-- * { font-variation-settings: "slnt" 0deg }- .italic { font-variation-settings: "slnt" 10deg }-- */-@font-face {- font-family: "Inter var experimental";- font-weight: 100 900;- font-display: swap;- font-style: oblique 0deg 10deg;- src: url("/fonts/Inter.var.woff2?v=3.19") format("woff2");-}diff --git a/apps/designer/api/_build/_assets/menu-JGVTHS5V.css b/apps/designer/api/_build/_assets/menu-JGVTHS5V.cssdeleted file mode 100644index 97b0093f5d..0000000000--- a/apps/designer/api/_build/_assets/menu-JGVTHS5V.css+++ /dev/null@@ -1,153 +0,0 @@-.ProseMirror-textblock-dropdown {- min-width: 3em;-}--.ProseMirror-menu {- margin: 0 -4px;- line-height: 1;-}--.ProseMirror-tooltip .ProseMirror-menu {- width: -webkit-fit-content;- width: fit-content;- white-space: pre;-}--.ProseMirror-menuitem {- margin-right: 3px;- display: inline-block;-}--.ProseMirror-menuseparator {- border-right: 1px solid #ddd;- margin-right: 3px;-}--.ProseMirror-menu-dropdown,-.ProseMirror-menu-dropdown-menu {- font-size: 90%;- white-space: nowrap;-}--.ProseMirror-menu-dropdown {- vertical-align: 1px;- cursor: pointer;- position: relative;- padding-right: 15px;-}--.ProseMirror-menu-dropdown-wrap {- padding: 1px 0 1px 4px;- display: inline-block;- position: relative;-}--.ProseMirror-menu-dropdown:after {- content: "";- border-left: 4px solid transparent;- border-right: 4px solid transparent;- border-top: 4px solid currentColor;- opacity: 0.6;- position: absolute;- right: 4px;- top: calc(50% - 2px);-}--.ProseMirror-menu-dropdown-menu,-.ProseMirror-menu-submenu {- position: absolute;- background: white;- color: #666;- border: 1px solid #aaa;- padding: 2px;-}--.ProseMirror-menu-dropdown-menu {- z-index: 15;- min-width: 6em;-}--.ProseMirror-menu-dropdown-item {- cursor: pointer;- padding: 2px 8px 2px 4px;-}--.ProseMirror-menu-dropdown-item:hover {- background: #f2f2f2;-}--.ProseMirror-menu-submenu-wrap {- position: relative;- margin-right: -4px;-}--.ProseMirror-menu-submenu-label:after {- content: "";- border-top: 4px solid transparent;- border-bottom: 4px solid transparent;- border-left: 4px solid currentColor;- opacity: 0.6;- position: absolute;- right: 4px;- top: calc(50% - 4px);-}--.ProseMirror-menu-submenu {- display: none;- min-width: 4em;- left: 100%;- top: -3px;-}--.ProseMirror-menu-active {- background: #eee;- border-radius: 4px;-}--.ProseMirror-menu-disabled {- opacity: 0.3;-}--.ProseMirror-menu-submenu-wrap:hover .ProseMirror-menu-submenu,-.ProseMirror-menu-submenu-wrap-active .ProseMirror-menu-submenu {- display: block;-}--.ProseMirror-menubar {- border-top-left-radius: inherit;- border-top-right-radius: inherit;- position: relative;- min-height: 1em;- color: #666;- padding: 1px 6px;- top: 0;- left: 0;- right: 0;- border-bottom: 1px solid silver;- background: white;- z-index: 10;- -moz-box-sizing: border-box;- box-sizing: border-box;- overflow: visible;-}--.ProseMirror-icon {- display: inline-block;- line-height: 0.8;- vertical-align: -2px; /* Compensate for padding */- padding: 2px 8px;- cursor: pointer;-}--.ProseMirror-menu-disabled.ProseMirror-icon {- cursor: default;-}--.ProseMirror-icon svg {- fill: currentColor;- height: 1em;-}--.ProseMirror-icon span {- vertical-align: text-top;-}diff --git a/apps/designer/api/_build/_assets/prosemirror-JK3HES3O.css b/apps/designer/api/_build/_assets/prosemirror-JK3HES3O.cssdeleted file mode 100644index 03046c61c2..0000000000--- a/apps/designer/api/_build/_assets/prosemirror-JK3HES3O.css+++ /dev/null@@ -1,59 +0,0 @@-.ProseMirror {- position: relative;-}--.ProseMirror {- word-wrap: break-word;- white-space: pre-wrap;- white-space: break-spaces;- -webkit-font-variant-ligatures: none;- font-variant-ligatures: none;- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */-}--.ProseMirror pre {- white-space: pre-wrap;-}--.ProseMirror li {- position: relative;-}--.ProseMirror-hideselection *::selection {- background: transparent;-}-.ProseMirror-hideselection *::-moz-selection {- background: transparent;-}-.ProseMirror-hideselection {- caret-color: transparent;-}--.ProseMirror-selectednode {- outline: 2px solid #8cf;-}--/* Make sure li selections wrap around markers */--li.ProseMirror-selectednode {- outline: none;-}--li.ProseMirror-selectednode:after {- content: "";- position: absolute;- left: -32px;- right: -2px;- top: -2px;- bottom: -2px;- border: 2px solid #8cf;- pointer-events: none;-}--/* Protect against generic img rules */--img.ProseMirror-separator {- display: inline !important;- border: none !important;- margin: 0 !important;-}diff --git a/apps/designer/api/_build/assets.json b/apps/designer/api/_build/assets.jsondeleted file mode 100644index 45aa0c71d5..0000000000--- a/apps/designer/api/_build/assets.json+++ /dev/null@@ -1,270 +0,0 @@-{- "version": "c220d3c6",- "entry": {- "module": "/build/entry.client-KSQXW5NW.js",- "imports": [- "/build/_shared/chunk-PQHWZ5NF.js",- "/build/_shared/chunk-YVIHDCKB.js"- ]- },- "routes": {- "root": {- "id": "root",- "path": "",- "module": "/build/root-KGRGI5N4.js",- "hasAction": false,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/canvas": {- "id": "routes/canvas",- "parentId": "root",- "path": "canvas",- "module": "/build/routes/canvas-X4QBMSZW.js",- "imports": [- "/build/_shared/chunk-X3BRQPR3.js",- "/build/_shared/chunk-DOSTPNNE.js"- ],- "hasAction": false,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/canvas/$projectId": {- "id": "routes/canvas/$projectId",- "parentId": "routes/canvas",- "path": ":projectId",- "module": "/build/routes/canvas/$projectId-AWRF5D62.js",- "imports": [- "/build/_shared/chunk-BBJX4I6V.js",- "/build/_shared/chunk-MJIZYEOU.js",- "/build/_shared/chunk-UYSIIPFR.js",- "/build/_shared/chunk-ZXVF42MG.js"- ],- "hasAction": false,- "hasLoader": true,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/dashboard": {- "id": "routes/dashboard",- "parentId": "root",- "path": "dashboard",- "module": "/build/routes/dashboard-ZVAA325Q.js",- "imports": [- "/build/_shared/chunk-SNOZCNV2.js",- "/build/_shared/chunk-DOSTPNNE.js",- "/build/_shared/chunk-UYSIIPFR.js"- ],- "hasAction": false,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/dashboard/index": {- "id": "routes/dashboard/index",- "parentId": "routes/dashboard",- "index": true,- "module": "/build/routes/dashboard/index-CHYZFUOV.js",- "imports": [- "/build/_shared/chunk-MQ76QM5N.js",- "/build/_shared/chunk-ZXVF42MG.js"- ],- "hasAction": true,- "hasLoader": true,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/designer": {- "id": "routes/designer",- "parentId": "root",- "path": "designer",- "module": "/build/routes/designer-I7VPIU3I.js",- "imports": [- "/build/_shared/chunk-SNOZCNV2.js",- "/build/_shared/chunk-DOSTPNNE.js",- "/build/_shared/chunk-UYSIIPFR.js"- ],- "hasAction": false,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/designer/$id": {- "id": "routes/designer/$id",- "parentId": "routes/designer",- "path": ":id",- "module": "/build/routes/designer/$id-54DJYML4.js",- "imports": [- "/build/_shared/chunk-MJIZYEOU.js",- "/build/_shared/chunk-MQ76QM5N.js",- "/build/_shared/chunk-ZXVF42MG.js"- ],- "hasAction": false,- "hasLoader": true,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/index": {- "id": "routes/index",- "parentId": "root",- "index": true,- "module": "/build/routes/index-OED5JBR3.js",- "imports": [- "/build/_shared/chunk-377SNQSM.js",- "/build/_shared/chunk-BBJX4I6V.js",- "/build/_shared/chunk-MJIZYEOU.js",- "/build/_shared/chunk-DOSTPNNE.js",- "/build/_shared/chunk-UYSIIPFR.js",- "/build/_shared/chunk-ZXVF42MG.js"- ],- "hasAction": false,- "hasLoader": true,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/preview": {- "id": "routes/preview",- "parentId": "root",- "path": "preview",- "module": "/build/routes/preview-7XNIUBJS.js",- "imports": [- "/build/_shared/chunk-X3BRQPR3.js",- "/build/_shared/chunk-DOSTPNNE.js"- ],- "hasAction": false,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/preview/$projectId": {- "id": "routes/preview/$projectId",- "parentId": "routes/preview",- "path": ":projectId",- "module": "/build/routes/preview/$projectId-KPNBZI5E.js",- "imports": [- "/build/_shared/chunk-377SNQSM.js",- "/build/_shared/chunk-BBJX4I6V.js",- "/build/_shared/chunk-MJIZYEOU.js",- "/build/_shared/chunk-UYSIIPFR.js",- "/build/_shared/chunk-ZXVF42MG.js"- ],- "hasAction": false,- "hasLoader": true,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/delete-instance.$treeId": {- "id": "routes/rest/delete-instance.$treeId",- "parentId": "root",- "path": "rest/delete-instance/:treeId",- "module": "/build/routes/rest/delete-instance.$treeId-HTHOM3PU.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": true,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/insert-instance.$treeId": {- "id": "routes/rest/insert-instance.$treeId",- "parentId": "root",- "path": "rest/insert-instance/:treeId",- "module": "/build/routes/rest/insert-instance.$treeId-GMJ347MZ.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": true,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/props.$projectId": {- "id": "routes/rest/props.$projectId",- "parentId": "root",- "path": "rest/props/:projectId",- "module": "/build/routes/rest/props.$projectId-4DCANIYP.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": false,- "hasLoader": true,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/props.delete-prop": {- "id": "routes/rest/props.delete-prop",- "parentId": "root",- "path": "rest/props/delete-prop",- "module": "/build/routes/rest/props.delete-prop-EFJOVSWP.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": true,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/props.update": {- "id": "routes/rest/props.update",- "parentId": "root",- "path": "rest/props/update",- "module": "/build/routes/rest/props.update-2JPILHQQ.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": true,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/publish": {- "id": "routes/rest/publish",- "parentId": "root",- "path": "rest/publish",- "module": "/build/routes/rest/publish-YUKSAVIE.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": true,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/reparent-instance.$treeId": {- "id": "routes/rest/reparent-instance.$treeId",- "parentId": "root",- "path": "rest/reparent-instance/:treeId",- "module": "/build/routes/rest/reparent-instance.$treeId-6OTCML6F.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": true,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/tree.$projectId": {- "id": "routes/rest/tree.$projectId",- "parentId": "root",- "path": "rest/tree/:projectId",- "module": "/build/routes/rest/tree.$projectId-L66DWGKR.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": false,- "hasLoader": true,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/update-children.$treeId": {- "id": "routes/rest/update-children.$treeId",- "parentId": "root",- "path": "rest/update-children/:treeId",- "module": "/build/routes/rest/update-children.$treeId-SG65R4B5.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": true,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- },- "routes/rest/update-styles.$treeId": {- "id": "routes/rest/update-styles.$treeId",- "parentId": "root",- "path": "rest/update-styles/:treeId",- "module": "/build/routes/rest/update-styles.$treeId-LRT7VFQO.js",- "imports": ["/build/_shared/chunk-ZXVF42MG.js"],- "hasAction": true,- "hasLoader": false,- "hasCatchBoundary": false,- "hasErrorBoundary": false- }- },- "url": "/build/manifest-C220D3C6.js"-}diff --git a/apps/designer/api/_build/index.js b/apps/designer/api/_build/index.jsdeleted file mode 100644index ec5e6fb24c..0000000000--- a/apps/designer/api/_build/index.js+++ /dev/null@@ -1,8705 +0,0 @@-var __create = Object.create;-var __defProp = Object.defineProperty, __defProps = Object.defineProperties, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropDescs = Object.getOwnPropertyDescriptors, __getOwnPropNames = Object.getOwnPropertyNames, __getOwnPropSymbols = Object.getOwnPropertySymbols, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;-var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {- for (var prop in b || (b = {}))- __hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);- if (__getOwnPropSymbols)- for (var prop of __getOwnPropSymbols(b))- __propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);- return a;-}, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __markAsModule = (target) => __defProp(target, "__esModule", { value: !0 });-var __objRest = (source, exclude) => {- var target = {};- for (var prop in source)- __hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0 && (target[prop] = source[prop]);- if (source != null && __getOwnPropSymbols)- for (var prop of __getOwnPropSymbols(source))- exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop) && (target[prop] = source[prop]);- return target;-};-var __export = (target, all) => {- for (var name in all)- __defProp(target, name, { get: all[name], enumerable: !0 });-}, __reExport = (target, module2, copyDefault, desc) => {- if (module2 && typeof module2 == "object" || typeof module2 == "function")- for (let key of __getOwnPropNames(module2))- !__hasOwnProp.call(target, key) && (copyDefault || key !== "default") && __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });- return target;-}, __toESM = (module2, isNodeMode) => __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: !0 } : { value: module2, enumerable: !0 })), module2), __toCommonJS = /* @__PURE__ */ ((cache) => (module2, temp) => cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp))(typeof WeakMap != "undefined" ? /* @__PURE__ */ new WeakMap() : 0);--// <stdin>-var stdin_exports = {};-__export(stdin_exports, {- assets: () => assets_manifest_default,- entry: () => entry,- routes: () => routes-});--// ../../node_modules/@remix-run/dev/dist/compiler/shims/react.ts-var React = __toESM(require("react"));--// app/entry.server.tsx-var entry_server_exports = {};-__export(entry_server_exports, {- default: () => handleRequest-});-var import_server = require("react-dom/server"), import_react16 = require("@remix-run/react");--// app/critical-css.ts-var import_sdk = require("@webstudio-is/sdk");--// app/shared/design-system/stitches.config.ts-var import_react = require("@stitches/react"), import_colors = require("@radix-ui/colors"), {- styled,- css,- theme,- createTheme,- getCssText,- globalCss,- keyframes,- config,- reset-} = (0, import_react.createStitches)({- theme: {- colors: __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, import_colors.gray), import_colors.mauve), import_colors.slate), import_colors.sage), import_colors.olive), import_colors.sand), import_colors.tomato), import_colors.red), import_colors.crimson), import_colors.pink), import_colors.plum), import_colors.purple), import_colors.violet), import_colors.indigo), import_colors.blue), import_colors.sky), import_colors.mint), import_colors.cyan), import_colors.teal), import_colors.green), import_colors.grass), import_colors.lime), import_colors.yellow), import_colors.amber), import_colors.orange), import_colors.brown), import_colors.bronze), import_colors.gold), import_colors.grayA), import_colors.mauveA), import_colors.slateA), import_colors.sageA), import_colors.oliveA), import_colors.sandA), import_colors.tomatoA), import_colors.redA), import_colors.crimsonA), import_colors.pinkA), import_colors.plumA), import_colors.purpleA), import_colors.violetA), import_colors.indigoA), import_colors.blueA), import_colors.skyA), import_colors.mintA), import_colors.cyanA), import_colors.tealA), import_colors.greenA), import_colors.grassA), import_colors.limeA), import_colors.yellowA), import_colors.amberA), import_colors.orangeA), import_colors.brownA), import_colors.bronzeA), import_colors.goldA), import_colors.whiteA), import_colors.blackA), {- hiContrast: "$slate12",- loContrast: "$slate1",- muted: "$slate6",- primary: "$blue12",- canvas: "hsl(0 0% 93%)",- panel: "white",- transparentPanel: "hsl(0 0% 0% / 97%)",- shadowLight: "hsl(206 22% 7% / 35%)",- shadowDark: "hsl(206 22% 7% / 20%)",- background: "$slate1",- text: "$slate12"- }),- fonts: {- sans: "Inter, -apple-system, system-ui, sans-serif",- mono: "S\xF6hne Mono, menlo, monospace"- },- space: {- 1: "5px",- 2: "10px",- 3: "15px",- 4: "20px",- 5: "25px",- 6: "35px",- 7: "45px",- 8: "65px",- 9: "80px"- },- sizes: {- 1: "5px",- 2: "10px",- 3: "15px",- 4: "20px",- 5: "25px",- 6: "35px",- 7: "45px",- 8: "65px",- 9: "80px"- },- fontSizes: {- 1: "12px",- 2: "13px",- 3: "15px",- 4: "17px",- 5: "19px",- 6: "21px",- 7: "27px",- 8: "35px",- 9: "59px"- },- radii: {- 1: "4px",- 2: "6px",- 3: "8px",- 4: "12px",- round: "50%",- pill: "9999px"- },- zIndices: {- 1: "100",- 2: "200",- 3: "300",- 4: "400",- max: "999"- }- },- media: {- bp1: "(min-width: 520px)",- bp2: "(min-width: 900px)",- bp3: "(min-width: 1200px)",- bp4: "(min-width: 1800px)",- motion: "(prefers-reduced-motion)",- hover: "(any-hover: hover)",- dark: "(prefers-color-scheme: dark)",- light: "(prefers-color-scheme: light)"- },- utils: {- p: (value) => ({- padding: value- }),- pt: (value) => ({- paddingTop: value- }),- pr: (value) => ({- paddingRight: value- }),- pb: (value) => ({- paddingBottom: value- }),- pl: (value) => ({- paddingLeft: value- }),- px: (value) => ({- paddingLeft: value,- paddingRight: value- }),- py: (value) => ({- paddingTop: value,- paddingBottom: value- }),- m: (value) => ({- margin: value- }),- mt: (value) => ({- marginTop: value- }),- mr: (value) => ({- marginRight: value- }),- mb: (value) => ({- marginBottom: value- }),- ml: (value) => ({- marginLeft: value- }),- mx: (value) => ({- marginLeft: value,- marginRight: value- }),- my: (value) => ({- marginTop: value,- marginBottom: value- }),- ta: (value) => ({ textAlign: value }),- fd: (value) => ({- flexDirection: value- }),- fw: (value) => ({ flexWrap: value }),- ai: (value) => ({- alignItems: value- }),- ac: (value) => ({- alignContent: value- }),- jc: (value) => ({- justifyContent: value- }),- as: (value) => ({ alignSelf: value }),- fg: (value) => ({ flexGrow: value }),- fs: (value) => ({- flexShrink: value- }),- fb: (value) => ({ flexBasis: value }),- bc: (value) => ({- backgroundColor: value- }),- br: (value) => ({- borderRadius: value- }),- btrr: (value) => ({- borderTopRightRadius: value- }),- bbrr: (value) => ({- borderBottomRightRadius: value- }),- bblr: (value) => ({- borderBottomLeftRadius: value- }),- btlr: (value) => ({- borderTopLeftRadius: value- }),- bs: (value) => ({ boxShadow: value }),- lh: (value) => ({- lineHeight: value- }),- ox: (value) => ({ overflowX: value }),- oy: (value) => ({ overflowY: value }),- pe: (value) => ({- pointerEvents: value- }),- us: (value) => ({- WebkitUserSelect: value,- userSelect: value- }),- userSelect: (value) => ({- WebkitUserSelect: value,- userSelect: value- }),- size: (value) => ({- width: value,- height: value- }),- appearance: (value) => ({- WebkitAppearance: value,- appearance: value- }),- backgroundClip: (value) => ({- WebkitBackgroundClip: value,- backgroundClip: value- })- }-}), darkTheme = createTheme("dark-theme", {- colors: __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, import_colors.grayDark), import_colors.mauveDark), import_colors.slateDark), import_colors.sageDark), import_colors.oliveDark), import_colors.sandDark), import_colors.tomatoDark), import_colors.redDark), import_colors.crimsonDark), import_colors.pinkDark), import_colors.plumDark), import_colors.purpleDark), import_colors.violetDark), import_colors.indigoDark), import_colors.blueDark), import_colors.skyDark), import_colors.mintDark), import_colors.cyanDark), import_colors.tealDark), import_colors.greenDark), import_colors.grassDark), import_colors.limeDark), import_colors.yellowDark), import_colors.amberDark), import_colors.orangeDark), import_colors.brownDark), import_colors.bronzeDark), import_colors.goldDark), import_colors.grayDarkA), import_colors.mauveDarkA), import_colors.slateDarkA), import_colors.sageDarkA), import_colors.oliveDarkA), import_colors.sandDarkA), import_colors.tomatoDarkA), import_colors.redDarkA), import_colors.crimsonDarkA), import_colors.pinkDarkA), import_colors.plumDarkA), import_colors.purpleDarkA), import_colors.violetDarkA), import_colors.indigoDarkA), import_colors.blueDarkA), import_colors.skyDarkA), import_colors.mintDarkA), import_colors.cyanDarkA), import_colors.tealDarkA), import_colors.greenDarkA), import_colors.grassDarkA), import_colors.limeDarkA), import_colors.yellowDarkA), import_colors.amberDarkA), import_colors.orangeDarkA), import_colors.brownDarkA), import_colors.bronzeDarkA), import_colors.goldDarkA), {- muted: "$slate8",- primary: "$blue9",- hiContrast: "$slate12",- loContrast: "$slate1",- canvas: "hsl(0 0% 15%)",- panel: "$slate3",- transparentPanel: "hsl(0 100% 100% / 97%)",- shadowLight: "hsl(206 22% 7% / 35%)",- shadowDark: "hsl(206 22% 7% / 20%)",- background: "$slate12",- text: "$slate1"- })-});--// app/shared/design-system/index.ts-var Collapsible = __toESM(require("@radix-ui/react-collapsible")), import_react_accessible_icon = require("@radix-ui/react-accessible-icon"), Portal = __toESM(require("@radix-ui/react-portal"));--// app/shared/design-system/components/label.tsx-var LabelPrimitive = __toESM(require("@radix-ui/react-label"));--// app/shared/design-system/components/text.tsx-var Text = styled("div", {- lineHeight: "1",- margin: "0",- fontWeight: 400,- fontVariantNumeric: "tabular-nums",- display: "block",- variants: {- size: {- "1": {- fontSize: "$1"- },- "2": {- fontSize: "$2"- },- "3": {- fontSize: "$3"- },- "4": {- fontSize: "$4"- },- "5": {- fontSize: "$5",- letterSpacing: "-.015em"- },- "6": {- fontSize: "$6",- letterSpacing: "-.016em"- },- "7": {- fontSize: "$7",- letterSpacing: "-.031em",- textIndent: "-.005em"- },- "8": {- fontSize: "$8",- letterSpacing: "-.034em",- textIndent: "-.018em"- },- "9": {- fontSize: "$9",- letterSpacing: "-.055em",- textIndent: "-.025em"- }- },- variant: {- red: {- color: "$red11"- },- crimson: {- color: "$crimson11"- },- pink: {- color: "$pink11"- },- purple: {- color: "$purple11"- },- violet: {- color: "$violet11"- },- indigo: {- color: "$indigo11"- },- blue: {- color: "$blue11"- },- cyan: {- color: "$cyan11"- },- teal: {- color: "$teal11"- },- green: {- color: "$green11"- },- lime: {- color: "$lime11"- },- yellow: {- color: "$yellow11"- },- orange: {- color: "$orange11"- },- gold: {- color: "$gold11"- },- bronze: {- color: "$bronze11"- },- gray: {- color: "$slate11"- },- contrast: {- color: "$hiContrast"- },- loContrast: {- color: "$loContrast"- }- },- gradient: {- true: {- WebkitBackgroundClip: "text",- WebkitTextFillColor: "transparent"- }- }- },- compoundVariants: [- {- variant: "red",- gradient: "true",- css: {- background: "linear-gradient(to right, $red11, $crimson11)"- }- },- {- variant: "crimson",- gradient: "true",- css: {- background: "linear-gradient(to right, $crimson11, $pink11)"- }- },- {- variant: "pink",- gradient: "true",- css: {- background: "linear-gradient(to right, $pink11, $purple11)"- }- },- {- variant: "purple",- gradient: "true",- css: {- background: "linear-gradient(to right, $purple11, $violet11)"- }- },- {- variant: "violet",- gradient: "true",- css: {- background: "linear-gradient(to right, $violet11, $indigo11)"- }- },- {- variant: "indigo",- gradient: "true",- css: {- background: "linear-gradient(to right, $indigo11, $blue11)"- }- },- {- variant: "blue",- gradient: "true",- css: {- background: "linear-gradient(to right, $blue11, $cyan11)"- }- },- {- variant: "cyan",- gradient: "true",- css: {- background: "linear-gradient(to right, $cyan11, $teal11)"- }- },- {- variant: "teal",- gradient: "true",- css: {- background: "linear-gradient(to right, $teal11, $green11)"- }- },- {- variant: "green",- gradient: "true",- css: {- background: "linear-gradient(to right, $green11, $lime11)"- }- },- {- variant: "lime",- gradient: "true",- css: {- background: "linear-gradient(to right, $lime11, $yellow11)"- }- },- {- variant: "yellow",- gradient: "true",- css: {- background: "linear-gradient(to right, $yellow11, $orange11)"- }- },- {- variant: "orange",- gradient: "true",- css: {- background: "linear-gradient(to right, $orange11, $red11)"- }- },- {- variant: "gold",- gradient: "true",- css: {- background: "linear-gradient(to right, $gold11, $gold9)"- }- },- {- variant: "bronze",- gradient: "true",- css: {- background: "linear-gradient(to right, $bronze11, $bronze9)"- }- },- {- variant: "gray",- gradient: "true",- css: {- background: "linear-gradient(to right, $gray11, $gray12)"- }- },- {- variant: "contrast",- gradient: "true",- css: {- background: "linear-gradient(to right, $hiContrast, $gray12)"- }- }- ],- defaultVariants: {- size: "3",- variant: "contrast"- }-});--// app/shared/design-system/components/label.tsx-var Label = styled(LabelPrimitive.Root, Text, {- display: "inline-block",- verticalAlign: "middle",- cursor: "default",- lineHeight: 1.5-});--// app/shared/design-system/components/toggle-group.tsx-var toggle_group_exports = {};-__export(toggle_group_exports, {- Item: () => Item2,- Root: () => Root3-});-var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group")), Root3 = styled(ToggleGroupPrimitive.Root, {- display: "inline-flex",- backgroundColor: "$slate5",- borderRadius: 4,- boxShadow: "0 2px 10px $blackA7"-}), Item2 = styled(ToggleGroupPrimitive.Item, {- all: "unset",- backgroundColor: "$panel",- color: "$hiContrast",- display: "flex",- whiteSpace: "nowrap",- fontSize: 15,- lineHeight: 1,- alignItems: "center",- justifyContent: "center",- marginLeft: 1,- "&": {- px: "$2",- py: "$1"- },- "&:first-child": {- marginLeft: 0,- borderTopLeftRadius: 4,- borderBottomLeftRadius: 4- },- "&:last-child": { borderTopRightRadius: 4, borderBottomRightRadius: 4 },- "&:hover": { backgroundColor: "$slateA3" },- "&[data-state=on]": {- backgroundColor: "$slateA5"- },- "&:focus": {- position: "relative",- boxShadow: "0 0 0 2px black"- }-});--// app/shared/design-system/components/select.tsx-var SelectPrimitive = __toESM(require("@radix-ui/react-select")), import_lodash = __toESM(require("lodash.noop")), import_react2 = __toESM(require("react"));--// app/shared/icons/index.ts-var icons_exports = {};-__export(icons_exports, {- BrushIcon: () => BrushIcon,- DevicesIcon: () => DevicesIcon,- FormIcon: () => FormIcon,- GithubIcon: () => GithubIcon,- GoogleIcon: () => GoogleIcon,- ListNestedIcon: () => ListNestedIcon,- RedoIcon: () => RedoIcon,- TabletIcon: () => TabletIcon,- UndoIcon: () => UndoIcon-});-__reExport(icons_exports, require("@radix-ui/react-icons"));--// app/shared/icons/list-nested.tsx-var React2 = __toESM(require("react")), ListNestedIcon = React2.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React2.createElement("svg", __spreadProps(__spreadValues({- width: "15",- height: "15",- viewBox: "0 0 15 15",- fill: "none",- xmlns: "http://www.w3.org/2000/svg"- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React2.createElement("path", {- fill: color,- fillRule: "evenodd",- clipRule: "evenodd",- d: "M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z"- }));-});-ListNestedIcon.displayName = "ListNestedIcon";--// app/shared/icons/brush.tsx-var React3 = __toESM(require("react")), BrushIcon = React3.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React3.createElement("svg", __spreadProps(__spreadValues({- width: "15",- height: "15",- viewBox: "0 0 24 24",- fill: "none",- xmlns: "http://www.w3.org/2000/svg"- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React3.createElement("path", {- fill: color,- fillRule: "evenodd",- clipRule: "evenodd",- d: "M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37-1.34-1.34a.9959.9959 0 0 0-1.41 0L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41z"- }));-});-BrushIcon.displayName = "BrushIcon";--// app/shared/icons/form.tsx-var React4 = __toESM(require("react")), FormIcon = React4.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React4.createElement("svg", __spreadProps(__spreadValues({- width: "15",- height: "15",- viewBox: "0 0 24 24",- fill: "none",- xmlns: "http://www.w3.org/2000/svg"- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React4.createElement("path", {- fill: color,- fillRule: "evenodd",- clipRule: "evenodd",- d: "M13 11H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h9v7zM4 9h7V6H4v3zm11 11H4c-1.1 0-2-.9-2-2v-3c0-1.1.9-2 2-2h11v7zM4 18h9v-3H4v3zm18-9h-2l2-5h-7v7h2v9l5-11zM4.75 17.25h1.5v-1.5h-1.5v1.5zm0-9h1.5v-1.5h-1.5v1.5z"- }));-});-FormIcon.displayName = "FormIcon";--// app/shared/icons/undo.tsx-var React5 = __toESM(require("react")), UndoIcon = React5.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React5.createElement("svg", __spreadProps(__spreadValues({- xmlns: "http://www.w3.org/2000/svg",- height: "15",- width: "15",- viewBox: "0 0 24 24",- fill: color- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React5.createElement("path", {- d: "M0 0h24v24H0z",- fill: "none"- }), /* @__PURE__ */ React5.createElement("path", {- d: "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"- }));-});-UndoIcon.displayName = "UndoIcon";--// app/shared/icons/redo.tsx-var React6 = __toESM(require("react")), RedoIcon = React6.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React6.createElement("svg", __spreadProps(__spreadValues({- xmlns: "http://www.w3.org/2000/svg",- height: "15",- width: "15",- viewBox: "0 0 24 24",- fill: color- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React6.createElement("path", {- d: "M0 0h24v24H0z",- fill: "none"- }), /* @__PURE__ */ React6.createElement("path", {- d: "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"- }));-});-RedoIcon.displayName = "RedoIcon";--// app/shared/icons/google.tsx-var React7 = __toESM(require("react")), GoogleIcon = React7.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React7.createElement("svg", __spreadProps(__spreadValues({- role: "img",- viewBox: "0 0 24 24",- xmlns: "http://www.w3.org/2000/svg"- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React7.createElement("title", null, "Google"), /* @__PURE__ */ React7.createElement("path", {- d: "M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z",- fill: color- }));-});-GoogleIcon.displayName = "GoogleIcon";--// app/shared/icons/github.tsx-var React8 = __toESM(require("react")), GithubIcon = React8.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React8.createElement("svg", __spreadProps(__spreadValues({- role: "img",- viewBox: "0 0 24 24",- xmlns: "http://www.w3.org/2000/svg"- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React8.createElement("title", null, "GitHub"), /* @__PURE__ */ React8.createElement("path", {- d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",- fill: color- }));-});-GithubIcon.displayName = "GithubIcon";--// app/shared/icons/devices.tsx-var React9 = __toESM(require("react")), DevicesIcon = React9.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React9.createElement("svg", __spreadProps(__spreadValues({- width: "15",- height: "15",- viewBox: "0 0 24 24",- fill: "none",- xmlns: "http://www.w3.org/2000/svg"- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React9.createElement("path", {- fill: color,- d: "M22.265 9.51L17.265 9.5C16.715 9.5 16.265 9.95 16.265 10.5V19.5C16.265 20.05 16.715 20.5 17.265 20.5H22.265C22.815 20.5 23.265 20.05 23.265 19.5V10.5C23.265 9.95 22.815 9.51 22.265 9.51ZM22.265 19.5H17.265V10.5H19.5H22.265V19.5ZM20.265 1.5H2.26499C1.15499 1.5 0.264988 2.39 0.264988 3.5V15.5C0.264988 16.6 1.15499 17.5 2.26499 17.5H10.5V19.5H7.26499V20.5H15.265V19.5H12.5V17.5H15.265V16.5H1.26499V2.5H21.265V8.5H22.265V3.5C22.265 2.39 21.365 1.5 20.265 1.5Z"- }));-});-DevicesIcon.displayName = "DevicesIcon";--// app/shared/icons/tablet.tsx-var React10 = __toESM(require("react")), TabletIcon = React10.forwardRef((_a, forwardedRef) => {- var _b = _a, { color = "currentColor" } = _b, props2 = __objRest(_b, ["color"]);- return /* @__PURE__ */ React10.createElement("svg", __spreadProps(__spreadValues({- width: "15",- height: "15",- viewBox: "0 0 24 24",- fill: "none",- xmlns: "http://www.w3.org/2000/svg"- }, props2), {- ref: forwardedRef- }), /* @__PURE__ */ React10.createElement("path", {- fill: color,- d: "M20 0H6C4.34 0 4 0.84 4 2.5V20.5C4 22.16 5.34 23.5 7 23.5H19C20.66 23.5 22 22.16 22 20.5V2.5C22 0.84 21.66 0 20 0ZM15 22.5H13H11V22H13H15V22.5ZM21 21H13H5V10.5V1H13H21V21Z"- }));-});-TabletIcon.displayName = "TabletIcon";--// app/shared/design-system/components/select.tsx-var StyledTrigger = styled(SelectPrimitive.SelectTrigger, {- all: "unset",- display: "inline-flex",- alignItems: "center",- justifyContent: "space-between",- fontVariantNumeric: "tabular-nums",- gap: "$2",- flexShrink: 0,- borderRadius: "$1",- backgroundColor: "$loContrast",- color: "$hiContrast",- boxShadow: "inset 0 0 0 1px $colors$slate7",- "&:hover": {- backgroundColor: "$slateA3"- },- "&:focus": {- boxShadow: "inset 0px 0px 0px 1px $colors$blue8, 0px 0px 0px 1px $colors$blue8"- },- variants: {- size: {- 1: { padding: "0 $1 0 $2", fontSize: "$1", height: "$5" },- 2: { padding: "0 $2 0 $3", height: "$6", fontSize: "$3" }- },- ghost: {- true: {- backgroundColor: "transparent",- boxShadow: "none"- }- },- fullWidth: {- true: {- width: "100%"- }- }- },- defaultVariants: {- size: 1- }-}), StyledIcon = styled(SelectPrimitive.Icon, {- display: "inline-flex",- alignItems: "center"-}), StyledContent = styled(SelectPrimitive.Content, {- overflow: "hidden",- backgroundColor: "$muted",- borderRadius: "$1",- boxShadow: "0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2)"-}), StyledViewport = styled(SelectPrimitive.Viewport, {- py: "$1"-}), StyledItem = styled(SelectPrimitive.Item, {- all: "unset",- fontSize: "$1",- lineHeight: 1,- color: "$hiContrast",- display: "flex",- alignItems: "center",- height: "$5",- padding: "0 $6 0 $5",- position: "relative",- userSelect: "none",- "&[data-disabled]": {- color: "$muted",- pointerEvents: "none"- },- "&:focus": {- backgroundColor: "$primary",- color: "$hiContrast"- }-}), StyledItemIndicator = styled(SelectPrimitive.ItemIndicator, {- position: "absolute",- left: 0,- width: 25,- display: "inline-flex",- alignItems: "center",- justifyContent: "center"-}), scrollButtonStyles = {- display: "flex",- alignItems: "center",- justifyContent: "center",- height: 25,- color: "$text",- cursor: "default"-}, SelectScrollUpButton = styled(SelectPrimitive.ScrollUpButton, scrollButtonStyles), SelectScrollDownButton = styled(SelectPrimitive.ScrollDownButton, scrollButtonStyles), SelectItemBase = (_a, forwardedRef) => {- var _b = _a, { children: children6 } = _b, props2 = __objRest(_b, ["children"]);- return /* @__PURE__ */ import_react2.default.createElement(StyledItem, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef- }), /* @__PURE__ */ import_react2.default.createElement(SelectPrimitive.ItemText, null, children6), /* @__PURE__ */ import_react2.default.createElement(StyledItemIndicator, null, /* @__PURE__ */ import_react2.default.createElement(icons_exports.CheckIcon, null)));-}, SelectItem = import_react2.default.forwardRef(SelectItemBase), SelectBase = (_a, forwardedRef) => {- var _b = _a, {- options: options2,- value,- defaultValue,- placeholder = "Select an option",- onChange = import_lodash.default,- getLabel = (option) => option,- name- } = _b, props2 = __objRest(_b, [- "options",- "value",- "defaultValue",- "placeholder",- "onChange",- "getLabel",- "name"- ]);- return /* @__PURE__ */ import_react2.default.createElement(SelectPrimitive.Root, {- name,- value,- defaultValue,- onValueChange: onChange- }, /* @__PURE__ */ import_react2.default.createElement(StyledTrigger, __spreadValues({- ref: forwardedRef- }, props2), /* @__PURE__ */ import_react2.default.createElement(SelectPrimitive.Value, null, value ? getLabel(value) : placeholder), /* @__PURE__ */ import_react2.default.createElement(StyledIcon, null, /* @__PURE__ */ import_react2.default.createElement(icons_exports.CaretSortIcon, null))), /* @__PURE__ */ import_react2.default.createElement(StyledContent, null, /* @__PURE__ */ import_react2.default.createElement(SelectScrollUpButton, null, /* @__PURE__ */ import_react2.default.createElement(icons_exports.ChevronUpIcon, null)), /* @__PURE__ */ import_react2.default.createElement(StyledViewport, null, options2.map((option) => /* @__PURE__ */ import_react2.default.createElement(SelectItem, {- key: option,- value: option,- textValue: option- }, getLabel(option)))), /* @__PURE__ */ import_react2.default.createElement(SelectScrollDownButton, null, /* @__PURE__ */ import_react2.default.createElement(icons_exports.ChevronDownIcon, null))));-}, Select = import_react2.default.forwardRef(SelectBase);-Select.displayName = "Select";--// app/shared/design-system/components/text-field.tsx-var TextField = styled("input", {- appearance: "none",- borderWidth: "0",- boxSizing: "border-box",- fontFamily: "inherit",- margin: "0",- outline: "none",- padding: "0",- width: "100%",- WebkitTapHighlightColor: "rgba(0,0,0,0)",- "&::before": {- boxSizing: "border-box"- },- "&::after": {- boxSizing: "border-box"- },- backgroundColor: "$loContrast",- boxShadow: "inset 0 0 0 1px $colors$slate7",- color: "$hiContrast",- fontVariantNumeric: "tabular-nums",- "&:-webkit-autofill": {- boxShadow: "inset 0 0 0 1px $colors$blue6, inset 0 0 0 100px $colors$blue3"- },- "&:-webkit-autofill::first-line": {- fontFamily: "$untitled",- color: "$hiContrast"- },- "&:focus": {- boxShadow: "inset 0px 0px 0px 1px $colors$blue8, 0px 0px 0px 1px $colors$blue8",- "&:-webkit-autofill": {- boxShadow: "inset 0px 0px 0px 1px $colors$blue8, 0px 0px 0px 1px $colors$blue8, inset 0 0 0 100px $colors$blue3"- }- },- "&::placeholder": {- color: "$slate9"- },- "&:disabled": {- pointerEvents: "none",- backgroundColor: "$slate2",- color: "$slate8",- cursor: "not-allowed",- "&::placeholder": {- color: "$slate7"- }- },- "&:read-only": {- backgroundColor: "$slate2",- "&:focus": {- boxShadow: "inset 0px 0px 0px 1px $colors$slate7"- }- },- '&[type="number"]': {- "&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {- WebkitAppearance: "none",- MozAppearance: "textfield",- margin: 0,- display: "none"- }- },- variants: {- size: {- "1": {- borderRadius: "$1",- height: "$5",- fontSize: "$1",- px: "$1",- lineHeight: "$sizes$5",- "&:-webkit-autofill::first-line": {- fontSize: "$1"- }- },- "2": {- borderRadius: "$2",- height: "$6",- fontSize: "$3",- px: "$2",- lineHeight: "$sizes$6",- "&:-webkit-autofill::first-line": {- fontSize: "$3"- }- }- },- variant: {- ghost: {- boxShadow: "none",- backgroundColor: "transparent",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px $colors$slateA7"- }- },- "&:focus": {- backgroundColor: "$loContrast",- boxShadow: "inset 0px 0px 0px 1px $colors$blue8, 0px 0px 0px 1px $colors$blue8"- },- "&:disabled": {- backgroundColor: "transparent"- },- "&:read-only": {- backgroundColor: "transparent"- }- }- },- state: {- invalid: {- boxShadow: "inset 0 0 0 1px $colors$red7",- "&:focus": {- boxShadow: "inset 0px 0px 0px 1px $colors$red8, 0px 0px 0px 1px $colors$red8"- }- },- valid: {- boxShadow: "inset 0 0 0 1px $colors$green7",- "&:focus": {- boxShadow: "inset 0px 0px 0px 1px $colors$green8, 0px 0px 0px 1px $colors$green8"- }- }- },- cursor: {- default: {- cursor: "default",- "&:focus": {- cursor: "text"- }- },- text: {- cursor: "text"- }- }- },- defaultVariants: {- size: "1"- }-});--// app/shared/design-system/components/flex.tsx-var Flex = styled("div", {- boxSizing: "border-box",- display: "flex",- variants: {- direction: {- row: {- flexDirection: "row"- },- column: {- flexDirection: "column"- },- rowReverse: {- flexDirection: "row-reverse"- },- columnReverse: {- flexDirection: "column-reverse"- }- },- align: {- start: {- alignItems: "flex-start"- },- center: {- alignItems: "center"- },- end: {- alignItems: "flex-end"- },- stretch: {- alignItems: "stretch"- },- baseline: {- alignItems: "baseline"- }- },- justify: {- start: {- justifyContent: "flex-start"- },- center: {- justifyContent: "center"- },- end: {- justifyContent: "flex-end"- },- between: {- justifyContent: "space-between"- }- },- wrap: {- noWrap: {- flexWrap: "nowrap"- },- wrap: {- flexWrap: "wrap"- },- wrapReverse: {- flexWrap: "wrap-reverse"- }- },- gap: {- 1: {- gap: "$1"- },- 2: {- gap: "$2"- },- 3: {- gap: "$3"- },- 4: {- gap: "$4"- },- 5: {- gap: "$5"- },- 6: {- gap: "$6"- },- 7: {- gap: "$7"- },- 8: {- gap: "$8"- },- 9: {- gap: "$9"- }- }- },- defaultVariants: {- direction: "row",- align: "stretch",- justify: "start",- wrap: "noWrap"- }-});--// app/shared/design-system/components/grid.tsx-var Grid = styled("div", {- boxSizing: "border-box",- display: "grid",- variants: {- align: {- start: {- alignItems: "start"- },- center: {- alignItems: "center"- },- end: {- alignItems: "end"- },- stretch: {- alignItems: "stretch"- },- baseline: {- alignItems: "baseline"- }- },- justify: {- start: {- justifyContent: "start"- },- center: {- justifyContent: "center"- },- end: {- justifyContent: "end"- },- between: {- justifyContent: "space-between"- }- },- flow: {- row: {- gridAutoFlow: "row"- },- column: {- gridAutoFlow: "column"- },- dense: {- gridAutoFlow: "dense"- },- rowDense: {- gridAutoFlow: "row dense"- },- columnDense: {- gridAutoFlow: "column dense"- }- },- columns: {- 1: {- gridTemplateColumns: "repeat(1, 1fr)"- },- 2: {- gridTemplateColumns: "repeat(2, 1fr)"- },- 3: {- gridTemplateColumns: "repeat(3, 1fr)"- },- 4: {- gridTemplateColumns: "repeat(4, 1fr)"- }- },- gap: {- 1: {- gap: "$1"- },- 2: {- gap: "$2"- },- 3: {- gap: "$3"- },- 4: {- gap: "$4"- },- 5: {- gap: "$5"- },- 6: {- gap: "$6"- },- 7: {- gap: "$7"- },- 8: {- gap: "$8"- },- 9: {- gap: "$9"- }- },- gapX: {- 1: {- columnGap: "$1"- },- 2: {- columnGap: "$2"- },- 3: {- columnGap: "$3"- },- 4: {- columnGap: "$4"- },- 5: {- columnGap: "$5"- },- 6: {- columnGap: "$6"- },- 7: {- columnGap: "$7"- },- 8: {- columnGap: "$8"- },- 9: {- columnGap: "$9"- }- },- gapY: {- 1: {- rowGap: "$1"- },- 2: {- rowGap: "$2"- },- 3: {- rowGap: "$3"- },- 4: {- rowGap: "$4"- },- 5: {- rowGap: "$5"- },- 6: {- rowGap: "$6"- },- 7: {- rowGap: "$7"- },- 8: {- rowGap: "$8"- },- 9: {- rowGap: "$9"- }- }- }-});--// app/shared/design-system/components/tabs.tsx-var import_react3 = __toESM(require("react"));-var TabsPrimitive = __toESM(require("@radix-ui/react-tabs")), Tabs = styled(TabsPrimitive.Root, {- display: "flex",- '&[data-orientation="horizontal"]': {- flexDirection: "column"- }-}), TabsTrigger = styled(TabsPrimitive.Trigger, {- flexShrink: 0,- size: "$6",- display: "inline-flex",- lineHeight: 1,- fontFamily: "inherit",- fontSize: "$1",- px: "$2",- userSelect: "none",- outline: "none",- alignItems: "center",- justifyContent: "center",- color: "$slate11",- border: "none",- borderBottom: "1px solid transparent",- borderTopLeftRadius: "$2",- borderTopRightRadius: "$2",- zIndex: "10",- backgroundColor: "transparent",- "@hover": {- "&:hover": {- color: "$hiContrast"- }- },- '&[data-state="active"]': {- color: "$hiContrast",- borderColor: "$slate6"- },- '&[data-orientation="vertical"]': {- justifyContent: "flex-start",- borderTopRightRadius: 0,- borderBottomLeftRadius: "$2",- borderBottomColor: "transparent",- '&[data-state="active"]': {- borderBottomColor: "$slate6",- borderRightColor: "transparent"- }- }-}), StyledTabsList = styled(TabsPrimitive.List, {- flexShrink: 0,- display: "flex",- "&:focus": {- outline: "none",- boxShadow: "inset 0 0 0 1px $slate8, 0 0 0 1px $slate8"- },- '&[data-orientation="vertical"]': {- flexDirection: "column",- boxShadow: "inset -1px 0 0 $slate6"- }-}), TabsList = import_react3.default.forwardRef((props2, forwardedRef) => /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(StyledTabsList, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef-}))));-TabsList.displayName = "TabsList";-var TabsContent = styled(TabsPrimitive.Content, {- flexGrow: 1,- "&:focus": {- outline: "none",- boxShadow: "inset 0 0 0 1px $slate8, 0 0 0 1px $slate8"- },- '&[data-state="inactive"]': {- display: "none"- }-});--// app/shared/design-system/components/sidebar-tabs.tsx-var import_react4 = __toESM(require("react"));-var TabsPrimitive2 = __toESM(require("@radix-ui/react-tabs")), SidebarTabs = styled(TabsPrimitive2.Root, {- display: "flex",- flexDirection: "column",- alignItems: "center"-}), SidebarTabsTrigger = styled(TabsPrimitive2.Trigger, {- flexShrink: 0,- display: "flex",- size: "$6",- m: 0,- userSelect: "none",- outline: "none",- alignItems: "center",- justifyContent: "center",- color: "$slate11",- border: "1px solid transparent",- zIndex: "10",- backgroundColor: "transparent",- "@hover": {- "&:hover": {- backgroundColor: "$slateA3",- color: "$hiContrast"- }- },- '&[data-state="active"]': {- color: "$hiContrast",- backgroundColor: "$slateA4",- borderColor: "$slate6"- }-}), StyledTabsList2 = styled(TabsPrimitive2.List, {- flexShrink: 0,- display: "flex",- flexDirection: "column",- alignItems: "center",- "&:focus": {- outline: "none",- boxShadow: "inset 0 0 0 1px $slate8, 0 0 0 1px $slate8"- },- '&[data-orientation="vertical"]': {- boxShadow: "inset -1px 0 0 $slate6"- }-}), SidebarTabsList = import_react4.default.forwardRef((props2, forwardedRef) => /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(StyledTabsList2, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef-}))));-SidebarTabsList.displayName = "SidebarTabsList";-var SidebarTabsContent = styled(TabsPrimitive2.Content, {- flexGrow: 1,- position: "absolute",- top: 0,- left: "100%",- width: 400,- height: "100%",- bc: "$loContrast",- outline: "1px solid $slate6",- "&:focus": {- outline: "none",- boxShadow: "inset 0 0 0 1px $slate8, 0 0 0 1px $slate8"- }-});--// app/shared/design-system/components/card.tsx-var Card = styled("div", {- appearance: "none",- border: "none",- boxSizing: "border-box",- font: "inherit",- lineHeight: "1",- outline: "none",- textAlign: "inherit",- verticalAlign: "middle",- WebkitTapHighlightColor: "rgba(0, 0, 0, 0)",- backgroundColor: "$panel",- display: "block",- textDecoration: "none",- color: "inherit",- flexShrink: 0,- borderRadius: "$3",- position: "relative",- "&::before": {- boxSizing: "border-box",- content: '""',- position: "absolute",- top: 0,- right: 0,- bottom: 0,- left: 0,- boxShadow: "inset 0 0 0 1px rgba(0,0,0,.1)",- borderRadius: "$3",- pointerEvents: "none"- },- variants: {- size: {- 1: {- width: "$10",- padding: "$5"- },- 2: {- width: "$12",- padding: "$7"- }- },- variant: {- interactive: {- "@hover": {- "&:hover": {- "&::before": {- boxShadow: "inset 0 0 0 1px rgba(0,0,0,.2)"- }- }- },- "&:focus": {- "&::before": {- boxShadow: "inset 0 0 0 1px $colors$blue8, 0 0 0 1px $colors$blue8"- }- }- },- ghost: {- backgroundColor: "transparent",- transition: "transform 200ms cubic-bezier(0.22, 1, 0.36, 1), background-color 25ms linear",- willChange: "transform",- "&::before": {- boxShadow: "0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2)",- opacity: "0",- transition: "all 200ms cubic-bezier(0.22, 1, 0.36, 1)"- },- "@hover": {- "&:hover": {- backgroundColor: "$panel",- transform: "translateY(-2px)",- "&::before": {- opacity: "1"- }- }- },- "&:active": {- transform: "translateY(0)",- transition: "none",- "&::before": {- boxShadow: "0px 5px 16px -5px rgba(22, 23, 24, 0.35), 0px 5px 10px -7px rgba(22, 23, 24, 0.2)",- opacity: "1"- }- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$blue8, 0 0 0 1px $colors$blue8"- }- },- active: {- transform: "translateY(0)",- transition: "none",- "&::before": {- boxShadow: "0px 5px 16px -5px rgba(22, 23, 24, 0.35), 0px 5px 10px -7px rgba(22, 23, 24, 0.2)",- opacity: "1"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$blue8, 0 0 0 1px $colors$blue8"- }- }- }- },- defaultVariants: {- size: "1"- }-});--// app/shared/design-system/components/simple-toggle.tsx-var TogglePrimitive = __toESM(require("@radix-ui/react-toggle")), SimpleToggle = styled(TogglePrimitive.Root, {- alignItems: "center",- appearance: "none",- borderWidth: "0",- boxSizing: "border-box",- display: "inline-flex",- flexShrink: 0,- fontFamily: "inherit",- fontSize: "14px",- justifyContent: "center",- lineHeight: "1",- outline: "none",- padding: "0",- textDecoration: "none",- userSelect: "none",- WebkitTapHighlightColor: "transparent",- color: "$hiContrast",- "&::before": {- boxSizing: "border-box"- },- "&::after": {- boxSizing: "border-box"- },- height: "$5",- width: "$5",- backgroundColor: "transparent",- "@hover": {- "&:hover": {- backgroundColor: "$slateA3"- }- },- "&:active": {- backgroundColor: "$slateA4"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $slateA8, 0 0 0 1px $slateA8",- zIndex: 1- },- '&[data-state="on"]': {- backgroundColor: "$slateA5",- "@hover": {- "&:hover": {- backgroundColor: "$slateA5"- }- },- "&:active": {- backgroundColor: "$slateA7"- }- },- variants: {- shape: {- circle: {- borderRadius: "$round"- },- square: {- borderRadius: "$1"- }- }- }-});--// app/shared/design-system/components/box.tsx-var Box = styled("div", {- boxSizing: "border-box"-});--// app/shared/design-system/components/tooltip.tsx-var import_react5 = __toESM(require("react"));-var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));-var Content5 = styled(TooltipPrimitive.Content, {- backgroundColor: "$loContrast",- boxShadow: "inset 0 0 0 1px $colors$slate7",- color: "$hiContrast",- borderRadius: "$1",- padding: "$1 $2",- variants: {- multiline: {- true: {- maxWidth: 250,- pb: 7- }- }- }-}), Tooltip = (_a) => {- var _b = _a, {- children: children6,- content,- open,- defaultOpen,- onOpenChange,- multiline,- delayDuration- } = _b, props2 = __objRest(_b, [- "children",- "content",- "open",- "defaultOpen",- "onOpenChange",- "multiline",- "delayDuration"- ]);- return /* @__PURE__ */ import_react5.default.createElement(TooltipPrimitive.Root, {- open,- defaultOpen,- onOpenChange,- delayDuration- }, /* @__PURE__ */ import_react5.default.createElement(TooltipPrimitive.Trigger, {- asChild: !0- }, children6), /* @__PURE__ */ import_react5.default.createElement(Content5, __spreadProps(__spreadValues({- side: "top",- align: "center",- sideOffset: 5- }, props2), {- multiline- }), /* @__PURE__ */ import_react5.default.createElement(Text, {- size: "1",- as: "p",- css: {- color: "currentColor",- lineHeight: multiline ? "$5" : void 0- }- }, content), /* @__PURE__ */ import_react5.default.createElement(Box, {- css: { color: "$transparentExtreme" }- }, /* @__PURE__ */ import_react5.default.createElement(TooltipPrimitive.Arrow, {- offset: 5,- width: 11,- height: 5,- style: {- fill: "$loContrast"- }- }))));-};--// app/shared/design-system/components/button.tsx-var Button = styled("button", {- all: "unset",- alignItems: "center",- boxSizing: "border-box",- userSelect: "none",- "&::before": {- boxSizing: "border-box"- },- "&::after": {- boxSizing: "border-box"- },- display: "inline-flex",- flexShrink: 0,- justifyContent: "center",- lineHeight: "1",- WebkitTapHighlightColor: "rgba(0,0,0,0)",- height: "$5",- px: "$2",- fontFamily: "$untitled",- fontSize: "$2",- fontWeight: 500,- fontVariantNumeric: "tabular-nums",- "&:disabled": {- backgroundColor: "$slate2",- boxShadow: "inset 0 0 0 1px $colors$slate7",- color: "$slate8",- pointerEvents: "none"- },- variants: {- size: {- "1": {- borderRadius: "$1",- height: "$5",- px: "$2",- fontSize: "$1",- lineHeight: "$sizes$5"- },- "2": {- borderRadius: "$2",- height: "$6",- px: "$3",- fontSize: "$3",- lineHeight: "$sizes$6"- },- "3": {- borderRadius: "$2",- height: "$7",- px: "$4",- fontSize: "$4",- lineHeight: "$sizes$7"- }- },- variant: {- gray: {- backgroundColor: "$loContrast",- boxShadow: "inset 0 0 0 1px $colors$slate7",- color: "$hiContrast",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px $colors$slate8"- }- },- "&:active": {- backgroundColor: "$slate2",- boxShadow: "inset 0 0 0 1px $colors$slate8"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$slate8, 0 0 0 1px $colors$slate8"- },- '&[data-state="open"]': {- backgroundColor: "$slate4",- boxShadow: "inset 0 0 0 1px $colors$slate8"- }- },- blue: {- backgroundColor: "$blue2",- boxShadow: "inset 0 0 0 1px $colors$blue7",- color: "$blue11",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px $colors$blue8"- }- },- "&:active": {- backgroundColor: "$blue3",- boxShadow: "inset 0 0 0 1px $colors$blue8"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$blue8, 0 0 0 1px $colors$blue8"- },- '&[data-state="open"]': {- backgroundColor: "$blue4",- boxShadow: "inset 0 0 0 1px $colors$blue8"- }- },- green: {- backgroundColor: "$green2",- boxShadow: "inset 0 0 0 1px $colors$green7",- color: "$green11",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px $colors$green8"- }- },- "&:active": {- backgroundColor: "$green3",- boxShadow: "inset 0 0 0 1px $colors$green8"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$green8, 0 0 0 1px $colors$green8"- },- '&[data-state="open"]': {- backgroundColor: "$green4",- boxShadow: "inset 0 0 0 1px $colors$green8"- }- },- red: {- backgroundColor: "$loContrast",- boxShadow: "inset 0 0 0 1px $colors$slate7",- color: "$red11",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px $colors$slate8"- }- },- "&:active": {- backgroundColor: "$red3",- boxShadow: "inset 0 0 0 1px $colors$red8"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$red8, 0 0 0 1px $colors$red8"- },- '&[data-state="open"]': {- backgroundColor: "$red4",- boxShadow: "inset 0 0 0 1px $colors$red8"- }- },- transparentWhite: {- backgroundColor: "hsla(0,100%,100%,.2)",- color: "white",- "@hover": {- "&:hover": {- backgroundColor: "hsla(0,100%,100%,.25)"- }- },- "&:active": {- backgroundColor: "hsla(0,100%,100%,.3)"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px hsla(0,100%,100%,.35), 0 0 0 1px hsla(0,100%,100%,.35)"- }- },- raw: {- background: "transparent",- color: "inherit",- padding: 0,- borderRadius: 0,- height: "auto"- },- transparentBlack: {- backgroundColor: "hsla(0,0%,0%,.2)",- color: "black",- "@hover": {- "&:hover": {- backgroundColor: "hsla(0,0%,0%,.25)"- }- },- "&:active": {- backgroundColor: "hsla(0,0%,0%,.3)"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px hsla(0,0%,0%,.35), 0 0 0 1px hsla(0,0%,0%,.35)"- }- }- },- state: {- active: {- backgroundColor: "$slate4",- boxShadow: "inset 0 0 0 1px $colors$slate8",- color: "$slate11",- "@hover": {- "&:hover": {- backgroundColor: "$slate5",- boxShadow: "inset 0 0 0 1px $colors$slate8"- }- },- "&:active": {- backgroundColor: "$slate5"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$slate8, 0 0 0 1px $colors$slate8"- }- },- waiting: {- backgroundColor: "$slate4",- boxShadow: "inset 0 0 0 1px $colors$slate8",- color: "transparent",- pointerEvents: "none",- "@hover": {- "&:hover": {- backgroundColor: "$slate5",- boxShadow: "inset 0 0 0 1px $colors$slate8"- }- },- "&:active": {- backgroundColor: "$slate5"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$slate8"- }- }- },- ghost: {- true: {- backgroundColor: "transparent",- boxShadow: "none"- }- }- },- compoundVariants: [- {- variant: "gray",- ghost: "true",- css: {- backgroundColor: "transparent",- color: "$hiContrast",- "@hover": {- "&:hover": {- backgroundColor: "$slateA3",- boxShadow: "none"- }- },- "&:active": {- backgroundColor: "$slateA4"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$slateA8, 0 0 0 1px $colors$slateA8"- },- '&[data-state="open"]': {- backgroundColor: "$slateA4",- boxShadow: "none"- }- }- },- {- variant: "blue",- ghost: "true",- css: {- backgroundColor: "transparent",- "@hover": {- "&:hover": {- backgroundColor: "$blueA3",- boxShadow: "none"- }- },- "&:active": {- backgroundColor: "$blueA4"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$blueA8, 0 0 0 1px $colors$blueA8"- },- '&[data-state="open"]': {- backgroundColor: "$blueA4",- boxShadow: "none"- }- }- },- {- variant: "green",- ghost: "true",- css: {- backgroundColor: "transparent",- "@hover": {- "&:hover": {- backgroundColor: "$greenA3",- boxShadow: "none"- }- },- "&:active": {- backgroundColor: "$greenA4"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$greenA8, 0 0 0 1px $colors$greenA8"- },- '&[data-state="open"]': {- backgroundColor: "$greenA4",- boxShadow: "none"- }- }- },- {- variant: "red",- ghost: "true",- css: {- backgroundColor: "transparent",- "@hover": {- "&:hover": {- backgroundColor: "$redA3",- boxShadow: "none"- }- },- "&:active": {- backgroundColor: "$redA4"- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$redA8, 0 0 0 1px $colors$redA8"- },- '&[data-state="open"]': {- backgroundColor: "$redA4",- boxShadow: "none"- }- }- }- ],- defaultVariants: {- size: "1",- variant: "gray"- }-});--// app/shared/design-system/components/icon-button.tsx-var IconButton = styled("button", {- alignItems: "center",- appearance: "none",- borderWidth: "0",- boxSizing: "border-box",- display: "inline-flex",- flexShrink: 0,- fontFamily: "inherit",- fontSize: "14px",- justifyContent: "center",- lineHeight: "1",- outline: "none",- padding: "0",- textDecoration: "none",- userSelect: "none",- WebkitTapHighlightColor: "transparent",- color: "$hiContrast",- "&::before": {- boxSizing: "border-box"- },- "&::after": {- boxSizing: "border-box"- },- backgroundColor: "$loContrast",- border: "1px solid $slate7",- "@hover": {- "&:hover": {- borderColor: "$slate8"- }- },- "&:active": {- backgroundColor: "$slate2"- },- "&:focus": {- borderColor: "$slate8",- boxShadow: "0 0 0 1px $colors$slate8"- },- "&:disabled": {- pointerEvents: "none",- backgroundColor: "transparent",- color: "$slate6"- },- variants: {- size: {- "1": {- borderRadius: "$1",- height: "$5",- width: "$5"- },- "2": {- borderRadius: "$2",- height: "$6",- width: "$6"- },- "3": {- borderRadius: "$2",- height: "$7",- width: "$7"- },- "4": {- borderRadius: "$3",- height: "$8",- width: "$8"- }- },- variant: {- ghost: {- backgroundColor: "transparent",- borderWidth: "0",- "@hover": {- "&:hover": {- backgroundColor: "$slateA3"- }- },- "&:focus": {- boxShadow: "inset 0 0 0 1px $colors$slateA8, 0 0 0 1px $colors$slateA8"- },- "&:active": {- backgroundColor: "$slateA4"- },- '&[data-state="open"]': {- backgroundColor: "$slateA4"- }- },- raised: {- boxShadow: "0 0 transparent, 0 16px 32px hsl(206deg 12% 5% / 25%), 0 3px 5px hsl(0deg 0% 0% / 10%)",- "@hover": {- "&:hover": {- boxShadow: "0 0 transparent, 0 16px 32px hsl(206deg 12% 5% / 25%), 0 3px 5px hsl(0deg 0% 0% / 10%)"- }- },- "&:focus": {- borderColor: "$slate8",- boxShadow: "0 0 0 1px $colors$slate8, 0 16px 32px hsl(206deg 12% 5% / 25%), 0 3px 5px hsl(0deg 0% 0% / 10%)"- },- "&:active": {- backgroundColor: "$slate4"- }- }- },- state: {- active: {- backgroundColor: "$slate4",- boxShadow: "inset 0 0 0 1px hsl(206,10%,76%)",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px hsl(206,10%,76%)"- }- },- "&:active": {- backgroundColor: "$slate4"- }- },- waiting: {- backgroundColor: "$slate4",- boxShadow: "inset 0 0 0 1px hsl(206,10%,76%)",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px hsl(206,10%,76%)"- }- },- "&:active": {- backgroundColor: "$slate4"- }- }- }- },- defaultVariants: {- size: "1",- variant: "ghost"- }-});--// app/shared/design-system/components/popover.tsx-var import_react6 = __toESM(require("react"));-var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));--// app/shared/design-system/components/panel.tsx-var panelStyles = css({- backgroundColor: "$panel",- borderRadius: "$3",- boxShadow: "$colors$shadowLight 0px 10px 38px -10px, $colors$shadowDark 0px 10px 20px -15px"-}), Panel = styled("div", panelStyles);--// app/shared/design-system/components/popover.tsx-var Popover = (_a) => {- var _b = _a, { children: children6 } = _b, props2 = __objRest(_b, ["children"]);- return /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive.Root, __spreadValues({}, props2), children6);-}, StyledContent2 = styled(PopoverPrimitive.Content, panelStyles, {- minWidth: 200,- minHeight: "$6",- maxWidth: 265,- "&:focus": {- outline: "none"- }-}), PopoverContent = import_react6.default.forwardRef((_a, fowardedRef) => {- var _b = _a, { children: children6, hideArrow } = _b, props2 = __objRest(_b, ["children", "hideArrow"]);- return /* @__PURE__ */ import_react6.default.createElement(StyledContent2, __spreadProps(__spreadValues({- sideOffset: 0- }, props2), {- ref: fowardedRef- }), children6, !hideArrow && /* @__PURE__ */ import_react6.default.createElement(Box, {- css: { color: "$panel" }- }, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive.Arrow, {- width: 11,- height: 5,- offset: 5,- style: { fill: "currentColor" }- })));-});-PopoverContent.displayName = "PopoverContent";-var PopoverTrigger = PopoverPrimitive.Trigger;--// app/shared/design-system/components/heading.tsx-var import_react7 = __toESM(require("react"));-var import_lodash2 = __toESM(require("lodash.merge")), DEFAULT_TAG = "h1", Heading = import_react7.default.forwardRef((props2, forwardedRef) => {- let _a = props2, { size = "1" } = _a, textProps = __objRest(_a, ["size"]), textSize = {- 1: { "@initial": "4", "@bp2": "5" },- 2: { "@initial": "6", "@bp2": "7" },- 3: { "@initial": "7", "@bp2": "8" },- 4: { "@initial": "8", "@bp2": "9" }- }, textCss2 = {- 1: { fontWeight: 500, lineHeight: "20px", "@bp2": { lineHeight: "23px" } },- 2: { fontWeight: 500, lineHeight: "25px", "@bp2": { lineHeight: "30px" } },- 3: { fontWeight: 500, lineHeight: "33px", "@bp2": { lineHeight: "41px" } },- 4: { fontWeight: 500, lineHeight: "35px", "@bp2": { lineHeight: "55px" } }- };- return /* @__PURE__ */ import_react7.default.createElement(Text, __spreadProps(__spreadValues({- as: DEFAULT_TAG- }, textProps), {- ref: forwardedRef,- size: textSize[size],- css: __spreadValues({- fontVariantNumeric: "proportional-nums"- }, (0, import_lodash2.default)(textCss2[size], props2.css))- }));-});-Heading.displayName = "Heading";--// app/shared/design-system/components/menu.tsx-var import_react8 = __toESM(require("react")), MenuPrimitive = __toESM(require("@radix-ui/react-menu"));-var baseItemCss = css({- display: "flex",- alignItems: "center",- justifyContent: "space-between",- fontFamily: "$untitled",- fontSize: "$1",- fontVariantNumeric: "tabular-nums",- lineHeight: "1",- cursor: "default",- userSelect: "none",- whiteSpace: "nowrap",- height: "$5",- px: "$5"-}), itemCss = css(baseItemCss, {- position: "relative",- color: "$hiContrast",- "&:focus, &[data-found]": {- outline: "none",- backgroundColor: "$blue9",- color: "white"- },- "&[data-disabled]": {- color: "$slate9"- }-}), labelCss = css(baseItemCss, {- color: "$slate11"-}), menuCss = css({- boxSizing: "border-box",- minWidth: 120,- py: "$1"-}), separatorCss = css({- height: 1,- my: "$1",- backgroundColor: "$slate6"-}), Menu = styled(MenuPrimitive.Root, menuCss), MenuContent = styled(MenuPrimitive.Content, panelStyles), MenuSeparator = styled(MenuPrimitive.Separator, separatorCss), MenuItem = styled(MenuPrimitive.Item, itemCss), StyledMenuRadioItem = styled(MenuPrimitive.RadioItem, itemCss), MenuRadioItem = import_react8.default.forwardRef((_a, forwardedRef) => {- var _b = _a, { children: children6 } = _b, props2 = __objRest(_b, ["children"]);- return /* @__PURE__ */ import_react8.default.createElement(StyledMenuRadioItem, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef- }), /* @__PURE__ */ import_react8.default.createElement(Box, {- as: "span",- css: { position: "absolute", left: "$1" }- }, /* @__PURE__ */ import_react8.default.createElement(MenuPrimitive.ItemIndicator, null, /* @__PURE__ */ import_react8.default.createElement(Flex, {- css: {- width: "$3",- height: "$3",- alignItems: "center",- justifyContent: "center"- }- }, /* @__PURE__ */ import_react8.default.createElement(Box, {- css: {- width: "$1",- height: "$1",- backgroundColor: "currentColor",- borderRadius: "$round"- }- })))), children6);-});-MenuRadioItem.displayName = "MenuRadioItem";-var StyledMenuCheckboxItem = styled(MenuPrimitive.CheckboxItem, itemCss), MenuCheckboxItem = import_react8.default.forwardRef((_a, forwardedRef) => {- var _b = _a, { children: children6 } = _b, props2 = __objRest(_b, ["children"]);- return /* @__PURE__ */ import_react8.default.createElement(StyledMenuCheckboxItem, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef- }), /* @__PURE__ */ import_react8.default.createElement(Box, {- as: "span",- css: { position: "absolute", left: "$1" }- }, /* @__PURE__ */ import_react8.default.createElement(MenuPrimitive.ItemIndicator, null, /* @__PURE__ */ import_react8.default.createElement(icons_exports.CheckIcon, null))), children6);-});-MenuCheckboxItem.displayName = "MenuCheckboxItem";-var MenuLabel = styled(MenuPrimitive.Label, labelCss), MenuRadioGroup = styled(MenuPrimitive.RadioGroup, {}), MenuGroup = styled(MenuPrimitive.Group, {}), MenuAnchor2 = MenuPrimitive.MenuAnchor;--// app/shared/design-system/components/paragraph.tsx-var import_react9 = __toESM(require("react"));-var import_lodash3 = __toESM(require("lodash.merge")), DEFAULT_TAG2 = "p", Paragraph = import_react9.default.forwardRef((props2, forwardedRef) => {- let _a = props2, { size = "1" } = _a, textProps = __objRest(_a, ["size"]), textSize = {- 1: { "@initial": "2", "@bp2": "4" },- 2: { "@initial": "5", "@bp2": "6" }- }, textCss2 = {- 1: { lineHeight: "25px", "@bp2": { lineHeight: "27px" } },- 2: {- color: "$slate11",- lineHeight: "27px",- "@bp2": { lineHeight: "30px" }- }- };- return /* @__PURE__ */ import_react9.default.createElement(Text, __spreadProps(__spreadValues({- as: DEFAULT_TAG2- }, textProps), {- ref: forwardedRef,- size: textSize[size],- css: __spreadValues({}, (0, import_lodash3.default)(textCss2[size], props2.css))- }));-});-Paragraph.displayName = "Paragraph";--// app/shared/design-system/components/link.tsx-var Link = styled("a", {- alignItems: "center",- gap: "$1",- flexShrink: 0,- outline: "none",- textDecorationLine: "none",- textUnderlineOffset: "3px",- textDecorationColor: "$slate4",- WebkitTapHighlightColor: "rgba(0,0,0,0)",- lineHeight: "inherit",- "@hover": {- "&:hover": {- textDecorationLine: "underline"- }- },- "&:focus": {- outlineWidth: "2px",- outlineStyle: "solid",- outlineOffset: "2px",- textDecorationLine: "none"- },- [`& ${Text}`]: {- color: "inherit"- },- variants: {- variant: {- blue: {- color: "$blue11",- textDecorationColor: "$blue4",- "&:focus": {- outlineColor: "$blue8"- }- },- subtle: {- color: "$slate11",- textDecorationColor: "$slate4",- "&:focus": {- outlineColor: "$slate8"- }- },- contrast: {- color: "$hiContrast",- textDecoration: "underline",- textDecorationColor: "$slate4",- "@hover": {- "&:hover": {- textDecorationColor: "$slate7"- }- },- "&:focus": {- outlineColor: "$slate8"- }- }- }- },- defaultVariants: {- variant: "contrast"- }-});--// app/shared/design-system/components/dropdown-menu.tsx-var import_react10 = __toESM(require("react"));-var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));-var DropdownMenu = DropdownMenuPrimitive.Root, DropdownMenuArrow = styled(DropdownMenuPrimitive.Arrow, {- fill: "$panel"-}), DropdownMenuTrigger = DropdownMenuPrimitive.Trigger, DropdownMenuContent = styled(DropdownMenuPrimitive.Content, menuCss, panelStyles), DropdownMenuSeparator = styled(DropdownMenuPrimitive.Separator, separatorCss), DropdownMenuItem = styled(DropdownMenuPrimitive.Item, itemCss), StyledDropdownMenuRadioItem = styled(DropdownMenuPrimitive.RadioItem, itemCss), DropdownMenuRadioItem = import_react10.default.forwardRef((_a, forwardedRef) => {- var _b = _a, { children: children6 } = _b, props2 = __objRest(_b, ["children"]);- return /* @__PURE__ */ import_react10.default.createElement(StyledDropdownMenuRadioItem, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef- }), /* @__PURE__ */ import_react10.default.createElement(Box, {- as: "span",- css: { position: "absolute", left: "$1" }- }, /* @__PURE__ */ import_react10.default.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ import_react10.default.createElement(Flex, {- css: {- width: "$3",- height: "$3",- alignItems: "center",- justifyContent: "center"- }- }, /* @__PURE__ */ import_react10.default.createElement(Box, {- css: {- width: "$1",- height: "$1",- backgroundColor: "currentColor",- borderRadius: "$round"- }- })))), children6);-});-DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";-var StyledDropdownMenuCheckboxItem = styled(DropdownMenuPrimitive.CheckboxItem, itemCss), DropdownMenuCheckboxItem = import_react10.default.forwardRef((_a, forwardedRef) => {- var _b = _a, { children: children6 } = _b, props2 = __objRest(_b, ["children"]);- return /* @__PURE__ */ import_react10.default.createElement(StyledDropdownMenuCheckboxItem, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef- }), /* @__PURE__ */ import_react10.default.createElement(Box, {- as: "span",- css: { position: "absolute", left: "$1" }- }, /* @__PURE__ */ import_react10.default.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ import_react10.default.createElement(icons_exports.CheckIcon, null))), children6);-});-DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";-var DropdownMenuLabel = styled(DropdownMenuPrimitive.Label, labelCss), DropdownMenuRadioGroup = styled(DropdownMenuPrimitive.RadioGroup, {}), DropdownMenuGroup = styled(DropdownMenuPrimitive.Group, {});--// app/shared/design-system/components/switch.tsx-var import_react11 = __toESM(require("react"));-var SwitchPrimitive = __toESM(require("@radix-ui/react-switch")), StyledThumb = styled(SwitchPrimitive.Thumb, {- position: "absolute",- left: 0,- width: 13,- height: 13,- backgroundColor: "white",- borderRadius: "$round",- boxShadow: "rgba(0, 0, 0, 0.3) 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 1px 2px;",- transition: "transform 100ms cubic-bezier(0.22, 1, 0.36, 1)",- transform: "translateX(1px)",- willChange: "transform",- '&[data-state="checked"]': {- transform: "translateX(11px)"- }-}), StyledSwitch = styled(SwitchPrimitive.Root, {- all: "unset",- boxSizing: "border-box",- userSelect: "none",- flexShrink: 0,- "&::before": {- boxSizing: "border-box"- },- "&::after": {- boxSizing: "border-box"- },- alignItems: "center",- display: "inline-flex",- justifyContent: "center",- lineHeight: "1",- margin: "0",- outline: "none",- WebkitTapHighlightColor: "rgba(0,0,0,0)",- backgroundColor: "$slate5",- borderRadius: "$pill",- position: "relative",- "&:focus": {- boxShadow: "0 0 0 2px $colors$slate8"- },- '&[data-state="checked"]': {- backgroundColor: "$blue9",- "&:focus": {- boxShadow: "0 0 0 2px $colors$blue8"- }- },- variants: {- size: {- "1": {- width: "$5",- height: "$3"- },- "2": {- width: "$7",- height: "$5",- [`& ${StyledThumb}`]: {- width: 21,- height: 21,- transform: "translateX(2px)",- '&[data-state="checked"]': {- transform: "translateX(22px)"- }- }- }- }- },- defaultVariants: {- size: "1"- }-}), Switch = import_react11.default.forwardRef((props2, forwardedRef) => /* @__PURE__ */ import_react11.default.createElement(StyledSwitch, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef-}), /* @__PURE__ */ import_react11.default.createElement(StyledThumb, null)));-Switch.displayName = "Switch";--// app/shared/design-system/components/slider.tsx-var import_react12 = __toESM(require("react"));-var SliderPrimitive = __toESM(require("@radix-ui/react-slider")), SliderTrack = styled(SliderPrimitive.Track, {- position: "relative",- flexGrow: 1,- backgroundColor: "$slate7",- borderRadius: "$pill",- '&[data-orientation="horizontal"]': {- height: 2- },- '&[data-orientation="vertical"]': {- width: 2,- height: 100- }-}), SliderRange = styled(SliderPrimitive.Range, {- position: "absolute",- background: "$blue9",- borderRadius: "inherit",- '&[data-orientation="horizontal"]': {- height: "100%"- },- '&[data-orientation="vertical"]': {- width: "100%"- }-}), SliderThumb = styled(SliderPrimitive.Thumb, {- position: "relative",- display: "block",- width: 15,- height: 15,- outline: "none",- backgroundColor: "white",- boxShadow: "0 0 1px rgba(0,0,0,.3), 0 1px 4px rgba(0,0,0,.15)",- borderRadius: "$round",- "&::after": {- content: '""',- position: "absolute",- top: 0,- right: 0,- bottom: 0,- left: 0,- zIndex: -2,- backgroundColor: "hsla(0,0%,0%,.035)",- transform: "scale(1)",- borderRadius: "$round",- transition: "transform 200ms cubic-bezier(0.22, 1, 0.36, 1)"- },- "&:focus": {- "&::after": {- transform: "scale(2)"- }- }-}), StyledSlider = styled(SliderPrimitive.Root, {- position: "relative",- display: "flex",- alignItems: "center",- flexShrink: 0,- userSelect: "none",- touchAction: "none",- height: 15,- flexGrow: 1,- '&[data-orientation="vertical"]': {- flexDirection: "column",- width: 15- },- "@hover": {- "&:hover": {- [`& ${SliderTrack}`]: {- backgroundColor: "$slate8"- }- }- }-}), Slider = import_react12.default.forwardRef((_a, forwardedRef) => {- var _b = _a, { value, defaultValue } = _b, props2 = __objRest(_b, ["value", "defaultValue"]);- let realValue = value || defaultValue || 0, thumbsArray = Array.isArray(realValue) ? realValue : [realValue];- return /* @__PURE__ */ import_react12.default.createElement(StyledSlider, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef- }), /* @__PURE__ */ import_react12.default.createElement(SliderTrack, null, /* @__PURE__ */ import_react12.default.createElement(SliderRange, null)), thumbsArray == null ? void 0 : thumbsArray.map((_, i) => /* @__PURE__ */ import_react12.default.createElement(SliderThumb, {- key: i- })));-});-Slider.displayName = "Slider";--// app/shared/design-system/components/radio.tsx-var import_react13 = __toESM(require("react"));-var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group")), RadioGroup3 = styled(RadioGroupPrimitive.Root, {- display: "flex"-}), StyledIndicator = styled(RadioGroupPrimitive.Indicator, {- alignItems: "center",- display: "flex",- height: "100%",- justifyContent: "center",- width: "100%",- position: "relative",- "&::after": {- content: '""',- display: "block",- width: "7px",- height: "7px",- borderRadius: "50%",- backgroundColor: "$blue9"- }-}), StyledRadio = styled(RadioGroupPrimitive.Item, {- all: "unset",- boxSizing: "border-box",- userSelect: "none",- "&::before": {- boxSizing: "border-box"- },- "&::after": {- boxSizing: "border-box"- },- alignItems: "center",- appearance: "none",- display: "inline-flex",- justifyContent: "center",- lineHeight: "1",- margin: "0",- outline: "none",- padding: "0",- textDecoration: "none",- WebkitTapHighlightColor: "rgba(0,0,0,0)",- borderRadius: "50%",- color: "$hiContrast",- boxShadow: "inset 0 0 0 1px $colors$slate7",- overflow: "hidden",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px $colors$slate8"- }- },- "&:focus": {- outline: "none",- borderColor: "$red7",- boxShadow: "inset 0 0 0 1px $colors$blue9, 0 0 0 1px $colors$blue9"- },- variants: {- size: {- "1": {- width: "$3",- height: "$3"- },- "2": {- width: "$5",- height: "$5",- [`& ${StyledIndicator}`]: {- "&::after": {- width: "$3",- height: "$3"- }- }- }- }- },- defaultVariants: {- size: "1"- }-}), Radio = import_react13.default.forwardRef((props2, forwardedRef) => /* @__PURE__ */ import_react13.default.createElement(StyledRadio, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef-}), /* @__PURE__ */ import_react13.default.createElement(StyledIndicator, null)));-Radio.displayName = "Radio";--// app/shared/design-system/components/combobox.tsx-var import_react14 = require("react");-var Combobox = (_a) => {- var _b = _a, {- items,- onValueSelect,- onValueEnter,- onItemEnter,- onItemLeave,- value,- css: css2- } = _b, rest = __objRest(_b, [- "items",- "onValueSelect",- "onValueEnter",- "onItemEnter",- "onItemLeave",- "value",- "css"- ]);- let [isOpen, setIsOpen] = (0, import_react14.useState)(!1), [currentValue, setCurrentValue] = (0, import_react14.useState)(value);- return (0, import_react14.useEffect)(() => {- setCurrentValue(value);- }, [value]), /* @__PURE__ */ React.createElement(Menu, {- open: isOpen,- modal: !0,- onOpenChange: setIsOpen- }, /* @__PURE__ */ React.createElement(MenuAnchor2, {- asChild: !0- }, /* @__PURE__ */ React.createElement(TextField, __spreadProps(__spreadValues({}, rest), {- value: currentValue,- autoComplete: "off",- css: __spreadProps(__spreadValues({}, css2), { paddingRight: 30 }),- onChange: (event) => {- setCurrentValue(event.target.value);- },- onKeyDown: (event) => {- switch (event.key) {- case "ArrowDown":- case "ArrowUp": {- setIsOpen(!0);- break;- }- case "Enter": {- onValueEnter(event.currentTarget.value);- break;- }- }- }- }))), /* @__PURE__ */ React.createElement(IconButton, {- variant: "ghost",- size: "1",- css: { marginLeft: -32 },- onClick: () => {- setIsOpen(!0);- }- }, /* @__PURE__ */ React.createElement(icons_exports.ChevronDownIcon, null)), /* @__PURE__ */ React.createElement(MenuContent, {- loop: !0,- portalled: !0,- asChild: !0- }, /* @__PURE__ */ React.createElement("div", null, items.map(({ label: label11 }, index) => /* @__PURE__ */ React.createElement(MenuItem, {- key: index,- onMouseEnter: () => {- onItemEnter(label11);- },- onMouseLeave: () => {- onItemLeave(label11);- },- onFocus: () => {- onItemEnter(label11);- },- onSelect: () => {- onValueSelect(label11);- }- }, label11)))));-};--// app/config.ts-var config2 = {- previewPath: "/preview",- canvasPath: "/canvas",- designerPath: "/designer",- dashboardPath: "/dashboard",- loginPath: "/login",- logoutPath: "/logout",- googleCallbackPath: "/google/callback",- githubCallbackPath: "/github/callback",- authPath: "/auth"-}, config_default = config2;--// app/critical-css.ts-var getCssTextFunctions = {- [config_default.previewPath]: import_sdk.getCssText,- [config_default.canvasPath]: import_sdk.getCssText,- [config_default.designerPath]: getCssText,- [config_default.dashboardPath]: getCssText,- [config_default.loginPath]: getCssText-}, getCssTextFunction = (url2) => {- let { pathname } = new URL(url2), path;- for (path in getCssTextFunctions)- if (pathname.indexOf(path) === 0)- return getCssTextFunctions[path];- return import_sdk.getCssText;-}, insertCriticalCss = (markup, url2) => (0, import_sdk.insertCriticalCss)(markup, getCssTextFunction(url2));--// app/entry.server.tsx-var Sentry2 = __toESM(require("@sentry/remix"));--// app/shared/sentry.ts-var Sentry = __toESM(require("@sentry/remix"));--// app/shared/env/namespace.ts-var namespace = "__webstudioEnv";--// app/shared/env/env.tsx-var import_react15 = require("@remix-run/react");-var Env = () => {- let data = (0, import_react15.useLoaderData)();- return /* @__PURE__ */ React.createElement("script", {- dangerouslySetInnerHTML: {- __html: `window["${namespace}"] = ${JSON.stringify(data.env)}`- }- });-};--// app/shared/env/env-getter.ts-var env_getter_default = new Proxy({}, {- get(_target, prop) {- if (typeof window > "u")- return prop in process.env ? process.env[prop] : void 0;- let env2 = window[namespace] ?? {};- return prop in env2 ? env2[prop] : void 0;- }-});--// app/shared/sentry.ts-var initSentry = ({- integrations = []-} = {}) => env_getter_default.SENTRY_DSN ? Sentry.init({- dsn: env_getter_default.SENTRY_DSN,- tracesSampleRate: 1,- environment: env_getter_default.VERCEL_ENV || "development",- integrations-}) : () => null;-var sentryException = ({- message,- extra,- skipLogging = !1-}) => {- env_getter_default.SENTRY_DSN && Sentry.withScope((scope) => {- extra && scope.setExtras(extra), Sentry.captureException(message);- }), skipLogging !== !0 && console.error(message);-};--// app/shared/db/prisma.server.ts-var import_client = require("@prisma/client"), import_runtime = require("@prisma/client/runtime"), prisma = global.prisma || new import_client.PrismaClient();-global.prisma = prisma;--// app/entry.server.tsx-initSentry({- integrations: [new Sentry2.Integrations.Prisma({ client: prisma })]-});-function handleRequest(request, responseStatusCode, responseHeaders, remixContext) {- let markup = (0, import_server.renderToString)(/* @__PURE__ */ React.createElement(import_react16.RemixServer, {- context: remixContext,- url: request.url- }));- return markup = insertCriticalCss(markup, request.url), responseHeaders.set("Content-Type", "text/html"), new Response("<!DOCTYPE html>" + markup, {- status: responseStatusCode,- headers: responseHeaders- });-}--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/root.tsx-var root_exports = {};-__export(root_exports, {- default: () => root_default-});-var import_react17 = require("@remix-run/react"), import_remix = require("@sentry/remix"), import_remix2 = require("@sentry/remix"), RootWithErrorBoundary = (props2) => /* @__PURE__ */ React.createElement(import_remix2.ErrorBoundary, null, /* @__PURE__ */ React.createElement(import_react17.Outlet, __spreadValues({}, props2))), root_default = (0, import_remix.withSentryRouteTracing)(RootWithErrorBoundary);--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/breakpoints.$projectId.ts-var breakpoints_projectId_exports = {};-__export(breakpoints_projectId_exports, {- loader: () => loader-});--// app/shared/db/tree.server.ts-var tree_server_exports = {};-__export(tree_server_exports, {- clone: () => clone,- create: () => create,- createRootInstance: () => createRootInstance,- loadById: () => loadById,- loadByProject: () => loadByProject,- patchRoot: () => patchRoot-});-var import_immer2 = require("immer");--// app/shared/tree-utils/create-instance.ts-var import_bson_objectid = __toESM(require("bson-objectid"));--// app/shared/canvas-components/primitives/index.ts-var primitives_exports = {};-__export(primitives_exports, {- Bold: () => bold_exports,- Box: () => box_exports,- Button: () => button_exports,- Form: () => form_exports,- Heading: () => heading_exports,- Input: () => input_exports,- Italic: () => italic_exports,- Link: () => link_exports,- Paragraph: () => paragraph_exports,- TextBlock: () => text_block_exports-});--// app/shared/canvas-components/primitives/box.tsx-var box_exports = {};-__export(box_exports, {- Component: () => Component,- Icon: () => icons_exports.SquareIcon,- canAcceptChild: () => canAcceptChild,- defaultStyle: () => defaultStyle,- isContentEditable: () => isContentEditable,- isInlineOnly: () => isInlineOnly,- label: () => label-});-var import_sdk2 = require("@webstudio-is/sdk"), defaultStyle = {- boxSizing: {- type: "keyword",- value: "border-box"- }-}, canAcceptChild = () => !0, isContentEditable = !1, isInlineOnly = !1, Component = import_sdk2.components.Box, label = "Box";--// app/shared/canvas-components/primitives/text-block.tsx-var text_block_exports = {};-__export(text_block_exports, {- Component: () => Component2,- Icon: () => icons_exports.TextIcon,- canAcceptChild: () => canAcceptChild2,- children: () => children,- defaultStyle: () => defaultStyle2,- isContentEditable: () => isContentEditable2,- isInlineOnly: () => isInlineOnly2,- label: () => label2-});-var import_sdk3 = require("@webstudio-is/sdk"), defaultStyle2 = {- minHeight: {- type: "unit",- unit: "em",- value: 1- }-}, children = ["Block of text you can edit"], canAcceptChild2 = () => !1, isContentEditable2 = !0, isInlineOnly2 = !1, label2 = "Text Block", Component2 = import_sdk3.components.TextBlock;--// app/shared/canvas-components/primitives/heading.tsx-var heading_exports = {};-__export(heading_exports, {- Component: () => Component3,- Icon: () => icons_exports.HeadingIcon,- canAcceptChild: () => canAcceptChild3,- children: () => children2,- defaultStyle: () => defaultStyle3,- isContentEditable: () => isContentEditable3,- isInlineOnly: () => isInlineOnly3,- label: () => label3-});-var import_sdk4 = require("@webstudio-is/sdk"), defaultStyle3 = {}, children2 = ["Heading you can edit"], canAcceptChild3 = () => !1, isContentEditable3 = !0, isInlineOnly3 = !1, label3 = "Heading", Component3 = import_sdk4.components.Heading;--// app/shared/canvas-components/primitives/paragraph.tsx-var paragraph_exports = {};-__export(paragraph_exports, {- Component: () => Component4,- Icon: () => icons_exports.TextAlignLeftIcon,- canAcceptChild: () => canAcceptChild4,- children: () => children3,- defaultStyle: () => defaultStyle4,- isContentEditable: () => isContentEditable4,- isInlineOnly: () => isInlineOnly4,- label: () => label4-});-var import_sdk5 = require("@webstudio-is/sdk"), defaultStyle4 = {}, children3 = ["Pragraph you can edit"], canAcceptChild4 = () => !1, isContentEditable4 = !0, isInlineOnly4 = !1, label4 = "Paragraph", Component4 = import_sdk5.components.Paragraph;--// app/shared/canvas-components/primitives/link.tsx-var link_exports = {};-__export(link_exports, {- Component: () => Component5,- Icon: () => icons_exports.Link2Icon,- canAcceptChild: () => canAcceptChild5,- children: () => children4,- defaultStyle: () => defaultStyle5,- isContentEditable: () => isContentEditable5,- isInlineOnly: () => isInlineOnly5,- label: () => label5-});-var import_sdk6 = require("@webstudio-is/sdk"), defaultStyle5 = {- minHeight: {- type: "unit",- unit: "em",- value: 1- },- display: {- type: "keyword",- value: "inline-block"- }-}, children4 = ["Link text you can edit"], canAcceptChild5 = () => !1, isContentEditable5 = !0, isInlineOnly5 = !1, label5 = "Link", Component5 = import_sdk6.components.Link;--// app/shared/canvas-components/primitives/bold.tsx-var bold_exports = {};-__export(bold_exports, {- Component: () => Component6,- Icon: () => icons_exports.FontBoldIcon,- canAcceptChild: () => canAcceptChild6,- isContentEditable: () => isContentEditable6,- isInlineOnly: () => isInlineOnly6,- label: () => label6-});-var import_sdk7 = require("@webstudio-is/sdk"), canAcceptChild6 = () => !1, isContentEditable6 = !1, label6 = "Bold Text", isInlineOnly6 = !0, Component6 = import_sdk7.components.Bold;--// app/shared/canvas-components/primitives/italic.tsx-var italic_exports = {};-__export(italic_exports, {- Component: () => Component7,- Icon: () => icons_exports.FontBoldIcon,- canAcceptChild: () => canAcceptChild7,- isContentEditable: () => isContentEditable7,- isInlineOnly: () => isInlineOnly7,- label: () => label7-});-var import_sdk8 = require("@webstudio-is/sdk"), canAcceptChild7 = () => !1, isContentEditable7 = !1, label7 = "Italic Text", isInlineOnly7 = !0, Component7 = import_sdk8.components.Italic;--// app/shared/canvas-components/primitives/button.tsx-var button_exports = {};-__export(button_exports, {- Component: () => Component8,- Icon: () => icons_exports.ButtonIcon,- canAcceptChild: () => canAcceptChild8,- children: () => children5,- defaultStyle: () => defaultStyle6,- isContentEditable: () => isContentEditable8,- isInlineOnly: () => isInlineOnly8,- label: () => label8-});-var import_sdk9 = require("@webstudio-is/sdk"), defaultStyle6 = {}, canAcceptChild8 = () => !1, isContentEditable8 = !0, isInlineOnly8 = !1, children5 = ["Button text you can edit"], Component8 = import_sdk9.components.Button, label8 = "Button";--// app/shared/canvas-components/primitives/input.tsx-var input_exports = {};-__export(input_exports, {- Component: () => Component9,- Icon: () => icons_exports.InputIcon,- canAcceptChild: () => canAcceptChild9,- defaultStyle: () => defaultStyle7,- isContentEditable: () => isContentEditable9,- isInlineOnly: () => isInlineOnly9,- label: () => label9-});-var import_sdk10 = require("@webstudio-is/sdk"), defaultStyle7 = {}, canAcceptChild9 = () => !1, isContentEditable9 = !1, isInlineOnly9 = !1, Component9 = import_sdk10.components.Input, label9 = "Input";--// app/shared/canvas-components/primitives/form.tsx-var form_exports = {};-__export(form_exports, {- Component: () => Component10,- Icon: () => FormIcon,- canAcceptChild: () => canAcceptChild10,- defaultStyle: () => defaultStyle8,- isContentEditable: () => isContentEditable10,- isInlineOnly: () => isInlineOnly10,- label: () => label10-});-var import_sdk11 = require("@webstudio-is/sdk"), defaultStyle8 = {- minHeight: {- type: "unit",- unit: "px",- value: 20- },- boxSizing: {- type: "keyword",- value: "border-box"- }-}, canAcceptChild10 = () => !0, isContentEditable10 = !1, isInlineOnly10 = !1, Component10 = import_sdk11.components.Form, label10 = "Form";--// app/shared/tree-utils/create-instance.ts-var createInstance = ({- component,- id,- children: children6,- cssRules-}) => {- let primitive = primitives_exports[component];- return {- component,- id: id === void 0 ? (0, import_bson_objectid.default)().toString() : id,- cssRules: cssRules ?? [],- children: children6 === void 0 ? "children" in primitive ? primitive.children : [] : children6- };-};--// app/shared/tree-utils/delete-instance.ts-var deleteInstanceMutable = (instance, instanceId) => {- if (instance.id === instanceId)- return !0;- for (let child of instance.children) {- if (typeof child == "string")- continue;- if (deleteInstanceMutable(child, instanceId) === !0) {- let index = instance.children.indexOf(child);- return instance.children.splice(index, 1), !1;- }- }- return !1;-};--// app/shared/tree-utils/insert-instance.ts-var insertInstanceMutable = (rootInstance, instance, spec) => {- if (spec.parentId !== rootInstance.id) {- for (let child of rootInstance.children) {- if (typeof child == "string")- continue;- if (insertInstanceMutable(child, instance, spec) === !0)- return !0;- }- return !1;- }- return typeof spec.position == "number" ? (rootInstance.children.splice(spec.position, 0, instance), !0) : (spec.position === "end" && rootInstance.children.push(instance), !0);-};--// app/shared/tree-utils/populate.ts-var populateInstance = (instance) => {- let populatedInstance = __spreadValues({}, instance), primitive = primitives_exports[instance.component];- if (primitive !== void 0 && "defaultStyle" in primitive) {- let cssRule = {- breakpoint: "",- style: primitive.defaultStyle- };- populatedInstance.cssRules.push(cssRule);- }- return populatedInstance;-};--// app/shared/tree-utils/find-instance.ts-var findInstanceById = (instance, id) => {- if (instance.id === id)- return instance;- if (instance.children !== void 0)- for (let child of instance.children) {- if (typeof child == "string")- continue;- let foundInstance = findInstanceById(child, id);- if (foundInstance !== void 0)- return foundInstance;- }-};--// app/shared/tree-utils/index.ts-var import_sdk12 = require("@webstudio-is/sdk");--// app/shared/tree-utils/set-instance-style.ts-var setInstanceStyleMutable = (rootInstance, id, updates, breakpoint) => {- let instance = findInstanceById(rootInstance, id);- if (instance === void 0)- return !1;- let cssRule = instance.cssRules.find((cssRule2) => cssRule2.breakpoint === breakpoint.id);- cssRule === void 0 && (cssRule = { style: {}, breakpoint: breakpoint.id }, instance.cssRules.push(cssRule));- for (let update2 of updates)- cssRule.style[update2.property] = update2.value;- return !0;-};--// app/shared/tree-utils/set-instance-children.ts-var setInstanceChildrenMutable = (id, updates, rootInstance) => {- let instance = findInstanceById(rootInstance, id);- if (instance === void 0)- return !1;- let children6 = [];- for (let update2 of updates) {- if (typeof update2 == "string") {- children6.push(update2);- continue;- }- if ("createInstance" in update2) {- let childInstance = createInstance({- id: update2.id,- component: update2.component,- children: [update2.text]- });- children6.push(childInstance);- continue;- }- if ("text" in update2) {- let childInstance = findInstanceById(instance, update2.id);- if (childInstance === void 0)- continue;- children6.push(__spreadProps(__spreadValues({}, childInstance), { children: [update2.text] }));- continue;- }- children6.push(update2);- }- return instance.children = children6, !0;-};--// app/shared/tree-utils/get-instance-path.ts-var getInstancePath = (instance, instanceId) => {- let path = [], find = (instance2) => {- if (instance2.id === instanceId)- return !0;- for (let child of instance2.children) {- if (typeof child == "string")- continue;- if (find(child))- return path.push(child), !0;- }- };- return find(instance) && path.push(instance), path.reverse();-};--// app/shared/tree-utils/find-closest-sibling-instance.ts-var findClosestSiblingInstance = (instance, instanceId) => {- if (instance.children.length === 0)- return;- let children6 = instance.children.filter((instance2) => typeof instance2 == "object"), index = children6.findIndex((instance2) => instance2.id === instanceId);- if (index === -1)- return;- let nextInstance = children6[index + 1];- return nextInstance !== void 0 ? nextInstance : children6[index - 1];-};--// app/shared/tree-utils/find-parent-instance.ts-var findParentInstance = (instance, instanceId) => {- let find = (childInstance, parentInstance) => {- if (childInstance.id === instanceId)- return parentInstance;- for (let child of childInstance.children) {- if (typeof child == "string")- continue;- let foundInstance = find(child, childInstance);- if (foundInstance !== void 0)- return foundInstance;- }- };- return find(instance);-};--// app/shared/tree-utils/clone-instance.ts-var import_bson_objectid2 = __toESM(require("bson-objectid")), import_immer = __toESM(require("immer")), updateIds = (instance) => {- instance.id = (0, import_bson_objectid2.default)().toString();- for (let child of instance.children)- typeof child != "string" && updateIds(child);-}, cloneInstance = (instance) => (0, import_immer.default)(updateIds)(instance);--// app/shared/breakpoints/sort.ts-var sort = (breakpoints) => [...breakpoints].sort((breakpointA, breakpointB) => breakpointA.minWidth - breakpointB.minWidth);--// app/shared/db/tree.server.ts-var createRootInstance = (breakpoints) => {- let defaultBreakpoint = sort(breakpoints)[0];- if (defaultBreakpoint === void 0)- throw new Error("A breakpoint with minWidth 0 is required");- let rootConfig = {- component: "Box",- cssRules: [- {- breakpoint: defaultBreakpoint.id,- style: {- backgroundColor: {- type: "keyword",- value: "white"- },- fontFamily: {- type: "keyword",- value: "Arial"- },- fontSize: {- type: "unit",- unit: "px",- value: 14- },- lineHeight: {- type: "unit",- unit: "number",- value: 1.5- },- color: {- type: "keyword",- value: "#232323"- },- minHeight: {- type: "unit",- unit: "vh",- value: 100- },- flexDirection: {- type: "keyword",- value: "column"- }- }- }- ]- };- return createInstance(rootConfig);-}, create = async (root) => {- let newRoot = JSON.stringify(root);- return await prisma.tree.create({- data: { root: newRoot }- });-}, loadById = async (treeId) => {- let tree = await prisma.tree.findUnique({- where: { id: treeId }- });- return tree === null ? null : __spreadProps(__spreadValues({}, tree), {- root: JSON.parse(tree.root)- });-}, loadByProject = async (project, env2 = "development") => {- if (project === null)- throw new Error("Project required");- let treeId = env2 === "production" ? project.prodTreeId : project.devTreeId;- if (treeId === null)- throw new Error("Site needs to be published, production tree ID is null.");- return await loadById(treeId);-}, clone = async (treeId) => {- let tree = await loadById(treeId);- if (tree === null)- throw new Error(`Tree ${treeId} not found`);- return await create(tree.root);-}, patchRoot = async ({ treeId }, patches) => {- let tree = await loadById(treeId);- if (tree === null)- throw new Error(`Tree ${treeId} not found`);- let root = (0, import_immer2.applyPatches)(tree.root, patches);- await prisma.tree.update({- data: { root: JSON.stringify(root) },- where: { id: treeId }- });-};--// app/shared/db/project.server.ts-var project_server_exports = {};-__export(project_server_exports, {- clone: () => clone2,- create: () => create2,- loadByDomain: () => loadByDomain,- loadById: () => loadById2,- loadManyByUserId: () => loadManyByUserId,- update: () => update-});-var import_slugify = __toESM(require("slugify")), import_nanoid = require("nanoid");-var parseProject = (project) => project ? __spreadProps(__spreadValues({}, project), {- prodTreeIdHistory: JSON.parse(project.prodTreeIdHistory)-}) : null, loadById2 = async (projectId) => {- if (typeof projectId != "string")- throw new Error("Project ID required");- let project = await prisma.project.findUnique({- where: { id: projectId }- });- return parseProject(project);-}, loadByDomain = async (domain) => {- let project = await prisma.project.findUnique({ where: { domain } });- return parseProject(project);-}, loadManyByUserId = async (userId) => (await prisma.project.findMany({- where: {- User: {- id: userId- }- }-})).map(parseProject), slugifyOptions = { lower: !0, strict: !0 }, MIN_DOMAIN_LENGTH = 10, MIN_TITLE_LENGTH = 2, generateDomain = (title) => {- let slugifiedTitle = (0, import_slugify.default)(title, slugifyOptions);- return `${slugifiedTitle}-${(0, import_nanoid.nanoid)(Math.max(MIN_DOMAIN_LENGTH - slugifiedTitle.length - 1, 5))}`;-}, create2 = async ({- userId,- title-}) => {- if (title.length < MIN_TITLE_LENGTH)- throw new Error(`Minimum ${MIN_TITLE_LENGTH} characters required`);- let domain = generateDomain(title), breakpoints = breakpoints_server_exports.getBreakpointsWithId(), tree = await tree_server_exports.create(tree_server_exports.createRootInstance(breakpoints)), project = await prisma.project.create({- data: {- userId,- title,- domain,- devTreeId: tree.id- }- });- return await breakpoints_server_exports.create(tree.id, breakpoints), parseProject(project);-}, clone2 = async (clonableDomain, userId) => {- let clonableProject = await loadByDomain(clonableDomain);- if (clonableProject === null)- throw new Error(`Not found project "${clonableDomain}"`);- if (clonableProject.prodTreeId === null)- throw new Error("Expected project to be published first");- let tree = await tree_server_exports.clone(clonableProject.prodTreeId), domain = generateDomain(clonableProject.title), [project] = await Promise.all([- prisma.project.create({- data: {- userId,- title: clonableProject.title,- domain,- devTreeId: tree.id- }- }),- props_server_exports.clone({- previousTreeId: clonableProject.prodTreeId,- nextTreeId: tree.id- }),- breakpoints_server_exports.clone({- previousTreeId: clonableProject.prodTreeId,- nextTreeId: tree.id- })- ]), parsedProject = parseProject(project);- if (parsedProject === null)- throw new Error(`Not found project "${clonableDomain}"`);- return parsedProject;-}, update = async (_a) => {- var _b = _a, {- id- } = _b, data = __objRest(_b, [- "id"- ]);- if (data.domain && (data.domain = (0, import_slugify.default)(data.domain, slugifyOptions), data.domain.length < MIN_DOMAIN_LENGTH))- throw new Error(`Minimum ${MIN_DOMAIN_LENGTH} characters required`);- try {- return await prisma.project.update({- data: __spreadProps(__spreadValues({}, data), {- prodTreeIdHistory: JSON.stringify(data.prodTreeIdHistory)- }),- where: { id }- });- } catch (error) {- throw error instanceof import_client.Prisma.PrismaClientKnownRequestError && error.code === "P2002" ? new Error(`Domain "${data.domain}" is already used`) : error;- }-};--// app/shared/db/props.server.ts-var props_server_exports = {};-__export(props_server_exports, {- clone: () => clone3,- loadByProject: () => loadByProject2,- loadByTreeId: () => loadByTreeId,- patch: () => patch-});-var import_immer3 = require("immer");-var loadByProject2 = async (project, env2 = "development") => {- if (project === null)- throw new Error("Project required");- let treeId = env2 === "production" ? project.prodTreeId : project.devTreeId;- if (treeId === null)- throw new Error("Site needs to be published, production tree ID is null.");- return loadByTreeId(treeId);-}, loadByTreeId = async (treeId) => (await prisma.instanceProps.findMany({- where: { treeId }-})).map((tree) => __spreadProps(__spreadValues({}, tree), {- props: JSON.parse(tree.props)-})), clone3 = async ({- previousTreeId,- nextTreeId-}) => {- let props2 = await prisma.instanceProps.findMany({- where: { treeId: previousTreeId }- });- if (props2.length === 0)- return;- let data = props2.map((_a) => {- var _b = _a, { id: _id, treeId: _treeId } = _b, rest = __objRest(_b, ["id", "treeId"]);- return __spreadProps(__spreadValues({}, rest), {- treeId: nextTreeId- });- });- await prisma.$transaction(data.map((prop) => prisma.instanceProps.create({- data: prop- })));-}, patch = async ({ treeId }, patches) => {- let allPropsMapByInstanceId = (await loadByTreeId(treeId)).reduce((acc, prop) => (acc[prop.instanceId] = prop, acc), {}), nextProps = (0, import_immer3.applyPatches)(allPropsMapByInstanceId, patches);- await Promise.all(Object.values(nextProps).map(({ id, instanceId, treeId: treeId2, props: props2 }) => prisma.instanceProps.upsert({- where: { id },- create: { id, instanceId, treeId: treeId2, props: JSON.stringify(props2) },- update: {- props: JSON.stringify(props2)- }- })));-};--// app/shared/db/misc.server.ts-var misc_server_exports = {};-__export(misc_server_exports, {- publish: () => publish-});-var publish = async ({- projectId,- domain-}) => {- if (projectId === null)- throw new Error("Project ID required");- if (domain === null)- throw new Error("Domain required");- let project = await project_server_exports.loadById(projectId);- if (project === null)- throw new Error(`Project "${projectId}" not found`);- let tree = await tree_server_exports.clone(project.devTreeId);- await props_server_exports.clone({- previousTreeId: project.devTreeId,- nextTreeId: tree.id- }), await breakpoints_server_exports.clone({- previousTreeId: project.devTreeId,- nextTreeId: tree.id- });- let prodTreeIdHistory = project.prodTreeIdHistory;- return project.prodTreeId && prodTreeIdHistory.push(project.prodTreeId), await project_server_exports.update({- id: projectId,- domain,- prodTreeId: tree.id,- prodTreeIdHistory- });-};--// app/shared/db/canvas.server.ts-var loadData = async (projectId) => {- let project = await project_server_exports.loadById(projectId);- if (project === null)- throw new Error(`Project "${projectId}" not found`);- let [tree, props2, breakpoints] = await Promise.all([- tree_server_exports.loadByProject(project, "development"),- props_server_exports.loadByProject(project, "development"),- breakpoints_server_exports.load(project.devTreeId)- ]);- if (tree === null)- throw new Error(`Tree ${project.devTreeId} not found for project ${projectId}`);- if (breakpoints === null)- throw new Error(`Breakpoints not found for project ${projectId}`);- return {- tree,- props: props2,- project,- breakpoints: breakpoints.values- };-}, loadCanvasData = async ({- projectId-}) => await loadData(projectId), loadPreviewData = async ({- projectId-}) => {- let { tree, props: props2, breakpoints } = await loadData(projectId);- return { tree, props: props2, breakpoints };-};--// app/shared/db/breakpoints.server.ts-var breakpoints_server_exports = {};-__export(breakpoints_server_exports, {- clone: () => clone4,- create: () => create3,- getBreakpointsWithId: () => getBreakpointsWithId,- load: () => load,- patch: () => patch2-});-var import_sdk13 = require("@webstudio-is/sdk"), import_bson_objectid3 = __toESM(require("bson-objectid")), import_immer4 = require("immer");-var load = async (treeId) => {- if (typeof treeId != "string")- throw new Error("Tree ID required");- let breakpoint = await prisma.breakpoints.findUnique({- where: { treeId }- });- if (breakpoint === null)- throw new Error("Breakpoint not found");- return __spreadProps(__spreadValues({}, breakpoint), {- values: JSON.parse(breakpoint.values)- });-}, getBreakpointsWithId = () => import_sdk13.initialBreakpoints.map((breakpoint) => __spreadProps(__spreadValues({}, breakpoint), {- id: (0, import_bson_objectid3.default)().toString()-})), create3 = async (treeId, breakpoints) => {- let data = {- treeId,- values: JSON.stringify(breakpoints)- };- return await prisma.breakpoints.create({ data }), __spreadProps(__spreadValues({}, data), {- breakpoints- });-}, clone4 = async ({- previousTreeId,- nextTreeId-}) => {- let breakpoints = await load(previousTreeId);- if (breakpoints === null)- throw new Error(`Didn't find breakpoints with tree id "${previousTreeId}"`);- await create3(nextTreeId, breakpoints.values);-}, patch2 = async ({ treeId }, patches) => {- let breakpoints = await load(treeId);- if (breakpoints === null)- return;- let nextBreakpoints = (0, import_immer4.applyPatches)(breakpoints.values, patches);- await prisma.breakpoints.update({- where: { treeId },- data: { values: nextBreakpoints }- });-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/breakpoints.$projectId.ts-var loader = async ({- params-}) => {- try {- let project = await project_server_exports.loadById(params.projectId);- if (project === null)- throw new Error(`Project ${params.projectId} not found`);- if (project.prodTreeId === null)- throw new Error(`Project ${params.projectId} needs to be published first`);- let data = await breakpoints_server_exports.load(project.prodTreeId);- if (data === null)- throw new Error(`Breakpoints not found for project ${params.projectId} and tree ID ${project.prodTreeId}`);- return data.values;- } catch (error) {- if (error instanceof Error)- return {- errors: error.message- };- }- return { errors: "Unexpected error" };-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/project/clone.$domain.ts-var clone_domain_exports = {};-__export(clone_domain_exports, {- loader: () => loader2-});-var import_node2 = require("@remix-run/node");--// app/shared/session/user.server.ts-var import_bson_objectid4 = __toESM(require("bson-objectid")), import_node = require("@remix-run/node"), userIdParser = (0, import_node.createCookie)("user-id", {- maxAge: 604800-}), ensureUserCookie = async (request) => {- let cookieString = request.headers.get("Cookie"), userId = await userIdParser.parse(cookieString);- if (userId !== null)- return { userId };- let generatedUserId = (0, import_bson_objectid4.default)().toString();- return {- headers: {- "Set-Cookie": await userIdParser.serialize(generatedUserId)- },- userId: userId || generatedUserId- };-};--// app/shared/session/use-login-error-message.ts-var import_isNil = __toESM(require("lodash/isNil")), import_react18 = require("react"), import_react_router_dom = require("react-router-dom");-var AUTH_PROVIDERS = {- LOGIN_DEV: "login_dev",- LOGIN_GITHUB: "login_github",- LOGIN_GOOGLE: "login_google"-}, LOGIN_ERROR_MESSAGES = {- [AUTH_PROVIDERS.LOGIN_DEV]: "There has been an issue logging you in with dev",- [AUTH_PROVIDERS.LOGIN_GITHUB]: "There has been an issue logging you in with Github",- [AUTH_PROVIDERS.LOGIN_GOOGLE]: "There has been an issue logging you in with Google"-}, useLoginErrorMessage = () => {- let [searchParams, setSearchParams] = (0, import_react_router_dom.useSearchParams)(), [messageToReturn, setMessageToReturn] = (0, import_react18.useState)("");- return (0, import_react18.useEffect)(() => {- let error = searchParams.get("error"), message = searchParams.get("message");- if (error !== null && !(0, import_isNil.default)(message) && message !== "") {- sentryException({- message- }), setMessageToReturn(message), setSearchParams({});- return;- }- switch (error) {- case AUTH_PROVIDERS.LOGIN_DEV:- setMessageToReturn(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_DEV]);- break;- case AUTH_PROVIDERS.LOGIN_GITHUB:- setMessageToReturn(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_GITHUB]);- break;- case AUTH_PROVIDERS.LOGIN_GOOGLE:- setMessageToReturn(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_GOOGLE]);- break;- default:- break;- }- setSearchParams({});- }, [searchParams, setSearchParams]), messageToReturn;-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/project/clone.$domain.ts-var ensureProject = async ({- userId,- domain-}) => {- let projects = await project_server_exports.loadManyByUserId(userId);- return projects.length !== 0 ? projects[0] : await project_server_exports.clone(domain, userId);-}, loader2 = async ({ request, params }) => {- if (params.domain === void 0)- return { errors: "Domain required" };- let { headers, userId } = await ensureUserCookie(request);- try {- let project = await ensureProject({ userId, domain: params.domain });- return (0, import_node2.redirect)(`${config_default.designerPath}/${project == null ? void 0 : project.id}`, { headers });- } catch (error) {- if (error instanceof Error)- return { errors: error.message };- }- return { errors: "Unexpected error" };-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/props.$projectId.ts-var props_projectId_exports = {};-__export(props_projectId_exports, {- loader: () => loader3-});-var loader3 = async ({- params-}) => {- try {- let project = await project_server_exports.loadById(params.projectId);- return await props_server_exports.loadByProject(project, "production");- } catch (error) {- if (error instanceof Error)- return {- errors: error.message- };- }- return { errors: "Unexpected error" };-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/tree.$projectId.ts-var tree_projectId_exports = {};-__export(tree_projectId_exports, {- loader: () => loader4-});-var loader4 = async ({- params-}) => {- try {- let project = await project_server_exports.loadById(params.projectId);- return await tree_server_exports.loadByProject(project, "production");- } catch (error) {- if (error instanceof Error)- return {- errors: error.message- };- }- return { errors: "Unexpected error" };-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/publish.ts-var publish_exports = {};-__export(publish_exports, {- action: () => action-});-var action = async ({ request }) => {- let formData = await request.formData(), domain = formData.get("domain"), projectId = formData.get("projectId");- try {- return { domain: (await misc_server_exports.publish({ projectId, domain })).domain };- } catch (error) {- if (error instanceof Error)- return {- errors: error.message- };- }- return { errors: "Unexpected error" };-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/github.tsx-var github_exports = {};-__export(github_exports, {- action: () => action2,- default: () => GH-});-var import_node4 = require("@remix-run/node");--// app/services/auth.server.ts-var import_remix_auth = require("remix-auth"), import_remix_auth_form = require("remix-auth-form"), import_remix_auth_github = require("remix-auth-github"), import_remix_auth_google = require("remix-auth-google");--// app/services/session.server.ts-var import_node3 = require("@remix-run/node"), sessionStorage = (0, import_node3.createCookieSessionStorage)({- cookie: {- maxAge: 60 * 60 * 24 * 30,- name: "_session",- sameSite: "lax",- path: "/",- httpOnly: !0,- secrets: process.env.AUTH_SECRET ? [process.env.AUTH_SECRET] : void 0,- secure: !1- }-}), { getSession, commitSession, destroySession } = sessionStorage;--// app/shared/db/user.server.ts-var genericCreateAccount = async (userData, userId) => {- if (await prisma.user.findUnique({- where: {- id: userId- }- })) {- let connectedUser = await prisma.user.update({- where: {- id: userId- },- data: userData- });- return connectedUser.teamId || await prisma.team.create({- data: {- users: {- connect: {- id: connectedUser.id- }- }- }- }), connectedUser;- }- let existingUserWithEmail = await prisma.user.findUnique({- where: {- email: userData.email- }- });- return existingUserWithEmail ? (existingUserWithEmail.teamId || await prisma.team.create({- data: {- users: {- connect: {- id: existingUserWithEmail.id- }- }- }- }), existingUserWithEmail) : (await prisma.team.create({- data: {- users: {- create: __spreadValues({- id: userId- }, userData)- }- },- include: {- users: {- where: {- id: userId- }- }- }- })).users[0];-}, createOrLoginWithGithub = async (profile, userId) => {- let userData = {- email: profile._json.email,- username: profile.displayName,- image: profile._json.avatar_url,- provider: profile.provider- };- return await genericCreateAccount(userData, userId);-}, createOrLoginWithGoogle = async (profile, userId) => {- let userData = {- email: profile._json.email,- username: profile.displayName,- image: profile._json.picture,- provider: profile.provider- };- return await genericCreateAccount(userData, userId);-}, createOrLoginWithDev = async (userId) => await genericCreateAccount({- email: "[email protected]",- username: "admin",- image: "",- provider: "dev"-}, userId);--// app/services/auth.server.ts-var url = `${process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : `http://localhost:${process.env.PORT || 3e3}`}${config_default.authPath}`, github = new import_remix_auth_github.GitHubStrategy({- clientID: process.env.GH_CLIENT_ID,- clientSecret: process.env.GH_CLIENT_SECRET,- callbackURL: `${url}${config_default.githubCallbackPath}`-}, async ({ profile, context }) => await createOrLoginWithGithub(profile, context == null ? void 0 : context.userId)), google = new import_remix_auth_google.GoogleStrategy({- clientID: process.env.GOOGLE_CLIENT_ID,- clientSecret: process.env.GOOGLE_CLIENT_SECRET,- callbackURL: `${url}${config_default.googleCallbackPath}`-}, async ({ profile, context }) => await createOrLoginWithGoogle(profile, context == null ? void 0 : context.userId)), authenticator = new import_remix_auth.Authenticator(sessionStorage);-process.env.GH_CLIENT_ID && process.env.GH_CLIENT_SECRET && authenticator.use(github, "github");-process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET && authenticator.use(google, "google");-process.env.DEV_LOGIN === "true" && authenticator.use(new import_remix_auth_form.FormStrategy(async ({ form }) => {- let secret = form.get("secret");- if (secret === process.env.AUTH_SECRET)- try {- return await createOrLoginWithDev(secret);- } catch (error) {- error instanceof Error && sentryException({- message: error.message,- extra: {- loginMethod: AUTH_PROVIDERS.LOGIN_DEV- }- });- }- throw new Error("The dev login code is incorrect");-}), "dev");--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/github.tsx-function GH() {- return null;-}-var action2 = async ({ request }) => {- try {- let { userId } = await ensureUserCookie(request);- return await authenticator.authenticate("github", request, {- context: {- userId- },- successRedirect: config_default.dashboardPath,- throwOnError: !0- });- } catch (error) {- if (error instanceof Response)- return error;- if (error instanceof Error)- return sentryException({- message: error.message,- extra: {- loginMethod: AUTH_PROVIDERS.LOGIN_GITHUB- }- }), (0, import_node4.redirect)(`${config_default.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GITHUB}&message=${(error == null ? void 0 : error.message) || ""}`);- }-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/github/callback.tsx-var callback_exports = {};-__export(callback_exports, {- loader: () => loader5-});-var import_node5 = require("@remix-run/node");-var loader5 = async ({ request }) => {- let { userId } = await ensureUserCookie(request), url2 = new URL(request.url), error = url2.searchParams.get("error"), error_description = url2.searchParams.get("error_description");- return error ? (0, import_node5.redirect)(`${config_default.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GITHUB}&message=${error_description || error}`) : authenticator.authenticate("github", request, {- context: {- userId- },- successRedirect: config_default.dashboardPath,- failureRedirect: config_default.loginPath- });-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/google.tsx-var google_exports = {};-__export(google_exports, {- action: () => action3,- default: () => Google,- loader: () => loader6-});-var import_node6 = require("@remix-run/node");-function Google() {- return null;-}-var loader6 = () => (0, import_node6.redirect)("/login"), action3 = async ({ request }) => {- try {- let { userId } = await ensureUserCookie(request);- return await authenticator.authenticate("google", request, {- context: {- userId- },- successRedirect: config_default.dashboardPath,- throwOnError: !0- });- } catch (error) {- if (error instanceof Response)- return error;- if (error instanceof Error)- return sentryException({- message: error.message,- extra: {- loginMethod: AUTH_PROVIDERS.LOGIN_GOOGLE- }- }), (0, import_node6.redirect)(`${config_default.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GOOGLE}&message=${(error == null ? void 0 : error.message) || ""}`);- }-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/google/callback.tsx-var callback_exports2 = {};-__export(callback_exports2, {- loader: () => loader7-});-var loader7 = async ({ request }) => {- let { userId } = await ensureUserCookie(request);- return authenticator.authenticate("google", request, {- successRedirect: config_default.dashboardPath,- failureRedirect: config_default.loginPath,- context: {- userId- }- });-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/patch.ts-var patch_exports = {};-__export(patch_exports, {- action: () => action4-});-var updaters = {- root: tree_server_exports.patchRoot,- props: props_server_exports.patch,- breakpoints: breakpoints_server_exports.patch-}, action4 = async ({ request }) => {- let { treeId, projectId, transactions } = await request.json();- if (treeId === void 0)- return { errors: "Tree id required" };- if (projectId === void 0)- return { errors: "Project id required" };- for await (let transaction of transactions)- for await (let change of transaction.changes) {- let { namespace: namespace2, patches } = change;- if (!(namespace2 in updaters))- return { errors: `Unknown namespace "${namespace2}"` };- await updaters[namespace2]({ treeId, projectId }, patches);- }- return { status: "ok" };-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/dashboard.tsx-var dashboard_exports = {};-__export(dashboard_exports, {- default: () => dashboard_default,- loader: () => loader8,- meta: () => meta-});--// app/shared/documents/designer.tsx-var import_react19 = require("@remix-run/react"), import_sdk14 = require("@webstudio-is/sdk");-var Designer = () => /* @__PURE__ */ React.createElement("html", {- lang: "en"-}, /* @__PURE__ */ React.createElement("head", null, /* @__PURE__ */ React.createElement("meta", {- charSet: "utf-8"-}), /* @__PURE__ */ React.createElement("meta", {- name: "viewport",- content: "width=device-width,initial-scale=1"-}), /* @__PURE__ */ React.createElement(import_react19.Meta, null), /* @__PURE__ */ React.createElement(import_react19.Links, null), /* @__PURE__ */ React.createElement(import_sdk14.CriticalCss, null)), /* @__PURE__ */ React.createElement("body", {- className: darkTheme-}, /* @__PURE__ */ React.createElement(import_react19.Outlet, null), /* @__PURE__ */ React.createElement(Env, null), /* @__PURE__ */ React.createElement(import_react19.Scripts, null), /* @__PURE__ */ React.createElement(import_react19.LiveReload, null)));--// app/env.server.ts-var env = {- SENTRY_DSN: process.env.SENTRY_DSN,- VERCEL_ENV: process.env.VERCEL_ENV-}, env_server_default = env;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/dashboard.tsx-var loader8 = () => ({- env: env_server_default-}), meta = () => ({ title: "Webstudio Dashboard" }), dashboard_default = Designer;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/dashboard/index.tsx-var dashboard_exports2 = {};-__export(dashboard_exports2, {- action: () => action5,- default: () => dashboard_default3,- links: () => links,- loader: () => loader9-});-var import_react24 = require("@remix-run/react"), import_node7 = require("@remix-run/node");--// app/dashboard/dashboard.tsx-var import_react23 = require("@remix-run/react");--// app/shared/font-faces/inter.css-var inter_default = "/build/_assets/inter-775NUFJE.css";--// app/dashboard/dashboard.css-var dashboard_default2 = "/build/_assets/dashboard-XMYFQPQX.css";--// app/dashboard/components/header.tsx-var import_react_icons = require("@radix-ui/react-icons");--// app/shared/design-system/components/avatar.tsx-var import_react20 = __toESM(require("react"));-var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));--// app/shared/design-system/components/status.tsx-var Status = styled("div", {- borderRadius: "50%",- flexShrink: 0,- variants: {- size: {- "1": {- width: 5,- height: 5- },- "2": {- width: 9,- height: 9- }- },- variant: {- gray: {- backgroundColor: "$slate7"- },- blue: {- backgroundColor: "$blue9"- },- green: {- backgroundColor: "$green9"- },- yellow: {- backgroundColor: "$yellow9"- },- red: {- backgroundColor: "$red9"- }- }- },- defaultVariants: {- size: "2",- variant: "gray"- }-});--// app/shared/design-system/components/avatar.tsx-var StyledAvatar = styled(AvatarPrimitive.Root, {- alignItems: "center",- justifyContent: "center",- verticalAlign: "middle",- overflow: "hidden",- userSelect: "none",- boxSizing: "border-box",- display: "flex",- flexShrink: 0,- position: "relative",- border: "none",- fontFamily: "inherit",- lineHeight: "1",- margin: "0",- outline: "none",- padding: "0",- fontWeight: "500",- color: "$hiContrast",- "&::before": {- content: '""',- position: "absolute",- top: 0,- right: 0,- bottom: 0,- left: 0,- borderRadius: "inherit",- boxShadow: "inset 0px 0px 1px rgba(0, 0, 0, 0.12)"- },- variants: {- size: {- "1": {- width: "$3",- height: "$3"- },- "2": {- width: "$5",- height: "$5"- },- "3": {- width: "$6",- height: "$6"- },- "4": {- width: "$7",- height: "$7"- },- "5": {- width: "$8",- height: "$8"- },- "6": {- width: "$9",- height: "$9"- }- },- variant: {- hiContrast: {- backgroundColor: "$hiContrast",- color: "$loContrast"- },- gray: {- backgroundColor: "$slate5"- },- tomato: {- backgroundColor: "$tomato5"- },- red: {- backgroundColor: "$red5"- },- crimson: {- backgroundColor: "$crimson5"- },- pink: {- backgroundColor: "$pink5"- },- plum: {- backgroundColor: "$plum5"- },- purple: {- backgroundColor: "$purple5"- },- violet: {- backgroundColor: "$violet5"- },- indigo: {- backgroundColor: "$indigo5"- },- blue: {- backgroundColor: "$blue5"- },- cyan: {- backgroundColor: "$cyan5"- },- teal: {- backgroundColor: "$teal5"- },- green: {- backgroundColor: "$green5"- },- grass: {- backgroundColor: "$grass5"- },- brown: {- backgroundColor: "$brown5"- },- bronze: {- backgroundColor: "$bronze5"- },- gold: {- backgroundColor: "$gold5"- },- sky: {- backgroundColor: "$sky5"- },- mint: {- backgroundColor: "$mint5"- },- lime: {- backgroundColor: "$lime5"- },- yellow: {- backgroundColor: "$yellow5"- },- amber: {- backgroundColor: "$amber5"- },- orange: {- backgroundColor: "$orange5"- }- },- shape: {- square: {- borderRadius: "$2"- },- circle: {- borderRadius: "50%"- }- },- inactive: {- true: {- opacity: ".3"- }- },- interactive: {- true: {- "&::after": {- content: '""',- position: "absolute",- top: "0",- right: "0",- bottom: "0",- left: "0",- backgroundColor: "rgba(0,0,0,.08)",- opacity: "0",- pointerEvents: "none",- transition: "opacity 25ms linear"- },- "@hover": {- "&:hover": {- "&::after": {- opacity: "1"- }- }- },- '&[data-state="open"]': {- "&::after": {- backgroundColor: "rgba(0,0,0,.12)",- opacity: "1"- }- }- }- }- },- defaultVariants: {- size: "2",- variant: "gray",- shape: "circle"- }-}), StyledAvatarImage = styled(AvatarPrimitive.Image, {- display: "flex",- objectFit: "cover",- boxSizing: "border-box",- height: "100%",- verticalAlign: "middle",- width: "100%"-}), StyledAvatarFallback = styled(AvatarPrimitive.Fallback, {- textTransform: "uppercase",- borderRadius: "50%",- variants: {- size: {- "1": {- fontSize: "10px",- lineHeight: "15px"- },- "2": {- fontSize: "$3"- },- "3": {- fontSize: "$6"- },- "4": {- fontSize: "$7"- },- "5": {- fontSize: "$8"- },- "6": {- fontSize: "$9"- }- }- },- defaultVariants: {- size: "2"- }-}), AvatarNestedItem = styled("div", {- boxShadow: "0 0 0 2px $colors$loContrast",- borderRadius: "50%"-}), AvatarGroup = styled("div", {- display: "flex",- flexDirection: "row-reverse",- [`& ${AvatarNestedItem}:nth-child(n+2)`]: {- marginRight: "-$1"- }-}), Avatar = import_react20.default.forwardRef((_a, forwardedRef) => {- var _b = _a, { alt, src, fallback, size, variant, shape, css: css2, status } = _b, props2 = __objRest(_b, ["alt", "src", "fallback", "size", "variant", "shape", "css", "status"]);- return /* @__PURE__ */ import_react20.default.createElement(Box, {- css: __spreadProps(__spreadValues({}, css2), {- position: "relative",- height: "fit-content",- width: "fit-content"- })- }, /* @__PURE__ */ import_react20.default.createElement(StyledAvatar, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef,- size,- variant,- shape- }), /* @__PURE__ */ import_react20.default.createElement(StyledAvatarImage, {- alt,- src- }), /* @__PURE__ */ import_react20.default.createElement(StyledAvatarFallback, {- size- }, fallback)), status && /* @__PURE__ */ import_react20.default.createElement(Box, {- css: {- position: "absolute",- bottom: "0",- right: "0",- boxShadow: "0 0 0 3px $colors$loContrast",- borderRadius: "$round",- mr: "-3px",- mb: "-3px"- }- }, /* @__PURE__ */ import_react20.default.createElement(Status, {- size: size && size > 2 ? "2" : "1",- variant: status- })));-});-Avatar.displayName = "Avatar";--// app/dashboard/components/header.tsx-var import_react_router_dom2 = require("react-router-dom"), DashboardHeader = ({ user }) => {- let navigate = (0, import_react_router_dom2.useNavigate)(), userNameFallback = ((user == null ? void 0 : user.username) || (user == null ? void 0 : user.email) || "X").charAt(0).toLocaleUpperCase();- return /* @__PURE__ */ React.createElement(Flex, {- as: "header",- align: "center",- justify: "end",- css: {- p: "$1",- bc: "$loContrast",- borderBottom: "1px solid $slate8"- }- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "1",- align: "center"- }, /* @__PURE__ */ React.createElement(DropdownMenu, null, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, {- asChild: !0- }, /* @__PURE__ */ React.createElement(Button, {- variant: "raw",- "aria-label": "Menu Button"- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "1",- align: "center",- css: { height: "$5" }- }, /* @__PURE__ */ React.createElement(Avatar, {- src: (user == null ? void 0 : user.image) || void 0,- fallback: userNameFallback- }), /* @__PURE__ */ React.createElement(import_react_icons.ChevronDownIcon, {- width: 15,- height: 15,- color: "white"- })))), /* @__PURE__ */ React.createElement(DropdownMenuContent, null, /* @__PURE__ */ React.createElement(DropdownMenuItem, {- onSelect: () => navigate("/logout")- }, /* @__PURE__ */ React.createElement(Text, null, "Logout"))))));-};--// app/dashboard/components/card.tsx-var import_react21 = require("react"), import_react22 = require("@remix-run/react"), import_react_router_dom3 = require("react-router-dom");-var SelectProjectCard = ({- projects,- config: config4,- errors-}) => {- let [selectedProject, setSelectedProject] = (0, import_react21.useState)(""), [newProject, setNewProject] = (0, import_react21.useState)("My awesome project"), navigate = (0, import_react_router_dom3.useNavigate)(), transition = (0, import_react22.useTransition)(), handleOpen = () => {- navigate(`${config4.designerPath}/${selectedProject}`);- }, options2 = ["", ...projects.map((project) => project.id)];- return /* @__PURE__ */ React.createElement(Card, {- size: 2- }, /* @__PURE__ */ React.createElement(Flex, {- direction: "column",- gap: "4"- }, /* @__PURE__ */ React.createElement(Heading, {- size: "2",- css: { textAlign: "center" }- }, "Select a project"), /* @__PURE__ */ React.createElement(Select, {- size: 2,- name: "project",- options: options2,- onChange: setSelectedProject,- value: selectedProject,- placeholder: "Create new project",- getLabel: (option) => {- var _a;- return ((_a = projects.find((project) => project.id === option)) == null ? void 0 : _a.title) || "Create new project";- }- }), selectedProject === "" ? /* @__PURE__ */ React.createElement(import_react22.Form, {- method: "post"- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "1"- }, /* @__PURE__ */ React.createElement(TextField, {- size: 2,- state: errors ? "invalid" : void 0,- name: "project",- defaultValue: newProject,- onFocus: (event) => {- event.target.select();- },- onChange: (event) => {- setNewProject(event.target.value);- }- }), /* @__PURE__ */ React.createElement(Button, {- size: 2,- disabled: newProject.length === 0 || transition.state === "submitting",- type: "submit"- }, transition.state === "submitting" ? "Creating..." : "Create")), errors ? /* @__PURE__ */ React.createElement(Text, {- variant: "red",- css: { marginTop: "$1" }- }, errors) : null) : /* @__PURE__ */ React.createElement(Button, {- onClick: handleOpen,- size: 2- }, "Open")));-};--// app/dashboard/dashboard.tsx-var links = () => [- {- rel: "stylesheet",- href: inter_default- },- {- rel: "stylesheet",- href: dashboard_default2- }-], Dashboard = ({ projects = [], config: config4, user }) => {- let actionData = (0, import_react23.useActionData)();- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DashboardHeader, {- user- }), /* @__PURE__ */ React.createElement(Flex, {- css: { height: "100vh" },- direction: "column",- align: "center",- justify: "center"- }, /* @__PURE__ */ React.createElement(SelectProjectCard, {- projects,- config: config4,- errors: actionData == null ? void 0 : actionData.errors- })));-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/dashboard/index.tsx-var action5 = async ({ request }) => {- let title = (await request.formData()).get("project");- if (typeof title != "string")- return { errors: "Title required" };- let { userId, headers } = await ensureUserCookie(request), authenticatedUser = await authenticator.isAuthenticated(request);- try {- let project = await project_server_exports.create({- title,- userId: (authenticatedUser == null ? void 0 : authenticatedUser.id) || userId- });- return (0, import_node7.redirect)(`${config_default.designerPath}/${project == null ? void 0 : project.id}`, { headers });- } catch (error) {- if (error instanceof Error)- return { errors: error.message };- }- return { errors: "Unexpected error" };-}, loader9 = async ({ request }) => {- let user = await authenticator.isAuthenticated(request);- if (!user)- return (0, import_node7.redirect)(config_default.loginPath);- let { headers } = await ensureUserCookie(request), projects = await project_server_exports.loadManyByUserId(user.id);- return (0, import_node7.json)({ config: config_default, projects, user }, headers);-}, DashboardRoute = () => {- let { config: config4, projects, user } = (0, import_react24.useLoaderData)();- return /* @__PURE__ */ React.createElement(Dashboard, {- config: config4,- user,- projects- });-}, dashboard_default3 = DashboardRoute;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/dev.tsx-var dev_exports = {};-__export(dev_exports, {- action: () => action6,- default: () => Dev-});-var import_node8 = require("@remix-run/node");-function Dev() {- return null;-}-var action6 = async ({ request }) => {- try {- return await authenticator.authenticate("dev", request, {- successRedirect: config_default.dashboardPath,- throwOnError: !0- });- } catch (error) {- if (error instanceof Response)- return error;- if (error instanceof Error)- return (0, import_node8.redirect)(`${config_default.loginPath}?error=${AUTH_PROVIDERS.LOGIN_DEV}&message=${(error == null ? void 0 : error.message) || ""}`);- }-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/designer.tsx-var designer_exports = {};-__export(designer_exports, {- default: () => designer_default,- loader: () => loader10,- meta: () => meta2-});-var loader10 = () => ({- env: env_server_default-}), meta2 = () => ({ title: "Webstudio" }), designer_default = Designer;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/designer/$id.tsx-var id_exports = {};-__export(id_exports, {- default: () => id_default,- links: () => links2,- loader: () => loader11-});-var import_react59 = require("@remix-run/react");--// app/designer/designer.tsx-var import_react58 = require("react"), import_react_dnd3 = require("react-dnd"), import_react_dnd_html5_backend2 = require("react-dnd-html5-backend"), import_sdk33 = require("@webstudio-is/sdk");--// app/designer/features/sidebar-left/sidebar-left.tsx-var import_react30 = require("react"), import_sdk16 = require("@webstudio-is/sdk");--// app/designer/shared/nano-states/index.ts-var import_react_nano_state = require("react-nano-state"), selectedInstanceDataContainer = (0, import_react_nano_state.createValueContainer)(), useSelectedInstanceData = () => (0, import_react_nano_state.useValue)(selectedInstanceDataContainer), hoveredInstanceDataContainer = (0, import_react_nano_state.createValueContainer)(), useHoveredInstanceData = () => (0, import_react_nano_state.useValue)(hoveredInstanceDataContainer), isShareDialogOpenContainer = (0, import_react_nano_state.createValueContainer)(!1), useIsShareDialogOpen = () => (0, import_react_nano_state.useValue)(isShareDialogOpenContainer), isPublishDialogOpenContainer = (0, import_react_nano_state.createValueContainer)(!1), useIsPublishDialogOpen = () => (0, import_react_nano_state.useValue)(isPublishDialogOpenContainer), selectedBreakpointContainer = (0, import_react_nano_state.createValueContainer)(), useSelectedBreakpoint = () => (0, import_react_nano_state.useValue)(selectedBreakpointContainer), zoomContainer = (0, import_react_nano_state.createValueContainer)(100), useZoom = () => (0, import_react_nano_state.useValue)(zoomContainer), canvasWidthContainer = (0, import_react_nano_state.createValueContainer)(0), useCanvasWidth = () => (0, import_react_nano_state.useValue)(canvasWidthContainer), canvasRectContainer = (0, import_react_nano_state.createValueContainer)(), useCanvasRect = () => (0, import_react_nano_state.useValue)(canvasRectContainer), syncStatusContainer = (0, import_react_nano_state.createValueContainer)("idle"), useSyncStatus = () => (0, import_react_nano_state.useValue)(syncStatusContainer), selectionRectContainer = (0, import_react_nano_state.createValueContainer)(), useSelectionRect = () => (0, import_react_nano_state.useValue)(selectionRectContainer);--// app/designer/features/sidebar-left/panels/index.ts-var panels_exports = {};-__export(panels_exports, {- components: () => components_exports,- tree: () => tree_exports-});--// app/designer/features/sidebar-left/panels/components/index.ts-var components_exports = {};-__export(components_exports, {- TabContent: () => TabContent,- icon: () => icon-});--// app/designer/features/sidebar-left/panels/components/components.tsx-var import_react27 = require("react"), import_react_dnd2 = require("react-dnd"), import_react_dnd_html5_backend = require("react-dnd-html5-backend");--// app/designer/features/sidebar-left/panels/components/custom-drag-layer.tsx-var import_react26 = require("react"), import_react_dom = require("react-dom"), import_react_dnd = require("react-dnd");--// app/designer/features/sidebar-left/panels/components/component-thumb.tsx-var import_react25 = require("react");-var Thumb3 = styled(Flex, {- px: 5,- width: 75,- height: 75,- border: "1px solid $slate6",- userSelect: "none",- color: "$hiContrast",- cursor: "grab",- "&:hover": {- background: "$slate3"- },- variants: {- state: {- dragging: {- background: "$slate3"- }- }- }-}), ComponentThumb = (0, import_react25.forwardRef)((_a, ref) => {- var _b = _a, { component } = _b, rest = __objRest(_b, ["component"]);- let { Icon: Icon2, label: label11 } = primitives_exports[component];- return /* @__PURE__ */ React.createElement(Thumb3, __spreadValues({- direction: "column",- align: "center",- justify: "center",- gap: "3",- ref- }, rest), /* @__PURE__ */ React.createElement(Icon2, {- width: 30,- height: 30- }), /* @__PURE__ */ React.createElement(Text, {- size: "1"- }, label11));-});-ComponentThumb.displayName = "ComponentThumb";--// app/designer/features/sidebar-left/panels/components/custom-drag-layer.tsx-var layerStyles = {- position: "absolute",- pointerEvents: "none",- zIndex: 1,- left: 0,- top: 0,- width: "100%",- height: "100%"-}, CustomDragLayer = ({ onDrag }) => {- let { component, isDragging, clientOffset, sourceClientOffset } = (0, import_react_dnd.useDragLayer)((monitor) => ({- component: monitor.getItemType(),- isDragging: monitor.isDragging(),- clientOffset: monitor.getClientOffset(),- sourceClientOffset: monitor.getSourceClientOffset()- })), [canvasRect] = useCanvasRect(), [zoom] = useZoom();- return (0, import_react26.useEffect)(() => {- if (clientOffset === null || component === null || canvasRect === void 0)- return;- let scale = zoom / 100, currentOffset = {- x: (clientOffset.x - canvasRect.x) / scale,- y: (clientOffset.y - canvasRect.y) / scale- };- onDrag({- currentOffset,- component- });- }, [clientOffset, component, onDrag, zoom, canvasRect]), isDragging === !1 || sourceClientOffset === null ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ React.createElement("div", {- style: layerStyles- }, /* @__PURE__ */ React.createElement(ComponentThumb, {- component,- style: {- transform: `translate3d(${sourceClientOffset.x}px, ${sourceClientOffset.y}px, 0)`- },- state: "dragging"- })), document.body);-};--// app/designer/features/sidebar-left/panels/components/components.tsx-var useDraggable = ({ component, onDragChange }) => {- let lastIsDragging = (0, import_react27.useRef)(), [{ isDragging }, dragRef, preview] = (0, import_react_dnd2.useDrag)(() => ({- type: component,- collect: (monitor) => ({- isDragging: monitor.isDragging()- })- }), []);- return (0, import_react27.useEffect)(() => {- lastIsDragging.current !== void 0 && onDragChange(isDragging), lastIsDragging.current = isDragging;- }, [isDragging, onDragChange]), (0, import_react27.useEffect)(() => {- preview((0, import_react_dnd_html5_backend.getEmptyImage)(), { captureDraggingState: !0 });- }, [preview]), dragRef;-}, DraggableThumb = ({- component,- onDragChange,- onClick-}) => {- let dragRef = useDraggable({ component, onDragChange });- return /* @__PURE__ */ React.createElement(ComponentThumb, {- component,- ref: dragRef,- onClick- });-}, TabContent = ({- onDragChange,- publish: publish12,- onSetActiveTab-}) => {- let components11 = Object.keys(primitives_exports).filter((component) => primitives_exports[component].isInlineOnly === !1), handleDragChange = (0, import_react27.useCallback)((isDragging) => {- onDragChange(isDragging), publish12({- type: isDragging === !0 ? "dragStartInstance" : "dragEndInstance"- });- }, [onDragChange, publish12]);- return /* @__PURE__ */ React.createElement(Flex, {- gap: "1",- wrap: "wrap",- css: { padding: "$1" }- }, components11.map((component) => /* @__PURE__ */ React.createElement(DraggableThumb, {- key: component,- component,- onClick: () => {- onSetActiveTab("none"), publish12({- type: "insertInstance",- payload: { instance: createInstance({ component }) }- });- },- onDragChange: handleDragChange- })), /* @__PURE__ */ React.createElement(CustomDragLayer, {- onDrag: (dragData) => {- publish12({- type: "dragInstance",- payload: {- instance: createInstance({ component: dragData.component }),- currentOffset: dragData.currentOffset- }- });- }- }));-}, icon = /* @__PURE__ */ React.createElement(icons_exports.PlusIcon, null);--// app/designer/features/sidebar-left/panels/tree.tsx-var tree_exports = {};-__export(tree_exports, {- TabContent: () => TabContent2,- icon: () => icon2-});--// app/designer/shared/instance/use-selected-instance-path.ts-var import_react28 = require("react");--// app/shared/nano-states/nano-states.ts-var import_react_nano_state2 = require("react-nano-state"), rootInstanceContainer = (0, import_react_nano_state2.createValueContainer)(), useRootInstance = () => (0, import_react_nano_state2.useValue)(rootInstanceContainer), breakpointsContainer = (0, import_react_nano_state2.createValueContainer)([]), useBreakpoints = () => (0, import_react_nano_state2.useValue)(breakpointsContainer), isPreviewModeContainer = (0, import_react_nano_state2.createValueContainer)(!1), useIsPreviewMode = () => (0, import_react_nano_state2.useValue)(isPreviewModeContainer), selectedInstanceRectContainer = (0, import_react_nano_state2.createValueContainer)(), useSelectedInstanceRect = () => (0, import_react_nano_state2.useValue)(selectedInstanceRectContainer), hoveredInstanceRectContainer = (0, import_react_nano_state2.createValueContainer)(), useHoveredInstanceRect = () => (0, import_react_nano_state2.useValue)(hoveredInstanceRectContainer), isScrollingContainer = (0, import_react_nano_state2.createValueContainer)(!1), useIsScrolling = () => (0, import_react_nano_state2.useValue)(isScrollingContainer), textEditingInstanceIdContainer = (0, import_react_nano_state2.createValueContainer)(), useTextEditingInstanceId = () => (0, import_react_nano_state2.useValue)(textEditingInstanceIdContainer);--// app/shared/nano-states/use-subscribe-scroll-state.ts-var import_sdk15 = require("@webstudio-is/sdk");-var useSubscribeScrollState = () => {- let [, setIsScrolling] = useIsScrolling();- (0, import_sdk15.useSubscribe)("scrollState", setIsScrolling);-};--// app/designer/shared/instance/use-selected-instance-path.ts-var useSelectedInstancePath = (selectedInstanceId) => {- let [rootInstance] = useRootInstance();- return (0, import_react28.useMemo)(() => selectedInstanceId !== void 0 && rootInstance !== void 0 ? getInstancePath(rootInstance, selectedInstanceId) : [], [selectedInstanceId, rootInstance]);-};--// app/designer/shared/tree/tree.tsx-var import_react29 = require("react");-var import_lodash4 = __toESM(require("lodash.noop")), openKeyframes = keyframes({- from: { height: 0 },- to: { height: "var(--radix-collapsible-content-height)" }-}), closeKeyframes = keyframes({- from: { height: "var(--radix-collapsible-content-height)" },- to: { height: 0 }-}), CollapsibleContentAnimated = styled(Collapsible.Content, {- overflow: "hidden",- '&[data-state="open"]': {- animation: `${openKeyframes} 150ms ease-in-out`- },- '&[data-state="closed"]': {- animation: `${closeKeyframes} 150ms ease-in-out`- }-}), CollapsibleContentUnanimated = styled(Collapsible.Content, {- overflow: "hidden"-}), Tree = ({- instance,- selectedInstanceId,- selectedInstancePath,- level = 0,- onSelect = import_lodash4.default,- animate = !0-}) => {- let [isOpen, setIsOpen] = (0, import_react29.useState)(selectedInstancePath.includes(instance));- (0, import_react29.useEffect)(() => {- setIsOpen(selectedInstancePath.includes(instance));- }, [selectedInstancePath, instance]);- let showChildren = instance.children.length > 1 || typeof instance.children[0] == "object", children6 = (0, import_react29.useMemo)(() => {- if (isOpen === !1 || showChildren === !1)- return null;- let children7 = [];- for (let child of instance.children)- typeof child != "string" && children7.push(/* @__PURE__ */ React.createElement(Tree, {- instance: child,- selectedInstanceId,- selectedInstancePath,- level: level + 1,- key: child.id,- onSelect,- animate- }));- return children7;- }, [- instance,- level,- isOpen,- selectedInstanceId,- selectedInstancePath,- onSelect,- showChildren,- animate- ]), { Icon: Icon2, label: label11 } = primitives_exports[instance.component], CollapsibleContent = animate ? CollapsibleContentAnimated : CollapsibleContentUnanimated;- return /* @__PURE__ */ React.createElement(Collapsible.Root, {- open: isOpen,- onOpenChange: setIsOpen- }, /* @__PURE__ */ React.createElement(Flex, {- css: {- paddingLeft: level * 15 + (showChildren ? 0 : 15),- color: "$hiContrast",- alignItems: "center"- }- }, showChildren && /* @__PURE__ */ React.createElement(Collapsible.Trigger, {- asChild: !0- }, isOpen ? /* @__PURE__ */ React.createElement(icons_exports.TriangleDownIcon, null) : /* @__PURE__ */ React.createElement(icons_exports.TriangleRightIcon, null)), /* @__PURE__ */ React.createElement(Button, __spreadProps(__spreadValues({}, instance.id === selectedInstanceId ? { state: "active" } : { ghost: !0 }), {- css: { display: "flex", gap: "$1", padding: "$1" },- onFocus: () => {- onSelect(instance);- }- }), /* @__PURE__ */ React.createElement(Icon2, null), /* @__PURE__ */ React.createElement(Text, null, label11))), /* @__PURE__ */ React.createElement(CollapsibleContent, null, children6));-};--// app/designer/features/sidebar-left/panels/tree.tsx-var TabContent2 = ({- publish: publish12,- selectedInstanceData-}) => {- let [rootInstance] = useRootInstance(), selectedInstancePath = useSelectedInstancePath(selectedInstanceData == null ? void 0 : selectedInstanceData.id);- return rootInstance === void 0 ? null : /* @__PURE__ */ React.createElement(Flex, {- gap: "3",- direction: "column",- css: { padding: "$1" }- }, /* @__PURE__ */ React.createElement(Tree, {- instance: rootInstance,- selectedInstancePath,- selectedInstanceId: selectedInstanceData == null ? void 0 : selectedInstanceData.id,- onSelect: (instance) => {- publish12({- type: "selectInstanceById",- payload: instance.id- });- }- }));-}, icon2 = /* @__PURE__ */ React.createElement(ListNestedIcon, null);--// app/designer/features/sidebar-left/sidebar-left.tsx-var sidebarTabsContentStyle = {- position: "absolute",- left: "100%",- width: 250,- height: "100%",- bc: "$loContrast",- outline: "1px solid $slate6"-}, none = { TabContent: () => null }, SidebarLeft = ({ onDragChange, publish: publish12 }) => {- let [selectedInstanceData] = useSelectedInstanceData(), [activeTab, setActiveTab] = (0, import_react30.useState)("none"), [isDragging, setIsDragging] = (0, import_react30.useState)(!1), { TabContent: TabContent3 } = activeTab === "none" ? none : panels_exports[activeTab];- (0, import_sdk16.useSubscribe)("clickCanvas", () => {- setActiveTab("none");- }), (0, import_sdk16.useSubscribe)("dragStartInstance", () => {- setIsDragging(!0);- }), (0, import_sdk16.useSubscribe)("dragEndInstance", () => {- setIsDragging(!1);- });- let handleDragChange = (0, import_react30.useCallback)((isDragging2) => {- isDragging2 === !1 && setActiveTab("none"), setIsDragging(isDragging2), onDragChange(isDragging2);- }, [onDragChange]);- return /* @__PURE__ */ React.createElement(Box, {- css: { position: "relative", zIndex: 1 }- }, /* @__PURE__ */ React.createElement(SidebarTabs, {- activationMode: "manual",- value: activeTab- }, /* @__PURE__ */ React.createElement(SidebarTabsList, null, Object.keys(panels_exports).map((tabName) => /* @__PURE__ */ React.createElement(SidebarTabsTrigger, {- "aria-label": tabName,- key: tabName,- value: tabName,- onClick: () => {- setActiveTab(activeTab !== tabName ? tabName : "none");- }- }, tabName === "none" ? null : panels_exports[tabName].icon))), /* @__PURE__ */ React.createElement(SidebarTabsContent, {- value: activeTab === "none" ? "" : activeTab,- css: __spreadProps(__spreadValues({}, sidebarTabsContentStyle), {- visibility: isDragging ? "hidden" : "visible",- overflow: "auto"- })- }, /* @__PURE__ */ React.createElement(TabContent3, {- selectedInstanceData,- publish: publish12,- onSetActiveTab: setActiveTab,- onDragChange: handleDragChange- }))));-};--// app/designer/shared/breakpoints/will-render.ts-var willRender = (breakpoint, canvasWidth) => canvasWidth >= breakpoint.minWidth;--// app/designer/features/style-panel/use-style-data.ts-var import_react31 = require("react");--// app/designer/features/style-panel/parse-css-value.ts-var import_hyphenate_style_name = __toESM(require("hyphenate-style-name")), import_sdk17 = require("@webstudio-is/sdk"), unitRegex = new RegExp(`${import_sdk17.units.join("|")}`), isValid = (property, value) => {- if (typeof CSSStyleValue > "u" || typeof CSSStyleValue.parse > "u")- return !0;- try {- CSSStyleValue.parse((0, import_hyphenate_style_name.default)(property), value);- } catch {- return !1;- }- return !0;-}, mathRegex = /[\+\-\*\/]/, evaluate = (input, parsedUnit) => {- let parsed = parseFloat(input);- if (isNaN(parsed))- return parsed;- if (mathRegex.test(input)) {- parsedUnit !== null && (input = input.replace(parsedUnit[0], ""));- try {- return eval(`(${input})`);- } catch (err) {- return parsed;- }- }- return parsed;-}, parseCssValue = (property, input2, defaultUnit) => {- let invalidValue = {- type: "invalid",- value: input2- };- if (input2.length === 0)- return invalidValue;- let parsedUnit2 = unitRegex.exec(input2), number = evaluate(input2, parsedUnit2);- if (isNaN(number) === !0)- return isValid(property, input2) ? {- type: "keyword",- value: input2- } : invalidValue;- let fallbackUnit = defaultUnit ?? "number", [unit] = parsedUnit2 || [fallbackUnit];- return isValid(property, number) || isValid(property, number + unit) ? {- type: "unit",- unit,- value: number- } : invalidValue;-};--// app/designer/features/style-panel/get-inherited-style.ts-var import_sdk18 = require("@webstudio-is/sdk"), propertyNames = Object.keys(import_sdk18.properties), inheritableProperties = propertyNames.reduce((acc, property) => (import_sdk18.properties[property].inherited && (acc[property] = !0), acc), {}), findParents = (instance, instanceId) => {- let parents = [];- for (let child of instance.children) {- if (typeof child == "string")- continue;- if (child.id === instanceId) {- parents.push(instance);- break;- }- let foundParents = findParents(child, instanceId);- parents.push.apply(parents, foundParents);- }- return parents;-}, getInheritedStyle = (rootInstance, instanceId) => {- let parents = findParents(rootInstance, instanceId).reverse(), inheritedStyle = {};- for (let parent of parents)- for (let cssRule of parent.cssRules)- for (let property in cssRule.style) {- let isInheritable = property in inheritableProperties, value = cssRule.style[property], hasValue = value !== void 0 && value.value !== "inherit", isFirst = !(property in inheritedStyle);- isInheritable && hasValue && isFirst && (inheritedStyle[property] = {- instance: parent,- value- });- }- return inheritedStyle;-};--// app/designer/features/style-panel/lib/utils/get-css-rule-for-breakpoint.ts-var getCssRuleForBreakpoint = (cssRules = [], breakpoint) => {- if (breakpoint !== void 0)- return cssRules.find((cssRule) => cssRule.breakpoint === breakpoint.id);-};--// app/designer/features/style-panel/use-style-data.ts-var useStyleData = ({- selectedInstanceData,- publish: publish12-}) => {- let [rootInstance] = useRootInstance(), [selectedBreakpoint] = useSelectedBreakpoint(), cssRule = (0, import_react31.useMemo)(() => getCssRuleForBreakpoint(selectedInstanceData == null ? void 0 : selectedInstanceData.cssRules, selectedBreakpoint), [selectedInstanceData == null ? void 0 : selectedInstanceData.cssRules, selectedBreakpoint]), getCurrentStyle = (0, import_react31.useCallback)(() => __spreadValues(__spreadValues({}, selectedInstanceData == null ? void 0 : selectedInstanceData.browserStyle), cssRule == null ? void 0 : cssRule.style), [selectedInstanceData, cssRule]), [currentStyle, setCurrentStyle] = (0, import_react31.useState)(getCurrentStyle());- (0, import_react31.useEffect)(() => {- let currentStyle2 = getCurrentStyle();- setCurrentStyle(currentStyle2);- }, [getCurrentStyle]);- let inheritedStyle = (0, import_react31.useMemo)(() => {- if (!(currentStyle === void 0 || selectedInstanceData === void 0 || rootInstance === void 0))- return getInheritedStyle(rootInstance, selectedInstanceData.id);- }, [currentStyle, selectedInstanceData, rootInstance]), publishUpdates = (type, updates) => {- updates.length === 0 || selectedInstanceData === void 0 || selectedBreakpoint == null || publish12({- type: type === "update" ? "updateStyle" : `previewStyle:${selectedInstanceData.id}`,- payload: {- id: selectedInstanceData.id,- updates,- breakpoint: selectedBreakpoint- }- });- };- return { currentStyle, inheritedStyle, setProperty: (property) => (input2, options2 = { isEphemeral: !1 }) => {- if (currentStyle === void 0)- return;- let currentValue = currentStyle[property], defaultUnit = (currentValue == null ? void 0 : currentValue.type) === "unit" ? currentValue == null ? void 0 : currentValue.unit : void 0, nextValue = parseCssValue(property, input2, defaultUnit);- if (nextValue.type !== "invalid") {- let updates = [{ property, value: nextValue }], type = options2.isEphemeral ? "preview" : "update";- publishUpdates(type, updates);- }- options2.isEphemeral === !1 && setCurrentStyle(__spreadProps(__spreadValues({}, currentStyle), { [property]: nextValue }));- } };-};--// app/designer/shared/inspector/collapsible-section.tsx-var import_react_nano_state3 = require("react-nano-state");-var stateContainer = (0, import_react_nano_state3.createValueContainer)({}), useOpenState = (label11, initialValue) => {- let [state, setState] = (0, import_react_nano_state3.useValue)(stateContainer);- return [label11 in state ? state[label11] : initialValue, (isOpen2) => {- setState(__spreadProps(__spreadValues({}, state), { [label11]: isOpen2 }));- }];-}, CollapsibleSection = ({- label: label11,- children: children6,- isOpenDefault = !1,- isOpen,- rightSlot-}) => {- let [isOpenByUser, setIsOpenByUser] = useOpenState(label11, isOpenDefault), isOpenFinal = isOpen === void 0 ? isOpenByUser : isOpen;- return /* @__PURE__ */ React.createElement(Collapsible.Root, {- open: isOpenFinal,- onOpenChange: setIsOpenByUser- }, /* @__PURE__ */ React.createElement(Collapsible.Trigger, {- asChild: !0- }, /* @__PURE__ */ React.createElement(Flex, {- align: "center",- gap: "1",- justify: "between",- css: {- py: "$3",- px: "$1",- color: "$hiContrast",- cursor: "default"- }- }, isOpenFinal ? /* @__PURE__ */ React.createElement(icons_exports.TriangleDownIcon, null) : /* @__PURE__ */ React.createElement(icons_exports.TriangleRightIcon, null), /* @__PURE__ */ React.createElement(Text, {- size: "3",- css: { flexGrow: 1 }- }, label11), rightSlot)), /* @__PURE__ */ React.createElement(Collapsible.Content, {- asChild: !0- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "3",- direction: "column",- css: { p: "$2", borderBottom: "1px solid $slate6" }- }, children6)));-};--// app/designer/shared/inspector/component-info.tsx-var ComponentInfo = ({- selectedInstanceData-}) => /* @__PURE__ */ React.createElement(Flex, {- justify: "between",- align: "center"-}, /* @__PURE__ */ React.createElement(Text, null, `Selected: ${primitives_exports[selectedInstanceData.component].label}`));--// app/designer/features/style-panel/settings.tsx-var import_react35 = require("react"), import_hyphenate_style_name2 = __toESM(require("hyphenate-style-name")), import_sdk22 = require("@webstudio-is/sdk");--// app/shared/style-panel-configs/configs.ts-var import_sdk19 = require("@webstudio-is/sdk");--// app/shared/string-utils/index.ts-var import_lodash5 = __toESM(require("lodash.snakecase")), import_lodash6 = __toESM(require("lodash.capitalize")), humanizeString = (string) => (0, import_lodash5.default)(string).split("_").map(import_lodash6.default).join(" ");--// app/shared/style-panel-configs/configs.ts-var getControl = (property) => property.toLocaleLowerCase().includes("color") ? "Color" : import_sdk19.categories.spacing.properties.includes(property) ? "Spacing" : "Combobox", createStyleConfigs = () => {- let map = {}, category;- for (category in import_sdk19.categories)- for (let prop of import_sdk19.categories[category].properties) {- let property = prop, keywords = import_sdk19.keywordValues[property] || [], label11 = humanizeString(property);- map[property] = {- label: label11,- property,- appliesTo: import_sdk19.properties[property].appliesTo,- control: getControl(property),- items: keywords.map((keyword) => ({- label: keyword,- name: keyword- }))- };- }- return Object.values(map);-}, styleConfigs = createStyleConfigs();--// app/designer/features/style-panel/render-property.tsx-var import_sdk21 = require("@webstudio-is/sdk");--// app/designer/features/style-panel/lib/color-picker.tsx-var import_react32 = require("react"), import_react_color = require("react-color");-var stringifyRGBA = (color) => {- let { r, g, b, a = 1 } = color;- return `rgba(${r},${g},${b},${a})`;-}, ColorPicker = ({- value,- onChange,- onChangeComplete,- id-}) => {- let [displayColorPicker, setDisplayColorPicker] = (0, import_react32.useState)(!1);- return value === "transparent" && (value = ""), /* @__PURE__ */ React.createElement(Popover, {- modal: !0,- open: displayColorPicker,- onOpenChange: setDisplayColorPicker- }, /* @__PURE__ */ React.createElement(PopoverTrigger, {- asChild: !0,- "aria-label": "Open color picker"- }, /* @__PURE__ */ React.createElement(Flex, null, /* @__PURE__ */ React.createElement(Box, {- css: {- width: "$5",- height: "$5",- background: value- }- }), /* @__PURE__ */ React.createElement(TextField, {- onChange: (e) => onChange(e.target.value),- onClick: () => setDisplayColorPicker((shown) => !shown),- variant: "ghost",- value,- id- }))), /* @__PURE__ */ React.createElement(PopoverContent, null, /* @__PURE__ */ React.createElement(import_react_color.SketchPicker, {- color: value,- onChange: (color) => onChange(stringifyRGBA(color.rgb)),- onChangeComplete: (color) => {- onChangeComplete(stringifyRGBA(color.rgb));- },- presetColors: [],- styles: {- default: {- picker: {- padding: 10- }- }- }- })));-};--// app/designer/features/style-panel/lib/spacing-widget.tsx-var import_react34 = require("react"), import_sdk20 = require("@webstudio-is/sdk");--// app/designer/features/style-panel/lib/utils/use-is-from-current-breakpoint.ts-var import_react33 = require("react");-var useIsFromCurrentBreakpoint = (property) => {- let [selectedBreakpoint] = useSelectedBreakpoint(), [selectedInstanceData] = useSelectedInstanceData(), cssRule = (0, import_react33.useMemo)(() => getCssRuleForBreakpoint(selectedInstanceData == null ? void 0 : selectedInstanceData.cssRules, selectedBreakpoint), [selectedInstanceData, selectedBreakpoint]);- return cssRule === void 0 ? !1 : property in cssRule.style;-};--// app/designer/features/style-panel/lib/constants.ts-var propertyNameColorForSelectedBreakpoint = "$blue11";--// app/designer/features/style-panel/lib/spacing-widget.tsx-var grid = {- margin: {- marginTop: "1 / 2 / 2 / 3",- marginRight: "2 / 3 / 3 / 4",- marginBottom: "3 / 2 / 4 / 3",- marginLeft: "2 / 1 / 3 / 2"- },- padding: {- paddingTop: "1 / 2 / 2 / 3",- paddingRight: "2 / 3 / 3 / 4",- paddingBottom: "3 / 2 / 4 / 3",- paddingLeft: "2 / 1 / 3 / 2"- }-}, styles = {- spacingEdit: {- fontSize: "$1",- color: "rgb(217, 217, 217)",- display: "flex",- alignItems: "center",- justifyContent: "center"- },- wrapper: {- display: "grid",- height: 130,- gridTemplateColumns: "$5 $1 $5 1fr $5 $1 $5",- gridTemplateRows: "$5 $1 $5 1fr $5 $1 $5"- },- input: {- fontSize: 10,- fontWeight: 400,- fontFamily: "inherit",- display: "block",- background: "transparent",- color: "$hiContrast",- zIndex: 99,- margin: "auto",- width: 40,- border: "none",- textAlign: "center",- outline: "none"- },- inputFromCurrentBreakpoint: {- color: propertyNameColorForSelectedBreakpoint- },- emptySpace: {- gridArea: "2 / 2 / 3 / 2",- background: "$loContrast",- width: "$6",- margin: "auto",- height: "100%",- borderRadius: "$1"- },- marginGrid: {- gridArea: "1 / 1 / -1 / -1",- display: "grid",- gridTemplateColumns: "$5 1fr $5",- gridTemplateRows: "$5 minmax($3, 1fr) $5",- height: 130,- backgroundColor: "$gray6",- borderRadius: "$1",- px: 2- },- text: {- fontWeight: "bold",- color: "$gray12",- fontSize: 8,- margin: "$1"- },- paddingGrid: {- gridArea: "3 / 3 / span 3 / span 3",- display: "grid",- gridTemplateColumns: "$5 1fr $5",- gridTemplateRows: "$5 minmax($3, 1fr) $5",- border: "2px solid",- borderColor: "$loContrast",- borderRadius: "$1"- }-}, TextField2 = ({ property, value, onEnter }) => {- let [currentValue, setCurrentValue] = (0, import_react34.useState)(value ?? ""), isFromCurrentBreakpoint = useIsFromCurrentBreakpoint(property);- return (0, import_react34.useEffect)(() => {- setCurrentValue(value ?? "");- }, [value]), /* @__PURE__ */ React.createElement(Box, {- as: "input",- name: property,- "aria-label": `${property} edit`,- value: currentValue,- onKeyDown: (event) => {- event.key === "Enter" && onEnter(currentValue);- },- onChange: (event) => {- setCurrentValue(event.target.value);- },- css: isFromCurrentBreakpoint ? __spreadValues(__spreadValues({}, styles.input), styles.inputFromCurrentBreakpoint) : styles.input- });-}, toCss = (style) => {- let css2 = {}, property;- for (property in style) {- let value = style[property];- value !== void 0 && (css2[property] = (0, import_sdk20.toValue)(value));- }- return css2;-}, SpacingWidget = ({ setProperty, values }) => {- let margins = toCss(values.margins), paddings = toCss(values.paddings), updateSpacing = ({- value,- property- }) => {- setProperty(property)(value);- };- return /* @__PURE__ */ React.createElement(Box, {- css: styles.wrapper- }, /* @__PURE__ */ React.createElement(Box, {- css: styles.marginGrid- }, Object.keys(margins).map((property) => /* @__PURE__ */ React.createElement(Box, {- key: property,- css: __spreadProps(__spreadValues({}, styles.spacingEdit), {- gridArea: grid.margin[property]- })- }, /* @__PURE__ */ React.createElement(TextField2, {- property,- value: margins[property],- onEnter: (value) => {- updateSpacing({- value,- property- });- }- })))), /* @__PURE__ */ React.createElement(Box, {- css: styles.paddingGrid- }, Object.keys(paddings).map((property) => /* @__PURE__ */ React.createElement(Box, {- key: property,- css: __spreadProps(__spreadValues({}, styles.spacingEdit), {- gridArea: grid.padding[property]- })- }, /* @__PURE__ */ React.createElement(TextField2, {- property,- value: paddings[property],- onEnter: (value) => {- updateSpacing({- value,- property- });- }- }))), /* @__PURE__ */ React.createElement(Box, {- css: styles.emptySpace- })), /* @__PURE__ */ React.createElement(Box, {- css: __spreadProps(__spreadValues({}, styles.text), {- gridArea: "3 / 3 / span 3 / span 3"- })- }, "PADDING"), /* @__PURE__ */ React.createElement(Box, {- css: __spreadProps(__spreadValues({}, styles.text), {- gridArea: "1 / 1 / -1 / -1"- })- }, "MARGIN"));-};--// app/designer/features/style-panel/render-property.tsx-var getFinalValue = ({- currentStyle,- inheritedStyle,- property-}) => {- let currentValue = currentStyle[property], inheritedValue = property in inheritedStyle ? inheritedStyle[property].value : void 0;- return (currentValue == null ? void 0 : currentValue.value) === "inherit" && inheritedValue !== void 0 ? inheritedValue : currentValue;-}, PropertyName = ({ property, label: label11 }) => {- let isCurrentBreakpoint = useIsFromCurrentBreakpoint(property);- return /* @__PURE__ */ React.createElement(Label, {- css: {- gridColumn: "1",- color: isCurrentBreakpoint ? propertyNameColorForSelectedBreakpoint : "$hiContrast"- },- variant: "contrast",- size: "1",- htmlFor: property- }, label11);-}, Unit = ({ value }) => value.type !== "unit" || value.unit === "number" ? null : /* @__PURE__ */ React.createElement(Text, {- css: {- fontSize: "$1",- cursor: "default"- }-}, value.unit), ColorControl = ({- currentStyle,- inheritedStyle,- setProperty,- styleConfig-}) => {- if (styleConfig.control !== "Color")- return null;- let value = getFinalValue({- currentStyle,- inheritedStyle,- property: styleConfig.property- });- if (value === void 0)- return null;- let setValue = setProperty(styleConfig.property);- return /* @__PURE__ */ React.createElement(Grid, {- columns: 2,- align: "center",- gapX: "1"- }, /* @__PURE__ */ React.createElement(PropertyName, {- property: styleConfig.property,- label: styleConfig.label- }), /* @__PURE__ */ React.createElement(Flex, {- align: "center",- css: { gridColumn: "2/4" },- gap: "1"- }, /* @__PURE__ */ React.createElement(ColorPicker, {- id: styleConfig.property,- value: String(value.value),- onChange: (value2) => {- setValue(value2, { isEphemeral: !0 });- },- onChangeComplete: setValue- })));-}, SpacingControl = ({- currentStyle,- inheritedStyle,- setProperty,- styleConfig-}) => {- if (styleConfig.control !== "Spacing")- return null;- let styles2 = import_sdk21.categories.spacing.properties.reduce((acc, property) => {- let value = getFinalValue({- currentStyle,- inheritedStyle,- property- });- return value !== void 0 && (property.includes("margin") ? acc.margins[property] = value : acc.paddings[property] = value), acc;- }, { margins: {}, paddings: {} });- return /* @__PURE__ */ React.createElement(SpacingWidget, {- setProperty,- values: styles2- });-}, ComboboxControl = ({- currentStyle,- inheritedStyle,- setProperty,- styleConfig-}) => {- if (styleConfig.control !== "Combobox")- return null;- let value = getFinalValue({- currentStyle,- inheritedStyle,- property: styleConfig.property- });- if (value === void 0)- return null;- let setValue = setProperty(styleConfig.property);- return /* @__PURE__ */ React.createElement(Grid, {- columns: 2,- align: "center",- gapX: "1"- }, /* @__PURE__ */ React.createElement(PropertyName, {- property: styleConfig.property,- label: styleConfig.label- }), /* @__PURE__ */ React.createElement(Flex, {- align: "center",- css: { gridColumn: "2/4" },- gap: "1"- }, /* @__PURE__ */ React.createElement(Combobox, {- id: styleConfig.property,- items: styleConfig.items,- variant: "ghost",- css: {- textAlign: "right"- },- state: value.type === "invalid" ? "invalid" : void 0,- value: String(value.value),- onValueSelect: setValue,- onValueEnter: setValue,- onItemEnter: (value2) => {- setValue(value2, { isEphemeral: !0 });- },- onItemLeave: () => {- setValue(String(value.value), { isEphemeral: !0 });- }- }), /* @__PURE__ */ React.createElement(Unit, {- value- })));-}, controls = {- Color: ColorControl,- Spacing: SpacingControl,- Combobox: ComboboxControl-}, renderProperty = ({- currentStyle,- inheritedStyle,- setProperty,- styleConfig,- category-}) => {- let Control2 = controls[styleConfig.control];- return /* @__PURE__ */ React.createElement(Control2, {- key: category + "-" + styleConfig.property,- currentStyle,- inheritedStyle,- setProperty,- styleConfig- });-};--// app/designer/features/style-panel/dependencies.ts-var displayInline = [- "inline",- "inline-block",- "inline-table",- "inline-list-item",- "inline-flex",- "inline-grid"-], dependencies = {- blockContainers: {- property: "display",- values: ["block"]- },- blockContainerElements: {- property: "display",- values: ["block"]- },- flexContainers: {- property: "display",- values: ["flex"]- },- flexItemsAndInFlowPseudos: {- property: "display",- values: ["flex"]- },- multilineFlexContainers: {- property: "flexWrap",- values: ["wrap", "wrap-reverse"]- },- gridContainers: {- property: "display",- values: ["grid"]- },- gridItemsAndBoxesWithinGridContainer: {- property: "display",- values: ["grid"]- },- positionedElements: {- property: "position",- notValues: ["static"]- },- allElementsNoEffectIfDisplayNone: {- property: "display",- notValues: ["none"]- },- blockLevelElements: {- property: "clear",- values: ["block", "flex", "grid", "table"]- },- allElementsExceptTableDisplayTypes: {- property: "display",- notValues: ["table"]- },- allElementsExceptInternalTableDisplayTypes: {- property: "display",- notValues: [- "table-row-group",- "table-header-group",- "table-footer-group",- "table-row",- "table-cell",- "table-column-group",- "table-column",- "table-caption"- ]- },- allElementsButNonReplacedAndTableColumns: {- property: "display",- notValues: ["table-column-group", "table-column"]- },- allElementsButNonReplacedAndTableRows: {- property: "display",- notValues: ["table-row-group", "table-row"]- },- blockContainersFlexContainersGridContainers: {- property: "display",- values: ["block", "flex", "grid"]- },- sameAsWidthAndHeight: {- property: "display",- notValues: [- "table-column-group",- "table-column",- "table-row-group",- "table-row"- ]- },- nonReplacedInlineElements: {- property: "display",- values: displayInline- },- inlineLevelAndTableCellElements: {- property: "display",- values: [...displayInline, "table-cell"]- },- absolutelyPositionedElements: {- property: "position",- values: ["absolute"]- }-};--// app/designer/features/style-panel/settings.tsx-var filterProperties = (properties3, search) => {- let searchParts = search.split(" ").map((part) => part.trim()), includes = (property) => property.toLowerCase().includes(search) || (0, import_hyphenate_style_name2.default)(property).includes(search) ? !0 : searchParts.every((searchPart) => property.toLowerCase().includes(searchPart));- return properties3.filter((property) => {- for (let styleConfig of styleConfigs)- if (styleConfig.property === property) {- if (includes(styleConfig.property) || includes(styleConfig.label))- return !0;- for (let item of styleConfig.items)- if (includes(item.name) || includes(item.label))- return !0;- }- return !1;- });-}, appliesTo = (styleConfig, currentStyle) => {- var _a;- let { appliesTo: appliesTo2 } = styleConfig;- if (appliesTo2 in dependencies) {- let dependency = dependencies[appliesTo2];- if (dependency === void 0)- return !1;- let currentValue = (_a = currentStyle[dependency.property]) == null ? void 0 : _a.value;- if (currentValue === void 0)- return !1;- if (Array.isArray(dependency.values))- return dependency.values.includes(String(currentValue));- if (Array.isArray(dependency.notValues))- return dependency.notValues.includes(String(currentValue)) === !1;- }- return !0;-}, didRender = (category, { property }) => category === "spacing" && property !== import_sdk22.categories.spacing.properties[0], ShowMore = ({ styleConfigs: styleConfigs2 }) => {- let [isOpen, setIsOpen] = (0, import_react35.useState)(!1);- return styleConfigs2.length === 0 ? null : /* @__PURE__ */ React.createElement(Collapsible.Root, {- asChild: !0,- onOpenChange: setIsOpen- }, /* @__PURE__ */ React.createElement(Flex, {- direction: "column",- gap: "3"- }, /* @__PURE__ */ React.createElement(Collapsible.Trigger, {- asChild: !0- }, /* @__PURE__ */ React.createElement(Button, {- css: { width: "100%", gap: "$1" }- }, isOpen ? /* @__PURE__ */ React.createElement(icons_exports.TriangleDownIcon, null) : /* @__PURE__ */ React.createElement(icons_exports.TriangleRightIcon, null), "Show more")), /* @__PURE__ */ React.createElement(Collapsible.Content, {- asChild: !0- }, /* @__PURE__ */ React.createElement(Flex, {- direction: "column",- gap: "3"- }, styleConfigs2))));-}, VisualSettings = (_a) => {- var _b = _a, {- currentStyle,- search- } = _b, rest = __objRest(_b, [- "currentStyle",- "search"- ]);- let isSearchMode = search.length !== 0, all = [], category;- for (category in import_sdk22.categories) {- let categoryProperties = filterProperties(import_sdk22.categories[category].properties, search), { moreFrom } = import_sdk22.categories[category], styleConfigsByCategory = [], moreStyleConfigsByCategory = [];- for (let styleConfig of styleConfigs) {- let isInCategory = categoryProperties.includes(styleConfig.property), isApplicable = isSearchMode ? !0 : appliesTo(styleConfig, currentStyle), isRendered = didRender(category, styleConfig);- if (isInCategory && isApplicable && isRendered === !1) {- let element = renderProperty(__spreadProps(__spreadValues({}, rest), {- currentStyle,- styleConfig,- category- }));- if ((styleConfig.property === moreFrom || moreStyleConfigsByCategory.length !== 0) && isSearchMode === !1) {- moreStyleConfigsByCategory.push(element);- continue;- }- styleConfigsByCategory.push(element);- }- }- styleConfigsByCategory.length !== 0 && all.push(/* @__PURE__ */ React.createElement(CollapsibleSection, {- isOpen: isSearchMode ? !0 : void 0,- label: import_sdk22.categories[category].label,- key: category- }, /* @__PURE__ */ React.createElement(React.Fragment, null, styleConfigsByCategory, /* @__PURE__ */ React.createElement(ShowMore, {- styleConfigs: moreStyleConfigsByCategory- }))));- }- return /* @__PURE__ */ React.createElement(Box, {- css: { overflow: "auto" }- }, all);-};--// app/designer/features/style-panel/search.tsx-var import_react36 = require("react");-var formStyle = css({- position: "relative"-}), resetStyle = css({- position: "absolute",- right: 0-}), useSearch = (onSearch) => {- let [search, setSearch] = (0, import_react36.useState)("");- return [- search,- (search2) => {- setSearch(search2), onSearch(search2);- }- ];-}, Search = ({ onSearch }) => {- let [search, setSearch] = useSearch(onSearch);- return /* @__PURE__ */ React.createElement("form", {- className: formStyle(),- onReset: () => {- setSearch("");- },- onKeyDown: (event) => {- event.key === "Escape" && event.currentTarget.reset();- }- }, /* @__PURE__ */ React.createElement(TextField, {- value: search,- css: { paddingRight: "$5" },- placeholder: "Search property or value",- onChange: (event) => {- let { value } = event.target;- setSearch(value.toLowerCase());- }- }), /* @__PURE__ */ React.createElement(IconButton, {- disabled: search.length === 0,- type: "reset",- "aria-label": "Reset search",- className: resetStyle()- }, /* @__PURE__ */ React.createElement(icons_exports.Cross1Icon, null)));-};--// app/designer/features/style-panel/style-panel.tsx-var import_react37 = require("react");-var StylePanel = ({- selectedInstanceData,- publish: publish12-}) => {- let { currentStyle, inheritedStyle, setProperty } = useStyleData({- selectedInstanceData,- publish: publish12- }), [breakpoint] = useSelectedBreakpoint(), [canvasWidth] = useCanvasWidth(), [search, setSearch] = (0, import_react37.useState)("");- return currentStyle === void 0 || inheritedStyle === void 0 || selectedInstanceData === void 0 || breakpoint === void 0 ? null : willRender(breakpoint, canvasWidth) === !1 ? /* @__PURE__ */ React.createElement(Box, {- css: { p: "$2" }- }, /* @__PURE__ */ React.createElement(Card, {- css: { p: "$3", mt: "$3" }- }, /* @__PURE__ */ React.createElement(Paragraph, {- css: { marginBottom: "$2" }- }, "Please increase the canvas width."), /* @__PURE__ */ React.createElement(Paragraph, null, `"${breakpoint.label}" breakpoint minimum width is ${breakpoint.minWidth}px.`))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, {- css: { p: "$2" }- }, /* @__PURE__ */ React.createElement(ComponentInfo, {- selectedInstanceData- })), /* @__PURE__ */ React.createElement(Box, {- css: { p: "$2" }- }, /* @__PURE__ */ React.createElement(Search, {- onSearch: setSearch- })), /* @__PURE__ */ React.createElement(VisualSettings, {- search,- selectedInstanceData,- currentStyle,- inheritedStyle,- setProperty- }));-};--// app/designer/features/props-panel/props-panel.tsx-var import_sdk24 = require("@webstudio-is/sdk");--// app/designer/features/props-panel/control.tsx-var import_react39 = __toESM(require("react"));--// app/shared/design-system/components/checkbox.tsx-var import_react38 = __toESM(require("react"));-var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));-var StyledCheckbox = styled(CheckboxPrimitive.Root, {- all: "unset",- boxSizing: "border-box",- userSelect: "none",- "&::before": {- boxSizing: "border-box"- },- "&::after": {- boxSizing: "border-box"- },- alignItems: "center",- appearance: "none",- display: "inline-flex",- justifyContent: "center",- lineHeight: "1",- margin: "0",- outline: "none",- padding: "0",- WebkitTapHighlightColor: "rgba(0,0,0,0)",- color: "$hiContrast",- boxShadow: "inset 0 0 0 1px $colors$slate7",- overflow: "hidden",- "@hover": {- "&:hover": {- boxShadow: "inset 0 0 0 1px $colors$slate8"- }- },- "&:focus": {- outline: "none",- borderColor: "$red7",- boxShadow: "inset 0 0 0 1px $colors$blue9, 0 0 0 1px $colors$blue9"- },- variants: {- size: {- "1": {- width: "$3",- height: "$3",- borderRadius: "$1"- },- "2": {- width: "$5",- height: "$5",- borderRadius: "$2"- }- }- },- defaultVariants: {- size: "1"- }-}), StyledIndicator2 = styled(CheckboxPrimitive.Indicator, {- alignItems: "center",- display: "flex",- height: "100%",- justifyContent: "center",- width: "100%"-}), Checkbox = import_react38.default.forwardRef((props2, forwardedRef) => /* @__PURE__ */ import_react38.default.createElement(StyledCheckbox, __spreadProps(__spreadValues({}, props2), {- ref: forwardedRef-}), /* @__PURE__ */ import_react38.default.createElement(StyledIndicator2, null, /* @__PURE__ */ import_react38.default.createElement(icons_exports.CheckIcon, null))));-Checkbox.displayName = "Checkbox";--// app/designer/features/props-panel/control.tsx-var TextControl = ({- value,- defaultValue,- type,- onChange-}) => /* @__PURE__ */ import_react39.default.createElement(TextField, {- type,- variant: "ghost",- placeholder: "Value",- name: "value",- value: String(value || defaultValue || ""),- onChange: (event) => {- onChange(event.target.value);- }-}), CheckboxControl = ({- value,- options: options2,- defaultValue,- onChange-}) => /* @__PURE__ */ import_react39.default.createElement(RadioGroup3, {- css: { flexDirection: "column" },- name: "value",- value: String(value || defaultValue || ""),- onValueChange: onChange-}, options2.map((value2) => /* @__PURE__ */ import_react39.default.createElement(Flex, {- align: "center",- gap: "1",- key: value2-}, /* @__PURE__ */ import_react39.default.createElement(Checkbox, {- value: value2-}), /* @__PURE__ */ import_react39.default.createElement(Label, null, value2)))), RadioControl = ({- value,- options: options2,- defaultValue,- onChange-}) => /* @__PURE__ */ import_react39.default.createElement(RadioGroup3, {- css: { flexDirection: "column" },- name: "value",- value: String(value || defaultValue || ""),- onValueChange: onChange-}, options2.map((value2) => /* @__PURE__ */ import_react39.default.createElement(Flex, {- align: "center",- gap: "1",- key: value2-}, /* @__PURE__ */ import_react39.default.createElement(Radio, {- value: value2,- id: value2-}), /* @__PURE__ */ import_react39.default.createElement(Label, {- htmlFor: value2-}, value2)))), SelectControl = ({- value,- options: options2,- defaultValue,- onChange-}) => /* @__PURE__ */ import_react39.default.createElement(Select, {- name: "value",- value: String(value || defaultValue || ""),- options: options2,- onChange-}), BooleanControl = ({- value,- defaultValue,- onChange-}) => /* @__PURE__ */ import_react39.default.createElement(Switch, {- name: "value",- defaultChecked: Boolean(defaultValue),- checked: value === !0,- onCheckedChange: onChange-}), RangeControl = ({- value,- defaultValue,- onChange,- min,- max,- step-}) => /* @__PURE__ */ import_react39.default.createElement(Flex, {- direction: "column",- gap: 1-}, /* @__PURE__ */ import_react39.default.createElement(Slider, {- value,- defaultValue,- onValueChange: (values) => {- onChange(values[0]);- },- min,- max,- step-}), /* @__PURE__ */ import_react39.default.createElement(Flex, {- direction: "row",- justify: "between"-}, /* @__PURE__ */ import_react39.default.createElement(Text, {- size: 1-}, min), /* @__PURE__ */ import_react39.default.createElement(Text, {- size: 1-}, max))), NotImplemented = () => /* @__PURE__ */ import_react39.default.createElement("div", null);-function Control(props2) {- switch (props2.type) {- case "array":- return /* @__PURE__ */ import_react39.default.createElement(TextControl, __spreadValues({}, props2));- case "boolean":- return /* @__PURE__ */ import_react39.default.createElement(BooleanControl, __spreadValues({}, props2));- case "color":- return /* @__PURE__ */ import_react39.default.createElement(TextControl, __spreadProps(__spreadValues({}, props2), {- type: "color"- }));- case "date":- return /* @__PURE__ */ import_react39.default.createElement(TextControl, __spreadProps(__spreadValues({}, props2), {- type: "date"- }));- case "file":- return /* @__PURE__ */ import_react39.default.createElement(TextControl, __spreadProps(__spreadValues({}, props2), {- type: "file"- }));- case "number":- return /* @__PURE__ */ import_react39.default.createElement(TextControl, __spreadProps(__spreadValues({}, props2), {- type: "number"- }));- case "range":- return /* @__PURE__ */ import_react39.default.createElement(RangeControl, __spreadValues({}, props2));- case "object":- return /* @__PURE__ */ import_react39.default.createElement(TextControl, __spreadValues({}, props2));- case "radio":- return /* @__PURE__ */ import_react39.default.createElement(RadioControl, __spreadValues({}, props2));- case "inline-radio":- return /* @__PURE__ */ import_react39.default.createElement(RadioControl, __spreadValues({}, props2));- case "check":- return /* @__PURE__ */ import_react39.default.createElement(CheckboxControl, __spreadValues({}, props2));- case "inline-check":- return /* @__PURE__ */ import_react39.default.createElement(CheckboxControl, __spreadValues({}, props2));- case "select":- return /* @__PURE__ */ import_react39.default.createElement(SelectControl, __spreadValues({}, props2));- case "multi-select":- return /* @__PURE__ */ import_react39.default.createElement(CheckboxControl, __spreadValues({}, props2));- case "text":- return /* @__PURE__ */ import_react39.default.createElement(TextControl, __spreadValues({}, props2));- default: {- let _exhaustiveCheck = props2;- return /* @__PURE__ */ import_react39.default.createElement(NotImplemented, null);- }- }-}--// app/designer/features/props-panel/use-props-logic.ts-var import_sdk23 = require("@webstudio-is/sdk"), import_bson_objectid5 = __toESM(require("bson-objectid")), import_immer5 = __toESM(require("immer")), import_uniqBy = __toESM(require("lodash/uniqBy")), import_debounce = __toESM(require("lodash/debounce")), import_react40 = require("react"), getRequiredProps = (selectedInstanceData) => {- let { component } = selectedInstanceData, meta6 = import_sdk23.componentsMeta[component], argTypes = (meta6 == null ? void 0 : meta6.argTypes) || {};- return Object.entries(argTypes).filter(([_, value]) => value.required).map(([prop, _]) => ({- id: (0, import_bson_objectid5.default)().toString(),- prop,- value: "",- required: !0- }));-}, getPropsWithDefaultValue = (selectedInstanceData) => {- let { component } = selectedInstanceData, meta6 = import_sdk23.componentsMeta[component], argTypes = (meta6 == null ? void 0 : meta6.argTypes) || {};- return Object.entries(argTypes).filter(([_, value]) => value.defaultValue != null).map(([prop, propObj]) => {- let { defaultValue } = propObj, value = "value" in defaultValue ? defaultValue.value : defaultValue;- return {- id: (0, import_bson_objectid5.default)().toString(),- prop,- value- };- });-}, usePropsLogic = ({- selectedInstanceData,- publish: publish12-}) => {- let props2 = selectedInstanceData.props === void 0 || selectedInstanceData.props.props.length === 0 ? [] : selectedInstanceData.props.props, initialState = (0, import_uniqBy.default)([- ...props2,- ...getPropsWithDefaultValue(selectedInstanceData),- ...getRequiredProps(selectedInstanceData)- ], "prop"), [userProps, setUserProps] = (0, import_react40.useState)(initialState), propsToPublishRef = (0, import_react40.useRef)({}), updateProps = (0, import_debounce.default)((updates) => {- publish12({- type: "updateProps",- payload: {- treeId: selectedInstanceData.props.treeId,- propsId: selectedInstanceData.props.id,- instanceId: selectedInstanceData.id,- updates- }- });- for (let update2 of updates)- delete propsToPublishRef.current[update2.id];- }, 1e3), deleteProp = (id) => {- publish12({- type: "deleteProp",- payload: {- instanceId: selectedInstanceData.id,- propId: id- }- });- };- return {- addEmptyProp: () => {- setUserProps([- ...userProps,- {- id: (0, import_bson_objectid5.default)().toString(),- prop: "",- value: ""- }- ]);- },- userProps,- handleChangeProp: (id, field, value) => {- let index = userProps.findIndex((item) => item.id === id), nextUserProps = (0, import_immer5.default)((draft) => {- let isPropRequired = draft[index].required;- switch (field) {- case "prop":- isPropRequired || (draft[index].prop = value);- break;- case "value":- draft[index].value = value;- break;- }- })(userProps);- setUserProps(nextUserProps), propsToPublishRef.current[id] = !0;- let updates = Object.keys(propsToPublishRef.current).map((id2) => nextUserProps.find((prop) => prop.id === id2)).filter(Boolean);- updateProps(updates);- },- handleDeleteProp: (id) => {- let nextUserProps = [...userProps], prop = userProps.find((prop2) => prop2.id === id);- if (prop === void 0 || prop.required)- return;- let index = nextUserProps.indexOf(prop);- nextUserProps.splice(index, 1), setUserProps(nextUserProps), deleteProp(id);- }- };-};--// app/designer/features/props-panel/props-panel.tsx-var Property = ({- id,- prop,- value,- required,- component,- onChange,- onDelete-}) => {- var _a;- let meta6 = import_sdk24.componentsMeta[component], argType = (_a = meta6 == null ? void 0 : meta6.argTypes) == null ? void 0 : _a[prop], type = argType == null ? void 0 : argType.control.type, defaultValue = argType == null ? void 0 : argType.control.defaultValue, options2 = argType == null ? void 0 : argType.options;- return /* @__PURE__ */ React.createElement(Grid, {- gap: "1",- css: { gridTemplateColumns: "auto 1fr auto" }- }, /* @__PURE__ */ React.createElement(TextField, {- readOnly: required,- variant: "ghost",- placeholder: "Property",- name: "prop",- value: prop,- onChange: (event) => {- onChange(id, "prop", event.target.value);- }- }), /* @__PURE__ */ React.createElement(Control, {- type,- required,- defaultValue,- options: options2,- value,- onChange: (value2) => onChange(id, "value", value2)- }), /* @__PURE__ */ React.createElement(Button, {- ghost: !0,- disabled: required,- onClick: () => {- onDelete(id);- }- }, /* @__PURE__ */ React.createElement(icons_exports.TrashIcon, null)));-}, PropsPanel = ({- selectedInstanceData,- publish: publish12-}) => {- let { userProps, addEmptyProp, handleChangeProp, handleDeleteProp } = usePropsLogic({ selectedInstanceData, publish: publish12 });- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, {- css: { p: "$2" }- }, /* @__PURE__ */ React.createElement(ComponentInfo, {- selectedInstanceData- })), /* @__PURE__ */ React.createElement(CollapsibleSection, {- label: "Properties",- rightSlot: /* @__PURE__ */ React.createElement(Button, {- ghost: !0,- onClick: (event) => {- event.preventDefault(), addEmptyProp();- }- }, /* @__PURE__ */ React.createElement(icons_exports.PlusIcon, null)),- isOpenDefault: !0- }, /* @__PURE__ */ React.createElement(React.Fragment, null, userProps.map(({ id, prop, value, required }) => /* @__PURE__ */ React.createElement(Property, {- key: id,- id,- prop,- value,- required,- component: selectedInstanceData.component,- onChange: handleChangeProp,- onDelete: handleDeleteProp- })))));-};--// app/designer/features/inspector/inspector.tsx-var contentStyle = {- display: "flex",- flexDirection: "column",- overflow: "auto"-}, Inspector = ({ publish: publish12 }) => {- let [selectedInstanceData] = useSelectedInstanceData();- return selectedInstanceData === void 0 ? /* @__PURE__ */ React.createElement(Box, {- css: { p: "$2" }- }, /* @__PURE__ */ React.createElement(Card, {- css: { p: "$3", mt: "$3" }- }, /* @__PURE__ */ React.createElement(Paragraph, null, "Select an instance on the canvas"))) : /* @__PURE__ */ React.createElement(Tabs, {- defaultValue: "style",- css: { width: "100%", gap: "$2" }- }, /* @__PURE__ */ React.createElement(TabsList, null, /* @__PURE__ */ React.createElement(TabsTrigger, {- value: "style"- }, /* @__PURE__ */ React.createElement(BrushIcon, null)), /* @__PURE__ */ React.createElement(TabsTrigger, {- value: "props"- }, /* @__PURE__ */ React.createElement(icons_exports.GearIcon, null))), /* @__PURE__ */ React.createElement(TabsContent, {- value: "style",- css: contentStyle- }, /* @__PURE__ */ React.createElement(StylePanel, {- publish: publish12,- selectedInstanceData- })), /* @__PURE__ */ React.createElement(TabsContent, {- value: "props",- css: contentStyle- }, /* @__PURE__ */ React.createElement(PropsPanel, {- publish: publish12,- key: selectedInstanceData.id,- selectedInstanceData- })));-};--// app/designer/features/topbar/preview.tsx-var import_sdk25 = require("@webstudio-is/sdk");-var PreviewButton = ({ publish: publish12 }) => {- let [isPreviewMode, setIsPreviewMode] = useIsPreviewMode(), setValue = (value) => {- setIsPreviewMode(value), publish12({- type: "previewMode",- payload: value- });- };- return (0, import_sdk25.useSubscribe)("togglePreviewMode", () => {- setValue(!isPreviewMode);- }), /* @__PURE__ */ React.createElement(SimpleToggle, {- onPressedChange: setValue,- pressed: isPreviewMode,- "aria-label": "Toggle Preview"- }, /* @__PURE__ */ React.createElement(icons_exports.EyeOpenIcon, null));-};--// app/designer/features/topbar/share.tsx-var Content9 = ({ path, project }) => {- if (typeof location > "u")- return null;- let url2 = new URL(`${location.protocol}//${location.host}${path}/${project.id}`);- return /* @__PURE__ */ React.createElement(PopoverContent, {- css: { padding: "$3" },- onFocusOutside: (event) => {- event.preventDefault();- }- }, /* @__PURE__ */ React.createElement("form", {- onSubmit: (event) => {- event.preventDefault(), window.open(url2.toString(), "_blank");- }- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "2"- }, /* @__PURE__ */ React.createElement(TextField, {- variant: "ghost",- readOnly: !0,- defaultValue: url2.toString(),- onFocus: (event) => {- event == null || event.target.select();- }- }), /* @__PURE__ */ React.createElement(Button, {- "aria-label": "Open in a new tab",- variant: "blue",- type: "submit"- }, "Open"))));-}, ShareButton = ({ path, project }) => {- let [isOpen, setIsOpen] = useIsShareDialogOpen();- return /* @__PURE__ */ React.createElement(Popover, {- open: isOpen,- onOpenChange: setIsOpen- }, /* @__PURE__ */ React.createElement(PopoverTrigger, {- asChild: !0,- "aria-label": "Share project"- }, /* @__PURE__ */ React.createElement(IconButton, null, /* @__PURE__ */ React.createElement(icons_exports.Share1Icon, null))), /* @__PURE__ */ React.createElement(Content9, {- path,- project- }));-};--// app/designer/features/topbar/publish.tsx-var import_react41 = require("react"), import_react42 = require("@remix-run/react"), import_react_id = require("@radix-ui/react-id");-var host = typeof location == "object" ? location.host.includes("webstudio.is") ? "wstd.io" : location.host : "", Content10 = ({ project }) => {- var _a, _b, _c;- let id = (0, import_react_id.useId)(), fetcher = (0, import_react42.useFetcher)(), [url2, setUrl] = (0, import_react41.useState)(), domain = ((_a = fetcher.data) == null ? void 0 : _a.domain) || project.domain;- return (0, import_react41.useEffect)(() => {- typeof location != "object" || !domain || setUrl(`${location.protocol}//${domain}.${host}`);- }, [domain]), /* @__PURE__ */ React.createElement(PopoverContent, {- css: { padding: "$3" },- onFocusOutside: (event) => {- event.preventDefault();- }- }, /* @__PURE__ */ React.createElement(fetcher.Form, {- method: "post",- action: "/rest/publish"- }, /* @__PURE__ */ React.createElement(Flex, {- direction: "column",- gap: "2"- }, url2 !== void 0 && /* @__PURE__ */ React.createElement(Link, {- href: url2,- target: "_blank",- css: {- display: "flex",- gap: "$0"- }- }, /* @__PURE__ */ React.createElement(Text, {- css: {- whiteSpace: "nowrap",- overflow: "hidden",- textOverflow: "ellipsis"- }- }, `${domain}.${host}`, " "), /* @__PURE__ */ React.createElement(icons_exports.ExternalLinkIcon, null)), /* @__PURE__ */ React.createElement(Flex, {- gap: "2",- align: "center"- }, /* @__PURE__ */ React.createElement("input", {- type: "hidden",- name: "projectId",- value: project.id- }), /* @__PURE__ */ React.createElement(Label, {- htmlFor: id- }, "Domain:"), /* @__PURE__ */ React.createElement(TextField, {- id,- name: "domain",- defaultValue: domain- })), ((_b = fetcher.data) == null ? void 0 : _b.errors) !== void 0 && /* @__PURE__ */ React.createElement(Text, {- variant: "red"- }, (_c = fetcher.data) == null ? void 0 : _c.errors), fetcher.state === "idle" ? /* @__PURE__ */ React.createElement(Button, {- variant: "blue",- type: "submit"- }, "Publish") : /* @__PURE__ */ React.createElement(Button, {- disabled: !0- }, "Publishing\u2026"))));-}, PublishButton = ({ project }) => {- let [isOpen, setIsOpen] = useIsPublishDialogOpen();- return /* @__PURE__ */ React.createElement(Popover, {- open: isOpen,- onOpenChange: setIsOpen- }, /* @__PURE__ */ React.createElement(PopoverTrigger, {- asChild: !0,- "aria-label": "Publish"- }, /* @__PURE__ */ React.createElement(Button, {- ghost: !0,- css: { display: "flex", gap: "$1" }- }, /* @__PURE__ */ React.createElement(icons_exports.RocketIcon, null), /* @__PURE__ */ React.createElement(Text, {- size: "1"- }, "Publish"))), /* @__PURE__ */ React.createElement(Content10, {- project- }));-};--// app/designer/features/topbar/sync-status.tsx-var iconSize = 15, ellipsisKeyframes = keyframes({- to: { width: iconSize }-}), AnimatedDotsIcon = () => /* @__PURE__ */ React.createElement(Flex, {- direction: "column",- css: {- animation: `${ellipsisKeyframes} steps(4,end) 900ms infinite`,- width: 0,- overflow: "hidden"- }-}, /* @__PURE__ */ React.createElement(icons_exports.DotsHorizontalIcon, {- width: "12",- height: "12"-})), SyncStatus = () => {- let [status] = useSyncStatus();- return /* @__PURE__ */ React.createElement(Flex, {- align: "center",- justify: "center",- css: {- mx: "$1",- width: iconSize,- height: iconSize,- backgroundColor: "$green9",- borderRadius: "100%"- }- }, /* @__PURE__ */ React.createElement(import_react_accessible_icon.AccessibleIcon, {- label: `Sync status: ${status}`- }, status === "syncing" ? /* @__PURE__ */ React.createElement(AnimatedDotsIcon, null) : /* @__PURE__ */ React.createElement(icons_exports.CheckIcon, null)));-};--// app/designer/features/topbar/menu/menu.tsx-var import_react_router_dom4 = require("react-router-dom");--// app/designer/features/topbar/menu/shortcut-hint.tsx-var isMac = typeof navigator == "object" ? /mac/i.test(navigator.platform) : !1, shortcutSymbolMap = {- cmd: "\u2318",- ctrl: "\u2303",- shift: "\u21E7",- option: "\u2325",- backspace: "\u232B"-}, shortcutWinMap = {- cmd: "ctrl"-}, mapToOs = (value) => isMac ? value : value.map((key) => shortcutWinMap[key] || key), format = (value) => mapToOs(value).map((shortcut) => shortcutSymbolMap[shortcut] ?? shortcut.toUpperCase()), ShortcutHint = ({ value }) => /* @__PURE__ */ React.createElement(Text, {- size: "1",- css: { letterSpacing: 1.5 }-}, format(value));--// app/designer/features/topbar/menu/menu.tsx-var menuItemCss = {- display: "flex",- gap: "$3",- justifyContent: "start",- flexGrow: 1,- minWidth: 140-}, textCss = {- flexGrow: 1,- fontSize: "$1"-}, Menu2 = ({ config: config4, publish: publish12 }) => {- let navigate = (0, import_react_router_dom4.useNavigate)(), [, setIsShareOpen] = useIsShareDialogOpen(), [, setIsPublishOpen] = useIsPublishDialogOpen();- return /* @__PURE__ */ React.createElement(DropdownMenu, null, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, {- asChild: !0- }, /* @__PURE__ */ React.createElement(IconButton, {- "aria-label": "Menu Button"- }, /* @__PURE__ */ React.createElement(icons_exports.HamburgerMenuIcon, null))), /* @__PURE__ */ React.createElement(DropdownMenuContent, null, /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- navigate(config4.dashboardPath);- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Dashboard")), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({- type: "shortcut",- payload: "undo"- });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Undo"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["cmd", "z"]- })), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({- type: "shortcut",- payload: "redo"- });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Redo"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["shift", "cmd", "z"]- })), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({- type: "shortcut",- payload: "copy"- });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Copy"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["cmd", "c"]- })), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({- type: "shortcut",- payload: "paste"- });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Paste"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["cmd", "v"]- })), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({- type: "shortcut",- payload: "delete"- });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Delete"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["backspace"]- })), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({ type: "openBreakpointsMenu" });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Breakpoints"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["cmd", "b"]- })), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({- type: "zoom",- payload: "zoomIn"- });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Zoom in"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["cmd", "+"]- })), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({- type: "zoom",- payload: "zoomOut"- });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Zoom out"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["cmd", "-"]- })), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- publish12({- type: "togglePreviewMode"- });- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Preview"), /* @__PURE__ */ React.createElement(ShortcutHint, {- value: ["cmd", "shift", "p"]- })), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- setIsShareOpen(!0);- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Share")), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: menuItemCss,- onSelect: () => {- setIsPublishOpen(!0);- }- }, /* @__PURE__ */ React.createElement(Text, {- css: textCss- }, "Publish")), /* @__PURE__ */ React.createElement(DropdownMenuArrow, {- offset: 10- })));-};--// app/designer/features/breakpoints/breakpoints.tsx-var import_react46 = require("react"), import_sdk27 = require("@webstudio-is/sdk");--// app/designer/features/breakpoints/breakpoints-editor.tsx-var import_react43 = require("react"), import_useDebounce = __toESM(require("react-use/lib/useDebounce"));-var import_bson_objectid6 = __toESM(require("bson-objectid"));-var BreakpointEditorItem = ({- breakpoint: initialBreakpoint,- onChange,- onDelete-}) => {- let [breakpoint, setBreakpoint] = (0, import_react43.useState)(initialBreakpoint);- return (0, import_useDebounce.default)(() => {- breakpoint !== initialBreakpoint && onChange(breakpoint);- }, 500, [breakpoint]), /* @__PURE__ */ React.createElement("form", {- onKeyDown: (event) => {- event.stopPropagation();- },- onChange: (event) => {- event.stopPropagation();- let form = event.currentTarget;- if (form.reportValidity() === !1)- return;- let data = new FormData(form), nextBreakpoint = __spreadProps(__spreadValues({}, breakpoint), {- label: String(data.get("label")),- minWidth: Number(data.get("minWidth"))- });- setBreakpoint(nextBreakpoint);- }- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "1",- css: { paddingLeft: "$4", paddingRight: "$3" }- }, /* @__PURE__ */ React.createElement(TextField, {- css: { width: 100, flexGrow: 1 },- type: "text",- variant: "ghost",- defaultValue: breakpoint.label,- placeholder: "Breakpoint name",- name: "label",- minLength: 2,- required: !0- }), /* @__PURE__ */ React.createElement(TextField, {- css: { textAlign: "right", width: 50 },- variant: "ghost",- defaultValue: breakpoint.minWidth,- type: "number",- name: "minWidth",- min: 0,- required: !0- }), /* @__PURE__ */ React.createElement(Button, {- type: "button",- ghost: !0,- onClick: () => {- onDelete(breakpoint);- }- }, /* @__PURE__ */ React.createElement(icons_exports.TrashIcon, null))));-}, BreakpointsEditor = ({- publish: publish12,- onDelete-}) => {- let [breakpoints, setBreakpoints2] = useBreakpoints();- return /* @__PURE__ */ React.createElement(Flex, {- gap: "2",- direction: "column"- }, /* @__PURE__ */ React.createElement(Flex, {- align: "center",- gap: "1",- justify: "between",- css: { paddingLeft: "$5", paddingRight: "$3", py: "$1" }- }, /* @__PURE__ */ React.createElement(Text, null, "Breakpoints"), /* @__PURE__ */ React.createElement(Button, {- ghost: !0,- onClick: () => {- setBreakpoints2([- ...breakpoints,- {- id: (0, import_bson_objectid6.default)().toString(),- label: "",- minWidth: 0- }- ]);- }- }, /* @__PURE__ */ React.createElement(icons_exports.PlusIcon, null))), breakpoints.map((breakpoint) => /* @__PURE__ */ React.createElement(BreakpointEditorItem, {- key: breakpoint.id,- breakpoint,- onChange: (updatedBreakpoint) => {- publish12({ type: "breakpointChange", payload: updatedBreakpoint });- let nextBreakpoints = breakpoints.map((breakpoint2) => breakpoint2.id === updatedBreakpoint.id ? updatedBreakpoint : breakpoint2);- setBreakpoints2(nextBreakpoints);- },- onDelete- })));-};--// app/designer/features/breakpoints/preview.tsx-var Preview = ({ breakpoint }) => /* @__PURE__ */ React.createElement(Flex, {- css: { px: "$5", py: "$1" },- gap: "1",- direction: "column"-}, /* @__PURE__ */ React.createElement(Text, {- size: "1"-}, "CSS Preview"), /* @__PURE__ */ React.createElement(Paragraph, {- css: { fontSize: "$1" },- variant: "gray"-}, breakpoint === void 0 ? "No breakpoint selected" : `@media (min-width: ${breakpoint.minWidth}px)`));--// app/designer/features/breakpoints/zoom-setting.tsx-var minZoom = 10, ZoomSetting = () => {- let [value, setValue] = useZoom();- return /* @__PURE__ */ React.createElement(Flex, {- css: { px: "$5", py: "$1" },- gap: "1",- direction: "column"- }, /* @__PURE__ */ React.createElement(Text, {- size: "1"- }, "Zoom"), /* @__PURE__ */ React.createElement(Flex, {- gap: "3",- align: "center"- }, /* @__PURE__ */ React.createElement(Slider, {- min: minZoom,- value: [value],- onValueChange: ([value2]) => {- setValue(value2);- }- }), /* @__PURE__ */ React.createElement(Text, {- size: "1"- }, value, "%")));-};--// app/designer/features/breakpoints/trigger-button.tsx-var import_react44 = require("react");-var renderIcon = (breakpoint, variant) => {- let color = variant === "contrast" ? "white" : "gray";- return breakpoint.minWidth >= 1280 ? /* @__PURE__ */ React.createElement(icons_exports.DesktopIcon, {- color- }) : breakpoint.minWidth >= 1024 ? /* @__PURE__ */ React.createElement(icons_exports.LaptopIcon, {- color- }) : breakpoint.minWidth >= 768 ? /* @__PURE__ */ React.createElement(TabletIcon, {- color- }) : /* @__PURE__ */ React.createElement(icons_exports.MobileIcon, {- color- });-}, TriggerButton = (0, import_react44.forwardRef)((props2, ref) => {- let [zoom] = useZoom(), [breakpoint] = useSelectedBreakpoint(), [canvasWidth] = useCanvasWidth();- if (breakpoint === void 0)- return null;- let variant = willRender(breakpoint, canvasWidth) ? "contrast" : "gray";- return /* @__PURE__ */ React.createElement(Button, __spreadProps(__spreadValues({}, props2), {- ref,- css: { gap: "$1" },- ghost: !0,- "aria-label": "Show breakpoints"- }), renderIcon(breakpoint, variant), /* @__PURE__ */ React.createElement(Text, {- size: "1",- variant- }, `${breakpoint.label} ${canvasWidth}px / ${zoom}%`));-});-TriggerButton.displayName = "TriggerButton";--// app/designer/features/breakpoints/width-setting.tsx-var import_react45 = require("react");-var minWidth = 50, maxWidth = 3e3, useNextBreakpoint = () => {- let [selectedBreakpoint] = useSelectedBreakpoint(), [breakpoints] = useBreakpoints(), sortedBreakpoints = (0, import_react45.useMemo)(() => sort(breakpoints), [breakpoints]);- return (0, import_react45.useMemo)(() => {- if (selectedBreakpoint === void 0)- return;- let index = sortedBreakpoints.findIndex((breakpoint) => breakpoint.id === selectedBreakpoint.id);- if (index !== -1)- return sortedBreakpoints[index + 1];- }, [sortedBreakpoints, selectedBreakpoint]);-}, WidthSetting = () => {- let [value, setValue] = useCanvasWidth(), [selectedBreakpoint] = useSelectedBreakpoint(), nextBreakpoint = useNextBreakpoint(), [isPreviewMode] = useIsPreviewMode();- if (selectedBreakpoint === void 0)- return null;- let min = isPreviewMode ? minWidth : Math.max(minWidth, selectedBreakpoint.minWidth), max = isPreviewMode ? maxWidth : Math.min(maxWidth, nextBreakpoint ? nextBreakpoint.minWidth - 1 : maxWidth);- return /* @__PURE__ */ React.createElement(Flex, {- css: { px: "$5", py: "$1" },- gap: "1",- direction: "column"- }, /* @__PURE__ */ React.createElement(Text, {- size: "1"- }, "Canvas width"), /* @__PURE__ */ React.createElement(Flex, {- gap: "3",- align: "center"- }, /* @__PURE__ */ React.createElement(Slider, {- min,- max,- value: [value],- onValueChange: ([value2]) => {- setValue(value2);- }- }), /* @__PURE__ */ React.createElement(Text, {- size: "1"- }, `${value}px`)));-};--// app/designer/features/breakpoints/use-subscribe-shortcuts.ts-var import_sdk26 = require("@webstudio-is/sdk");-var useSubscribeSelectBreakpointFromShortcut = () => {- let [breakpoints] = useBreakpoints(), [, setSelectedBreakpoint] = useSelectedBreakpoint();- (0, import_sdk26.useSubscribe)("selectBreakpointFromShortcut", (index) => {- let breakpoint = sort(breakpoints)[index - 1];- breakpoint && setSelectedBreakpoint(breakpoint);- });-}, zoomStep = 20, useSubscribeZoomFromShortcut = () => {- let [zoom, setZoom] = useZoom();- (0, import_sdk26.useSubscribe)("zoom", (direction) => {- if (direction === "zoomIn") {- setZoom(Math.min(zoom + zoomStep, 100));- return;- }- setZoom(Math.max(zoom - zoomStep, minZoom));- });-};--// app/designer/features/breakpoints/confirmation-dialog.tsx-var ConfirmationDialog = ({- breakpoint,- onConfirm,- onAbort-}) => /* @__PURE__ */ React.createElement(Flex, {- gap: "2",- direction: "column",- css: { px: "$5", py: "$2", width: 300 }-}, /* @__PURE__ */ React.createElement(Text, {- size: "2",- css: { lineHeight: 1.5 }-}, `Are you sure you want to delete "${breakpoint.label}"?`), /* @__PURE__ */ React.createElement(Text, {- size: "2",- css: { lineHeight: 1.5 }-}, `Deleting a breakpoint will also delete all styles associated with this- breakpoint.`), /* @__PURE__ */ React.createElement(Flex, {- justify: "end",- gap: "2"-}, /* @__PURE__ */ React.createElement(Button, {- onClick: () => {- onConfirm();- }-}, "Delete"), /* @__PURE__ */ React.createElement(Button, {- autoFocus: !0,- onClick: () => {- onAbort();- }-}, "Abort")));--// app/designer/features/breakpoints/breakpoints.tsx-var BreakpointSelectorItem = ({- breakpoint-}) => {- let [canvasWidth] = useCanvasWidth();- return /* @__PURE__ */ React.createElement(Flex, {- align: "center",- justify: "between",- gap: "3",- css: { flexGrow: 1 }- }, /* @__PURE__ */ React.createElement(Text, {- size: "1",- css: { flexGrow: 1 }- }, breakpoint.label), /* @__PURE__ */ React.createElement(Text, {- size: "1",- variant: willRender(breakpoint, canvasWidth) ? "contrast" : "gray"- }, breakpoint.minWidth));-}, menuItemCss2 = {- display: "flex",- gap: "$3",- justifyContent: "start",- flexGrow: 1,- minWidth: 180-}, Breakpoints = ({ publish: publish12 }) => {- let [view, setView] = (0, import_react46.useState)(), [breakpointToDelete, setBreakpointToDelete] = (0, import_react46.useState)(), [breakpoints, setBreakpoints2] = useBreakpoints(), [selectedBreakpoint, setSelectedBreakpoint] = useSelectedBreakpoint(), [breakpointPreview, setBreakpointPreview] = (0, import_react46.useState)(selectedBreakpoint);- return useSubscribeSelectBreakpointFromShortcut(), useSubscribeZoomFromShortcut(), (0, import_react46.useEffect)(() => {- setBreakpointPreview(selectedBreakpoint);- }, [selectedBreakpoint]), (0, import_sdk27.useSubscribe)("openBreakpointsMenu", () => {- setView("selector");- }), (0, import_sdk27.useSubscribe)("clickCanvas", () => {- setView(void 0);- }), selectedBreakpoint === void 0 ? null : /* @__PURE__ */ React.createElement(DropdownMenu, {- open: view !== void 0,- onOpenChange: (isOpen) => {- setView(isOpen ? "selector" : void 0);- }- }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, {- asChild: !0- }, /* @__PURE__ */ React.createElement(TriggerButton, null)), /* @__PURE__ */ React.createElement(DropdownMenuContent, null, view === "confirmation" && /* @__PURE__ */ React.createElement(ConfirmationDialog, {- breakpoint: selectedBreakpoint,- onAbort: () => {- setBreakpointToDelete(void 0), setView("editor");- },- onConfirm: () => {- if (breakpointToDelete === void 0)- return;- let nextBreakpoints = [...breakpoints], index = breakpoints.indexOf(breakpointToDelete);- nextBreakpoints.splice(index, 1), setBreakpoints2(nextBreakpoints), breakpointToDelete === selectedBreakpoint && setSelectedBreakpoint(sort(nextBreakpoints)[0]), publish12({- type: "breakpointDelete",- payload: breakpointToDelete- }), setBreakpointToDelete(void 0), setView("editor");- }- }), view === "editor" && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(BreakpointsEditor, {- breakpoints,- publish: publish12,- onDelete: (breakpoint) => {- setBreakpointToDelete(breakpoint), setView("confirmation");- }- }), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: { justifyContent: "center" },- onSelect: (event) => {- event.preventDefault(), setView("selector");- }- }, "Done")), view === "selector" && /* @__PURE__ */ React.createElement(React.Fragment, null, sort(breakpoints).map((breakpoint) => /* @__PURE__ */ React.createElement(DropdownMenuCheckboxItem, {- checked: breakpoint === selectedBreakpoint,- key: breakpoint.id,- css: menuItemCss2,- onMouseEnter: () => {- setBreakpointPreview(breakpoint);- },- onMouseLeave: () => {- setBreakpointPreview(selectedBreakpoint);- },- onSelect: () => {- setSelectedBreakpoint(breakpoint);- }- }, /* @__PURE__ */ React.createElement(BreakpointSelectorItem, {- breakpoint- }))), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), /* @__PURE__ */ React.createElement("form", null, /* @__PURE__ */ React.createElement(ZoomSetting, null), /* @__PURE__ */ React.createElement(WidthSetting, null)), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), /* @__PURE__ */ React.createElement(Preview, {- breakpoint: breakpointPreview- }), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), /* @__PURE__ */ React.createElement(DropdownMenuItem, {- css: { justifyContent: "center" },- onSelect: (event) => {- event.preventDefault(), setView("editor");- }- }, "Edit breakpoints")), /* @__PURE__ */ React.createElement(DropdownMenuArrow, {- offset: 10- })));-};--// app/designer/features/breakpoints/use-update-canvas-width.ts-var import_react47 = require("react");-var useUpdateCanvasWidth = () => {- let [selectedBreakpoint] = useSelectedBreakpoint(), [canvasWidth, setCanvasWidth] = useCanvasWidth(), [isPreviewMode] = useIsPreviewMode();- return (0, import_react47.useEffect)(() => {- isPreviewMode === !0 || selectedBreakpoint === void 0 || setCanvasWidth(Math.max(selectedBreakpoint.minWidth, minWidth));- }, [isPreviewMode, selectedBreakpoint, setCanvasWidth]), (0, import_react47.useEffect)(() => {- if (selectedBreakpoint !== void 0) {- if (selectedBreakpoint.minWidth === 0) {- setCanvasWidth(minWidth);- return;- }- setCanvasWidth(Math.max(selectedBreakpoint.minWidth, minWidth));- }- }, [selectedBreakpoint, setCanvasWidth]), (0, import_react47.useCallback)((iframe) => {- iframe === null || selectedBreakpoint === void 0 || canvasWidth !== 0 || setCanvasWidth(minWidth);- }, [canvasWidth, selectedBreakpoint, setCanvasWidth]);-};--// app/designer/features/breakpoints/use-subscribe-breakpoints.ts-var import_react48 = require("react"), import_sdk28 = require("@webstudio-is/sdk");-var useSubscribeBreakpoints = () => {- let [breakpoints, setBreakpoints2] = useBreakpoints(), [selectedBreakpoint, setSelectedBreakpoint] = useSelectedBreakpoint();- (0, import_sdk28.useSubscribe)("loadBreakpoints", setBreakpoints2), (0, import_react48.useEffect)(() => {- if (selectedBreakpoint === void 0 && breakpoints.length !== 0 && setSelectedBreakpoint(sort(breakpoints)[0]), selectedBreakpoint !== void 0 && breakpoints.includes(selectedBreakpoint) === !1) {- let nextSelectedBreakpoint = breakpoints.find((breakpoint) => breakpoint.id === selectedBreakpoint.id);- nextSelectedBreakpoint !== void 0 && setSelectedBreakpoint(nextSelectedBreakpoint);- }- }, [breakpoints, selectedBreakpoint, setSelectedBreakpoint]);-};--// app/designer/features/topbar/topbar.tsx-var Topbar = ({ config: config4, css: css2, project, publish: publish12 }) => /* @__PURE__ */ React.createElement(Flex, {- as: "header",- align: "center",- justify: "between",- css: __spreadValues({- p: "$1",- bc: "$loContrast",- borderBottom: "1px solid $slate8"- }, css2)-}, /* @__PURE__ */ React.createElement(Menu2, {- config: config4,- publish: publish12-}), /* @__PURE__ */ React.createElement(Breakpoints, {- publish: publish12-}), /* @__PURE__ */ React.createElement(Flex, {- gap: "1",- align: "center"-}, /* @__PURE__ */ React.createElement(SyncStatus, null), /* @__PURE__ */ React.createElement(PreviewButton, {- publish: publish12-}), /* @__PURE__ */ React.createElement(ShareButton, {- path: config4.previewPath,- project-}), /* @__PURE__ */ React.createElement(PublishButton, {- project-})));--// app/designer/designer.css-var designer_default2 = "/build/_assets/designer-AWJKBZLB.css";--// app/designer/features/breadcrumbs/breadcrumbs.tsx-var Breadcrumb = ({ component, onClick }) => /* @__PURE__ */ React.createElement(Flex, {- align: "center"-}, /* @__PURE__ */ React.createElement(Button, {- ghost: !0,- css: { color: "$loContrast", px: 0 },- onClick-}, component), " ", /* @__PURE__ */ React.createElement(icons_exports.ChevronRightIcon, null)), EmptyState = () => /* @__PURE__ */ React.createElement(Text, {- variant: "loContrast",- size: "1"-}, "No instance selected"), Breadcrumbs = ({ publish: publish12 }) => {- let [selectedInstanceData] = useSelectedInstanceData(), selectedInstancePath = useSelectedInstancePath(selectedInstanceData == null ? void 0 : selectedInstanceData.id);- return /* @__PURE__ */ React.createElement(Flex, {- as: "footer",- align: "center",- css: { height: "$5", background: "$hiContrast", padding: "$1" }- }, selectedInstancePath.length === 0 ? /* @__PURE__ */ React.createElement(EmptyState, null) : selectedInstancePath.map((instance) => /* @__PURE__ */ React.createElement(Breadcrumb, {- key: instance.id,- component: instance.component,- onClick: () => {- publish12({- type: "selectInstanceById",- payload: instance.id- });- }- })));-};--// app/designer/features/tree-preview/tree-preview.tsx-var import_sdk29 = require("@webstudio-is/sdk"), import_immer6 = __toESM(require("immer")), import_react49 = require("react");-var TreePrevew = () => {- let [rootInstance] = useRootInstance(), [draftRootInstance, setDraftRootInstance] = (0, import_react49.useState)(rootInstance), [instanceId, setInstanceId] = (0, import_react49.useState)();- if ((0, import_sdk29.useSubscribe)("dropPreview", ({ dragData, dropData }) => {- if (rootInstance === void 0)- return;- setInstanceId(dragData.instance.id);- let isNew = findInstanceById(rootInstance, dragData.instance.id) === void 0, updatedRootInstance = (0, import_immer6.default)((rootInstanceDraft) => {- isNew === !1 && dropData.instance.id !== dragData.instance.id && deleteInstanceMutable(rootInstanceDraft, dragData.instance.id), insertInstanceMutable(rootInstanceDraft, dragData.instance, {- parentId: dropData.instance.id,- position: dropData.position- });- })(rootInstance);- setDraftRootInstance(updatedRootInstance);- }), draftRootInstance === void 0 || instanceId === void 0)- return null;- let selectedInstancePath = getInstancePath(draftRootInstance, instanceId);- return selectedInstancePath.length === 0 ? null : /* @__PURE__ */ React.createElement(Flex, {- gap: "3",- direction: "column",- css: { padding: "$1" }- }, /* @__PURE__ */ React.createElement(Tree, {- instance: draftRootInstance,- selectedInstancePath,- selectedInstanceId: instanceId,- animate: !1- }));-};--// app/designer/features/workspace/canvas-tools/outline/outline.tsx-var import_react50 = require("react");-var OutlineContainer = styled("div", {- position: "absolute",- pointerEvents: "none",- outline: "1px solid $blue9",- outlineOffset: -1,- top: 0,- left: 0-}), useStyle = (rect) => (0, import_react50.useMemo)(() => {- if (rect !== void 0)- return {- transform: `translate3d(${rect.left}px, ${rect.top}px, 0)`,- width: rect.width,- height: rect.height- };-}, [rect]), Outline = ({ children: children6, rect }) => {- let style = useStyle(rect);- return /* @__PURE__ */ React.createElement(OutlineContainer, {- style- }, children6);-};--// app/designer/features/workspace/canvas-tools/outline/label.tsx-var import_react51 = require("react");-var useLabelPosition = (instanceRect) => {- let [position, setPosition] = (0, import_react51.useState)("top");- return [(0, import_react51.useCallback)((element) => {- if (element === null || instanceRect === void 0)- return;- let labelRect = element.getBoundingClientRect(), nextPosition = "top";- labelRect.height > instanceRect.top && (nextPosition = instanceRect.height < 250 ? "bottom" : "inside"), setPosition(nextPosition);- }, [instanceRect]), position];-}, LabelContainer = styled("div", {- position: "absolute",- display: "flex",- padding: "0 $1",- height: "$4",- color: "$hiContrast",- alignItems: "center",- justifyContent: "center",- gap: "$1",- fontSize: "$2",- fontFamily: "$sans",- lineHeight: 1,- minWidth: "$6",- whiteSpace: "nowrap",- backgroundColor: "$blue9",- pointerEvents: "auto"-}, {- variants: {- position: {- top: {- top: "-$4"- },- inside: {- top: 0- },- bottom: {- bottom: "-$4"- }- }- }-}), Label4 = ({ component, instanceRect }) => {- let [labelRef, position] = useLabelPosition(instanceRect), primitive = primitives_exports[component], { Icon: Icon2 } = primitive;- return /* @__PURE__ */ React.createElement(LabelContainer, {- position,- ref: labelRef- }, /* @__PURE__ */ React.createElement(Icon2, {- width: "1em",- height: "1em"- }), primitive.label);-};--// app/designer/features/workspace/canvas-tools/outline/selected-instance-outline.tsx-var SelectedInstanceOutline = () => {- let [instanceRect] = useSelectedInstanceRect(), [instanceData] = useSelectedInstanceData(), [textEditingInstanceId] = useTextEditingInstanceId(), isEditingCurrentInstance = textEditingInstanceId !== void 0 && textEditingInstanceId === (instanceData == null ? void 0 : instanceData.id);- return instanceData === void 0 || instanceRect === void 0 || isEditingCurrentInstance ? null : /* @__PURE__ */ React.createElement(Outline, {- rect: instanceRect- }, /* @__PURE__ */ React.createElement(Label4, {- component: instanceData.component,- instanceRect- }));-};--// app/designer/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx-var HoveredInstanceOutline = () => {- let [selectedInstanceData] = useSelectedInstanceData(), [instanceRect] = useHoveredInstanceRect(), [hoveredInstanceData] = useHoveredInstanceData(), [textEditingInstanceId] = useTextEditingInstanceId(), isEditingText = textEditingInstanceId !== void 0, isHoveringSelectedInstance = (selectedInstanceData == null ? void 0 : selectedInstanceData.id) === (hoveredInstanceData == null ? void 0 : hoveredInstanceData.id);- return hoveredInstanceData === void 0 || instanceRect === void 0 || isHoveringSelectedInstance || isEditingText ? null : /* @__PURE__ */ React.createElement(Outline, {- rect: instanceRect- }, /* @__PURE__ */ React.createElement(Label4, {- component: hoveredInstanceData.component,- instanceRect- }));-};--// app/designer/features/workspace/canvas-tools/text-toolbar/text-toolbar.tsx-var import_react52 = require("react");-var getPlacement = ({- toolbarRect,- selectionRect-}) => {- let align = "top", left = selectionRect.x + selectionRect.width / 2, visibility = "hidden";- toolbarRect !== void 0 && (visibility = "visible", left = Math.max(left, toolbarRect.width / 2), left = Math.min(left, window.innerWidth - toolbarRect.width / 2), align = selectionRect.y > toolbarRect.height ? "top" : "bottom");- let marginBottom = align === "bottom" ? "-$5" : 0, marginTop = align === "bottom" ? 0 : "-$5", transform = "translateX(-50%)";- return { top: align === "top" ? Math.max(selectionRect.y - selectionRect.height, 0) : Math.max(selectionRect.y + selectionRect.height), left, marginBottom, marginTop, transform, visibility };-}, onClickPreventDefault = (event) => {- event.preventDefault(), event.stopPropagation();-}, Toolbar = ({ css: css2, onValueChange, rootRef }) => /* @__PURE__ */ React.createElement(toggle_group_exports.Root, {- ref: rootRef,- type: "single",- onValueChange,- onClick: onClickPreventDefault,- css: __spreadValues({- position: "absolute",- borderRadius: "$1",- padding: "$1 $2",- pointerEvents: "auto"- }, css2)-}, /* @__PURE__ */ React.createElement(toggle_group_exports.Item, {- value: "Bold"-}, /* @__PURE__ */ React.createElement(icons_exports.FontBoldIcon, null)), /* @__PURE__ */ React.createElement(toggle_group_exports.Item, {- value: "Italic"-}, /* @__PURE__ */ React.createElement(icons_exports.FontItalicIcon, null)), /* @__PURE__ */ React.createElement(toggle_group_exports.Item, {- value: "Link"-}, /* @__PURE__ */ React.createElement(icons_exports.Link2Icon, null))), TextToolbar = ({ publish: publish12 }) => {- let [selectionRect] = useSelectionRect(), [selectedIntsanceData] = useSelectedInstanceData(), [element, setElement] = (0, import_react52.useState)(null), placement = (0, import_react52.useMemo)(() => {- if (selectionRect === void 0 || element === null)- return;- let toolbarRect = element.getBoundingClientRect();- return getPlacement({ toolbarRect, selectionRect });- }, [selectionRect, element]);- return selectionRect === void 0 || selectedIntsanceData === void 0 ? null : /* @__PURE__ */ React.createElement(Toolbar, {- rootRef: setElement,- css: placement,- onValueChange: (component) => {- let instance = createInstance({ component });- publish12({- type: "insertInlineInstance",- payload: instance- });- }- });-};--// app/designer/features/workspace/canvas-tools/hooks/use-subscribe-instance-rect.ts-var import_sdk30 = require("@webstudio-is/sdk");-var useSubscribeInstanceRect = () => {- let [, setSelectedRect] = useSelectedInstanceRect();- (0, import_sdk30.useSubscribe)("selectedInstanceRect", setSelectedRect);- let [, setHoveredRect] = useHoveredInstanceRect();- (0, import_sdk30.useSubscribe)("hoveredInstanceRect", setHoveredRect);-};--// app/designer/features/workspace/canvas-tools/hooks/use-subscribe-selection-rect.ts-var import_sdk31 = require("@webstudio-is/sdk");-var useSubscribeSelectionRect = () => {- let [, setSelectionRect] = useSelectionRect();- (0, import_sdk31.useSubscribe)("selectionRect", setSelectionRect);-};--// app/designer/features/workspace/canvas-tools/hooks/use-subscribe-editing-instance-id.ts-var import_sdk32 = require("@webstudio-is/sdk");-var useSubscribeTextEditingInstanceId = () => {- let [, setInstanceId] = useTextEditingInstanceId();- (0, import_sdk32.useSubscribe)("textEditingInstanceId", setInstanceId);-};--// app/designer/features/workspace/canvas-tools/canvas-tools.tsx-var toolsStyle = {- position: "absolute",- top: 0,- right: 0,- bottom: 0,- left: 0,- pointerEvents: "none",- overflow: "hidden"-}, CanvasTools = ({ publish: publish12 }) => {- useSubscribeInstanceRect(), useSubscribeSelectionRect(), useSubscribeScrollState(), useSubscribeTextEditingInstanceId();- let [isPreviewMode] = useIsPreviewMode(), [isScrolling] = useIsScrolling();- return isPreviewMode || isScrolling ? null : /* @__PURE__ */ React.createElement(Box, {- css: toolsStyle- }, /* @__PURE__ */ React.createElement(SelectedInstanceOutline, null), /* @__PURE__ */ React.createElement(HoveredInstanceOutline, null), /* @__PURE__ */ React.createElement(TextToolbar, {- publish: publish12- }));-};--// app/designer/features/workspace/workspace.tsx-var workspaceStyle = {- flexGrow: 1,- background: "$gray8",- overflow: "auto",- scrollbarGutter: "stable"-}, zoomStyle = {- transformStyle: "preserve-3d",- transition: "transform 200ms ease-out",- height: "100%",- width: "100%"-}, canvasContainerStyle = {- position: "relative",- height: "100%"-}, Workspace = ({- children: children6,- onTransitionEnd,- publish: publish12-}) => {- let [zoom] = useZoom(), [canvasWidth] = useCanvasWidth();- return /* @__PURE__ */ React.createElement(Box, {- css: workspaceStyle,- onClick: () => {- publish12({ type: "unselectInstance" });- }- }, /* @__PURE__ */ React.createElement(Flex, {- direction: "column",- align: "center",- css: zoomStyle,- style: { transform: `scale(${zoom / 100})` },- onTransitionEnd- }, /* @__PURE__ */ React.createElement(Box, {- css: canvasContainerStyle,- style: { width: canvasWidth }- }, children6, /* @__PURE__ */ React.createElement(CanvasTools, {- publish: publish12- }))));-};--// app/designer/features/workspace/use-read-canvas-rect.ts-var import_react56 = require("react");--// app/shared/dom-hooks/use-window-resize.ts-var import_react53 = require("react"), import_mitt = __toESM(require("mitt")), emitter = (0, import_mitt.default)();-typeof window == "object" && window.addEventListener("resize", () => {- emitter.emit("resize");-}, !1);-var useWindowResize = (onResize) => {- (0, import_react53.useEffect)(() => (emitter.on("resize", onResize), () => {- emitter.off("resize", onResize);- }), [onResize]);-};--// app/shared/dom-hooks/use-measure.ts-var import_react55 = require("react");--// app/shared/dom-hooks/use-scroll-state.ts-var import_react54 = require("react"), import_mitt2 = __toESM(require("mitt")), import_lodash7 = __toESM(require("lodash.noop")), emitter2 = (0, import_mitt2.default)();-if (typeof window == "object") {- let eventOptions3 = {- passive: !0,- capture: !0- };- window.addEventListener("scroll", () => {- emitter2.emit("scroll");- }, eventOptions3);- let timeoutId = 0, isScrolling = !1;- emitter2.on("scroll", () => {- isScrolling = !0, emitter2.emit("scrollStart"), clearTimeout(timeoutId), timeoutId = window.setTimeout(() => {- isScrolling !== !1 && (isScrolling = !1, emitter2.emit("scrollEnd"));- }, 150);- });-}-var useScrollState = ({- onScroll = import_lodash7.default,- onScrollStart = import_lodash7.default,- onScrollEnd = import_lodash7.default-}) => {- (0, import_react54.useEffect)(() => (emitter2.on("scrollStart", onScrollStart), emitter2.on("scroll", onScroll), emitter2.on("scrollEnd", onScrollEnd), () => {- emitter2.off("scrollStart", onScrollStart), emitter2.off("scroll", onScroll), emitter2.off("scrollEnd", onScrollEnd);- }), [onScroll, onScrollEnd, onScrollStart]);-};--// app/shared/dom-hooks/use-measure.ts-var useMeasure = () => {- let [element, setElement] = (0, import_react55.useState)(null), [rect, setRect] = (0, import_react55.useState)(), handleChange = (0, import_react55.useCallback)(() => {- element !== null && setRect(element.getBoundingClientRect());- }, [element]);- useScrollState({- onScrollEnd: handleChange- });- let observer = (0, import_react55.useMemo)(() => {- if (!(typeof window > "u"))- return new window.ResizeObserver(handleChange);- }, [handleChange]);- return (0, import_react55.useEffect)(() => (observer && (element === null ? observer.disconnect() : observer.observe(element)), () => {- observer == null || observer.disconnect();- }), [element, observer]), (0, import_react55.useEffect)(handleChange, [handleChange]), [setElement, rect];-};--// app/designer/features/workspace/use-read-canvas-rect.ts-var useReadCanvasRect = () => {- let [iframeElement, setIframeElement] = (0, import_react56.useState)(null), [, setCanvasRect] = useCanvasRect(), [canvasWidth] = useCanvasWidth(), [zoom] = useZoom(), [recalcFlag, forceRecalc] = (0, import_react56.useState)(!1);- useWindowResize(() => {- forceRecalc(!recalcFlag);- });- let readRect = (0, import_react56.useCallback)(() => {- iframeElement !== null && requestAnimationFrame(() => {- let rect = iframeElement.getBoundingClientRect();- setCanvasRect(rect);- });- }, [iframeElement, setCanvasRect, canvasWidth, zoom, recalcFlag]);- return (0, import_react56.useEffect)(readRect, [readRect]), {- onRef: setIframeElement,- onTransitionEnd: readRect- };-};--// app/designer/features/workspace/canvas-iframe.tsx-var import_react57 = require("react");-var iframeStyle = css({- border: "none",- variants: {- pointerEvents: {- none: {- pointerEvents: "none"- },- all: {- pointerEvents: "all"- }- }- }-}), CanvasIframe = (0, import_react57.forwardRef)((_a, ref) => {- var _b = _a, { pointerEvents = "all", css: css2 } = _b, rest = __objRest(_b, ["pointerEvents", "css"]);- return /* @__PURE__ */ React.createElement("iframe", __spreadProps(__spreadValues({}, rest), {- ref,- className: iframeStyle({ pointerEvents, css: css2 })- }));-});-CanvasIframe.displayName = "CanvasIframe";--// app/designer/shared/shortcuts/use-publish-shortcuts.ts-var import_react_hotkeys_hook = require("react-hotkeys-hook");--// app/shared/shortcuts/index.ts-var shortcuts = {- undo: "cmd+z, ctrl+z",- redo: "cmd+shift+z, ctrl+shift+z",- preview: "cmd+shift+p, ctrl+shift+p",- copy: "cmd+c, ctrl+c",- paste: "cmd+v, ctrl+v",- breakpointsMenu: "cmd+b, ctrl+b",- breakpoint: Array.from(new Array(9)).map((_, index) => `cmd+${index + 1}, ctrl+${index + 1}`).join(", "),- zoom: "cmd+=, ctrl+=, cmd+-, ctrl+-"-}, options = { splitKey: "+", keydown: !0 };--// app/designer/shared/shortcuts/use-publish-shortcuts.ts-var names = Object.keys(shortcuts), usePublishShortcuts = (publish12) => {- names.forEach((name) => {- (0, import_react_hotkeys_hook.useHotkeys)(shortcuts[name], (event) => {- event.preventDefault(), publish12({- type: "shortcut",- payload: { name, key: event.key }- });- }, options, []);- });-};--// app/designer/designer.tsx-var links2 = () => [- { rel: "stylesheet", href: inter_default },- { rel: "stylesheet", href: designer_default2 }-], useSubscribeRootInstance = () => {- let [, setValue] = useRootInstance();- (0, import_sdk33.useSubscribe)("loadRootInstance", setValue);-}, useSubscribeSelectedInstanceData = () => {- let [, setValue] = useSelectedInstanceData();- (0, import_sdk33.useSubscribe)("selectInstance", setValue);-}, useSubscribeHoveredInstanceData = () => {- let [, setValue] = useHoveredInstanceData();- (0, import_sdk33.useSubscribe)("hoverInstance", setValue);-}, useSubscribeSyncStatus = () => {- let [, setValue] = useSyncStatus();- (0, import_sdk33.useSubscribe)("syncStatus", setValue);-}, useIsDragging = () => {- let [isDragging, setIsDragging] = (0, import_react58.useState)(!1);- return (0, import_sdk33.useSubscribe)("dragStartInstance", () => {- setIsDragging(!0);- }), (0, import_sdk33.useSubscribe)("dragEndInstance", () => {- setIsDragging(!1);- }), [isDragging, setIsDragging];-}, SidePanel = ({- children: children6,- isPreviewMode,- gridArea,- css: css2-}) => isPreviewMode === !0 ? null : /* @__PURE__ */ React.createElement(Box, {- as: "aside",- css: __spreadValues({- gridArea,- display: "flex",- px: 0,- fg: 0,- bc: "$loContrast",- height: "100%"- }, css2)-}, children6), Main = ({ children: children6 }) => /* @__PURE__ */ React.createElement(Flex, {- as: "main",- direction: "column",- css: {- gridArea: "main",- overflow: "hidden"- }-}, children6), ChromeWrapper = ({ children: children6, isPreviewMode }) => /* @__PURE__ */ React.createElement(Grid, {- css: __spreadValues({- height: "100vh",- overflow: "hidden",- display: "grid"- }, isPreviewMode ? {- gridTemplateColumns: "auto 1fr",- gridTemplateRows: "auto 1fr",- gridTemplateAreas: `- "header header"- "sidebar main"- `- } : {- gridTemplateColumns: "auto 1fr 240px",- gridTemplateRows: "auto 1fr",- gridTemplateAreas: `- "header header header"- "sidebar main inspector"- `- })-}, children6), Designer2 = ({ config: config4, project }) => {- useSubscribeSyncStatus(), useSubscribeRootInstance(), useSubscribeSelectedInstanceData(), useSubscribeHoveredInstanceData(), useSubscribeBreakpoints();- let [publish12, publishRef] = (0, import_sdk33.usePublish)(), [isPreviewMode] = useIsPreviewMode(), [isDragging, setIsDragging] = useIsDragging();- usePublishShortcuts(publish12);- let onRefReadCanvasWidth = useUpdateCanvasWidth(), { onRef: onRefReadCanvas, onTransitionEnd } = useReadCanvasRect(), iframeRefCallback = (0, import_react58.useCallback)((ref) => {- publishRef.current = ref, onRefReadCanvasWidth(ref), onRefReadCanvas(ref);- }, [publishRef, onRefReadCanvasWidth, onRefReadCanvas]);- return /* @__PURE__ */ React.createElement(import_react_dnd3.DndProvider, {- backend: import_react_dnd_html5_backend2.HTML5Backend- }, /* @__PURE__ */ React.createElement(ChromeWrapper, {- isPreviewMode- }, /* @__PURE__ */ React.createElement(SidePanel, {- gridArea: "sidebar",- isPreviewMode- }, /* @__PURE__ */ React.createElement(SidebarLeft, {- onDragChange: setIsDragging,- publish: publish12- })), /* @__PURE__ */ React.createElement(Topbar, {- css: { gridArea: "header" },- config: config4,- project,- publish: publish12- }), /* @__PURE__ */ React.createElement(Main, null, /* @__PURE__ */ React.createElement(Workspace, {- onTransitionEnd,- publish: publish12- }, /* @__PURE__ */ React.createElement(CanvasIframe, {- ref: iframeRefCallback,- src: `${config4.canvasPath}/${project.id}`,- pointerEvents: isDragging ? "none" : "all",- title: project.title,- css: {- height: "100%",- width: "100%"- }- })), /* @__PURE__ */ React.createElement(Breadcrumbs, {- publish: publish12- })), /* @__PURE__ */ React.createElement(SidePanel, {- gridArea: "inspector",- isPreviewMode,- css: { overflow: "hidden" }- }, isDragging ? /* @__PURE__ */ React.createElement(TreePrevew, null) : /* @__PURE__ */ React.createElement(Inspector, {- publish: publish12- }))));-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/designer/$id.tsx-var loader11 = async ({ params }) => {- if (params.id === void 0)- throw new Error("Project id undefined");- let project = await project_server_exports.loadById(params.id);- return project === null ? { errors: `Project "${params.id}" not found` } : { config: config_default, project, env: env_server_default };-}, DesignerRoute = () => {- let data = (0, import_react59.useLoaderData)();- return "errors" in data ? /* @__PURE__ */ React.createElement("p", null, data.errors) : /* @__PURE__ */ React.createElement(Designer2, __spreadValues({}, data));-}, id_default = DesignerRoute;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/preview.tsx-var preview_exports = {};-__export(preview_exports, {- default: () => preview_default,- loader: () => loader12,- meta: () => meta3-});--// app/shared/documents/canvas.tsx-var import_react60 = require("@remix-run/react"), import_sdk34 = require("@webstudio-is/sdk");-var Canvas = ({- Outlet: Outlet3 = import_react60.Outlet-}) => /* @__PURE__ */ React.createElement("html", {- lang: "en"-}, /* @__PURE__ */ React.createElement("head", null, /* @__PURE__ */ React.createElement("meta", {- charSet: "utf-8"-}), /* @__PURE__ */ React.createElement("meta", {- name: "viewport",- content: "width=device-width,initial-scale=1"-}), /* @__PURE__ */ React.createElement("link", {- rel: "icon",- href: "/favicon.ico",- type: "image/x-icon"-}), /* @__PURE__ */ React.createElement("link", {- rel: "shortcut icon",- href: "/favicon.ico",- type: "image/x-icon"-}), /* @__PURE__ */ React.createElement(import_react60.Meta, null), /* @__PURE__ */ React.createElement(import_react60.Links, null), /* @__PURE__ */ React.createElement(import_sdk34.CriticalCss, null)), /* @__PURE__ */ React.createElement("body", null, /* @__PURE__ */ React.createElement(Outlet3, null), /* @__PURE__ */ React.createElement(import_react60.ScrollRestoration, null), /* @__PURE__ */ React.createElement(Env, null), /* @__PURE__ */ React.createElement(import_react60.Scripts, null), /* @__PURE__ */ React.createElement(import_react60.LiveReload, null)));--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/preview.tsx-var loader12 = () => ({- env: env_server_default-}), meta3 = () => ({ title: "Webstudio site preview" }), preview_default = Canvas;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/preview/$projectId.tsx-var projectId_exports = {};-__export(projectId_exports, {- default: () => projectId_default,- loader: () => loader13-});-var import_react61 = require("@remix-run/react"), import_sdk35 = require("@webstudio-is/sdk");-var loader13 = async ({ params }) => {- if (params.projectId === void 0)- return { errors: "Missing projectId", env: env_server_default };- try {- let previewData = await loadPreviewData({ projectId: params.projectId });- return __spreadProps(__spreadValues({}, previewData), {- env: env_server_default- });- } catch (error) {- if (error instanceof Error)- return {- errors: error.message,- env: env_server_default- };- }- return { errors: "Unexpected error", env: env_server_default };-}, PreviewRoute = () => {- let data = (0, import_react61.useLoaderData)();- return "errors" in data ? /* @__PURE__ */ React.createElement("p", null, data.errors) : /* @__PURE__ */ React.createElement(import_sdk35.Root, {- data- });-}, projectId_default = PreviewRoute;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/canvas.tsx-var canvas_exports = {};-__export(canvas_exports, {- default: () => canvas_default,- loader: () => loader14,- meta: () => meta4-});-var loader14 = () => ({- env: env_server_default-}), meta4 = () => ({ title: "Webstudio canvas" }), canvas_default = Canvas;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/canvas/$projectId.tsx-var projectId_exports2 = {};-__export(projectId_exports2, {- default: () => projectId_default2,- loader: () => loader15-});-var import_react77 = require("@remix-run/react");--// app/canvas/canvas.tsx-var import_react76 = require("react"), import_react_dnd5 = require("react-dnd"), import_react_dnd_touch_backend = require("react-dnd-touch-backend"), import_immerhin8 = __toESM(require("immerhin")), import_sdk52 = require("@webstudio-is/sdk");--// app/canvas/shared/use-drag-drop-handlers.ts-var import_react62 = require("react"), import_sdk36 = require("@webstudio-is/sdk");--// app/shared/dom-utils/find-closest-child.ts-var calculateDistance = (coordinate, rect) => {- let distanceX = Math.max(rect.left - coordinate.x, 0, coordinate.x - rect.right), distanceY = Math.max(rect.top - coordinate.y, 0, coordinate.y - rect.bottom);- return Math.sqrt(distanceX * distanceX + distanceY * distanceY);-}, sortNumbers = (a, b) => a - b, isPositionedElement = (element, getComputedStyle2) => {- let { position } = getComputedStyle2(element);- return position !== "static" && position !== "relative";-}, findClosestChild = (parentElement, coordinate, getBoundingClientRect2, getComputedStyle2) => {- if (parentElement.children.length === 0)- return;- let distances = [], distanceElementMap = /* @__PURE__ */ new Map();- for (let child of parentElement.children) {- if (isPositionedElement(child, getComputedStyle2))- continue;- let rect2 = getBoundingClientRect2(child), distance = calculateDistance(coordinate, rect2);- distances.push(distance), distanceElementMap.set(distance, child);- }- distances.sort(sortNumbers);- let element = distanceElementMap.get(distances[0]), rect = getBoundingClientRect2(element), relativePosition = coordinate.y - rect.top < 0 ? "before" : coordinate.y - rect.bottom > 0 ? "after" : "inside";- return { element, relativePosition };-};--// app/shared/dom-utils/find-insertion-index.ts-var findInsertionIndex = (dragOver, closestChildInfo) => {- var _a;- let index = [...((_a = dragOver.element) == null ? void 0 : _a.children) || []].indexOf(closestChildInfo.element), insertionIndex = 0;- if (closestChildInfo.relativePosition == "inside")- if (dragOver.edge === "top")- insertionIndex = index;- else if (dragOver.edge === "bottom")- insertionIndex = index + 1;- else- return 0;- else- insertionIndex = closestChildInfo.relativePosition === "before" ? index - 1 : index + 1;- return insertionIndex < 0 ? 0 : insertionIndex;-};--// app/shared/dom-utils/get-drag-over-info.ts-var elementFromPoint = (coordinate) => {- let element = document.elementFromPoint(coordinate.x, coordinate.y);- if (element instanceof HTMLElement)- return element;-}, getDragOverInfo = (offset, getBoundingClientRect2) => {- let element = elementFromPoint(offset), edge = "none";- if (element === void 0)- return { element, edge };- let { bottom, y } = getBoundingClientRect2(element);- if (offset.y - y <= 5 && (edge = "top"), bottom - offset.y <= 5 && (edge = "bottom"), edge === "none")- return { element, edge };- let { parentElement } = element;- return parentElement !== null && parentElement !== document.body && (element = parentElement), { element, edge };-};--// app/canvas/shared/nano-states.ts-var import_react_nano_state4 = require("react-nano-state"), dropDataContainer = (0, import_react_nano_state4.createValueContainer)(), useDropData = () => (0, import_react_nano_state4.useValue)(dropDataContainer), selectedInstanceContainer = (0, import_react_nano_state4.createValueContainer)(), useSelectedInstance = () => (0, import_react_nano_state4.useValue)(selectedInstanceContainer), hoveredInstanceContainer = (0, import_react_nano_state4.createValueContainer)(), useHoveredInstance = () => (0, import_react_nano_state4.useValue)(hoveredInstanceContainer), selectedElementContainer = (0, import_react_nano_state4.createValueContainer)(), useSelectedElement = () => (0, import_react_nano_state4.useValue)(selectedElementContainer), hoveredElementContainer = (0, import_react_nano_state4.createValueContainer)(), useHoveredElement = () => (0, import_react_nano_state4.useValue)(hoveredElementContainer);--// app/canvas/shared/use-drag-drop-handlers.ts-var import_lodash8 = __toESM(require("lodash.memoize")), getBoundingClientRect = (0, import_lodash8.default)((element) => element.getBoundingClientRect()), getComputedStyle = (0, import_lodash8.default)((element) => window.getComputedStyle(element)), useDragDropHandlers = () => {- let [rootInstance] = useRootInstance(), [, setSelectedInstance] = useSelectedInstance(), [, setHoveredInstance] = useHoveredInstance(), [, setHoveredElement] = useHoveredElement(), [dropData, setDropData] = useDropData(), [dragData, setDragData] = (0, import_react62.useState)();- (0, import_sdk36.useSubscribe)("dragStartInstance", () => {- setSelectedInstance(void 0);- }), (0, import_sdk36.useSubscribe)("dragEndInstance", () => {- var _a, _b;- if (((_a = getBoundingClientRect.cache) == null ? void 0 : _a.clear) && getBoundingClientRect.cache.clear(), ((_b = getComputedStyle.cache) == null ? void 0 : _b.clear) && getComputedStyle.cache.clear(), setDropData(void 0), setDragData(void 0), rootInstance === void 0 || dropData === void 0 || dragData === void 0 || dropData.instance.id === dragData.instance.id)- return;- let isNew = findInstanceById(rootInstance, dragData.instance.id) === void 0, data = {- instance: dragData.instance,- dropData- };- if (isNew) {- (0, import_sdk36.publish)({- type: "insertInstance",- payload: data- });- return;- }- (0, import_sdk36.publish)({- type: "reparentInstance",- payload: data- });- }), (0, import_sdk36.useSubscribe)("dragInstance", (dragData2) => {- let { currentOffset } = dragData2, dragOver = getDragOverInfo(currentOffset, getBoundingClientRect);- if (rootInstance === void 0 || dragOver.element === void 0)- return;- let dropInstance = findInstanceById(rootInstance, dragOver.element.id);- if (dropInstance === void 0)- return;- let closestChild = findClosestChild(dragOver.element, currentOffset, getBoundingClientRect, getComputedStyle), position = 0;- dragOver.element !== void 0 && closestChild !== void 0 && (position = findInsertionIndex(dragOver, closestChild));- let dropData2 = {- instance: dropInstance,- position- };- setDragData(dragData2), setDropData(dropData2), setHoveredInstance(dropInstance), setHoveredElement(dragOver.element), (0, import_sdk36.publish)({- type: "dropPreview",- payload: { dropData: dropData2, dragData: dragData2 }- });- });-};--// app/canvas/shared/use-shortcuts.ts-var import_react_hotkeys_hook2 = require("react-hotkeys-hook"), import_immerhin = __toESM(require("immerhin")), import_sdk38 = require("@webstudio-is/sdk");--// app/canvas/shared/copy-paste.ts-var import_sdk37 = require("@webstudio-is/sdk");--// app/shared/props-utils/update-props.ts-var updateAllUserPropsMutable = (allUserProps, { instanceId, propsId, treeId, updates }) => {- instanceId in allUserProps || (allUserProps[instanceId] = {- id: propsId,- instanceId,- treeId,- props: []- });- let instanceProps = allUserProps[instanceId];- for (let update2 of updates) {- let prop = instanceProps.props.find(({ id }) => id === update2.id);- prop === void 0 ? instanceProps.props.push(update2) : (prop.prop = update2.prop, prop.value = update2.value);- }-};--// app/shared/props-utils/delete-prop.ts-var deletePropMutable = (allProps, deleteProp) => {- let prop = allProps[deleteProp.instanceId];- if (prop === void 0)- return !1;- let index = prop.props.findIndex(({ id }) => id === deleteProp.propId);- return index === -1 ? !1 : (prop.props.splice(index, 1), !0);-};--// app/shared/props-utils/clone-props.ts-var import_bson_objectid7 = __toESM(require("bson-objectid")), import_immer7 = __toESM(require("immer")), cloneProps = (instanceProps, { instanceId }) => (0, import_immer7.default)((instanceProps2) => {- instanceProps2.id = (0, import_bson_objectid7.default)().toString(), instanceProps2.instanceId = instanceId;- for (let prop of instanceProps2.props)- prop.id = (0, import_bson_objectid7.default)().toString();-})(instanceProps);--// app/canvas/shared/copy-paste.ts-var currentInstance, currentProps, copy = () => {- selectedInstanceContainer.value !== void 0 && (currentInstance = selectedInstanceContainer.value, currentProps = import_sdk37.allUserPropsContainer.value[currentInstance.id]);-}, paste = () => {- if (currentInstance === void 0)- return;- let instance = cloneInstance(currentInstance), props2 = currentProps ? cloneProps(currentProps, { instanceId: instance.id }) : void 0;- (0, import_sdk37.publish)({- type: "insertInstance",- payload: {- instance,- props: props2- }- });-};--// app/canvas/shared/use-shortcuts.ts-var inputTags = ["INPUT", "SELECT", "TEXTAREA"], togglePreviewMode = () => {- (0, import_sdk38.publish)({ type: "togglePreviewMode" });-}, publishSelectBreakpoint = ({ key }) => {- (0, import_sdk38.publish)({- type: "selectBreakpointFromShortcut",- payload: key- });-}, publishZoom = (event) => {- event.preventDefault !== void 0 && event.preventDefault(), (0, import_sdk38.publish)({- type: "zoom",- payload: event.key === "-" ? "zoomOut" : "zoomIn"- });-}, publishOpenBreakpointsMenu = () => {- (0, import_sdk38.publish)({ type: "openBreakpointsMenu" });-}, useShortcuts = () => {- let [rootInstance] = useRootInstance(), [selectedInstance, setSelectedInstance] = useSelectedInstance(), [editingInstanceId, setEditingInstanceId] = useTextEditingInstanceId(), publishDeleteInstance = () => {- selectedInstance === void 0 || selectedInstance.id === (rootInstance == null ? void 0 : rootInstance.id) || (0, import_sdk38.publish)({- type: "deleteInstance",- payload: {- id: selectedInstance.id- }- });- }, shortcutHandlerMap = {- undo: import_immerhin.default.undo.bind(import_immerhin.default),- redo: import_immerhin.default.redo.bind(import_immerhin.default),- delete: publishDeleteInstance,- preview: togglePreviewMode,- copy,- paste,- breakpointsMenu: publishOpenBreakpointsMenu,- breakpoint: publishSelectBreakpoint,- zoom: publishZoom- };- (0, import_react_hotkeys_hook2.useHotkeys)("backspace, delete", shortcutHandlerMap.delete, __spreadProps(__spreadValues({}, options), { enableOnTags: [...inputTags] }), [shortcutHandlerMap.delete]), (0, import_react_hotkeys_hook2.useHotkeys)("esc", () => {- if (selectedInstance !== void 0) {- if (editingInstanceId) {- setEditingInstanceId(void 0);- return;- }- setSelectedInstance(void 0), (0, import_sdk38.publish)({ type: "selectInstance" });- }- }, __spreadProps(__spreadValues({}, options), { enableOnContentEditable: !0, enableOnTags: [...inputTags] }), [selectedInstance, editingInstanceId]), (0, import_react_hotkeys_hook2.useHotkeys)("enter", (event) => {- if (selectedInstance === void 0)- return;- let { isContentEditable: isContentEditable11 } = primitives_exports[selectedInstance.component];- isContentEditable11 !== !1 && (event.preventDefault(), setEditingInstanceId(selectedInstance.id));- }, options, [selectedInstance, setEditingInstanceId]), (0, import_react_hotkeys_hook2.useHotkeys)(shortcuts.undo, shortcutHandlerMap.undo, options, []), (0, import_react_hotkeys_hook2.useHotkeys)(shortcuts.redo, shortcutHandlerMap.redo, options, []), (0, import_react_hotkeys_hook2.useHotkeys)(shortcuts.preview, shortcutHandlerMap.preview, options, []), (0, import_react_hotkeys_hook2.useHotkeys)(shortcuts.copy, shortcutHandlerMap.copy, options, [- shortcutHandlerMap.copy- ]), (0, import_react_hotkeys_hook2.useHotkeys)(shortcuts.paste, shortcutHandlerMap.paste, options, []), (0, import_react_hotkeys_hook2.useHotkeys)(shortcuts.breakpoint, shortcutHandlerMap.breakpoint, options, []), (0, import_react_hotkeys_hook2.useHotkeys)(shortcuts.zoom, shortcutHandlerMap.zoom, options, []), (0, import_react_hotkeys_hook2.useHotkeys)(shortcuts.breakpointsMenu, shortcutHandlerMap.breakpointsMenu, options, []), (0, import_sdk38.useSubscribe)("shortcut", ({ name, key }) => {- shortcutHandlerMap[name]({ key });- });-};--// app/canvas/shared/instance.ts-var import_react63 = require("react"), import_bson_objectid8 = __toESM(require("bson-objectid")), import_sdk39 = require("@webstudio-is/sdk");-var import_immerhin2 = __toESM(require("immerhin"));-var usePopulateRootInstance = (tree) => {- let [, setRootInstance] = useRootInstance();- (0, import_react63.useEffect)(() => {- setRootInstance(tree.root);- }, [tree, setRootInstance]);-}, useInsertInstance = () => {- let [selectedInstance, setSelectedInstance] = useSelectedInstance();- (0, import_sdk39.useSubscribe)("insertInstance", ({ instance, dropData, props: props2 }) => {- import_immerhin2.default.createTransaction([rootInstanceContainer, import_sdk39.allUserPropsContainer], (rootInstance, allUserProps) => {- if (rootInstance === void 0)- return;- let populatedInstance = populateInstance(instance);- insertInstanceMutable(rootInstance, populatedInstance, {- parentId: (dropData == null ? void 0 : dropData.instance.id) ?? (selectedInstance == null ? void 0 : selectedInstance.id) ?? rootInstance.id,- position: (dropData == null ? void 0 : dropData.position) || "end"- }) && setSelectedInstance(instance), props2 !== void 0 && (allUserProps[props2.instanceId] = props2);- });- });-}, useReparentInstance = () => {- (0, import_sdk39.useSubscribe)("reparentInstance", ({ instance, dropData }) => {- import_immerhin2.default.createTransaction([rootInstanceContainer], (rootInstance) => {- rootInstance !== void 0 && (deleteInstanceMutable(rootInstance, instance.id), insertInstanceMutable(rootInstance, instance, {- parentId: dropData.instance.id,- position: dropData.position- }));- });- });-}, useDeleteInstance = () => {- let [rootInstance] = useRootInstance(), [selectedInstance, setSelectedInstance] = useSelectedInstance();- (0, import_sdk39.useSubscribe)("deleteInstance", ({ id }) => {- if (rootInstance !== void 0 && selectedInstance !== void 0) {- let parentInstance = findParentInstance(rootInstance, id);- if (parentInstance !== void 0) {- let siblingInstance = findClosestSiblingInstance(parentInstance, id);- setSelectedInstance(siblingInstance || parentInstance);- }- }- import_immerhin2.default.createTransaction([rootInstanceContainer], (rootInstance2) => {- rootInstance2 !== void 0 && deleteInstanceMutable(rootInstance2, id);- });- });-}, usePublishSelectedInstanceData = (treeId) => {- let [instance] = useSelectedInstance(), [selectedElement] = useSelectedElement(), [allUserProps] = (0, import_sdk39.useAllUserProps)(), browserStyle = (0, import_react63.useMemo)(() => (0, import_sdk39.getBrowserStyle)(selectedElement), [selectedElement]);- (0, import_react63.useEffect)(() => {- let payload;- if (instance !== void 0) {- let props2 = allUserProps[instance.id];- props2 === void 0 && (props2 = {- id: (0, import_bson_objectid8.default)().toString(),- instanceId: instance.id,- treeId,- props: []- }), payload = {- id: instance.id,- component: instance.component,- cssRules: instance.cssRules,- browserStyle,- props: props2- };- }- (0, import_sdk39.publish)({- type: "selectInstance",- payload- });- }, [instance, allUserProps, treeId, browserStyle]);-}, usePublishHoveredInstanceData = () => {- let [instance] = useHoveredInstance();- (0, import_react63.useEffect)(() => {- let payload = instance ? {- id: instance.id,- component: instance.component- } : void 0;- (0, import_sdk39.publish)({- type: "hoverInstance",- payload- });- }, [instance]);-}, usePublishRootInstance = () => {- let [rootInstance] = useRootInstance();- (0, import_react63.useEffect)(() => {- (0, import_sdk39.publish)({- type: "loadRootInstance",- payload: rootInstance- });- }, [rootInstance]);-}, publishRect = (rect) => {- (0, import_sdk39.publish)({- type: "selectedInstanceRect",- payload: rect- });-}, usePublishSelectedInstanceDataRect = () => {- let [element] = useSelectedElement(), [refCallback, rect] = useMeasure();- (0, import_react63.useEffect)(() => {- refCallback(element ?? null);- }, [element, refCallback]), (0, import_react63.useEffect)(() => {- rect !== void 0 && publishRect(rect);- }, [rect]);-}, usePublishHoveredInstanceRect = () => {- let [element] = useHoveredElement(), publishRect2 = (0, import_react63.useCallback)(() => {- element !== void 0 && (0, import_sdk39.publish)({- type: "hoveredInstanceRect",- payload: element.getBoundingClientRect()- });- }, [element]);- (0, import_react63.useEffect)(publishRect2, [publishRect2]);-}, useSetHoveredInstance = () => {- let [rootInstance] = useRootInstance(), [hoveredElement] = useHoveredElement(), [, setHoveredInstance] = useHoveredInstance();- (0, import_react63.useEffect)(() => {- let instance;- rootInstance !== void 0 && (hoveredElement == null ? void 0 : hoveredElement.id) && (instance = findInstanceById(rootInstance, hoveredElement.id)), setHoveredInstance(instance);- }, [rootInstance, hoveredElement, setHoveredInstance]);-}, useUpdateSelectedInstance = () => {- let [rootInstance] = useRootInstance(), [selectedInstance, setSelectedInstance] = useSelectedInstance();- (0, import_react63.useEffect)(() => {- let instance;- rootInstance !== void 0 && (selectedInstance == null ? void 0 : selectedInstance.id) && (instance = findInstanceById(rootInstance, selectedInstance.id)), instance !== void 0 && setSelectedInstance(instance);- }, [rootInstance, selectedInstance, setSelectedInstance]);-}, useUnselectInstance = () => {- let [, setSelectedInstance] = useSelectedInstance();- (0, import_sdk39.useSubscribe)("unselectInstance", () => {- setSelectedInstance(void 0);- });-}, usePublishTextEditingInstanceId = () => {- let [editingInstanceId] = useTextEditingInstanceId();- (0, import_react63.useEffect)(() => {- (0, import_sdk39.publish)({- type: "textEditingInstanceId",- payload: editingInstanceId- });- }, [editingInstanceId]);-};--// app/canvas/shared/style.ts-var import_immerhin3 = __toESM(require("immerhin")), import_sdk40 = require("@webstudio-is/sdk");-var useUpdateStyle = () => {- let [selectedInstance] = useSelectedInstance();- (0, import_sdk40.useSubscribe)("updateStyle", ({ id, updates, breakpoint }) => {- id === (selectedInstance == null ? void 0 : selectedInstance.id) && import_immerhin3.default.createTransaction([rootInstanceContainer], (rootInstance) => {- rootInstance !== void 0 && setInstanceStyleMutable(rootInstance, id, updates, breakpoint);- });- });-};--// app/canvas/shared/use-track-selected-element.ts-var import_react64 = require("react"), import_sdk41 = require("@webstudio-is/sdk");-var eventOptions = {- passive: !0-}, useTrackSelectedElement = () => {- let [selectedElement, setSelectedElement] = useSelectedElement(), [selectedInstance, setSelectedInstance] = useSelectedInstance(), [editingInstanceId, setEditingInstanceId] = useTextEditingInstanceId(), editingInstanceIdRef = (0, import_react64.useRef)(editingInstanceId);- editingInstanceIdRef.current = editingInstanceId;- let [rootInstance] = useRootInstance(), selectInstance = (0, import_react64.useCallback)((id) => {- if (rootInstance === void 0)- return;- let instance = findInstanceById(rootInstance, id);- setSelectedInstance(instance);- }, [setSelectedInstance, rootInstance]);- (0, import_sdk41.useSubscribe)("selectInstanceById", selectInstance), (0, import_react64.useEffect)(() => {- if (selectedInstance !== void 0 && (selectedElement === void 0 || (selectedInstance == null ? void 0 : selectedInstance.id) !== selectedElement.id)) {- let element = document.getElementById(selectedInstance.id);- if (element === null)- return;- element.focus(), setSelectedElement(element);- }- }, [selectedInstance, selectedElement, setSelectedElement]), (0, import_react64.useEffect)(() => {- editingInstanceIdRef.current !== void 0 && (selectedInstance == null ? void 0 : selectedInstance.id) !== editingInstanceIdRef.current && setEditingInstanceId(void 0);- }, [selectedInstance, setEditingInstanceId]), (0, import_react64.useEffect)(() => {- let handleClick = (event) => {- var _a;- (0, import_sdk41.publish)({ type: "clickCanvas" });- let element = event.target;- if (element.dataset.component === void 0) {- let instanceElement = element.closest("[data-component]");- if (instanceElement === null)- return;- element = instanceElement;- }- let { id, dataset } = element;- if (editingInstanceIdRef.current !== id) {- if (event.detail === 2) {- let component = dataset.component;- if (component === void 0 || !(component in primitives_exports))- return;- let { isInlineOnly: isInlineOnly11, isContentEditable: isContentEditable11 } = primitives_exports[component];- if (isContentEditable11 === !1)- return;- if (isInlineOnly11) {- let parentId = (_a = element.parentElement) == null ? void 0 : _a.id;- parentId && (selectInstance(parentId), setEditingInstanceId(parentId));- } else- setEditingInstanceId(id);- return;- }- selectInstance(id);- }- };- return window.addEventListener("click", handleClick, eventOptions), () => {- window.removeEventListener("click", handleClick);- };- }, [selectInstance, setEditingInstanceId]);-};--// app/canvas/features/wrapper-component/wrapper-component.tsx-var import_react73 = require("react"), import_sdk46 = require("@webstudio-is/sdk");--// app/canvas/features/wrapper-component/use-css.tsx-var import_react65 = require("react"), import_sdk42 = require("@webstudio-is/sdk"), usePreviewCss = ({ instance, css: css2 }) => {- let [previewCss, setPreviewCss] = (0, import_react65.useState)([]);- return (0, import_sdk42.useSubscribe)(`previewStyle:${instance.id}`, ({ updates }) => {- setPreviewCss(updates);- }), (0, import_react65.useEffect)(() => {- let reset2 = previewCss.map(({ property }) => ({- property,- value: void 0- }));- setPreviewCss(reset2);- }, [css2]), previewCss;-}, voidElements = "area, base, br, col, embed, hr, img, input, link, meta, source, track, wbr", rootElement = "body > div", defaultStyle9 = {- "&": {- userSelect: "none"- },- [`&:not(${voidElements}):not(${rootElement}):empty`]: {- outline: "1px dashed #555",- outlineOffset: -1,- paddingTop: 50,- paddingRight: 50- },- "&[contenteditable], &:focus": {- outline: 0- },- "&[contenteditable]": {- boxShadow: "0 0 0px 4px rgb(36 150 255 / 20%)"- },- "&[contenteditable] p": {- margin: 0- }-}, useCss = ({ instance, css: css2 }) => {- let previewCss = usePreviewCss({ instance, css: css2 });- return (0, import_react65.useMemo)(() => {- let overrides = __spreadValues({}, defaultStyle9);- for (let update2 of previewCss)- update2.value !== void 0 && (overrides[update2.property] = (0, import_sdk42.toValue)(update2.value));- return (0, import_sdk42.css)(css2)({ css: overrides });- }, [css2, previewCss]);-};--// app/canvas/features/wrapper-component/use-draggable.ts-var import_react66 = require("react"), import_react_dnd4 = require("react-dnd"), import_sdk43 = require("@webstudio-is/sdk"), useDraggable2 = ({ instance, isDisabled }) => {- let isDraggingRef = (0, import_react66.useRef)(!1), [{ isDragging, currentOffset }, dragRefCallback] = (0, import_react_dnd4.useDrag)(() => ({- type: instance.component,- collect(monitor) {- return {- isDragging: monitor.isDragging(),- currentOffset: monitor.getClientOffset()- };- },- canDrag() {- return isDisabled === !1;- }- }), [isDisabled]);- (0, import_react66.useEffect)(() => {- isDragging === !0 ? (0, import_sdk43.publish)({ type: "dragStartInstance" }) : (0, import_sdk43.publish)({ type: "dragEndInstance" }), isDraggingRef.current = isDragging;- }, [isDragging, instance.id]), (0, import_react66.useEffect)(() => {- currentOffset === null || isDragging === !1 || (0, import_sdk43.publish)({- type: "dragInstance",- payload: {- instance,- currentOffset- }- });- }, [instance, currentOffset, isDragging]);- let handleMouseDown = (0, import_react66.useCallback)((event) => {- isDisabled && event.stopPropagation();- }, [isDisabled]);- return { dragRefCallback, onMouseDownCapture: handleMouseDown };-};--// app/canvas/features/wrapper-component/use-ensure-focus.ts-var import_react67 = require("react");-var useEnsureFocus = () => {- let [selectedInstance] = useSelectedInstance();- return (0, import_react67.useCallback)((element) => {- element !== null && element.id === (selectedInstance == null ? void 0 : selectedInstance.id) && document.activeElement !== element && element.focus();- }, [selectedInstance]);-};--// app/canvas/features/wrapper-component/text-editor/lexical.ts-var import_lexical = require("lexical"), import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext"), import_LexicalComposer = require("@lexical/react/LexicalComposer"), import_LexicalRichTextPlugin = require("@lexical/react/LexicalRichTextPlugin"), import_LexicalContentEditable = require("@lexical/react/LexicalContentEditable"), import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin"), import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin"), import_LexicalTreeView = require("@lexical/react/LexicalTreeView");--// app/canvas/features/wrapper-component/text-editor/nodes/node-instance.tsx-var import_react_dom2 = require("react-dom");-var InstanceNode = class extends import_lexical.TextNode {- static getType() {- return "instance";- }- static clone(node) {- return new InstanceNode(node.options);- }- constructor(options2) {- super(options2.text);- this.options = options2;- }- exportJSON() {- let json2 = super.exportJSON();- return __spreadProps(__spreadValues(__spreadValues({}, json2), this.options), {- type: InstanceNode.getType()- });- }- createDOM(config4) {- let container = super.createDOM(config4), element = /* @__PURE__ */ React.createElement(InlineWrapperComponentDev, {- instance: this.options.instance- }, this.options.text);- return (0, import_react_dom2.render)(element, container), container;- }- updateDOM(prevNode, dom, config4) {- let inner = dom.firstChild;- return inner === null ? !0 : (super.updateDOM(prevNode, inner, config4), !1);- }- isInline() {- return !0;- }- canInsertTextBefore() {- return !1;- }- canInsertTextAfter() {- return !1;- }-}, $createInstanceNode = (options2) => new InstanceNode(options2);--// app/canvas/features/wrapper-component/text-editor/config.ts-var config3 = {- namespace: "ComponentTextEditor",- onError(error) {- throw error;- },- nodes: [InstanceNode]-};--// app/canvas/features/wrapper-component/text-editor/hooks/use-content-editable.tsx-var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext"), import_react68 = require("react"), props = {- contentEditable: !0-}, useContentEditable = (isEditing) => {- let [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)(), ref = (0, import_react68.useCallback)((rootElement2) => {- editor.setRootElement(rootElement2);- }, [editor]);- return (0, import_react68.useEffect)(() => {- isEditing !== !0 && editor.setRootElement(null);- }, [editor, isEditing]), [ref, isEditing ? props : void 0];-};--// app/canvas/features/wrapper-component/text-editor/plugins/plugin-instance.tsx-var import_react69 = require("react"), import_sdk44 = require("@webstudio-is/sdk");--// app/canvas/features/wrapper-component/text-editor/utils/to-lexical-nodes.tsx-var toLexicalNodes = (children6) => {- let nodes = [], p = (0, import_lexical.$createParagraphNode)();- nodes.push(p);- for (let child of children6) {- if (child === `-`) {- p = (0, import_lexical.$createParagraphNode)(), nodes.push(p);- continue;- }- if (typeof child == "string") {- let textNode = (0, import_lexical.$createTextNode)(child);- p.append(textNode);- continue;- }- let text = typeof child.children[0] == "string" ? child.children[0] : "", paragraph = nodes[nodes.length - 1], instanceNode = $createInstanceNode({- instance: child,- text,- isNew: !1- });- paragraph.append(instanceNode);- }- return nodes;-};--// app/canvas/features/wrapper-component/text-editor/plugins/plugin-instance.tsx-var populateRoot = (children6) => {- let nodes = toLexicalNodes(children6), root = (0, import_lexical.$getRoot)();- root.clear();- for (let node of nodes)- root.append(node);- root.selectStart();-}, INSERT_INSTANCE_COMMAND = (0, import_lexical.createCommand)(), InstancePlugin = ({ children: children6 }) => {- let [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();- return (0, import_react69.useEffect)(() => {- if (editor.hasNodes([InstanceNode]) === !1)- throw new Error("InstancePlugin: InstanceNode not registered on editor");- return editor.registerCommand(INSERT_INSTANCE_COMMAND, (instance) => {- let selection = (0, import_lexical.$getSelection)(), text = selection == null ? void 0 : selection.getTextContent();- if ((0, import_lexical.$isRangeSelection)(selection) && text) {- let instanceNode = $createInstanceNode({- instance,- text,- isNew: !0- });- selection.insertNodes([instanceNode]), requestAnimationFrame(() => {- editor.update(() => {- instanceNode.select();- });- });- }- return !0;- }, import_lexical.COMMAND_PRIORITY_EDITOR);- }, [editor]), (0, import_react69.useEffect)(() => {- editor.update(() => {- populateRoot(children6);- });- }, [editor, children6]), (0, import_sdk44.useSubscribe)("insertInlineInstance", (payload) => {- editor.dispatchCommand(INSERT_INSTANCE_COMMAND, payload);- }), null;-};--// app/canvas/features/wrapper-component/text-editor/plugins/plugin-toolbar-connector.tsx-var import_react70 = require("react"), import_sdk45 = require("@webstudio-is/sdk");-var ToolbarConnectorPlugin = () => {- let [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)(), lastSelectionRef = (0, import_react70.useRef)(), clearSelectionRect = () => {- lastSelectionRef.current && ((0, import_sdk45.publish)({ type: "selectionRect", payload: void 0 }), lastSelectionRef.current = void 0);- }, publishSelectionRect = (0, import_react70.useCallback)(() => {- let selection = (0, import_lexical.$getSelection)(), text = selection == null ? void 0 : selection.getTextContent(), nativeSelection = window.getSelection();- if ((0, import_lexical.$isRangeSelection)(selection) && Boolean(text) && nativeSelection !== null) {- let rect = nativeSelection.getRangeAt(0).getBoundingClientRect();- return (0, import_sdk45.publish)({- type: "selectionRect",- payload: rect- }), lastSelectionRef.current = selection, !0;- }- return clearSelectionRect(), !0;- }, []);- return (0, import_react70.useEffect)(() => {- editor.registerCommand(import_lexical.SELECTION_CHANGE_COMMAND, publishSelectionRect, import_lexical.COMMAND_PRIORITY_LOW);- }, [editor, publishSelectionRect]), (0, import_react70.useEffect)(() => clearSelectionRect, []), null;-};--// app/canvas/features/wrapper-component/text-editor/plugins/plugin-on-change.tsx-var import_react71 = require("react"), import_react_use = require("react-use");--// app/canvas/features/wrapper-component/text-editor/utils/to-updates.ts-var toUpdates = (node, updates = []) => {- if (node.type === "text" && "text" in node && updates.push(node.text), node.type === "instance" && "instance" in node && ("isNew" in node && node.isNew === !0 ? updates.push({- id: node.instance.id,- text: node.text,- component: node.instance.component,- createInstance: !0- }) : updates.push({- id: node.instance.id,- text: node.text- })), "children" in node)- for (let child of node.children)- child.type === "paragraph" && updates.length !== 0 && updates.push(`-`), toUpdates(child, updates);- return updates;-};--// app/canvas/features/wrapper-component/text-editor/plugins/plugin-on-change.tsx-var OnChangePlugin2 = ({- onChange-}) => {- let [editorState, setEditorState] = (0, import_react71.useState)();- return (0, import_react_use.useDebounce)(() => {- editorState !== void 0 && editorState.read(() => {- let updates = toUpdates(editorState.toJSON().root);- onChange(updates);- });- }, 500, [editorState]), /* @__PURE__ */ React.createElement(import_LexicalOnChangePlugin.OnChangePlugin, {- onChange: setEditorState- });-};--// app/canvas/features/wrapper-component/text-editor/editor.tsx-var import_react72 = require("react"), Editor = ({- instance,- editable,- children: children6,- onChange-}) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_LexicalRichTextPlugin.RichTextPlugin, {- contentEditable: editable,- placeholder: ""-}), /* @__PURE__ */ React.createElement(OnChangePlugin2, {- onChange-}), /* @__PURE__ */ React.createElement(import_LexicalHistoryPlugin.HistoryPlugin, null), /* @__PURE__ */ React.createElement(InstancePlugin, null, instance.children), /* @__PURE__ */ React.createElement(ToolbarConnectorPlugin, null), children6), EditorMemoized = (0, import_react72.memo)(Editor, () => !0);--// app/canvas/features/wrapper-component/wrapper-component.tsx-var import_lodash9 = __toESM(require("lodash.noop"));-var WrapperComponentDev = (_a) => {- var _b = _a, {- instance,- css: css2,- children: children6,- onChangeChildren = import_lodash9.default- } = _b, rest = __objRest(_b, [- "instance",- "css",- "children",- "onChangeChildren"- ]);- let className = useCss({ instance, css: css2 }), [editingInstanceId] = useTextEditingInstanceId(), [, setSelectedElement] = useSelectedElement(), isEditing = editingInstanceId === instance.id, [editableRefCallback, editableProps] = useContentEditable(isEditing), _a2 = useDraggable2({- instance,- isDisabled: isEditing === !0- }), { dragRefCallback } = _a2, draggableProps = __objRest(_a2, ["dragRefCallback"]), focusRefCallback = useEnsureFocus(), refCallback = (0, import_react73.useCallback)((element) => {- isEditing && editableRefCallback(element), dragRefCallback(element), focusRefCallback(element), element !== null && setSelectedElement(element);- }, [- dragRefCallback,- focusRefCallback,- editableRefCallback,- setSelectedElement,- isEditing- ]), userProps = (0, import_sdk46.useUserProps)(instance.id), readonlyProps = instance.component === "Input" ? { readOnly: !0 } : void 0, { Component: Component11 } = primitives_exports[instance.component], props2 = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, userProps), rest), draggableProps), readonlyProps), editableProps), {- className,- id: instance.id,- tabIndex: 0,- "data-component": instance.component,- "data-id": instance.id,- ref: refCallback,- onClick: (event) => {- instance.component === "Link" && event.preventDefault();- },- onSubmit: (event) => {- event.preventDefault();- }- });- return isEditing ? /* @__PURE__ */ React.createElement(EditorMemoized, {- instance,- editable: /* @__PURE__ */ React.createElement(Component11, __spreadValues({}, props2)),- onChange: (updates) => {- onChangeChildren({ instanceId: instance.id, updates });- }- }) : /* @__PURE__ */ React.createElement(Component11, __spreadValues({}, props2), (0, import_sdk46.renderWrapperComponentChildren)(children6));-}, InlineWrapperComponentDev = (_a) => {- var _b = _a, {- instance- } = _b, rest = __objRest(_b, [- "instance"- ]);- let [breakpoints] = useBreakpoints(), css2 = (0, import_react73.useMemo)(() => (0, import_sdk46.toCss)(instance.cssRules, breakpoints), [instance, breakpoints]), className = useCss({ instance, css: css2 }), userProps = (0, import_sdk46.useUserProps)(instance.id), { Component: Component11 } = primitives_exports[instance.component];- return /* @__PURE__ */ React.createElement(Component11, __spreadProps(__spreadValues(__spreadValues({}, rest), userProps), {- "data-outline-disabled": !0,- key: instance.id,- id: instance.id,- className- }));-};--// app/canvas/shared/sync/use-sync.ts-var import_useInterval = __toESM(require("react-use/lib/useInterval")), import_immerhin4 = require("immerhin");--// app/canvas/shared/sync/queue.ts-var import_sdk47 = require("@webstudio-is/sdk"), queue = [], enqueue = (job) => {- queue.push(job), isInProgress === !1 && dequeue();-}, isInProgress = !1, dequeue = () => {- let job = queue.shift();- job && (isInProgress = !0, (0, import_sdk47.publish)({- type: "syncStatus",- payload: "syncing"- }), job().finally(() => {- isInProgress = !1, (0, import_sdk47.publish)({- type: "syncStatus",- payload: "idle"- }), dequeue();- }));-};--// app/canvas/shared/sync/use-sync.ts-var useSync = ({ project }) => {- (0, import_useInterval.default)(() => {- let entries = (0, import_immerhin4.sync)();- entries.length !== 0 && enqueue(() => fetch("/rest/patch", {- method: "post",- body: JSON.stringify({- transactions: entries,- treeId: project.devTreeId,- projectId: project.id- })- }));- }, 1e3);-};--// app/canvas/shared/props.ts-var import_sdk48 = require("@webstudio-is/sdk"), import_immerhin5 = __toESM(require("immerhin"));-var useManageProps = () => {- (0, import_sdk48.useSubscribe)("updateProps", (userPropsUpdates) => {- import_immerhin5.default.createTransaction([import_sdk48.allUserPropsContainer], (allUserProps) => {- updateAllUserPropsMutable(allUserProps, userPropsUpdates);- });- }), (0, import_sdk48.useSubscribe)("deleteProp", (deleteProp) => {- import_immerhin5.default.createTransaction([import_sdk48.allUserPropsContainer], (allUserProps) => {- deletePropMutable(allUserProps, deleteProp);- });- });-};--// app/canvas/shared/breakpoints.ts-var import_react74 = require("react"), import_immerhin6 = __toESM(require("immerhin")), import_sdk49 = require("@webstudio-is/sdk");--// app/shared/css-utils/delete-css-rules-by-breakpoint.ts-var deleteCssRulesByBreakpoint = (instance, breakpointId) => {- [...instance.cssRules].forEach((cssRule, index) => {- cssRule.breakpoint === breakpointId && instance.cssRules.splice(index, 1);- });- for (let child of instance.children)- typeof child != "string" && deleteCssRulesByBreakpoint(child, breakpointId);-};--// app/canvas/shared/breakpoints.ts-var useInitializeBreakpoints = (breakpoints) => {- let [, setCurrentBreakpoints] = useBreakpoints();- (0, import_react74.useEffect)(() => {- (0, import_sdk49.setBreakpoints)(breakpoints), setCurrentBreakpoints(breakpoints);- }, [breakpoints, setCurrentBreakpoints]);-}, usePublishBreakpoints = () => {- let [breakpoints] = useBreakpoints();- (0, import_react74.useEffect)(() => {- (0, import_sdk49.publish)({- type: "loadBreakpoints",- payload: breakpoints- });- }, [breakpoints]);-}, useBreakpointChange = () => {- (0, import_sdk49.useSubscribe)("breakpointChange", (breakpoint) => {- import_immerhin6.default.createTransaction([breakpointsContainer], (breakpoints) => {- let foundBreakpoint = breakpoints.find(({ id }) => id == breakpoint.id);- foundBreakpoint ? (foundBreakpoint.label = breakpoint.label, foundBreakpoint.minWidth = breakpoint.minWidth) : breakpoints.push(breakpoint), (0, import_sdk49.setBreakpoints)(breakpoints);- });- });-}, useBreakpointDelete = () => {- (0, import_sdk49.useSubscribe)("breakpointDelete", (breakpoint) => {- import_immerhin6.default.createTransaction([breakpointsContainer, rootInstanceContainer], (breakpoints, rootInstance) => {- if (rootInstance === void 0)- return;- let index = breakpoints.findIndex(({ id }) => id == breakpoint.id);- index !== -1 && breakpoints.splice(index, 1), deleteCssRulesByBreakpoint(rootInstance, breakpoint.id);- });- });-}, useHandleBreakpoints = () => {- usePublishBreakpoints(), useBreakpointChange(), useBreakpointDelete();-};--// app/canvas/shared/immerhin.ts-var import_sdk50 = require("@webstudio-is/sdk"), import_immerhin7 = __toESM(require("immerhin"));-var registerContainers = () => {- import_immerhin7.default.register("breakpoints", breakpointsContainer), import_immerhin7.default.register("root", rootInstanceContainer), import_immerhin7.default.register("props", import_sdk50.allUserPropsContainer);-};--// app/canvas/shared/use-track-hovered-element.ts-var import_react75 = require("react");-var eventOptions2 = {- passive: !0-}, useTrackHoveredElement = () => {- let [rootInstance] = useRootInstance(), [, setHoveredElement] = useHoveredElement(), [selectedElement] = useSelectedElement();- (0, import_react75.useEffect)(() => {- let handleMouseOver = (event) => {- let element = event.target;- rootInstance === void 0 || !(element instanceof HTMLElement) || element.dataset.outlineDisabled || setHoveredElement(element);- }, handleMouseOut = () => {- rootInstance !== void 0 && setHoveredElement(void 0);- };- return window.addEventListener("mouseover", handleMouseOver, eventOptions2), window.addEventListener("mouseout", handleMouseOut, eventOptions2), () => {- window.removeEventListener("mouseover", handleMouseOver), window.removeEventListener("mouseout", handleMouseOut);- };- }, [rootInstance, selectedElement, setHoveredElement]);-};--// app/canvas/shared/use-publish-scroll-state.ts-var import_sdk51 = require("@webstudio-is/sdk");-var usePublishScrollState = () => {- useScrollState({- onScrollStart() {- (0, import_sdk51.publish)({ type: "scrollState", payload: !0 });- },- onScrollEnd() {- (0, import_sdk51.publish)({- type: "scrollState",- payload: !1- });- }- });-};--// app/canvas/canvas.tsx-registerContainers();-var useElementsTree = () => {- let [rootInstance] = useRootInstance(), [breakpoints] = useBreakpoints(), onChangeChildren = (0, import_react76.useCallback)((change) => {- import_immerhin8.default.createTransaction([rootInstanceContainer], (rootInstance2) => {- if (rootInstance2 === void 0)- return;- let { instanceId, updates } = change;- setInstanceChildrenMutable(instanceId, updates, rootInstance2);- });- }, []);- return (0, import_react76.useMemo)(() => {- if (rootInstance !== void 0)- return (0, import_sdk12.createElementsTree)({- instance: rootInstance,- breakpoints,- Component: WrapperComponentDev,- onChangeChildren- });- }, [rootInstance, breakpoints, onChangeChildren]);-}, useSubscribePreviewMode = () => {- let [isPreviewMode, setIsPreviewMode] = (0, import_react76.useState)(!1);- return (0, import_sdk52.useSubscribe)("previewMode", setIsPreviewMode), isPreviewMode;-}, PreviewMode = () => {- let [rootInstance] = useRootInstance(), [breakpoints] = useBreakpoints();- return rootInstance === void 0 ? null : (0, import_sdk12.createElementsTree)({- breakpoints,- instance: rootInstance,- Component: import_sdk52.WrapperComponent- });-}, dndOptions = { enableMouseEvents: !0 }, DesignMode = ({ treeId, project }) => {- useDragDropHandlers(), useUpdateStyle(), useManageProps(), usePublishSelectedInstanceData(treeId), usePublishHoveredInstanceData(), useHandleBreakpoints(), useInsertInstance(), useReparentInstance(), useDeleteInstance(), usePublishRootInstance(), useTrackSelectedElement(), useTrackHoveredElement(), useSetHoveredInstance(), useSync({ project }), useUpdateSelectedInstance(), usePublishSelectedInstanceDataRect(), usePublishHoveredInstanceRect(), useUnselectInstance(), usePublishScrollState(), useSubscribeScrollState(), usePublishTextEditingInstanceId();- let elements = useElementsTree();- return /* @__PURE__ */ React.createElement(import_react_dnd5.DndProvider, {- backend: import_react_dnd_touch_backend.TouchBackend,- options: dndOptions- }, elements && /* @__PURE__ */ React.createElement(import_LexicalComposer.LexicalComposer, {- initialConfig: config3- }, elements));-}, Canvas2 = ({ data }) => {- if (data.tree === null)- throw new Error("Tree is null");- return useInitializeBreakpoints(data.breakpoints), (0, import_sdk52.globalStyles)(), (0, import_sdk52.useAllUserProps)(data.props), usePopulateRootInstance(data.tree), useShortcuts(), useSubscribePreviewMode() ? /* @__PURE__ */ React.createElement(PreviewMode, null) : /* @__PURE__ */ React.createElement(DesignMode, {- treeId: data.tree.id,- project: data.project- });-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/canvas/$projectId.tsx-var loader15 = async ({ params }) => {- if (params.projectId === void 0)- return { errors: "Missing projectId", env: env_server_default };- try {- let canvasData = await loadCanvasData({ projectId: params.projectId });- return __spreadProps(__spreadValues({}, canvasData), {- env: env_server_default- });- } catch (error) {- if (error instanceof Error)- return {- errors: error.message,- env: env_server_default- };- }- return { errors: "Unexpected error", env: env_server_default };-}, CanvasRoute = () => {- let data = (0, import_react77.useLoaderData)();- return "errors" in data ? /* @__PURE__ */ React.createElement("p", null, data.errors) : /* @__PURE__ */ React.createElement(Canvas2, {- data- });-}, projectId_default2 = CanvasRoute;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/logout.tsx-var logout_exports = {};-__export(logout_exports, {- default: () => Logout,- loader: () => loader16-});-function Logout() {- return null;-}-var loader16 = async ({ request }) => {- await authenticator.logout(request, { redirectTo: config_default.loginPath });-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/index.tsx-var routes_exports = {};-__export(routes_exports, {- default: () => routes_default,- loader: () => loader17-});-var import_node9 = require("@remix-run/node"), import_react78 = require("@remix-run/react"), import_sdk53 = require("@webstudio-is/sdk");--// app/routes/canvas.tsx-var canvas_default2 = Canvas;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/index.tsx-var loader17 = async ({- request-}) => {- let host2 = request.headers.get("x-forwarded-host") || request.headers.get("host") || "", [userDomain, wstdDomain] = host2.split(".");- if (typeof userDomain == "string" && (wstdDomain === "wstd" || (wstdDomain == null ? void 0 : wstdDomain.includes("localhost"))))- try {- let project = await project_server_exports.loadByDomain(userDomain);- if (project === null)- throw new Error(`Unknown domain "${userDomain}"`);- if (project.prodTreeId === null)- throw new Error("Site is not published");- let [tree, props2, breakpoints] = await Promise.all([- tree_server_exports.loadByProject(project, "production"),- props_server_exports.loadByTreeId(project.prodTreeId),- breakpoints_server_exports.load(project.prodTreeId)- ]);- if (tree === null)- throw new Error(`Tree ${project.prodTreeId} not found`);- if (breakpoints === null)- throw new Error(`Breakpoints for tree ${project.prodTreeId} not found`);- return { tree, props: props2, breakpoints: breakpoints.values, env: env_server_default };- } catch (error) {- if (error instanceof Error)- return { errors: error.message, env: env_server_default };- }- return (0, import_node9.redirect)(config_default.dashboardPath);-}, Index = () => {- let data = (0, import_react78.useLoaderData)();- return "errors" in data ? /* @__PURE__ */ React.createElement("p", null, data.errors) : data.tree && data.props ? /* @__PURE__ */ React.createElement(canvas_default2, {- Outlet: () => /* @__PURE__ */ React.createElement(import_sdk53.Root, {- data- })- }) : null;-}, routes_default = Index;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/login.tsx-var login_exports = {};-__export(login_exports, {- default: () => login_default,- loader: () => loader18,- meta: () => meta5-});-var loader18 = () => ({- env: env_server_default-}), meta5 = () => ({ title: "Webstudio Login" }), login_default = Designer;--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/login/index.tsx-var login_exports2 = {};-__export(login_exports2, {- default: () => login_default3,- links: () => links3,- loader: () => loader19-});-var import_node10 = require("@remix-run/node");--// app/auth/login.tsx-var import_react80 = require("@remix-run/react"), import_react81 = require("react");--// app/auth/components/login-button.tsx-var import_react79 = __toESM(require("react"));-var isPreviewEnvironment = env_getter_default.VERCEL_ENV === "preview", LoginButton = (_a) => {- var _b = _a, {- children: children6,- isDevLogin = !1,- enabled- } = _b, props2 = __objRest(_b, [- "children",- "isDevLogin",- "enabled"- ]);- let isSocialLoginInPreviewEnvironment = isPreviewEnvironment && isDevLogin === !1;- return isSocialLoginInPreviewEnvironment || enabled === !1 ? /* @__PURE__ */ import_react79.default.createElement(Tooltip, {- content: isSocialLoginInPreviewEnvironment ? "Social login does not work in preview deployments" : "This login is not configured",- delayDuration: 0- }, /* @__PURE__ */ import_react79.default.createElement("span", {- tabIndex: 0,- style: { width: "100%", display: "block" }- }, /* @__PURE__ */ import_react79.default.createElement(Button, __spreadProps(__spreadValues({}, props2), {- css: { width: "100%" },- size: 3,- type: "submit",- disabled: !0- }), children6))) : /* @__PURE__ */ import_react79.default.createElement(Button, __spreadProps(__spreadValues({}, props2), {- css: { width: "100%" },- size: 3,- type: "submit"- }), children6);-};--// app/auth/login.css-var login_default2 = "/build/_assets/login-XMYFQPQX.css";--// app/auth/login.tsx-var links3 = () => [- {- rel: "stylesheet",- href: inter_default- },- {- rel: "stylesheet",- href: login_default2- }-];-var Login = ({ errorMessage }) => {- let [isDevLoginOpen, openDevLogin] = (0, import_react81.useState)(!1), data = (0, import_react80.useLoaderData)();- return /* @__PURE__ */ React.createElement(Flex, {- css: { height: "100vh" },- direction: "column",- align: "center",- justify: "center"- }, /* @__PURE__ */ React.createElement(Card, {- size: 2- }, /* @__PURE__ */ React.createElement(Flex, {- direction: "column",- gap: "4",- align: "center"- }, /* @__PURE__ */ React.createElement(Heading, {- size: "2"- }, "Login"), errorMessage.length ? /* @__PURE__ */ React.createElement(Text, {- css: { textAlign: "center" },- variant: "red"- }, errorMessage) : null, /* @__PURE__ */ React.createElement(Flex, {- gap: "2",- direction: "column",- align: "center"- }, /* @__PURE__ */ React.createElement(import_react80.Form, {- action: "/auth/github",- method: "post"- }, /* @__PURE__ */ React.createElement(LoginButton, {- enabled: data.isGithubEnabled- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "1"- }, /* @__PURE__ */ React.createElement(GithubIcon, {- width: "20"- }), "Login with GitHub"))), /* @__PURE__ */ React.createElement(import_react80.Form, {- action: "/auth/google",- method: "post"- }, /* @__PURE__ */ React.createElement(LoginButton, {- enabled: data.isGoogleEnabled- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "1"- }, /* @__PURE__ */ React.createElement(GoogleIcon, {- width: "20"- }), "Login with Google"))), data.isDevLogin && /* @__PURE__ */ React.createElement(React.Fragment, null, isDevLoginOpen ? /* @__PURE__ */ React.createElement(import_react80.Form, {- action: "/auth/dev",- method: "post"- }, /* @__PURE__ */ React.createElement(TextField, {- size: 2,- css: { width: "100%", flexGrow: 1 },- name: "secret",- type: "text",- minLength: 2,- required: !0,- autoFocus: !0,- placeholder: "Place your auth secret here"- })) : /* @__PURE__ */ React.createElement(LoginButton, {- enabled: data.isDevLogin,- isDevLogin: !0,- onClick: () => openDevLogin(!0)- }, /* @__PURE__ */ React.createElement(Flex, {- gap: "1",- align: "center"- }, /* @__PURE__ */ React.createElement(icons_exports.CommitIcon, {- width: "20"- }), "Dev Login")))))));-};--// route:/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/login/index.tsx-var loader19 = async ({ request }) => await authenticator.isAuthenticated(request) ? (0, import_node10.redirect)(config_default.dashboardPath) : {- isDevLogin: process.env.DEV_LOGIN === "true",- env: env_server_default,- isGithubEnabled: Boolean(process.env.GH_CLIENT_ID && process.env.GH_CLIENT_SECRET),- isGoogleEnabled: Boolean(process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET)-}, LoginRoute = () => {- let errorMessage = useLoginErrorMessage();- return /* @__PURE__ */ React.createElement(Login, {- errorMessage- });-}, login_default3 = LoginRoute;--// server-assets-manifest:@remix-run/dev/assets-manifest-var assets_manifest_default = { version: "6412d0f3", entry: { module: "/build/entry.client-BADAYHVI.js", imports: ["/build/_shared/chunk-B36H54Q2.js", "/build/_shared/chunk-MADQQ4W2.js", "/build/_shared/chunk-QD7BDOJK.js", "/build/_shared/chunk-QPKOW66L.js", "/build/_shared/chunk-SRJHFGUQ.js", "/build/_shared/chunk-R6VSS7HB.js"] }, routes: { root: { id: "root", parentId: void 0, path: "", index: void 0, caseSensitive: void 0, module: "/build/root-HIH74YUZ.js", imports: void 0, hasAction: !1, hasLoader: !1, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/auth/dev": { id: "routes/auth/dev", parentId: "root", path: "auth/dev", index: void 0, caseSensitive: void 0, module: "/build/routes/auth/dev-OY6U6ZZL.js", imports: ["/build/_shared/chunk-WWM4X7G7.js", "/build/_shared/chunk-TDLYKOPO.js"], hasAction: !0, hasLoader: !1, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/auth/github": { id: "routes/auth/github", parentId: "root", path: "auth/github", index: void 0, caseSensitive: void 0, module: "/build/routes/auth/github-VQ7AN4UG.js", imports: ["/build/_shared/chunk-WWM4X7G7.js", "/build/_shared/chunk-TDLYKOPO.js"], hasAction: !0, hasLoader: !1, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/auth/github/callback": { id: "routes/auth/github/callback", parentId: "routes/auth/github", path: "callback", index: void 0, caseSensitive: void 0, module: "/build/routes/auth/github/callback-TALPZT4U.js", imports: void 0, hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/auth/google": { id: "routes/auth/google", parentId: "root", path: "auth/google", index: void 0, caseSensitive: void 0, module: "/build/routes/auth/google-IPCRXR2G.js", imports: ["/build/_shared/chunk-WWM4X7G7.js", "/build/_shared/chunk-TDLYKOPO.js"], hasAction: !0, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/auth/google/callback": { id: "routes/auth/google/callback", parentId: "routes/auth/google", path: "callback", index: void 0, caseSensitive: void 0, module: "/build/routes/auth/google/callback-SJVT2W6T.js", imports: void 0, hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/canvas": { id: "routes/canvas", parentId: "root", path: "canvas", index: void 0, caseSensitive: void 0, module: "/build/routes/canvas-BNYCH64M.js", imports: ["/build/_shared/chunk-CHKIVGVF.js", "/build/_shared/chunk-VDMDGISW.js", "/build/_shared/chunk-6KWPSJTY.js", "/build/_shared/chunk-D4F75PJ7.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/canvas/$projectId": { id: "routes/canvas/$projectId", parentId: "routes/canvas", path: ":projectId", index: void 0, caseSensitive: void 0, module: "/build/routes/canvas/$projectId-EN7MP3RM.js", imports: ["/build/_shared/chunk-6YZOMFAW.js", "/build/_shared/chunk-LZQQRXUE.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/dashboard": { id: "routes/dashboard", parentId: "root", path: "dashboard", index: void 0, caseSensitive: void 0, module: "/build/routes/dashboard-GORLGHTU.js", imports: ["/build/_shared/chunk-GJEHYJKD.js", "/build/_shared/chunk-6KWPSJTY.js", "/build/_shared/chunk-D4F75PJ7.js", "/build/_shared/chunk-KEIN4CGZ.js", "/build/_shared/chunk-LZQQRXUE.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/dashboard/index": { id: "routes/dashboard/index", parentId: "routes/dashboard", path: void 0, index: !0, caseSensitive: void 0, module: "/build/routes/dashboard/index-47ACBDYH.js", imports: ["/build/_shared/chunk-7YTDWDGG.js", "/build/_shared/chunk-WWM4X7G7.js", "/build/_shared/chunk-TDLYKOPO.js"], hasAction: !0, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/designer": { id: "routes/designer", parentId: "root", path: "designer", index: void 0, caseSensitive: void 0, module: "/build/routes/designer-7PTVKO44.js", imports: ["/build/_shared/chunk-GJEHYJKD.js", "/build/_shared/chunk-6KWPSJTY.js", "/build/_shared/chunk-D4F75PJ7.js", "/build/_shared/chunk-KEIN4CGZ.js", "/build/_shared/chunk-LZQQRXUE.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/designer/$id": { id: "routes/designer/$id", parentId: "routes/designer", path: ":id", index: void 0, caseSensitive: void 0, module: "/build/routes/designer/$id-ALVFN3YN.js", imports: ["/build/_shared/chunk-6YZOMFAW.js", "/build/_shared/chunk-7YTDWDGG.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/index": { id: "routes/index", parentId: "root", path: void 0, index: !0, caseSensitive: void 0, module: "/build/routes/index-O6SAICID.js", imports: ["/build/_shared/chunk-CHKIVGVF.js", "/build/_shared/chunk-VDMDGISW.js", "/build/_shared/chunk-6KWPSJTY.js", "/build/_shared/chunk-D4F75PJ7.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/login": { id: "routes/login", parentId: "root", path: "login", index: void 0, caseSensitive: void 0, module: "/build/routes/login-BRUOWCYK.js", imports: ["/build/_shared/chunk-GJEHYJKD.js", "/build/_shared/chunk-6KWPSJTY.js", "/build/_shared/chunk-D4F75PJ7.js", "/build/_shared/chunk-KEIN4CGZ.js", "/build/_shared/chunk-LZQQRXUE.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/login/index": { id: "routes/login/index", parentId: "routes/login", path: void 0, index: !0, caseSensitive: void 0, module: "/build/routes/login/index-Y3BTJFU4.js", imports: ["/build/_shared/chunk-7YTDWDGG.js", "/build/_shared/chunk-WWM4X7G7.js", "/build/_shared/chunk-TDLYKOPO.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/logout": { id: "routes/logout", parentId: "root", path: "logout", index: void 0, caseSensitive: void 0, module: "/build/routes/logout-O5E6MPSO.js", imports: ["/build/_shared/chunk-TDLYKOPO.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/preview": { id: "routes/preview", parentId: "root", path: "preview", index: void 0, caseSensitive: void 0, module: "/build/routes/preview-DNRQO7NW.js", imports: ["/build/_shared/chunk-VDMDGISW.js", "/build/_shared/chunk-6KWPSJTY.js", "/build/_shared/chunk-D4F75PJ7.js"], hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/preview/$projectId": { id: "routes/preview/$projectId", parentId: "routes/preview", path: ":projectId", index: void 0, caseSensitive: void 0, module: "/build/routes/preview/$projectId-4SZF7FOL.js", imports: void 0, hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/rest/breakpoints.$projectId": { id: "routes/rest/breakpoints.$projectId", parentId: "root", path: "rest/breakpoints/:projectId", index: void 0, caseSensitive: void 0, module: "/build/routes/rest/breakpoints.$projectId-OC77KFX5.js", imports: void 0, hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/rest/patch": { id: "routes/rest/patch", parentId: "root", path: "rest/patch", index: void 0, caseSensitive: void 0, module: "/build/routes/rest/patch-NSLESHUG.js", imports: void 0, hasAction: !0, hasLoader: !1, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/rest/project/clone.$domain": { id: "routes/rest/project/clone.$domain", parentId: "root", path: "rest/project/clone/:domain", index: void 0, caseSensitive: void 0, module: "/build/routes/rest/project/clone.$domain-KRUZBK37.js", imports: void 0, hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/rest/props.$projectId": { id: "routes/rest/props.$projectId", parentId: "root", path: "rest/props/:projectId", index: void 0, caseSensitive: void 0, module: "/build/routes/rest/props.$projectId-JSZ6VLX5.js", imports: void 0, hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/rest/publish": { id: "routes/rest/publish", parentId: "root", path: "rest/publish", index: void 0, caseSensitive: void 0, module: "/build/routes/rest/publish-4BQNZ4P3.js", imports: void 0, hasAction: !0, hasLoader: !1, hasCatchBoundary: !1, hasErrorBoundary: !1 }, "routes/rest/tree.$projectId": { id: "routes/rest/tree.$projectId", parentId: "root", path: "rest/tree/:projectId", index: void 0, caseSensitive: void 0, module: "/build/routes/rest/tree.$projectId-4GKHHDNV.js", imports: void 0, hasAction: !1, hasLoader: !0, hasCatchBoundary: !1, hasErrorBoundary: !1 } }, url: "/build/manifest-6412D0F3.js" };--// server-entry-module:@remix-run/dev/server-build-var entry = { module: entry_server_exports }, routes = {- root: {- id: "root",- parentId: void 0,- path: "",- index: void 0,- caseSensitive: void 0,- module: root_exports- },- "routes/rest/breakpoints.$projectId": {- id: "routes/rest/breakpoints.$projectId",- parentId: "root",- path: "rest/breakpoints/:projectId",- index: void 0,- caseSensitive: void 0,- module: breakpoints_projectId_exports- },- "routes/rest/project/clone.$domain": {- id: "routes/rest/project/clone.$domain",- parentId: "root",- path: "rest/project/clone/:domain",- index: void 0,- caseSensitive: void 0,- module: clone_domain_exports- },- "routes/rest/props.$projectId": {- id: "routes/rest/props.$projectId",- parentId: "root",- path: "rest/props/:projectId",- index: void 0,- caseSensitive: void 0,- module: props_projectId_exports- },- "routes/rest/tree.$projectId": {- id: "routes/rest/tree.$projectId",- parentId: "root",- path: "rest/tree/:projectId",- index: void 0,- caseSensitive: void 0,- module: tree_projectId_exports- },- "routes/rest/publish": {- id: "routes/rest/publish",- parentId: "root",- path: "rest/publish",- index: void 0,- caseSensitive: void 0,- module: publish_exports- },- "routes/auth/github": {- id: "routes/auth/github",- parentId: "root",- path: "auth/github",- index: void 0,- caseSensitive: void 0,- module: github_exports- },- "routes/auth/github/callback": {- id: "routes/auth/github/callback",- parentId: "routes/auth/github",- path: "callback",- index: void 0,- caseSensitive: void 0,- module: callback_exports- },- "routes/auth/google": {- id: "routes/auth/google",- parentId: "root",- path: "auth/google",- index: void 0,- caseSensitive: void 0,- module: google_exports- },- "routes/auth/google/callback": {- id: "routes/auth/google/callback",- parentId: "routes/auth/google",- path: "callback",- index: void 0,- caseSensitive: void 0,- module: callback_exports2- },- "routes/rest/patch": {- id: "routes/rest/patch",- parentId: "root",- path: "rest/patch",- index: void 0,- caseSensitive: void 0,- module: patch_exports- },- "routes/dashboard": {- id: "routes/dashboard",- parentId: "root",- path: "dashboard",- index: void 0,- caseSensitive: void 0,- module: dashboard_exports- },- "routes/dashboard/index": {- id: "routes/dashboard/index",- parentId: "routes/dashboard",- path: void 0,- index: !0,- caseSensitive: void 0,- module: dashboard_exports2- },- "routes/auth/dev": {- id: "routes/auth/dev",- parentId: "root",- path: "auth/dev",- index: void 0,- caseSensitive: void 0,- module: dev_exports- },- "routes/designer": {- id: "routes/designer",- parentId: "root",- path: "designer",- index: void 0,- caseSensitive: void 0,- module: designer_exports- },- "routes/designer/$id": {- id: "routes/designer/$id",- parentId: "routes/designer",- path: ":id",- index: void 0,- caseSensitive: void 0,- module: id_exports- },- "routes/preview": {- id: "routes/preview",- parentId: "root",- path: "preview",- index: void 0,- caseSensitive: void 0,- module: preview_exports- },- "routes/preview/$projectId": {- id: "routes/preview/$projectId",- parentId: "routes/preview",- path: ":projectId",- index: void 0,- caseSensitive: void 0,- module: projectId_exports- },- "routes/canvas": {- id: "routes/canvas",- parentId: "root",- path: "canvas",- index: void 0,- caseSensitive: void 0,- module: canvas_exports- },- "routes/canvas/$projectId": {- id: "routes/canvas/$projectId",- parentId: "routes/canvas",- path: ":projectId",- index: void 0,- caseSensitive: void 0,- module: projectId_exports2- },- "routes/logout": {- id: "routes/logout",- parentId: "root",- path: "logout",- index: void 0,- caseSensitive: void 0,- module: logout_exports- },- "routes/index": {- id: "routes/index",- parentId: "root",- path: void 0,- index: !0,- caseSensitive: void 0,- module: routes_exports- },- "routes/login": {- id: "routes/login",- parentId: "root",- path: "login",- index: void 0,- caseSensitive: void 0,- module: login_exports- },- "routes/login/index": {- id: "routes/login/index",- parentId: "routes/login",- path: void 0,- index: !0,- caseSensitive: void 0,- module: login_exports2- }-};-module.exports = __toCommonJS(stdin_exports);-// Annotate the CommonJS export names for ESM import in node:-0 && (module.exports = {- assets,- entry,- routes-});-//# sourceMappingURL=index.js.mapdiff --git a/apps/designer/api/_build/index.js.map b/apps/designer/api/_build/index.js.mapdeleted file mode 100644index 8dbeb7e589..0000000000--- a/apps/designer/api/_build/index.js.map+++ /dev/null@@ -1,7 +0,0 @@-{- "version": 3,- "sources": ["<stdin>", "../../../../node_modules/@remix-run/dev/dist/compiler/shims/react.ts", "../../app/entry.server.tsx", "../../app/critical-css.ts", "../../app/shared/design-system/stitches.config.ts", "../../app/shared/design-system/index.ts", "../../app/shared/design-system/components/label.tsx", "../../app/shared/design-system/components/text.tsx", "../../app/shared/design-system/components/toggle-group.tsx", "../../app/shared/design-system/components/select.tsx", "../../app/shared/icons/index.ts", "../../app/shared/icons/list-nested.tsx", "../../app/shared/icons/brush.tsx", "../../app/shared/icons/form.tsx", "../../app/shared/icons/undo.tsx", "../../app/shared/icons/redo.tsx", "../../app/shared/icons/google.tsx", "../../app/shared/icons/github.tsx", "../../app/shared/icons/devices.tsx", "../../app/shared/icons/tablet.tsx", "../../app/shared/design-system/components/text-field.tsx", "../../app/shared/design-system/components/flex.tsx", "../../app/shared/design-system/components/grid.tsx", "../../app/shared/design-system/components/tabs.tsx", "../../app/shared/design-system/components/sidebar-tabs.tsx", "../../app/shared/design-system/components/card.tsx", "../../app/shared/design-system/components/simple-toggle.tsx", "../../app/shared/design-system/components/box.tsx", "../../app/shared/design-system/components/tooltip.tsx", "../../app/shared/design-system/components/button.tsx", "../../app/shared/design-system/components/icon-button.tsx", "../../app/shared/design-system/components/popover.tsx", "../../app/shared/design-system/components/panel.tsx", "../../app/shared/design-system/components/heading.tsx", "../../app/shared/design-system/components/menu.tsx", "../../app/shared/design-system/components/paragraph.tsx", "../../app/shared/design-system/components/link.tsx", "../../app/shared/design-system/components/dropdown-menu.tsx", "../../app/shared/design-system/components/switch.tsx", "../../app/shared/design-system/components/slider.tsx", "../../app/shared/design-system/components/radio.tsx", "../../app/shared/design-system/components/combobox.tsx", "../../app/config.ts", "../../app/shared/sentry.ts", "../../app/shared/env/namespace.ts", "../../app/shared/env/env.tsx", "../../app/shared/env/env-getter.ts", "../../app/shared/db/prisma.server.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/root.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/breakpoints.$projectId.ts", "../../app/shared/db/tree.server.ts", "../../app/shared/tree-utils/create-instance.ts", "../../app/shared/canvas-components/primitives/index.ts", "../../app/shared/canvas-components/primitives/box.tsx", "../../app/shared/canvas-components/primitives/text-block.tsx", "../../app/shared/canvas-components/primitives/heading.tsx", "../../app/shared/canvas-components/primitives/paragraph.tsx", "../../app/shared/canvas-components/primitives/link.tsx", "../../app/shared/canvas-components/primitives/bold.tsx", "../../app/shared/canvas-components/primitives/italic.tsx", "../../app/shared/canvas-components/primitives/button.tsx", "../../app/shared/canvas-components/primitives/input.tsx", "../../app/shared/canvas-components/primitives/form.tsx", "../../app/shared/tree-utils/delete-instance.ts", "../../app/shared/tree-utils/insert-instance.ts", "../../app/shared/tree-utils/populate.ts", "../../app/shared/tree-utils/find-instance.ts", "../../app/shared/tree-utils/index.ts", "../../app/shared/tree-utils/set-instance-style.ts", "../../app/shared/tree-utils/set-instance-children.ts", "../../app/shared/tree-utils/get-instance-path.ts", "../../app/shared/tree-utils/find-closest-sibling-instance.ts", "../../app/shared/tree-utils/find-parent-instance.ts", "../../app/shared/tree-utils/clone-instance.ts", "../../app/shared/breakpoints/sort.ts", "../../app/shared/db/project.server.ts", "../../app/shared/db/props.server.ts", "../../app/shared/db/misc.server.ts", "../../app/shared/db/canvas.server.ts", "../../app/shared/db/breakpoints.server.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/project/clone.$domain.ts", "../../app/shared/session/user.server.ts", "../../app/shared/session/use-login-error-message.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/props.$projectId.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/tree.$projectId.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/publish.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/github.tsx", "../../app/services/auth.server.ts", "../../app/services/session.server.ts", "../../app/shared/db/user.server.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/github/callback.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/google.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/google/callback.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/patch.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/dashboard.tsx", "../../app/shared/documents/designer.tsx", "../../app/env.server.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/dashboard/index.tsx", "../../app/dashboard/dashboard.tsx", "../../app/dashboard/components/header.tsx", "../../app/shared/design-system/components/avatar.tsx", "../../app/shared/design-system/components/status.tsx", "../../app/dashboard/components/card.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/dev.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/designer.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/designer/$id.tsx", "../../app/designer/designer.tsx", "../../app/designer/features/sidebar-left/sidebar-left.tsx", "../../app/designer/shared/nano-states/index.ts", "../../app/designer/features/sidebar-left/panels/index.ts", "../../app/designer/features/sidebar-left/panels/components/index.ts", "../../app/designer/features/sidebar-left/panels/components/components.tsx", "../../app/designer/features/sidebar-left/panels/components/custom-drag-layer.tsx", "../../app/designer/features/sidebar-left/panels/components/component-thumb.tsx", "../../app/designer/features/sidebar-left/panels/tree.tsx", "../../app/designer/shared/instance/use-selected-instance-path.ts", "../../app/shared/nano-states/nano-states.ts", "../../app/shared/nano-states/use-subscribe-scroll-state.ts", "../../app/designer/shared/tree/tree.tsx", "../../app/designer/shared/breakpoints/will-render.ts", "../../app/designer/features/style-panel/use-style-data.ts", "../../app/designer/features/style-panel/parse-css-value.ts", "../../app/designer/features/style-panel/get-inherited-style.ts", "../../app/designer/features/style-panel/lib/utils/get-css-rule-for-breakpoint.ts", "../../app/designer/shared/inspector/collapsible-section.tsx", "../../app/designer/shared/inspector/component-info.tsx", "../../app/designer/features/style-panel/settings.tsx", "../../app/shared/style-panel-configs/configs.ts", "../../app/shared/string-utils/index.ts", "../../app/designer/features/style-panel/render-property.tsx", "../../app/designer/features/style-panel/lib/color-picker.tsx", "../../app/designer/features/style-panel/lib/spacing-widget.tsx", "../../app/designer/features/style-panel/lib/utils/use-is-from-current-breakpoint.ts", "../../app/designer/features/style-panel/lib/constants.ts", "../../app/designer/features/style-panel/dependencies.ts", "../../app/designer/features/style-panel/search.tsx", "../../app/designer/features/style-panel/style-panel.tsx", "../../app/designer/features/props-panel/props-panel.tsx", "../../app/designer/features/props-panel/control.tsx", "../../app/shared/design-system/components/checkbox.tsx", "../../app/designer/features/props-panel/use-props-logic.ts", "../../app/designer/features/inspector/inspector.tsx", "../../app/designer/features/topbar/preview.tsx", "../../app/designer/features/topbar/share.tsx", "../../app/designer/features/topbar/publish.tsx", "../../app/designer/features/topbar/sync-status.tsx", "../../app/designer/features/topbar/menu/menu.tsx", "../../app/designer/features/topbar/menu/shortcut-hint.tsx", "../../app/designer/features/breakpoints/breakpoints.tsx", "../../app/designer/features/breakpoints/breakpoints-editor.tsx", "../../app/designer/features/breakpoints/preview.tsx", "../../app/designer/features/breakpoints/zoom-setting.tsx", "../../app/designer/features/breakpoints/trigger-button.tsx", "../../app/designer/features/breakpoints/width-setting.tsx", "../../app/designer/features/breakpoints/use-subscribe-shortcuts.ts", "../../app/designer/features/breakpoints/confirmation-dialog.tsx", "../../app/designer/features/breakpoints/use-update-canvas-width.ts", "../../app/designer/features/breakpoints/use-subscribe-breakpoints.ts", "../../app/designer/features/topbar/topbar.tsx", "../../app/designer/features/breadcrumbs/breadcrumbs.tsx", "../../app/designer/features/tree-preview/tree-preview.tsx", "../../app/designer/features/workspace/canvas-tools/outline/outline.tsx", "../../app/designer/features/workspace/canvas-tools/outline/label.tsx", "../../app/designer/features/workspace/canvas-tools/outline/selected-instance-outline.tsx", "../../app/designer/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx", "../../app/designer/features/workspace/canvas-tools/text-toolbar/text-toolbar.tsx", "../../app/designer/features/workspace/canvas-tools/hooks/use-subscribe-instance-rect.ts", "../../app/designer/features/workspace/canvas-tools/hooks/use-subscribe-selection-rect.ts", "../../app/designer/features/workspace/canvas-tools/hooks/use-subscribe-editing-instance-id.ts", "../../app/designer/features/workspace/canvas-tools/canvas-tools.tsx", "../../app/designer/features/workspace/workspace.tsx", "../../app/designer/features/workspace/use-read-canvas-rect.ts", "../../app/shared/dom-hooks/use-window-resize.ts", "../../app/shared/dom-hooks/use-measure.ts", "../../app/shared/dom-hooks/use-scroll-state.ts", "../../app/designer/features/workspace/canvas-iframe.tsx", "../../app/designer/shared/shortcuts/use-publish-shortcuts.ts", "../../app/shared/shortcuts/index.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/preview.tsx", "../../app/shared/documents/canvas.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/preview/$projectId.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/canvas.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/canvas/$projectId.tsx", "../../app/canvas/canvas.tsx", "../../app/canvas/shared/use-drag-drop-handlers.ts", "../../app/shared/dom-utils/find-closest-child.ts", "../../app/shared/dom-utils/find-insertion-index.ts", "../../app/shared/dom-utils/get-drag-over-info.ts", "../../app/canvas/shared/nano-states.ts", "../../app/canvas/shared/use-shortcuts.ts", "../../app/canvas/shared/copy-paste.ts", "../../app/shared/props-utils/update-props.ts", "../../app/shared/props-utils/delete-prop.ts", "../../app/shared/props-utils/clone-props.ts", "../../app/canvas/shared/instance.ts", "../../app/canvas/shared/style.ts", "../../app/canvas/shared/use-track-selected-element.ts", "../../app/canvas/features/wrapper-component/wrapper-component.tsx", "../../app/canvas/features/wrapper-component/use-css.tsx", "../../app/canvas/features/wrapper-component/use-draggable.ts", "../../app/canvas/features/wrapper-component/use-ensure-focus.ts", "../../app/canvas/features/wrapper-component/text-editor/lexical.ts", "../../app/canvas/features/wrapper-component/text-editor/nodes/node-instance.tsx", "../../app/canvas/features/wrapper-component/text-editor/config.ts", "../../app/canvas/features/wrapper-component/text-editor/hooks/use-content-editable.tsx", "../../app/canvas/features/wrapper-component/text-editor/plugins/plugin-instance.tsx", "../../app/canvas/features/wrapper-component/text-editor/utils/to-lexical-nodes.tsx", "../../app/canvas/features/wrapper-component/text-editor/plugins/plugin-toolbar-connector.tsx", "../../app/canvas/features/wrapper-component/text-editor/plugins/plugin-on-change.tsx", "../../app/canvas/features/wrapper-component/text-editor/utils/to-updates.ts", "../../app/canvas/features/wrapper-component/text-editor/editor.tsx", "../../app/canvas/shared/sync/use-sync.ts", "../../app/canvas/shared/sync/queue.ts", "../../app/canvas/shared/props.ts", "../../app/canvas/shared/breakpoints.ts", "../../app/shared/css-utils/delete-css-rules-by-breakpoint.ts", "../../app/canvas/shared/immerhin.ts", "../../app/canvas/shared/use-track-hovered-element.ts", "../../app/canvas/shared/use-publish-scroll-state.ts", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/logout.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/index.tsx", "../../app/routes/canvas.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/login.tsx", "/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/login/index.tsx", "../../app/auth/login.tsx", "../../app/auth/components/login-button.tsx", "server-assets-manifest:@remix-run/dev/assets-manifest", "server-entry-module:@remix-run/dev/server-build"],- "sourcesContent": ["export * from \"@remix-run/dev/server-build\";", "// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as React from \"react\";\nexport { React };\n", "import { renderToString } from \"react-dom/server\";\nimport { RemixServer } from \"@remix-run/react\";\nimport { insertCriticalCss } from \"./critical-css\";\nimport type { EntryContext } from \"@remix-run/node\";\nimport * as Sentry from \"@sentry/remix\";\nimport { initSentry } from \"./shared/sentry\";\nimport { prisma } from \"./shared/db/prisma.server\";\n\ninitSentry({\n integrations: [new Sentry.Integrations.Prisma({ client: prisma })],\n});\n\nexport default function handleRequest(\n request: Request,\n responseStatusCode: number,\n responseHeaders: Headers,\n remixContext: EntryContext\n) {\n let markup = renderToString(\n <RemixServer context={remixContext} url={request.url} />\n );\n\n markup = insertCriticalCss(markup, request.url);\n\n responseHeaders.set(\"Content-Type\", \"text/html\");\n\n return new Response(\"<!DOCTYPE html>\" + markup, {\n status: responseStatusCode,\n headers: responseHeaders,\n });\n}\n", "import {\n insertCriticalCss as insert,\n getCssText as getCanvasCssText,\n} from \"@webstudio-is/sdk\";\nimport { getCssText as getDesignerCssText } from \"apps/designer/app/shared/design-system\";\nimport config from \"./config\";\n\nconst getCssTextFunctions = {\n [config.previewPath]: getCanvasCssText,\n [config.canvasPath]: getCanvasCssText,\n [config.designerPath]: getDesignerCssText,\n [config.dashboardPath]: getDesignerCssText,\n [config.loginPath]: getDesignerCssText,\n};\n\nconst getCssTextFunction = (url: string) => {\n const { pathname } = new URL(url);\n let path: keyof typeof getCssTextFunctions;\n for (path in getCssTextFunctions) {\n if (pathname.indexOf(path) === 0) {\n return getCssTextFunctions[path];\n }\n }\n return getCanvasCssText;\n};\n\n/**\n * This works around the problem with getCssTextfunction being a different one\n * depending on createStitches() used in each outlet.\n * @todo find a better way\n */\nexport const insertCriticalCss = (markup: string, url: string): string => {\n return insert(markup, getCssTextFunction(url));\n};\n", "import { createStitches } from \"@stitches/react\";\nimport {\n amber,\n amberA,\n amberDark,\n amberDarkA,\n blackA,\n blue,\n blueA,\n blueDark,\n blueDarkA,\n bronze,\n bronzeA,\n bronzeDark,\n bronzeDarkA,\n brown,\n brownA,\n brownDark,\n brownDarkA,\n crimson,\n crimsonA,\n crimsonDark,\n crimsonDarkA,\n cyan,\n cyanA,\n cyanDark,\n cyanDarkA,\n gold,\n goldA,\n goldDark,\n goldDarkA,\n grass,\n grassA,\n grassDark,\n grassDarkA,\n gray,\n grayA,\n grayDark,\n grayDarkA,\n green,\n greenA,\n greenDark,\n greenDarkA,\n indigo,\n indigoA,\n indigoDark,\n indigoDarkA,\n lime,\n limeA,\n limeDark,\n limeDarkA,\n mauve,\n mauveA,\n mauveDark,\n mauveDarkA,\n mint,\n mintA,\n mintDark,\n mintDarkA,\n olive,\n oliveA,\n oliveDark,\n oliveDarkA,\n orange,\n orangeA,\n orangeDark,\n orangeDarkA,\n pink,\n pinkA,\n pinkDark,\n pinkDarkA,\n plum,\n plumA,\n plumDark,\n plumDarkA,\n purple,\n purpleA,\n purpleDark,\n purpleDarkA,\n red,\n redA,\n redDark,\n redDarkA,\n sage,\n sageA,\n sageDark,\n sageDarkA,\n sand,\n sandA,\n sandDark,\n sandDarkA,\n sky,\n skyA,\n skyDark,\n skyDarkA,\n slate,\n slateA,\n slateDark,\n slateDarkA,\n teal,\n tealA,\n tealDark,\n tealDarkA,\n tomato,\n tomatoA,\n tomatoDark,\n tomatoDarkA,\n violet,\n violetA,\n violetDark,\n violetDarkA,\n whiteA,\n yellow,\n yellowA,\n yellowDark,\n yellowDarkA,\n} from \"@radix-ui/colors\";\nimport type * as Stitches from \"@stitches/react\";\nexport type { VariantProps } from \"@stitches/react\";\n\nexport const {\n styled,\n css,\n theme,\n createTheme,\n getCssText,\n globalCss,\n keyframes,\n config,\n reset,\n} = createStitches({\n theme: {\n colors: {\n ...gray,\n ...mauve,\n ...slate,\n ...sage,\n ...olive,\n ...sand,\n ...tomato,\n ...red,\n ...crimson,\n ...pink,\n ...plum,\n ...purple,\n ...violet,\n ...indigo,\n ...blue,\n ...sky,\n ...mint,\n ...cyan,\n ...teal,\n ...green,\n ...grass,\n ...lime,\n ...yellow,\n ...amber,\n ...orange,\n ...brown,\n ...bronze,\n ...gold,\n\n ...grayA,\n ...mauveA,\n ...slateA,\n ...sageA,\n ...oliveA,\n ...sandA,\n ...tomatoA,\n ...redA,\n ...crimsonA,\n ...pinkA,\n ...plumA,\n ...purpleA,\n ...violetA,\n ...indigoA,\n ...blueA,\n ...skyA,\n ...mintA,\n ...cyanA,\n ...tealA,\n ...greenA,\n ...grassA,\n ...limeA,\n ...yellowA,\n ...amberA,\n ...orangeA,\n ...brownA,\n ...bronzeA,\n ...goldA,\n\n ...whiteA,\n ...blackA,\n\n // Semantic colors\n hiContrast: \"$slate12\",\n loContrast: \"$slate1\",\n muted: \"$slate6\",\n primary: \"$blue12\",\n canvas: \"hsl(0 0% 93%)\",\n panel: \"white\",\n transparentPanel: \"hsl(0 0% 0% / 97%)\",\n shadowLight: \"hsl(206 22% 7% / 35%)\",\n shadowDark: \"hsl(206 22% 7% / 20%)\",\n background: \"$slate1\",\n text: \"$slate12\",\n },\n fonts: {\n sans: \"Inter, -apple-system, system-ui, sans-serif\",\n mono: \"S\u00F6hne Mono, menlo, monospace\",\n },\n space: {\n 1: \"5px\",\n 2: \"10px\",\n 3: \"15px\",\n 4: \"20px\",\n 5: \"25px\",\n 6: \"35px\",\n 7: \"45px\",\n 8: \"65px\",\n 9: \"80px\",\n },\n sizes: {\n 1: \"5px\",\n 2: \"10px\",\n 3: \"15px\",\n 4: \"20px\",\n 5: \"25px\",\n 6: \"35px\",\n 7: \"45px\",\n 8: \"65px\",\n 9: \"80px\",\n },\n // space: {\n // 1: '4px',\n // 2: '8px',\n // 3: '16px',\n // 4: '20px',\n // 5: '24px',\n // 6: '32px',\n // 7: '48px',\n // 8: '64px',\n // 9: '80px',\n // },\n // sizes: {\n // 1: '4px',\n // 2: '8px',\n // 3: '16px',\n // 4: '20px',\n // 5: '24px',\n // 6: '32px',\n // 7: '48px',\n // 8: '64px',\n // 9: '80px',\n // },\n fontSizes: {\n 1: \"12px\",\n 2: \"13px\",\n 3: \"15px\",\n 4: \"17px\",\n 5: \"19px\",\n 6: \"21px\",\n 7: \"27px\",\n 8: \"35px\",\n 9: \"59px\",\n },\n // fontSizes: {\n // 1: '11px',\n // 2: '12px',\n // 3: '15px',\n // 4: '17px',\n // 5: '20px',\n // 6: '22px',\n // 7: '28px',\n // 8: '36px',\n // 9: '60px',\n // },\n radii: {\n 1: \"4px\",\n 2: \"6px\",\n 3: \"8px\",\n 4: \"12px\",\n round: \"50%\",\n pill: \"9999px\",\n },\n zIndices: {\n 1: \"100\",\n 2: \"200\",\n 3: \"300\",\n 4: \"400\",\n max: \"999\",\n },\n },\n media: {\n bp1: \"(min-width: 520px)\",\n bp2: \"(min-width: 900px)\",\n bp3: \"(min-width: 1200px)\",\n bp4: \"(min-width: 1800px)\",\n motion: \"(prefers-reduced-motion)\",\n hover: \"(any-hover: hover)\",\n dark: \"(prefers-color-scheme: dark)\",\n light: \"(prefers-color-scheme: light)\",\n },\n utils: {\n p: (value: Stitches.PropertyValue<\"padding\">) => ({\n padding: value,\n }),\n pt: (value: Stitches.PropertyValue<\"paddingTop\">) => ({\n paddingTop: value,\n }),\n pr: (value: Stitches.PropertyValue<\"paddingRight\">) => ({\n paddingRight: value,\n }),\n pb: (value: Stitches.PropertyValue<\"paddingBottom\">) => ({\n paddingBottom: value,\n }),\n pl: (value: Stitches.PropertyValue<\"paddingLeft\">) => ({\n paddingLeft: value,\n }),\n px: (value: Stitches.PropertyValue<\"paddingLeft\">) => ({\n paddingLeft: value,\n paddingRight: value,\n }),\n py: (value: Stitches.PropertyValue<\"paddingTop\">) => ({\n paddingTop: value,\n paddingBottom: value,\n }),\n\n m: (value: Stitches.PropertyValue<\"margin\">) => ({\n margin: value,\n }),\n mt: (value: Stitches.PropertyValue<\"marginTop\">) => ({\n marginTop: value,\n }),\n mr: (value: Stitches.PropertyValue<\"marginRight\">) => ({\n marginRight: value,\n }),\n mb: (value: Stitches.PropertyValue<\"marginBottom\">) => ({\n marginBottom: value,\n }),\n ml: (value: Stitches.PropertyValue<\"marginLeft\">) => ({\n marginLeft: value,\n }),\n mx: (value: Stitches.PropertyValue<\"marginLeft\">) => ({\n marginLeft: value,\n marginRight: value,\n }),\n my: (value: Stitches.PropertyValue<\"marginTop\">) => ({\n marginTop: value,\n marginBottom: value,\n }),\n\n ta: (value: Stitches.PropertyValue<\"textAlign\">) => ({ textAlign: value }),\n\n fd: (value: Stitches.PropertyValue<\"flexDirection\">) => ({\n flexDirection: value,\n }),\n fw: (value: Stitches.PropertyValue<\"flexWrap\">) => ({ flexWrap: value }),\n\n ai: (value: Stitches.PropertyValue<\"alignItems\">) => ({\n alignItems: value,\n }),\n ac: (value: Stitches.PropertyValue<\"alignContent\">) => ({\n alignContent: value,\n }),\n jc: (value: Stitches.PropertyValue<\"justifyContent\">) => ({\n justifyContent: value,\n }),\n as: (value: Stitches.PropertyValue<\"alignSelf\">) => ({ alignSelf: value }),\n fg: (value: Stitches.PropertyValue<\"flexGrow\">) => ({ flexGrow: value }),\n fs: (value: Stitches.PropertyValue<\"flexShrink\">) => ({\n flexShrink: value,\n }),\n fb: (value: Stitches.PropertyValue<\"flexBasis\">) => ({ flexBasis: value }),\n\n bc: (value: Stitches.PropertyValue<\"backgroundColor\">) => ({\n backgroundColor: value,\n }),\n\n br: (value: Stitches.PropertyValue<\"borderRadius\">) => ({\n borderRadius: value,\n }),\n btrr: (value: Stitches.PropertyValue<\"borderTopRightRadius\">) => ({\n borderTopRightRadius: value,\n }),\n bbrr: (value: Stitches.PropertyValue<\"borderBottomRightRadius\">) => ({\n borderBottomRightRadius: value,\n }),\n bblr: (value: Stitches.PropertyValue<\"borderBottomLeftRadius\">) => ({\n borderBottomLeftRadius: value,\n }),\n btlr: (value: Stitches.PropertyValue<\"borderTopLeftRadius\">) => ({\n borderTopLeftRadius: value,\n }),\n\n bs: (value: Stitches.PropertyValue<\"boxShadow\">) => ({ boxShadow: value }),\n\n lh: (value: Stitches.PropertyValue<\"lineHeight\">) => ({\n lineHeight: value,\n }),\n\n ox: (value: Stitches.PropertyValue<\"overflowX\">) => ({ overflowX: value }),\n oy: (value: Stitches.PropertyValue<\"overflowY\">) => ({ overflowY: value }),\n\n pe: (value: Stitches.PropertyValue<\"pointerEvents\">) => ({\n pointerEvents: value,\n }),\n us: (value: Stitches.PropertyValue<\"userSelect\">) => ({\n WebkitUserSelect: value,\n userSelect: value,\n }),\n\n userSelect: (value: Stitches.PropertyValue<\"userSelect\">) => ({\n WebkitUserSelect: value,\n userSelect: value,\n }),\n\n size: (value: Stitches.PropertyValue<\"width\">) => ({\n width: value,\n height: value,\n }),\n\n appearance: (value: Stitches.PropertyValue<\"appearance\">) => ({\n WebkitAppearance: value,\n appearance: value,\n }),\n backgroundClip: (value: Stitches.PropertyValue<\"backgroundClip\">) => ({\n WebkitBackgroundClip: value,\n backgroundClip: value,\n }),\n },\n});\n\nexport type CSS = Stitches.CSS<typeof config>;\n\nexport const darkTheme = createTheme(\"dark-theme\", {\n colors: {\n ...grayDark,\n ...mauveDark,\n ...slateDark,\n ...sageDark,\n ...oliveDark,\n ...sandDark,\n ...tomatoDark,\n ...redDark,\n ...crimsonDark,\n ...pinkDark,\n ...plumDark,\n ...purpleDark,\n ...violetDark,\n ...indigoDark,\n ...blueDark,\n ...skyDark,\n ...mintDark,\n ...cyanDark,\n ...tealDark,\n ...greenDark,\n ...grassDark,\n ...limeDark,\n ...yellowDark,\n ...amberDark,\n ...orangeDark,\n ...brownDark,\n ...bronzeDark,\n ...goldDark,\n\n ...grayDarkA,\n ...mauveDarkA,\n ...slateDarkA,\n ...sageDarkA,\n ...oliveDarkA,\n ...sandDarkA,\n ...tomatoDarkA,\n ...redDarkA,\n ...crimsonDarkA,\n ...pinkDarkA,\n ...plumDarkA,\n ...purpleDarkA,\n ...violetDarkA,\n ...indigoDarkA,\n ...blueDarkA,\n ...skyDarkA,\n ...mintDarkA,\n ...cyanDarkA,\n ...tealDarkA,\n ...greenDarkA,\n ...grassDarkA,\n ...limeDarkA,\n ...yellowDarkA,\n ...amberDarkA,\n ...orangeDarkA,\n ...brownDarkA,\n ...bronzeDarkA,\n ...goldDarkA,\n\n // Semantic colors\n muted: \"$slate8\",\n primary: \"$blue9\",\n hiContrast: \"$slate12\",\n loContrast: \"$slate1\",\n canvas: \"hsl(0 0% 15%)\",\n panel: \"$slate3\",\n transparentPanel: \"hsl(0 100% 100% / 97%)\",\n shadowLight: \"hsl(206 22% 7% / 35%)\",\n shadowDark: \"hsl(206 22% 7% / 20%)\",\n\n background: \"$slate12\",\n text: \"$slate1\",\n },\n});\n", "export {\n config,\n createTheme,\n css,\n darkTheme,\n getCssText,\n globalCss,\n keyframes,\n reset,\n styled,\n theme,\n type CSS,\n} from \"./stitches.config\";\n\nexport * as Collapsible from \"@radix-ui/react-collapsible\";\nexport { AccessibleIcon } from \"@radix-ui/react-accessible-icon\";\nexport * as Portal from \"@radix-ui/react-portal\";\n\nexport { Container } from \"./components/container\";\nexport { Label } from \"./components/label\";\nexport * as ToggleGroup from \"./components/toggle-group\";\nexport * from \"./components/select\";\nexport { TextField } from \"./components/text-field\";\nexport { Flex } from \"./components/flex\";\nexport { Grid } from \"./components/grid\";\nexport { Tabs, TabsContent, TabsList, TabsTrigger } from \"./components/tabs\";\nexport {\n SidebarTabs,\n SidebarTabsContent,\n SidebarTabsList,\n SidebarTabsTrigger,\n} from \"./components/sidebar-tabs\";\nexport { Text } from \"./components/text\";\nexport { Card } from \"./components/card\";\nexport { SimpleToggle } from \"./components/simple-toggle\";\nexport { ScrollArea } from \"./components/scrollbar\";\nexport { Tooltip } from \"./components/tooltip\";\nexport { Button } from \"./components/button\";\nexport { IconButton } from \"./components/icon-button\";\nexport { Box } from \"./components/box\";\nexport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n PopoverClose,\n} from \"./components/popover\";\nexport { Heading } from \"./components/heading\";\nexport { MenuContent, MenuItem, Menu, MenuAnchor } from \"./components/menu\";\nexport { Paragraph } from \"./components/paragraph\";\nexport { Link } from \"./components/link\";\nexport { Panel } from \"./components/panel\";\nexport * from \"./components/dropdown-menu\";\nexport * from \"./components/switch\";\nexport * from \"./components/slider\";\nexport * from \"./components/control-group\";\nexport * from \"./components/radio\";\nexport * from \"./components/combobox\";\n", "import { styled } from \"../stitches.config\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Text } from \"./text\";\n\nexport const Label = styled(LabelPrimitive.Root, Text, {\n display: \"inline-block\",\n verticalAlign: \"middle\",\n cursor: \"default\",\n lineHeight: 1.5,\n});\n", "import { styled } from \"../stitches.config\";\n\nexport const Text = styled(\"div\", {\n // Reset\n lineHeight: \"1\",\n margin: \"0\",\n fontWeight: 400,\n fontVariantNumeric: \"tabular-nums\",\n display: \"block\",\n\n variants: {\n size: {\n \"1\": {\n fontSize: \"$1\",\n },\n \"2\": {\n fontSize: \"$2\",\n },\n \"3\": {\n fontSize: \"$3\",\n },\n \"4\": {\n fontSize: \"$4\",\n },\n \"5\": {\n fontSize: \"$5\",\n letterSpacing: \"-.015em\",\n },\n \"6\": {\n fontSize: \"$6\",\n letterSpacing: \"-.016em\",\n },\n \"7\": {\n fontSize: \"$7\",\n letterSpacing: \"-.031em\",\n textIndent: \"-.005em\",\n },\n \"8\": {\n fontSize: \"$8\",\n letterSpacing: \"-.034em\",\n textIndent: \"-.018em\",\n },\n \"9\": {\n fontSize: \"$9\",\n letterSpacing: \"-.055em\",\n textIndent: \"-.025em\",\n },\n },\n variant: {\n red: {\n color: \"$red11\",\n },\n crimson: {\n color: \"$crimson11\",\n },\n pink: {\n color: \"$pink11\",\n },\n purple: {\n color: \"$purple11\",\n },\n violet: {\n color: \"$violet11\",\n },\n indigo: {\n color: \"$indigo11\",\n },\n blue: {\n color: \"$blue11\",\n },\n cyan: {\n color: \"$cyan11\",\n },\n teal: {\n color: \"$teal11\",\n },\n green: {\n color: \"$green11\",\n },\n lime: {\n color: \"$lime11\",\n },\n yellow: {\n color: \"$yellow11\",\n },\n orange: {\n color: \"$orange11\",\n },\n gold: {\n color: \"$gold11\",\n },\n bronze: {\n color: \"$bronze11\",\n },\n gray: {\n color: \"$slate11\",\n },\n contrast: {\n color: \"$hiContrast\",\n },\n loContrast: {\n color: \"$loContrast\",\n },\n },\n gradient: {\n true: {\n WebkitBackgroundClip: \"text\",\n WebkitTextFillColor: \"transparent\",\n },\n },\n },\n compoundVariants: [\n {\n variant: \"red\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $red11, $crimson11)\",\n },\n },\n {\n variant: \"crimson\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $crimson11, $pink11)\",\n },\n },\n {\n variant: \"pink\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $pink11, $purple11)\",\n },\n },\n {\n variant: \"purple\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $purple11, $violet11)\",\n },\n },\n {\n variant: \"violet\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $violet11, $indigo11)\",\n },\n },\n {\n variant: \"indigo\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $indigo11, $blue11)\",\n },\n },\n {\n variant: \"blue\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $blue11, $cyan11)\",\n },\n },\n {\n variant: \"cyan\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $cyan11, $teal11)\",\n },\n },\n {\n variant: \"teal\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $teal11, $green11)\",\n },\n },\n {\n variant: \"green\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $green11, $lime11)\",\n },\n },\n {\n variant: \"lime\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $lime11, $yellow11)\",\n },\n },\n {\n variant: \"yellow\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $yellow11, $orange11)\",\n },\n },\n {\n variant: \"orange\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $orange11, $red11)\",\n },\n },\n {\n variant: \"gold\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $gold11, $gold9)\",\n },\n },\n {\n variant: \"bronze\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $bronze11, $bronze9)\",\n },\n },\n {\n variant: \"gray\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $gray11, $gray12)\",\n },\n },\n {\n variant: \"contrast\",\n gradient: \"true\",\n css: {\n background: \"linear-gradient(to right, $hiContrast, $gray12)\",\n },\n },\n ],\n defaultVariants: {\n size: \"3\",\n variant: \"contrast\",\n },\n});\n", "import { styled } from \"../stitches.config\";\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\n\nexport const Root = styled(ToggleGroupPrimitive.Root, {\n display: \"inline-flex\",\n backgroundColor: \"$slate5\",\n borderRadius: 4,\n boxShadow: `0 2px 10px $blackA7`,\n});\n\nexport const Item = styled(ToggleGroupPrimitive.Item, {\n all: \"unset\",\n backgroundColor: \"$panel\",\n color: \"$hiContrast\",\n display: \"flex\",\n whiteSpace: \"nowrap\",\n fontSize: 15,\n lineHeight: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n marginLeft: 1,\n \"&\": {\n px: \"$2\",\n py: \"$1\",\n },\n \"&:first-child\": {\n marginLeft: 0,\n borderTopLeftRadius: 4,\n borderBottomLeftRadius: 4,\n },\n \"&:last-child\": { borderTopRightRadius: 4, borderBottomRightRadius: 4 },\n \"&:hover\": { backgroundColor: \"$slateA3\" },\n \"&[data-state=on]\": {\n backgroundColor: \"$slateA5\",\n },\n \"&:focus\": {\n position: \"relative\",\n boxShadow: `0 0 0 2px black`,\n },\n});\n", "import * as SelectPrimitive from \"@radix-ui/react-select\";\nimport noop from \"lodash.noop\";\nimport React, { ReactNode, Ref } from \"react\";\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from \"apps/designer/app/shared/icons\";\nimport { styled } from \"../stitches.config\";\n\nconst StyledTrigger = styled(SelectPrimitive.SelectTrigger, {\n all: \"unset\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n fontVariantNumeric: \"tabular-nums\",\n gap: \"$2\",\n flexShrink: 0,\n borderRadius: \"$1\",\n backgroundColor: \"$loContrast\",\n color: \"$hiContrast\",\n boxShadow: \"inset 0 0 0 1px $colors$slate7\",\n \"&:hover\": {\n backgroundColor: \"$slateA3\",\n },\n \"&:focus\": {\n boxShadow:\n \"inset 0px 0px 0px 1px $colors$blue8, 0px 0px 0px 1px $colors$blue8\",\n },\n\n variants: {\n size: {\n 1: { padding: \"0 $1 0 $2\", fontSize: \"$1\", height: \"$5\" },\n 2: { padding: \"0 $2 0 $3\", height: \"$6\", fontSize: \"$3\" },\n },\n ghost: {\n true: {\n backgroundColor: \"transparent\",\n boxShadow: \"none\",\n },\n },\n fullWidth: {\n true: {\n width: \"100%\",\n },\n },\n },\n defaultVariants: {\n size: 1,\n },\n});\n\nconst StyledIcon = styled(SelectPrimitive.Icon, {\n display: \"inline-flex\",\n alignItems: \"center\",\n});\n\nconst StyledContent = styled(SelectPrimitive.Content, {\n overflow: \"hidden\",\n backgroundColor: \"$muted\",\n borderRadius: \"$1\",\n boxShadow:\n \"0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2)\",\n});\n\nconst StyledViewport = styled(SelectPrimitive.Viewport, {\n py: \"$1\",\n});\n\nconst StyledItem = styled(SelectPrimitive.Item, {\n all: \"unset\",\n fontSize: \"$1\",\n lineHeight: 1,\n color: \"$hiContrast\",\n display: \"flex\",\n alignItems: \"center\",\n height: \"$5\",\n padding: \"0 $6 0 $5\",\n position: \"relative\",\n userSelect: \"none\",\n\n \"&[data-disabled]\": {\n color: \"$muted\",\n pointerEvents: \"none\",\n },\n\n \"&:focus\": {\n backgroundColor: \"$primary\",\n color: \"$hiContrast\",\n },\n});\n\nconst StyledItemIndicator = styled(SelectPrimitive.ItemIndicator, {\n position: \"absolute\",\n left: 0,\n width: 25,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n});\n\nconst scrollButtonStyles = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: 25,\n color: \"$text\",\n cursor: \"default\",\n};\n\nconst SelectScrollUpButton = styled(\n SelectPrimitive.ScrollUpButton,\n scrollButtonStyles\n);\n\nconst SelectScrollDownButton = styled(\n SelectPrimitive.ScrollDownButton,\n scrollButtonStyles\n);\n\nconst SelectItemBase = (\n { children, ...props }: SelectItemProps,\n forwardedRef: Ref<HTMLDivElement>\n) => {\n return (\n <StyledItem {...props} ref={forwardedRef}>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <StyledItemIndicator>\n <CheckIcon />\n </StyledItemIndicator>\n </StyledItem>\n );\n};\n\ntype SelectItemProps = SelectPrimitive.SelectItemProps & {\n children: ReactNode;\n};\nconst SelectItem = React.forwardRef(SelectItemBase);\n\nexport type SelectOption = string;\n\nexport type SelectProps<T = SelectOption> = Omit<\n React.ComponentProps<typeof StyledTrigger>,\n \"onChange\" | \"value\" | \"defaultValue\"\n> & {\n options: T[];\n defaultValue?: T;\n value?: T;\n onChange?: (option: T) => void;\n placeholder?: string;\n getLabel?: (option: T) => string | undefined;\n};\n\nconst SelectBase = (\n {\n options,\n value,\n defaultValue,\n placeholder = \"Select an option\",\n onChange = noop,\n getLabel = (option) => option,\n name,\n ...props\n }: SelectProps,\n forwardedRef: Ref<HTMLButtonElement>\n) => {\n return (\n <SelectPrimitive.Root\n name={name}\n value={value}\n defaultValue={defaultValue}\n onValueChange={onChange}\n >\n <StyledTrigger ref={forwardedRef} {...props}>\n <SelectPrimitive.Value>\n {value ? getLabel(value) : placeholder}\n </SelectPrimitive.Value>\n <StyledIcon>\n <CaretSortIcon />\n </StyledIcon>\n </StyledTrigger>\n\n <StyledContent>\n <SelectScrollUpButton>\n <ChevronUpIcon />\n </SelectScrollUpButton>\n <StyledViewport>\n {options.map((option) => (\n <SelectItem key={option} value={option} textValue={option}>\n {getLabel(option)}\n </SelectItem>\n ))}\n </StyledViewport>\n <SelectScrollDownButton>\n <ChevronDownIcon />\n </SelectScrollDownButton>\n </StyledContent>\n </SelectPrimitive.Root>\n );\n};\n\nexport const Select = React.forwardRef(SelectBase);\nSelect.displayName = \"Select\";\n", "export * from \"@radix-ui/react-icons\";\nexport * from \"./list-nested\";\nexport * from \"./brush\";\nexport * from \"./form\";\nexport * from \"./undo\";\nexport * from \"./redo\";\nexport * from \"./google\";\nexport * from \"./github\";\nexport * from \"./devices\";\nexport * from \"./tablet\";\nexport * from \"./types\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const ListNestedIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n width=\"15\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fill={color}\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z\"\n />\n </svg>\n );\n }\n);\n\nListNestedIcon.displayName = \"ListNestedIcon\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const BrushIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n width=\"15\"\n height=\"15\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fill={color}\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37-1.34-1.34a.9959.9959 0 0 0-1.41 0L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41z\"\n />\n </svg>\n );\n }\n);\n\nBrushIcon.displayName = \"BrushIcon\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const FormIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n width=\"15\"\n height=\"15\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fill={color}\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M13 11H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h9v7zM4 9h7V6H4v3zm11 11H4c-1.1 0-2-.9-2-2v-3c0-1.1.9-2 2-2h11v7zM4 18h9v-3H4v3zm18-9h-2l2-5h-7v7h2v9l5-11zM4.75 17.25h1.5v-1.5h-1.5v1.5zm0-9h1.5v-1.5h-1.5v1.5z\"\n />\n </svg>\n );\n }\n);\n\nFormIcon.displayName = \"FormIcon\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const UndoIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"15\"\n width=\"15\"\n viewBox=\"0 0 24 24\"\n fill={color}\n {...props}\n ref={forwardedRef}\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\" />\n </svg>\n );\n }\n);\n\nUndoIcon.displayName = \"UndoIcon\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const RedoIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"15\"\n width=\"15\"\n viewBox=\"0 0 24 24\"\n fill={color}\n {...props}\n ref={forwardedRef}\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\" />\n </svg>\n );\n }\n);\n\nRedoIcon.displayName = \"RedoIcon\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const GoogleIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <title>Google</title>\n <path\n d=\"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z\"\n fill={color}\n />\n </svg>\n );\n }\n);\n\nGoogleIcon.displayName = \"GoogleIcon\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const GithubIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <title>GitHub</title>\n <path\n d=\"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\"\n fill={color}\n />\n </svg>\n );\n }\n);\n\nGithubIcon.displayName = \"GithubIcon\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const DevicesIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n width=\"15\"\n height=\"15\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fill={color}\n d=\"M22.265 9.51L17.265 9.5C16.715 9.5 16.265 9.95 16.265 10.5V19.5C16.265 20.05 16.715 20.5 17.265 20.5H22.265C22.815 20.5 23.265 20.05 23.265 19.5V10.5C23.265 9.95 22.815 9.51 22.265 9.51ZM22.265 19.5H17.265V10.5H19.5H22.265V19.5ZM20.265 1.5H2.26499C1.15499 1.5 0.264988 2.39 0.264988 3.5V15.5C0.264988 16.6 1.15499 17.5 2.26499 17.5H10.5V19.5H7.26499V20.5H15.265V19.5H12.5V17.5H15.265V16.5H1.26499V2.5H21.265V8.5H22.265V3.5C22.265 2.39 21.365 1.5 20.265 1.5Z\"\n />\n </svg>\n );\n }\n);\n\nDevicesIcon.displayName = \"DevicesIcon\";\n", "import * as React from \"react\";\nimport { IconProps } from \"./types\";\n\nexport const TabletIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ color = \"currentColor\", ...props }, forwardedRef) => {\n return (\n <svg\n width=\"15\"\n height=\"15\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fill={color}\n d=\"M20 0H6C4.34 0 4 0.84 4 2.5V20.5C4 22.16 5.34 23.5 7 23.5H19C20.66 23.5 22 22.16 22 20.5V2.5C22 0.84 21.66 0 20 0ZM15 22.5H13H11V22H13H15V22.5ZM21 21H13H5V10.5V1H13H21V21Z\"\n />\n </svg>\n );\n }\n);\n\nTabletIcon.displayName = \"TabletIcon\";\n", "import { styled } from \"../stitches.config\";\n\nexport const TextField = styled(\"input\", {\n // Reset\n appearance: \"none\",\n borderWidth: \"0\",\n boxSizing: \"border-box\",\n fontFamily: \"inherit\",\n margin: \"0\",\n outline: \"none\",\n padding: \"0\",\n width: \"100%\",\n WebkitTapHighlightColor: \"rgba(0,0,0,0)\",\n \"&::before\": {\n boxSizing: \"border-box\",\n },\n \"&::after\": {\n boxSizing: \"border-box\",\n },\n\n // Custom\n backgroundColor: \"$loContrast\",\n boxShadow: \"inset 0 0 0 1px $colors$slate7\",\n color: \"$hiContrast\",\n fontVariantNumeric: \"tabular-nums\",\n\n \"&:-webkit-autofill\": {\n boxShadow: \"inset 0 0 0 1px $colors$blue6, inset 0 0 0 100px $colors$blue3\",\n },\n\n \"&:-webkit-autofill::first-line\": {\n fontFamily: \"$untitled\",\n color: \"$hiContrast\",\n },\n\n \"&:focus\": {\n boxShadow:\n \"inset 0px 0px 0px 1px $colors$blue8, 0px 0px 0px 1px $colors$blue8\",\n \"&:-webkit-autofill\": {\n boxShadow:\n \"inset 0px 0px 0px 1px $colors$blue8, 0px 0px 0px 1px $colors$blue8, inset 0 0 0 100px $colors$blue3\",\n },\n },\n \"&::placeholder\": {\n color: \"$slate9\",\n },\n \"&:disabled\": {\n pointerEvents: \"none\",\n backgroundColor: \"$slate2\",\n color: \"$slate8\",\n cursor: \"not-allowed\",\n \"&::placeholder\": {\n color: \"$slate7\",\n },\n },\n \"&:read-only\": {\n backgroundColor: \"$slate2\",\n \"&:focus\": {\n boxShadow: \"inset 0px 0px 0px 1px $colors$slate7\",\n },\n },\n '&[type=\"number\"]': {\n \"&::-webkit-outer-spin-button, &::-webkit-inner-spin-button\": {\n WebkitAppearance: \"none\",\n MozAppearance: \"textfield\",\n margin: 0,\n display: \"none\",\n },\n },\n\n variants: {\n size: {\n \"1\": {\n borderRadius: \"$1\",\n height: \"$5\",\n fontSize: \"$1\",\n px: \"$1\",\n lineHeight: \"$sizes$5\",\n \"&:-webkit-autofill::first-line\": {\n fontSize: \"$1\",\n },\n },\n \"2\": {\n borderRadius: \"$2\",\n height: \"$6\",\n fontSize: \"$3\",\n px: \"$2\",\n lineHeight: \"$sizes$6\",\n \"&:-webkit-autofill::first-line\": {\n fontSize: \"$3\",\n },\n },\n },\n variant: {\n ghost: {\n boxShadow: \"none\",\n backgroundColor: \"transparent\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px $colors$slateA7\",\n },\n },\n \"&:focus\": {\n backgroundColor: \"$loContrast\",\n boxShadow:\n \"inset 0px 0px 0px 1px $colors$blue8, 0px 0px 0px 1px $colors$blue8\",\n },\n \"&:disabled\": {\n backgroundColor: \"transparent\",\n },\n \"&:read-only\": {\n backgroundColor: \"transparent\",\n },\n },\n },\n state: {\n invalid: {\n boxShadow: \"inset 0 0 0 1px $colors$red7\",\n \"&:focus\": {\n boxShadow:\n \"inset 0px 0px 0px 1px $colors$red8, 0px 0px 0px 1px $colors$red8\",\n },\n },\n valid: {\n boxShadow: \"inset 0 0 0 1px $colors$green7\",\n \"&:focus\": {\n boxShadow:\n \"inset 0px 0px 0px 1px $colors$green8, 0px 0px 0px 1px $colors$green8\",\n },\n },\n },\n cursor: {\n default: {\n cursor: \"default\",\n \"&:focus\": {\n cursor: \"text\",\n },\n },\n text: {\n cursor: \"text\",\n },\n },\n },\n defaultVariants: {\n size: \"1\",\n },\n});\n", "import { styled } from \"../stitches.config\";\n\nexport const Flex = styled(\"div\", {\n boxSizing: \"border-box\",\n display: \"flex\",\n\n variants: {\n direction: {\n row: {\n flexDirection: \"row\",\n },\n column: {\n flexDirection: \"column\",\n },\n rowReverse: {\n flexDirection: \"row-reverse\",\n },\n columnReverse: {\n flexDirection: \"column-reverse\",\n },\n },\n align: {\n start: {\n alignItems: \"flex-start\",\n },\n center: {\n alignItems: \"center\",\n },\n end: {\n alignItems: \"flex-end\",\n },\n stretch: {\n alignItems: \"stretch\",\n },\n baseline: {\n alignItems: \"baseline\",\n },\n },\n justify: {\n start: {\n justifyContent: \"flex-start\",\n },\n center: {\n justifyContent: \"center\",\n },\n end: {\n justifyContent: \"flex-end\",\n },\n between: {\n justifyContent: \"space-between\",\n },\n },\n wrap: {\n noWrap: {\n flexWrap: \"nowrap\",\n },\n wrap: {\n flexWrap: \"wrap\",\n },\n wrapReverse: {\n flexWrap: \"wrap-reverse\",\n },\n },\n gap: {\n 1: {\n gap: \"$1\",\n },\n 2: {\n gap: \"$2\",\n },\n 3: {\n gap: \"$3\",\n },\n 4: {\n gap: \"$4\",\n },\n 5: {\n gap: \"$5\",\n },\n 6: {\n gap: \"$6\",\n },\n 7: {\n gap: \"$7\",\n },\n 8: {\n gap: \"$8\",\n },\n 9: {\n gap: \"$9\",\n },\n },\n },\n defaultVariants: {\n direction: \"row\",\n align: \"stretch\",\n justify: \"start\",\n wrap: \"noWrap\",\n },\n});\n", "import { styled } from \"../stitches.config\";\n\nexport const Grid = styled(\"div\", {\n boxSizing: \"border-box\",\n display: \"grid\",\n\n variants: {\n align: {\n start: {\n alignItems: \"start\",\n },\n center: {\n alignItems: \"center\",\n },\n end: {\n alignItems: \"end\",\n },\n stretch: {\n alignItems: \"stretch\",\n },\n baseline: {\n alignItems: \"baseline\",\n },\n },\n justify: {\n start: {\n justifyContent: \"start\",\n },\n center: {\n justifyContent: \"center\",\n },\n end: {\n justifyContent: \"end\",\n },\n between: {\n justifyContent: \"space-between\",\n },\n },\n flow: {\n row: {\n gridAutoFlow: \"row\",\n },\n column: {\n gridAutoFlow: \"column\",\n },\n dense: {\n gridAutoFlow: \"dense\",\n },\n rowDense: {\n gridAutoFlow: \"row dense\",\n },\n columnDense: {\n gridAutoFlow: \"column dense\",\n },\n },\n columns: {\n 1: {\n gridTemplateColumns: \"repeat(1, 1fr)\",\n },\n 2: {\n gridTemplateColumns: \"repeat(2, 1fr)\",\n },\n 3: {\n gridTemplateColumns: \"repeat(3, 1fr)\",\n },\n 4: {\n gridTemplateColumns: \"repeat(4, 1fr)\",\n },\n },\n gap: {\n 1: {\n gap: \"$1\",\n },\n 2: {\n gap: \"$2\",\n },\n 3: {\n gap: \"$3\",\n },\n 4: {\n gap: \"$4\",\n },\n 5: {\n gap: \"$5\",\n },\n 6: {\n gap: \"$6\",\n },\n 7: {\n gap: \"$7\",\n },\n 8: {\n gap: \"$8\",\n },\n 9: {\n gap: \"$9\",\n },\n },\n gapX: {\n 1: {\n columnGap: \"$1\",\n },\n 2: {\n columnGap: \"$2\",\n },\n 3: {\n columnGap: \"$3\",\n },\n 4: {\n columnGap: \"$4\",\n },\n 5: {\n columnGap: \"$5\",\n },\n 6: {\n columnGap: \"$6\",\n },\n 7: {\n columnGap: \"$7\",\n },\n 8: {\n columnGap: \"$8\",\n },\n 9: {\n columnGap: \"$9\",\n },\n },\n gapY: {\n 1: {\n rowGap: \"$1\",\n },\n 2: {\n rowGap: \"$2\",\n },\n 3: {\n rowGap: \"$3\",\n },\n 4: {\n rowGap: \"$4\",\n },\n 5: {\n rowGap: \"$5\",\n },\n 6: {\n rowGap: \"$6\",\n },\n 7: {\n rowGap: \"$7\",\n },\n 8: {\n rowGap: \"$8\",\n },\n 9: {\n rowGap: \"$9\",\n },\n },\n },\n});\n", "import React from \"react\";\nimport { styled, CSS } from \"../stitches.config\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nexport const Tabs = styled(TabsPrimitive.Root, {\n display: \"flex\",\n '&[data-orientation=\"horizontal\"]': {\n flexDirection: \"column\",\n },\n});\n\nexport const TabsTrigger = styled(TabsPrimitive.Trigger, {\n flexShrink: 0,\n size: \"$6\",\n display: \"inline-flex\",\n lineHeight: 1,\n fontFamily: \"inherit\",\n fontSize: \"$1\",\n px: \"$2\",\n userSelect: \"none\",\n outline: \"none\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"$slate11\",\n border: \"none\",\n borderBottom: \"1px solid transparent\",\n borderTopLeftRadius: \"$2\",\n borderTopRightRadius: \"$2\",\n zIndex: \"10\",\n backgroundColor: \"transparent\",\n\n \"@hover\": {\n \"&:hover\": {\n color: \"$hiContrast\",\n },\n },\n\n '&[data-state=\"active\"]': {\n color: \"$hiContrast\",\n borderColor: \"$slate6\",\n },\n\n '&[data-orientation=\"vertical\"]': {\n justifyContent: \"flex-start\",\n borderTopRightRadius: 0,\n borderBottomLeftRadius: \"$2\",\n borderBottomColor: \"transparent\",\n\n '&[data-state=\"active\"]': {\n borderBottomColor: \"$slate6\",\n borderRightColor: \"transparent\",\n },\n },\n});\n\nconst StyledTabsList = styled(TabsPrimitive.List, {\n flexShrink: 0,\n display: \"flex\",\n \"&:focus\": {\n outline: \"none\",\n boxShadow: \"inset 0 0 0 1px $slate8, 0 0 0 1px $slate8\",\n },\n '&[data-orientation=\"vertical\"]': {\n flexDirection: \"column\",\n boxShadow: \"inset -1px 0 0 $slate6\",\n },\n});\n\ntype TabsListPrimitiveProps = React.ComponentProps<typeof TabsPrimitive.List>;\ntype TabsListProps = TabsListPrimitiveProps & { css?: CSS };\n\nexport const TabsList = React.forwardRef<\n React.ElementRef<typeof StyledTabsList>,\n TabsListProps\n>((props, forwardedRef) => (\n <>\n <StyledTabsList {...props} ref={forwardedRef} />\n </>\n));\n\nTabsList.displayName = \"TabsList\";\n\nexport const TabsContent = styled(TabsPrimitive.Content, {\n flexGrow: 1,\n \"&:focus\": {\n outline: \"none\",\n boxShadow: \"inset 0 0 0 1px $slate8, 0 0 0 1px $slate8\",\n },\n '&[data-state=\"inactive\"]': {\n display: \"none\",\n },\n});\n", "// @todo this should be a local customization in sidebar left, not a reusable component\nimport React from \"react\";\nimport { CSS, styled } from \"../stitches.config\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nexport const SidebarTabs = styled(TabsPrimitive.Root, {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n});\n\nexport const SidebarTabsTrigger = styled(TabsPrimitive.Trigger, {\n flexShrink: 0,\n display: \"flex\",\n size: \"$6\",\n m: 0,\n userSelect: \"none\",\n outline: \"none\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"$slate11\",\n border: \"1px solid transparent\",\n zIndex: \"10\",\n backgroundColor: \"transparent\",\n\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$slateA3\",\n color: \"$hiContrast\",\n },\n },\n\n '&[data-state=\"active\"]': {\n color: \"$hiContrast\",\n backgroundColor: \"$slateA4\",\n borderColor: \"$slate6\",\n },\n});\n\nconst StyledTabsList = styled(TabsPrimitive.List, {\n flexShrink: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n \"&:focus\": {\n outline: \"none\",\n boxShadow: \"inset 0 0 0 1px $slate8, 0 0 0 1px $slate8\",\n },\n '&[data-orientation=\"vertical\"]': {\n boxShadow: \"inset -1px 0 0 $slate6\",\n },\n});\n\ntype TabsListPrimitiveProps = React.ComponentProps<typeof TabsPrimitive.List>;\ntype TabsListProps = TabsListPrimitiveProps & { css?: CSS };\n\nexport const SidebarTabsList = React.forwardRef<\n React.ElementRef<typeof StyledTabsList>,\n TabsListProps\n>((props, forwardedRef) => (\n <>\n <StyledTabsList {...props} ref={forwardedRef} />\n </>\n));\n\nSidebarTabsList.displayName = \"SidebarTabsList\";\n\nexport const SidebarTabsContent = styled(TabsPrimitive.Content, {\n flexGrow: 1,\n position: \"absolute\",\n top: 0,\n left: \"100%\",\n width: 400,\n height: \"100%\",\n bc: \"$loContrast\",\n outline: \"1px solid $slate6\",\n \"&:focus\": {\n outline: \"none\",\n boxShadow: \"inset 0 0 0 1px $slate8, 0 0 0 1px $slate8\",\n },\n});\n", "import { styled } from \"../stitches.config\";\n\nexport const Card = styled(\"div\", {\n appearance: \"none\",\n border: \"none\",\n boxSizing: \"border-box\",\n font: \"inherit\",\n lineHeight: \"1\",\n outline: \"none\",\n textAlign: \"inherit\",\n verticalAlign: \"middle\",\n WebkitTapHighlightColor: \"rgba(0, 0, 0, 0)\",\n backgroundColor: \"$panel\",\n display: \"block\",\n textDecoration: \"none\",\n color: \"inherit\",\n flexShrink: 0,\n borderRadius: \"$3\",\n position: \"relative\",\n\n \"&::before\": {\n boxSizing: \"border-box\",\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n boxShadow: \"inset 0 0 0 1px rgba(0,0,0,.1)\",\n borderRadius: \"$3\",\n pointerEvents: \"none\",\n },\n\n variants: {\n size: {\n 1: {\n width: \"$10\",\n padding: \"$5\",\n },\n 2: {\n width: \"$12\",\n padding: \"$7\",\n },\n },\n variant: {\n interactive: {\n \"@hover\": {\n \"&:hover\": {\n \"&::before\": {\n boxShadow: \"inset 0 0 0 1px rgba(0,0,0,.2)\",\n },\n },\n },\n \"&:focus\": {\n \"&::before\": {\n boxShadow: \"inset 0 0 0 1px $colors$blue8, 0 0 0 1px $colors$blue8\",\n },\n },\n },\n ghost: {\n backgroundColor: \"transparent\",\n transition:\n \"transform 200ms cubic-bezier(0.22, 1, 0.36, 1), background-color 25ms linear\",\n willChange: \"transform\",\n \"&::before\": {\n boxShadow:\n \"0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2)\",\n opacity: \"0\",\n transition: \"all 200ms cubic-bezier(0.22, 1, 0.36, 1)\",\n },\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$panel\",\n transform: \"translateY(-2px)\",\n \"&::before\": {\n opacity: \"1\",\n },\n },\n },\n \"&:active\": {\n transform: \"translateY(0)\",\n transition: \"none\",\n \"&::before\": {\n boxShadow:\n \"0px 5px 16px -5px rgba(22, 23, 24, 0.35), 0px 5px 10px -7px rgba(22, 23, 24, 0.2)\",\n opacity: \"1\",\n },\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$blue8, 0 0 0 1px $colors$blue8\",\n },\n },\n active: {\n transform: \"translateY(0)\",\n transition: \"none\",\n \"&::before\": {\n boxShadow:\n \"0px 5px 16px -5px rgba(22, 23, 24, 0.35), 0px 5px 10px -7px rgba(22, 23, 24, 0.2)\",\n opacity: \"1\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$blue8, 0 0 0 1px $colors$blue8\",\n },\n },\n },\n },\n defaultVariants: {\n size: \"1\",\n },\n});\n", "import { styled } from \"../stitches.config\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\n\nexport const SimpleToggle = styled(TogglePrimitive.Root, {\n // Reset\n alignItems: \"center\",\n appearance: \"none\",\n borderWidth: \"0\",\n boxSizing: \"border-box\",\n display: \"inline-flex\",\n flexShrink: 0,\n fontFamily: \"inherit\",\n fontSize: \"14px\",\n justifyContent: \"center\",\n lineHeight: \"1\",\n outline: \"none\",\n padding: \"0\",\n textDecoration: \"none\",\n userSelect: \"none\",\n WebkitTapHighlightColor: \"transparent\",\n color: \"$hiContrast\",\n \"&::before\": {\n boxSizing: \"border-box\",\n },\n \"&::after\": {\n boxSizing: \"border-box\",\n },\n height: \"$5\",\n width: \"$5\",\n backgroundColor: \"transparent\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$slateA3\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slateA4\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $slateA8, 0 0 0 1px $slateA8\",\n zIndex: 1,\n },\n\n '&[data-state=\"on\"]': {\n backgroundColor: \"$slateA5\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$slateA5\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slateA7\",\n },\n },\n\n variants: {\n shape: {\n circle: {\n borderRadius: \"$round\",\n },\n square: {\n borderRadius: \"$1\",\n },\n },\n },\n});\n", "import { styled } from \"../stitches.config\";\n\nexport const Box = styled(\"div\", {\n // Reset\n boxSizing: \"border-box\",\n});\n", "import React from \"react\";\nimport { styled } from \"../stitches.config\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { Box } from \"./box\";\nimport { Text } from \"./text\";\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> &\n React.ComponentProps<typeof TooltipPrimitive.Content> & {\n children: React.ReactElement;\n content: React.ReactNode;\n multiline?: boolean;\n delayDuration?: number;\n };\n\nconst Content = styled(TooltipPrimitive.Content, {\n backgroundColor: \"$loContrast\",\n boxShadow: \"inset 0 0 0 1px $colors$slate7\",\n color: \"$hiContrast\",\n borderRadius: \"$1\",\n padding: \"$1 $2\",\n\n variants: {\n multiline: {\n true: {\n maxWidth: 250,\n pb: 7,\n },\n },\n },\n});\n\nexport const Tooltip = ({\n children,\n content,\n open,\n defaultOpen,\n onOpenChange,\n multiline,\n delayDuration,\n ...props\n}: TooltipProps) => {\n return (\n <TooltipPrimitive.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n delayDuration={delayDuration}\n >\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n\n <Content\n side=\"top\"\n align=\"center\"\n sideOffset={5}\n {...props}\n multiline={multiline}\n >\n <Text\n size=\"1\"\n as=\"p\"\n css={{\n color: \"currentColor\",\n lineHeight: multiline ? \"$5\" : undefined,\n }}\n >\n {content}\n </Text>\n <Box css={{ color: \"$transparentExtreme\" }}>\n <TooltipPrimitive.Arrow\n offset={5}\n width={11}\n height={5}\n style={{\n fill: \"$loContrast\",\n }}\n />\n </Box>\n </Content>\n </TooltipPrimitive.Root>\n );\n};\n", "import { styled } from \"../stitches.config\";\n\nexport const Button = styled(\"button\", {\n // Reset\n all: \"unset\",\n alignItems: \"center\",\n boxSizing: \"border-box\",\n userSelect: \"none\",\n \"&::before\": {\n boxSizing: \"border-box\",\n },\n \"&::after\": {\n boxSizing: \"border-box\",\n },\n\n // Custom reset?\n display: \"inline-flex\",\n flexShrink: 0,\n justifyContent: \"center\",\n lineHeight: \"1\",\n WebkitTapHighlightColor: \"rgba(0,0,0,0)\",\n\n // Custom\n height: \"$5\",\n px: \"$2\",\n fontFamily: \"$untitled\",\n fontSize: \"$2\",\n fontWeight: 500,\n fontVariantNumeric: \"tabular-nums\",\n\n \"&:disabled\": {\n backgroundColor: \"$slate2\",\n boxShadow: \"inset 0 0 0 1px $colors$slate7\",\n color: \"$slate8\",\n pointerEvents: \"none\",\n },\n\n variants: {\n size: {\n \"1\": {\n borderRadius: \"$1\",\n height: \"$5\",\n px: \"$2\",\n fontSize: \"$1\",\n lineHeight: \"$sizes$5\",\n },\n \"2\": {\n borderRadius: \"$2\",\n height: \"$6\",\n px: \"$3\",\n fontSize: \"$3\",\n lineHeight: \"$sizes$6\",\n },\n \"3\": {\n borderRadius: \"$2\",\n height: \"$7\",\n px: \"$4\",\n fontSize: \"$4\",\n lineHeight: \"$sizes$7\",\n },\n },\n variant: {\n gray: {\n backgroundColor: \"$loContrast\",\n boxShadow: \"inset 0 0 0 1px $colors$slate7\",\n color: \"$hiContrast\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slate2\",\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$slate8, 0 0 0 1px $colors$slate8\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$slate4\",\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n },\n blue: {\n backgroundColor: \"$blue2\",\n boxShadow: \"inset 0 0 0 1px $colors$blue7\",\n color: \"$blue11\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px $colors$blue8\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$blue3\",\n boxShadow: \"inset 0 0 0 1px $colors$blue8\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$blue8, 0 0 0 1px $colors$blue8\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$blue4\",\n boxShadow: \"inset 0 0 0 1px $colors$blue8\",\n },\n },\n green: {\n backgroundColor: \"$green2\",\n boxShadow: \"inset 0 0 0 1px $colors$green7\",\n color: \"$green11\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px $colors$green8\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$green3\",\n boxShadow: \"inset 0 0 0 1px $colors$green8\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$green8, 0 0 0 1px $colors$green8\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$green4\",\n boxShadow: \"inset 0 0 0 1px $colors$green8\",\n },\n },\n red: {\n backgroundColor: \"$loContrast\",\n boxShadow: \"inset 0 0 0 1px $colors$slate7\",\n color: \"$red11\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$red3\",\n boxShadow: \"inset 0 0 0 1px $colors$red8\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$red8, 0 0 0 1px $colors$red8\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$red4\",\n boxShadow: \"inset 0 0 0 1px $colors$red8\",\n },\n },\n transparentWhite: {\n backgroundColor: \"hsla(0,100%,100%,.2)\",\n color: \"white\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"hsla(0,100%,100%,.25)\",\n },\n },\n \"&:active\": {\n backgroundColor: \"hsla(0,100%,100%,.3)\",\n },\n \"&:focus\": {\n boxShadow:\n \"inset 0 0 0 1px hsla(0,100%,100%,.35), 0 0 0 1px hsla(0,100%,100%,.35)\",\n },\n },\n raw: {\n background: \"transparent\",\n color: \"inherit\",\n padding: 0,\n borderRadius: 0,\n height: \"auto\",\n },\n transparentBlack: {\n backgroundColor: \"hsla(0,0%,0%,.2)\",\n color: \"black\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"hsla(0,0%,0%,.25)\",\n },\n },\n \"&:active\": {\n backgroundColor: \"hsla(0,0%,0%,.3)\",\n },\n \"&:focus\": {\n boxShadow:\n \"inset 0 0 0 1px hsla(0,0%,0%,.35), 0 0 0 1px hsla(0,0%,0%,.35)\",\n },\n },\n },\n state: {\n active: {\n backgroundColor: \"$slate4\",\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n color: \"$slate11\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$slate5\",\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slate5\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$slate8, 0 0 0 1px $colors$slate8\",\n },\n },\n waiting: {\n backgroundColor: \"$slate4\",\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n color: \"transparent\",\n pointerEvents: \"none\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$slate5\",\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slate5\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n },\n },\n ghost: {\n true: {\n backgroundColor: \"transparent\",\n boxShadow: \"none\",\n },\n },\n },\n compoundVariants: [\n {\n variant: \"gray\",\n ghost: \"true\",\n css: {\n backgroundColor: \"transparent\",\n color: \"$hiContrast\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$slateA3\",\n boxShadow: \"none\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slateA4\",\n },\n \"&:focus\": {\n boxShadow:\n \"inset 0 0 0 1px $colors$slateA8, 0 0 0 1px $colors$slateA8\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$slateA4\",\n boxShadow: \"none\",\n },\n },\n },\n {\n variant: \"blue\",\n ghost: \"true\",\n css: {\n backgroundColor: \"transparent\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$blueA3\",\n boxShadow: \"none\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$blueA4\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$blueA8, 0 0 0 1px $colors$blueA8\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$blueA4\",\n boxShadow: \"none\",\n },\n },\n },\n {\n variant: \"green\",\n ghost: \"true\",\n css: {\n backgroundColor: \"transparent\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$greenA3\",\n boxShadow: \"none\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$greenA4\",\n },\n \"&:focus\": {\n boxShadow:\n \"inset 0 0 0 1px $colors$greenA8, 0 0 0 1px $colors$greenA8\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$greenA4\",\n boxShadow: \"none\",\n },\n },\n },\n {\n variant: \"red\",\n ghost: \"true\",\n css: {\n backgroundColor: \"transparent\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$redA3\",\n boxShadow: \"none\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$redA4\",\n },\n \"&:focus\": {\n boxShadow: \"inset 0 0 0 1px $colors$redA8, 0 0 0 1px $colors$redA8\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$redA4\",\n boxShadow: \"none\",\n },\n },\n },\n ],\n defaultVariants: {\n size: \"1\",\n variant: \"gray\",\n },\n});\n", "import { styled } from \"../stitches.config\";\n\nexport const IconButton = styled(\"button\", {\n // Reset\n alignItems: \"center\",\n appearance: \"none\",\n borderWidth: \"0\",\n boxSizing: \"border-box\",\n display: \"inline-flex\",\n flexShrink: 0,\n fontFamily: \"inherit\",\n fontSize: \"14px\",\n justifyContent: \"center\",\n lineHeight: \"1\",\n outline: \"none\",\n padding: \"0\",\n textDecoration: \"none\",\n userSelect: \"none\",\n WebkitTapHighlightColor: \"transparent\",\n color: \"$hiContrast\",\n \"&::before\": {\n boxSizing: \"border-box\",\n },\n \"&::after\": {\n boxSizing: \"border-box\",\n },\n backgroundColor: \"$loContrast\",\n border: \"1px solid $slate7\",\n \"@hover\": {\n \"&:hover\": {\n borderColor: \"$slate8\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slate2\",\n },\n \"&:focus\": {\n borderColor: \"$slate8\",\n boxShadow: \"0 0 0 1px $colors$slate8\",\n },\n \"&:disabled\": {\n pointerEvents: \"none\",\n backgroundColor: \"transparent\",\n color: \"$slate6\",\n },\n\n variants: {\n size: {\n \"1\": {\n borderRadius: \"$1\",\n height: \"$5\",\n width: \"$5\",\n },\n \"2\": {\n borderRadius: \"$2\",\n height: \"$6\",\n width: \"$6\",\n },\n \"3\": {\n borderRadius: \"$2\",\n height: \"$7\",\n width: \"$7\",\n },\n \"4\": {\n borderRadius: \"$3\",\n height: \"$8\",\n width: \"$8\",\n },\n },\n variant: {\n ghost: {\n backgroundColor: \"transparent\",\n borderWidth: \"0\",\n \"@hover\": {\n \"&:hover\": {\n backgroundColor: \"$slateA3\",\n },\n },\n \"&:focus\": {\n boxShadow:\n \"inset 0 0 0 1px $colors$slateA8, 0 0 0 1px $colors$slateA8\",\n },\n \"&:active\": {\n backgroundColor: \"$slateA4\",\n },\n '&[data-state=\"open\"]': {\n backgroundColor: \"$slateA4\",\n },\n },\n raised: {\n boxShadow:\n \"0 0 transparent, 0 16px 32px hsl(206deg 12% 5% / 25%), 0 3px 5px hsl(0deg 0% 0% / 10%)\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow:\n \"0 0 transparent, 0 16px 32px hsl(206deg 12% 5% / 25%), 0 3px 5px hsl(0deg 0% 0% / 10%)\",\n },\n },\n \"&:focus\": {\n borderColor: \"$slate8\",\n boxShadow:\n \"0 0 0 1px $colors$slate8, 0 16px 32px hsl(206deg 12% 5% / 25%), 0 3px 5px hsl(0deg 0% 0% / 10%)\",\n },\n \"&:active\": {\n backgroundColor: \"$slate4\",\n },\n },\n },\n state: {\n active: {\n backgroundColor: \"$slate4\",\n boxShadow: \"inset 0 0 0 1px hsl(206,10%,76%)\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px hsl(206,10%,76%)\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slate4\",\n },\n },\n waiting: {\n backgroundColor: \"$slate4\",\n boxShadow: \"inset 0 0 0 1px hsl(206,10%,76%)\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px hsl(206,10%,76%)\",\n },\n },\n \"&:active\": {\n backgroundColor: \"$slate4\",\n },\n },\n },\n },\n defaultVariants: {\n size: \"1\",\n variant: \"ghost\",\n },\n});\n", "import React from \"react\";\nimport { styled, CSS } from \"../stitches.config\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { Box } from \"./box\";\nimport { panelStyles } from \"./panel\";\n\ntype PopoverProps = React.ComponentProps<typeof PopoverPrimitive.Root> & {\n children: React.ReactNode;\n};\n\nexport const Popover = ({ children, ...props }: PopoverProps) => {\n return <PopoverPrimitive.Root {...props}>{children}</PopoverPrimitive.Root>;\n};\n\nconst StyledContent = styled(PopoverPrimitive.Content, panelStyles, {\n minWidth: 200,\n minHeight: \"$6\",\n maxWidth: 265,\n \"&:focus\": {\n outline: \"none\",\n },\n});\n\ntype PopoverContentPrimitiveProps = React.ComponentProps<\n typeof PopoverPrimitive.Content\n>;\n\ntype PopoverContentProps = PopoverContentPrimitiveProps & {\n css?: CSS;\n hideArrow?: boolean;\n};\n\nexport const PopoverContent = React.forwardRef<\n React.ElementRef<typeof StyledContent>,\n PopoverContentProps\n>(({ children, hideArrow, ...props }, fowardedRef) => (\n <StyledContent sideOffset={0} {...props} ref={fowardedRef}>\n {children}\n {!hideArrow && (\n <Box css={{ color: \"$panel\" }}>\n <PopoverPrimitive.Arrow\n width={11}\n height={5}\n offset={5}\n style={{ fill: \"currentColor\" }}\n />\n </Box>\n )}\n </StyledContent>\n));\nPopoverContent.displayName = \"PopoverContent\";\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\nexport const PopoverClose = PopoverPrimitive.Close;\n", "import { css, styled } from \"../stitches.config\";\n\nexport const panelStyles = css({\n backgroundColor: \"$panel\",\n borderRadius: \"$3\",\n boxShadow:\n \"$colors$shadowLight 0px 10px 38px -10px, $colors$shadowDark 0px 10px 20px -15px\",\n});\n\nexport const Panel = styled(\"div\", panelStyles);\n", "import React from \"react\";\nimport { Text } from \"./text\";\nimport { VariantProps, CSS } from \"../stitches.config\";\nimport merge from \"lodash.merge\";\n\nconst DEFAULT_TAG = \"h1\";\n\ntype TextSizeVariants = Pick<VariantProps<typeof Text>, \"size\">;\ntype HeadingSizeVariants = \"1\" | \"2\" | \"3\" | \"4\";\ntype HeadingVariants = { size?: HeadingSizeVariants } & Omit<\n VariantProps<typeof Text>,\n \"size\"\n>;\ntype HeadingProps = React.ComponentProps<typeof DEFAULT_TAG> &\n HeadingVariants & { css?: CSS; as?: string };\n\nexport const Heading = React.forwardRef<\n React.ElementRef<typeof DEFAULT_TAG>,\n HeadingProps\n>((props, forwardedRef) => {\n // '2' here is the default heading size variant\n const { size = \"1\", ...textProps } = props;\n // This is the mapping of Heading Variants to Text variants\n const textSize: Record<HeadingSizeVariants, TextSizeVariants[\"size\"]> = {\n 1: { \"@initial\": \"4\", \"@bp2\": \"5\" },\n 2: { \"@initial\": \"6\", \"@bp2\": \"7\" },\n 3: { \"@initial\": \"7\", \"@bp2\": \"8\" },\n 4: { \"@initial\": \"8\", \"@bp2\": \"9\" },\n };\n\n // This is the mapping of Heading Variants to Text css\n const textCss: Record<HeadingSizeVariants, CSS> = {\n 1: { fontWeight: 500, lineHeight: \"20px\", \"@bp2\": { lineHeight: \"23px\" } },\n 2: { fontWeight: 500, lineHeight: \"25px\", \"@bp2\": { lineHeight: \"30px\" } },\n 3: { fontWeight: 500, lineHeight: \"33px\", \"@bp2\": { lineHeight: \"41px\" } },\n 4: { fontWeight: 500, lineHeight: \"35px\", \"@bp2\": { lineHeight: \"55px\" } },\n };\n\n return (\n <Text\n as={DEFAULT_TAG}\n {...textProps}\n ref={forwardedRef}\n size={textSize[size]}\n css={{\n fontVariantNumeric: \"proportional-nums\",\n ...merge(textCss[size], props.css),\n }}\n />\n );\n});\n\nHeading.displayName = \"Heading\";\n", "import React from \"react\";\nimport * as MenuPrimitive from \"@radix-ui/react-menu\";\nimport { CheckIcon } from \"apps/designer/app/shared/icons\";\nimport { styled, css, CSS } from \"../stitches.config\";\nimport { Box } from \"./box\";\nimport { Flex } from \"./flex\";\nimport { panelStyles } from \"./panel\";\n\nexport const baseItemCss = css({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n fontFamily: \"$untitled\",\n fontSize: \"$1\",\n fontVariantNumeric: \"tabular-nums\",\n lineHeight: \"1\",\n cursor: \"default\",\n userSelect: \"none\",\n whiteSpace: \"nowrap\",\n height: \"$5\",\n px: \"$5\",\n});\n\nexport const itemCss = css(baseItemCss, {\n position: \"relative\",\n color: \"$hiContrast\",\n \"&:focus, &[data-found]\": {\n outline: \"none\",\n backgroundColor: \"$blue9\",\n color: \"white\",\n },\n \"&[data-disabled]\": {\n color: \"$slate9\",\n },\n});\n\nexport const labelCss = css(baseItemCss, {\n color: \"$slate11\",\n});\n\nexport const menuCss = css({\n boxSizing: \"border-box\",\n minWidth: 120,\n py: \"$1\",\n});\n\nexport const separatorCss = css({\n height: 1,\n my: \"$1\",\n backgroundColor: \"$slate6\",\n});\n\nexport const Menu = styled(MenuPrimitive.Root, menuCss);\nexport const MenuContent = styled(MenuPrimitive.Content, panelStyles);\n\nexport const MenuSeparator = styled(MenuPrimitive.Separator, separatorCss);\n\nexport const MenuItem = styled(MenuPrimitive.Item, itemCss);\n\nconst StyledMenuRadioItem = styled(MenuPrimitive.RadioItem, itemCss);\n\ntype MenuRadioItemPrimitiveProps = React.ComponentProps<\n typeof MenuPrimitive.RadioItem\n>;\ntype MenuRadioItemProps = MenuRadioItemPrimitiveProps & { css?: CSS };\n\nexport const MenuRadioItem = React.forwardRef<\n React.ElementRef<typeof StyledMenuRadioItem>,\n MenuRadioItemProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledMenuRadioItem {...props} ref={forwardedRef}>\n <Box as=\"span\" css={{ position: \"absolute\", left: \"$1\" }}>\n <MenuPrimitive.ItemIndicator>\n <Flex\n css={{\n width: \"$3\",\n height: \"$3\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Box\n css={{\n width: \"$1\",\n height: \"$1\",\n backgroundColor: \"currentColor\",\n borderRadius: \"$round\",\n }}\n ></Box>\n </Flex>\n </MenuPrimitive.ItemIndicator>\n </Box>\n {children}\n </StyledMenuRadioItem>\n));\nMenuRadioItem.displayName = \"MenuRadioItem\";\n\nconst StyledMenuCheckboxItem = styled(MenuPrimitive.CheckboxItem, itemCss);\n\ntype MenuCheckboxItemPrimitiveProps = React.ComponentProps<\n typeof MenuPrimitive.CheckboxItem\n>;\ntype MenuCheckboxItemProps = MenuCheckboxItemPrimitiveProps & { css?: CSS };\n\nexport const MenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof StyledMenuCheckboxItem>,\n MenuCheckboxItemProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledMenuCheckboxItem {...props} ref={forwardedRef}>\n <Box as=\"span\" css={{ position: \"absolute\", left: \"$1\" }}>\n <MenuPrimitive.ItemIndicator>\n <CheckIcon />\n </MenuPrimitive.ItemIndicator>\n </Box>\n {children}\n </StyledMenuCheckboxItem>\n));\nMenuCheckboxItem.displayName = \"MenuCheckboxItem\";\n\nexport const MenuLabel = styled(MenuPrimitive.Label, labelCss);\nexport const MenuRadioGroup = styled(MenuPrimitive.RadioGroup, {});\nexport const MenuGroup = styled(MenuPrimitive.Group, {});\nexport const MenuAnchor = MenuPrimitive.MenuAnchor;\n", "import React from \"react\";\nimport { Text } from \"./text\";\nimport { VariantProps, CSS } from \"../stitches.config\";\nimport merge from \"lodash.merge\";\n\nconst DEFAULT_TAG = \"p\";\n\ntype TextSizeVariants = Pick<VariantProps<typeof Text>, \"size\">;\ntype ParagraphSizeVariants = \"1\" | \"2\";\ntype ParagraphVariants = { size?: ParagraphSizeVariants } & Omit<\n VariantProps<typeof Text>,\n \"size\"\n>;\ntype ParagraphProps = React.ComponentProps<typeof DEFAULT_TAG> &\n ParagraphVariants & { css?: CSS; as?: string };\n\nexport const Paragraph = React.forwardRef<\n React.ElementRef<typeof DEFAULT_TAG>,\n ParagraphProps\n>((props, forwardedRef) => {\n // '2' here is the default Paragraph size variant\n const { size = \"1\", ...textProps } = props;\n\n // This is the mapping of Paragraph Variants to Text variants\n const textSize: Record<ParagraphSizeVariants, TextSizeVariants[\"size\"]> = {\n 1: { \"@initial\": \"2\", \"@bp2\": \"4\" },\n 2: { \"@initial\": \"5\", \"@bp2\": \"6\" },\n };\n\n // This is the mapping of Paragraph Variants to Text css\n const textCss: Record<ParagraphSizeVariants, CSS> = {\n 1: { lineHeight: \"25px\", \"@bp2\": { lineHeight: \"27px\" } },\n 2: {\n color: \"$slate11\",\n lineHeight: \"27px\",\n \"@bp2\": { lineHeight: \"30px\" },\n },\n };\n return (\n <Text\n as={DEFAULT_TAG}\n {...textProps}\n ref={forwardedRef}\n size={textSize[size]}\n css={{\n ...merge(textCss[size], props.css),\n }}\n />\n );\n});\n\nParagraph.displayName = \"Paragraph\";\n", "import { styled } from \"../stitches.config\";\nimport { Text } from \"./text\";\n\nexport const Link = styled(\"a\", {\n alignItems: \"center\",\n gap: \"$1\",\n flexShrink: 0,\n outline: \"none\",\n textDecorationLine: \"none\",\n textUnderlineOffset: \"3px\",\n textDecorationColor: \"$slate4\",\n WebkitTapHighlightColor: \"rgba(0,0,0,0)\",\n lineHeight: \"inherit\",\n \"@hover\": {\n \"&:hover\": {\n textDecorationLine: \"underline\",\n },\n },\n \"&:focus\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n textDecorationLine: \"none\",\n },\n [`& ${Text}`]: {\n color: \"inherit\",\n },\n variants: {\n variant: {\n blue: {\n color: \"$blue11\",\n textDecorationColor: \"$blue4\",\n \"&:focus\": {\n outlineColor: \"$blue8\",\n },\n },\n subtle: {\n color: \"$slate11\",\n textDecorationColor: \"$slate4\",\n \"&:focus\": {\n outlineColor: \"$slate8\",\n },\n },\n contrast: {\n color: \"$hiContrast\",\n textDecoration: \"underline\",\n textDecorationColor: \"$slate4\",\n \"@hover\": {\n \"&:hover\": {\n textDecorationColor: \"$slate7\",\n },\n },\n \"&:focus\": {\n outlineColor: \"$slate8\",\n },\n },\n },\n },\n defaultVariants: {\n variant: \"contrast\",\n },\n});\n", "import React from \"react\";\nimport { CheckIcon } from \"apps/designer/app/shared/icons\";\nimport { styled, CSS } from \"../stitches.config\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { menuCss, separatorCss, itemCss, labelCss } from \"./menu\";\nimport { Box } from \"./box\";\nimport { Flex } from \"./flex\";\nimport { panelStyles } from \"./panel\";\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\nexport const DropdownMenuArrow = styled(DropdownMenuPrimitive.Arrow, {\n fill: \"$panel\",\n});\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nexport const DropdownMenuContent = styled(\n DropdownMenuPrimitive.Content,\n menuCss,\n panelStyles\n);\nexport const DropdownMenuSeparator = styled(\n DropdownMenuPrimitive.Separator,\n separatorCss\n);\nexport const DropdownMenuItem = styled(DropdownMenuPrimitive.Item, itemCss);\n\nconst StyledDropdownMenuRadioItem = styled(\n DropdownMenuPrimitive.RadioItem,\n itemCss\n);\n\ntype DialogMenuRadioItemPrimitiveProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.RadioItem\n>;\ntype DialogMenuRadioItemProps = DialogMenuRadioItemPrimitiveProps & {\n css?: CSS;\n};\n\nexport const DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof StyledDropdownMenuRadioItem>,\n DialogMenuRadioItemProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledDropdownMenuRadioItem {...props} ref={forwardedRef}>\n <Box as=\"span\" css={{ position: \"absolute\", left: \"$1\" }}>\n <DropdownMenuPrimitive.ItemIndicator>\n <Flex\n css={{\n width: \"$3\",\n height: \"$3\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Box\n css={{\n width: \"$1\",\n height: \"$1\",\n backgroundColor: \"currentColor\",\n borderRadius: \"$round\",\n }}\n />\n </Flex>\n </DropdownMenuPrimitive.ItemIndicator>\n </Box>\n {children}\n </StyledDropdownMenuRadioItem>\n));\n\nDropdownMenuRadioItem.displayName = \"DropdownMenuRadioItem\";\n\nconst StyledDropdownMenuCheckboxItem = styled(\n DropdownMenuPrimitive.CheckboxItem,\n itemCss\n);\n\ntype DialogMenuCheckboxItemPrimitiveProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\ntype DialogMenuCheckboxItemProps = DialogMenuCheckboxItemPrimitiveProps & {\n css?: CSS;\n};\n\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof StyledDropdownMenuCheckboxItem>,\n DialogMenuCheckboxItemProps\n>(({ children, ...props }, forwardedRef) => (\n <StyledDropdownMenuCheckboxItem {...props} ref={forwardedRef}>\n <Box as=\"span\" css={{ position: \"absolute\", left: \"$1\" }}>\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </DropdownMenuPrimitive.ItemIndicator>\n </Box>\n {children}\n </StyledDropdownMenuCheckboxItem>\n));\n\nDropdownMenuCheckboxItem.displayName = \"DropdownMenuCheckboxItem\";\n\nexport const DropdownMenuLabel = styled(DropdownMenuPrimitive.Label, labelCss);\nexport const DropdownMenuRadioGroup = styled(\n DropdownMenuPrimitive.RadioGroup,\n {}\n);\nexport const DropdownMenuGroup = styled(DropdownMenuPrimitive.Group, {});\n", "import React from \"react\";\nimport { styled, VariantProps, CSS } from \"../stitches.config\";\nimport * as SwitchPrimitive from \"@radix-ui/react-switch\";\n\nconst StyledThumb = styled(SwitchPrimitive.Thumb, {\n position: \"absolute\",\n left: 0,\n width: 13,\n height: 13,\n backgroundColor: \"white\",\n borderRadius: \"$round\",\n boxShadow: \"rgba(0, 0, 0, 0.3) 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 1px 2px;\",\n transition: \"transform 100ms cubic-bezier(0.22, 1, 0.36, 1)\",\n transform: \"translateX(1px)\",\n willChange: \"transform\",\n\n '&[data-state=\"checked\"]': {\n transform: \"translateX(11px)\",\n },\n});\n\nconst StyledSwitch = styled(SwitchPrimitive.Root, {\n all: \"unset\",\n boxSizing: \"border-box\",\n userSelect: \"none\",\n flexShrink: 0,\n \"&::before\": {\n boxSizing: \"border-box\",\n },\n \"&::after\": {\n boxSizing: \"border-box\",\n },\n\n // Reset\n alignItems: \"center\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n lineHeight: \"1\",\n margin: \"0\",\n outline: \"none\",\n WebkitTapHighlightColor: \"rgba(0,0,0,0)\",\n\n backgroundColor: \"$slate5\",\n borderRadius: \"$pill\",\n position: \"relative\",\n \"&:focus\": {\n boxShadow: \"0 0 0 2px $colors$slate8\",\n },\n\n '&[data-state=\"checked\"]': {\n backgroundColor: \"$blue9\",\n \"&:focus\": {\n boxShadow: \"0 0 0 2px $colors$blue8\",\n },\n },\n\n variants: {\n size: {\n \"1\": {\n width: \"$5\",\n height: \"$3\",\n },\n \"2\": {\n width: \"$7\",\n height: \"$5\",\n [`& ${StyledThumb}`]: {\n width: 21,\n height: 21,\n transform: \"translateX(2px)\",\n '&[data-state=\"checked\"]': {\n transform: \"translateX(22px)\",\n },\n },\n },\n },\n },\n defaultVariants: {\n size: \"1\",\n },\n});\n\ntype SwitchVariants = VariantProps<typeof StyledSwitch>;\ntype SwitchPrimitiveProps = React.ComponentProps<typeof SwitchPrimitive.Root>;\ntype SwitchProps = SwitchPrimitiveProps & SwitchVariants & { css?: CSS };\n\nexport const Switch = React.forwardRef<\n React.ElementRef<typeof StyledSwitch>,\n SwitchProps\n>((props, forwardedRef) => (\n <StyledSwitch {...props} ref={forwardedRef}>\n <StyledThumb />\n </StyledSwitch>\n));\n\nSwitch.displayName = \"Switch\";\n", "import React from \"react\";\nimport { styled, CSS } from \"../stitches.config\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\n\nconst SliderTrack = styled(SliderPrimitive.Track, {\n position: \"relative\",\n flexGrow: 1,\n backgroundColor: \"$slate7\",\n borderRadius: \"$pill\",\n '&[data-orientation=\"horizontal\"]': {\n height: 2,\n },\n '&[data-orientation=\"vertical\"]': {\n width: 2,\n height: 100,\n },\n});\n\nconst SliderRange = styled(SliderPrimitive.Range, {\n position: \"absolute\",\n background: \"$blue9\",\n borderRadius: \"inherit\",\n '&[data-orientation=\"horizontal\"]': {\n height: \"100%\",\n },\n '&[data-orientation=\"vertical\"]': {\n width: \"100%\",\n },\n});\n\nconst SliderThumb = styled(SliderPrimitive.Thumb, {\n position: \"relative\",\n display: \"block\",\n width: 15,\n height: 15,\n outline: \"none\",\n backgroundColor: \"white\",\n boxShadow: \"0 0 1px rgba(0,0,0,.3), 0 1px 4px rgba(0,0,0,.15)\",\n borderRadius: \"$round\",\n\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: -2,\n backgroundColor: \"hsla(0,0%,0%,.035)\",\n transform: \"scale(1)\",\n borderRadius: \"$round\",\n transition: \"transform 200ms cubic-bezier(0.22, 1, 0.36, 1)\",\n },\n\n \"&:focus\": {\n \"&::after\": {\n transform: \"scale(2)\",\n },\n },\n});\n\nexport const StyledSlider = styled(SliderPrimitive.Root, {\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n flexShrink: 0,\n userSelect: \"none\",\n touchAction: \"none\",\n height: 15,\n flexGrow: 1,\n\n '&[data-orientation=\"vertical\"]': {\n flexDirection: \"column\",\n width: 15,\n },\n\n \"@hover\": {\n \"&:hover\": {\n [`& ${SliderTrack}`]: {\n backgroundColor: \"$slate8\",\n },\n },\n },\n});\n\ntype SliderPrimitiveProps = Omit<\n React.ComponentProps<typeof SliderPrimitive.Root>,\n \"value\" | \"defaultValue\"\n> & {\n value?: number | number[];\n defaultValue?: number | number[];\n};\ntype SliderProps = SliderPrimitiveProps & { css?: CSS };\n\nexport const Slider = React.forwardRef<\n React.ElementRef<typeof StyledSlider>,\n SliderProps\n>(({ value, defaultValue, ...props }, forwardedRef) => {\n const realValue = value || defaultValue || 0;\n const hasRange = Array.isArray(realValue);\n const thumbsArray = hasRange ? realValue : [realValue];\n\n return (\n <StyledSlider {...props} ref={forwardedRef}>\n <SliderTrack>\n <SliderRange />\n </SliderTrack>\n {thumbsArray?.map((_, i: number) => (\n <SliderThumb key={i} />\n ))}\n </StyledSlider>\n );\n});\nSlider.displayName = \"Slider\";\n", "import React from \"react\";\nimport { styled, CSS, VariantProps } from \"../stitches.config\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\n\nexport const RadioGroup = styled(RadioGroupPrimitive.Root, {\n display: \"flex\",\n});\n\nconst StyledIndicator = styled(RadioGroupPrimitive.Indicator, {\n alignItems: \"center\",\n display: \"flex\",\n height: \"100%\",\n justifyContent: \"center\",\n width: \"100%\",\n position: \"relative\",\n \"&::after\": {\n content: '\"\"',\n display: \"block\",\n width: \"7px\",\n height: \"7px\",\n borderRadius: \"50%\",\n backgroundColor: \"$blue9\",\n },\n});\n\nconst StyledRadio = styled(RadioGroupPrimitive.Item, {\n all: \"unset\",\n boxSizing: \"border-box\",\n userSelect: \"none\",\n \"&::before\": {\n boxSizing: \"border-box\",\n },\n \"&::after\": {\n boxSizing: \"border-box\",\n },\n alignItems: \"center\",\n appearance: \"none\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n lineHeight: \"1\",\n margin: \"0\",\n outline: \"none\",\n padding: \"0\",\n textDecoration: \"none\",\n WebkitTapHighlightColor: \"rgba(0,0,0,0)\",\n\n borderRadius: \"50%\",\n color: \"$hiContrast\",\n boxShadow: \"inset 0 0 0 1px $colors$slate7\",\n overflow: \"hidden\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n },\n \"&:focus\": {\n outline: \"none\",\n borderColor: \"$red7\",\n boxShadow: \"inset 0 0 0 1px $colors$blue9, 0 0 0 1px $colors$blue9\",\n },\n\n variants: {\n size: {\n \"1\": {\n width: \"$3\",\n height: \"$3\",\n },\n \"2\": {\n width: \"$5\",\n height: \"$5\",\n\n [`& ${StyledIndicator}`]: {\n \"&::after\": {\n width: \"$3\",\n height: \"$3\",\n },\n },\n },\n },\n },\n defaultVariants: {\n size: \"1\",\n },\n});\n\ntype RadioVariants = VariantProps<typeof StyledRadio>;\ntype RadioGroupItemPrimitiveProps = React.ComponentProps<\n typeof RadioGroupPrimitive.Item\n>;\ntype RadioProps = RadioGroupItemPrimitiveProps & RadioVariants & { css?: CSS };\n\nexport const Radio = React.forwardRef<\n React.ElementRef<typeof StyledRadio>,\n RadioProps\n>((props, forwardedRef) => (\n <StyledRadio {...props} ref={forwardedRef}>\n <StyledIndicator />\n </StyledRadio>\n));\n\nRadio.displayName = \"Radio\";\n", "import { type ComponentProps, useState, useEffect } from \"react\";\nimport { ChevronDownIcon } from \"apps/designer/app/shared/icons\";\nimport { TextField } from \"./text-field\";\nimport { IconButton } from \"./icon-button\";\nimport { MenuAnchor, Menu, MenuContent, MenuItem } from \"./menu\";\n\ntype Item = { label: string };\n\ntype ComboboxProps = ComponentProps<typeof TextField> & {\n items: Array<Item>;\n onValueSelect: (value: string) => void;\n onValueEnter: (value: string) => void;\n onItemEnter: (value: string) => void;\n onItemLeave: (value: string) => void;\n value: string;\n};\n\nexport const Combobox = ({\n items,\n onValueSelect,\n onValueEnter,\n onItemEnter,\n onItemLeave,\n value,\n css,\n ...rest\n}: ComboboxProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const [currentValue, setCurrentValue] = useState(value);\n\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n return (\n <Menu open={isOpen} modal={true} onOpenChange={setIsOpen}>\n <MenuAnchor asChild>\n <TextField\n {...rest}\n value={currentValue}\n autoComplete=\"off\"\n // @todo avoid hardcoding padding\n css={{ ...css, paddingRight: 30 }}\n onChange={(event) => {\n setCurrentValue(event.target.value);\n }}\n onKeyDown={(event) => {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\": {\n setIsOpen(true);\n break;\n }\n case \"Enter\": {\n onValueEnter(event.currentTarget.value);\n break;\n }\n }\n }}\n />\n </MenuAnchor>\n <IconButton\n variant=\"ghost\"\n size=\"1\"\n // @todo avoid hardcoding margin\n css={{ marginLeft: -32 }}\n onClick={() => {\n setIsOpen(true);\n }}\n >\n <ChevronDownIcon />\n </IconButton>\n <MenuContent loop portalled asChild>\n <div>\n {items.map(({ label }, index) => {\n return (\n <MenuItem\n key={index}\n onMouseEnter={() => {\n onItemEnter(label);\n }}\n onMouseLeave={() => {\n onItemLeave(label);\n }}\n onFocus={() => {\n onItemEnter(label);\n }}\n onSelect={() => {\n onValueSelect(label);\n }}\n >\n {label}\n </MenuItem>\n );\n })}\n </div>\n </MenuContent>\n </Menu>\n );\n};\n", "const config = {\n previewPath: \"/preview\",\n canvasPath: \"/canvas\",\n designerPath: \"/designer\",\n dashboardPath: \"/dashboard\",\n loginPath: \"/login\",\n logoutPath: \"/logout\",\n googleCallbackPath: \"/google/callback\",\n githubCallbackPath: \"/github/callback\",\n authPath: \"/auth\",\n};\nexport default config;\nexport type Config = typeof config;\n", "import * as Sentry from \"@sentry/remix\";\nimport { Extras, Integration } from \"@sentry/types\";\nimport env from \"apps/designer/app/shared/env\";\n\nexport const initSentry = ({\n integrations = [],\n}: { integrations?: Integration[] } = {}) =>\n env.SENTRY_DSN\n ? Sentry.init({\n dsn: env.SENTRY_DSN,\n tracesSampleRate: 1.0,\n environment: env.VERCEL_ENV || \"development\",\n integrations: integrations,\n })\n : () => null;\n\ntype SentryHelperProps = {\n message: string;\n extra?: Extras;\n skipLogging?: boolean;\n};\n\nexport const sentryMessage = ({\n message,\n extra,\n skipLogging = false,\n}: SentryHelperProps) => {\n if (env.SENTRY_DSN) {\n Sentry.withScope((scope) => {\n if (extra) scope.setExtras(extra);\n Sentry.captureMessage(message);\n });\n }\n\n if (skipLogging !== true) {\n // eslint-disable-next-line no-console\n console.log(message);\n }\n};\n\nexport const sentryException = ({\n message,\n extra,\n skipLogging = false,\n}: SentryHelperProps) => {\n if (env.SENTRY_DSN) {\n Sentry.withScope((scope) => {\n if (extra) scope.setExtras(extra);\n Sentry.captureException(message);\n });\n }\n if (skipLogging !== true) {\n // eslint-disable-next-line no-console\n console.error(message);\n }\n};\n", "// Global namespace on window.\nexport const namespace = \"__webstudioEnv\";\n", "import { useLoaderData } from \"@remix-run/react\";\nimport { namespace } from \"./namespace\";\n\n// @todo remove once remix has a built-in way\n// https://github.com/remix-run/remix/discussions/2769\n// This renders env config as a script tag so we can have access to it before any scripts run\nexport const Env = () => {\n const data = useLoaderData();\n return (\n <script\n dangerouslySetInnerHTML={{\n __html: `window[\"${namespace}\"] = ${JSON.stringify(data.env)}`,\n }}\n />\n );\n};\n", "import { namespace } from \"./namespace\";\nimport type { Env } from \"apps/designer/app/env.server\";\n\n// @todo remove once remix has a built-in way\n// https://github.com/remix-run/remix/discussions/2769\n// This provides an access to a config over window by accessing a property in an env proxy object\nexport default new Proxy(\n {},\n {\n get(_target, prop) {\n if (typeof window === \"undefined\") {\n return prop in process.env ? process.env[prop as keyof Env] : undefined;\n }\n const env = (window[namespace as never] ?? {}) as unknown as Env;\n return prop in env ? env[prop as keyof Env] : undefined;\n },\n }\n) as Env;\n", "import { PrismaClient, Prisma } from \"@prisma/client\";\nimport { PrismaClientKnownRequestError } from \"@prisma/client/runtime\";\n\ndeclare global {\n // allow global `var` declarations\n // eslint-disable-next-line no-var\n var prisma: PrismaClient | undefined;\n}\n\n// this fixes the issue with `warn(prisma-client) There are already 10 instances of Prisma Client actively running.`\n// explanation here\n// https://www.prisma.io/docs/guides/database/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices\nexport const prisma = global.prisma || new PrismaClient();\n\nif (process.env.NODE_ENV !== \"production\") global.prisma = prisma;\n\nexport { Prisma, PrismaClientKnownRequestError };\n", "// Our root outlet doesn't contain a layout because we have 2 types of documents: canvas and designer and we need to decide down the line which one to render, thre is no single root document.\nimport { Outlet } from \"@remix-run/react\";\nimport { withSentryRouteTracing } from \"@sentry/remix\";\nimport { ErrorBoundary } from \"@sentry/remix\";\nimport { OutletProps } from \"react-router-dom\";\n\nconst RootWithErrorBoundary = (props: OutletProps) => (\n <ErrorBoundary>\n <Outlet {...props} />\n </ErrorBoundary>\n);\n\nexport default withSentryRouteTracing(\n // withSentryRouteTracing() expects a type from component that is not necessary true.\n RootWithErrorBoundary as () => JSX.Element\n);\n", "import type { LoaderFunction } from \"@remix-run/node\";\nimport type { Breakpoint } from \"@webstudio-is/sdk\";\nimport * as db from \"apps/designer/app/shared/db\";\n\nexport type ErrorData = {\n errors: string;\n};\n\nexport const loader: LoaderFunction = async ({\n params,\n}): Promise<Array<Breakpoint> | ErrorData> => {\n try {\n const project = await db.project.loadById(params.projectId);\n if (project === null) {\n throw new Error(`Project ${params.projectId} not found`);\n }\n if (project.prodTreeId === null) {\n throw new Error(\n `Project ${params.projectId} needs to be published first`\n );\n }\n const data = await db.breakpoints.load(project.prodTreeId);\n if (data === null) {\n throw new Error(\n `Breakpoints not found for project ${params.projectId} and tree ID ${project.prodTreeId}`\n );\n }\n return data.values;\n } catch (error) {\n if (error instanceof Error) {\n return {\n errors: error.message,\n };\n }\n }\n return { errors: \"Unexpected error\" };\n};\n", "import { type Instance, type Breakpoint, type Tree } from \"@webstudio-is/sdk\";\nimport { applyPatches, type Patch } from \"immer\";\nimport { prisma } from \"./prisma.server\";\nimport { createInstance } from \"apps/designer/app/shared/tree-utils\";\nimport { sort } from \"apps/designer/app/shared/breakpoints\";\nimport { Tree as DbTree } from \"@prisma/client\";\nimport { Project } from \"./project.server\";\n\nexport const createRootInstance = (breakpoints: Array<Breakpoint>) => {\n // Take the smallest breakpoint as default\n const defaultBreakpoint = sort(breakpoints)[0];\n if (defaultBreakpoint === undefined) {\n throw new Error(\"A breakpoint with minWidth 0 is required\");\n }\n // @todo this should be part of a root primitive in primitives\n const rootConfig: Pick<Instance, \"component\" | \"cssRules\"> = {\n component: \"Box\",\n cssRules: [\n {\n breakpoint: defaultBreakpoint.id,\n style: {\n backgroundColor: {\n type: \"keyword\",\n value: \"white\",\n },\n fontFamily: {\n type: \"keyword\",\n value: \"Arial\",\n },\n fontSize: {\n type: \"unit\",\n unit: \"px\",\n value: 14,\n },\n lineHeight: {\n type: \"unit\",\n unit: \"number\",\n value: 1.5,\n },\n color: {\n type: \"keyword\",\n value: \"#232323\",\n },\n minHeight: {\n type: \"unit\",\n unit: \"vh\",\n value: 100,\n },\n flexDirection: {\n type: \"keyword\",\n value: \"column\",\n },\n },\n },\n ],\n };\n return createInstance(rootConfig);\n};\n\nexport const create = async (root: Instance): Promise<DbTree> => {\n const newRoot = JSON.stringify(root);\n return await prisma.tree.create({\n data: { root: newRoot },\n });\n};\n\nexport const loadById = async (treeId: string): Promise<Tree | null> => {\n const tree = await prisma.tree.findUnique({\n where: { id: treeId },\n });\n\n if (tree === null) return null;\n\n return {\n ...tree,\n root: JSON.parse(tree.root),\n };\n};\n\nexport const loadByProject = async (\n project: Project | null,\n env: \"production\" | \"development\" = \"development\"\n) => {\n if (project === null) {\n throw new Error(\"Project required\");\n }\n\n const treeId = env === \"production\" ? project.prodTreeId : project.devTreeId;\n\n if (treeId === null) {\n throw new Error(\"Site needs to be published, production tree ID is null.\");\n }\n\n return await loadById(treeId);\n};\n\nexport const clone = async (treeId: string) => {\n const tree = await loadById(treeId);\n if (tree === null) {\n throw new Error(`Tree ${treeId} not found`);\n }\n return await create(tree.root);\n};\n\nexport const patchRoot = async (\n { treeId }: { treeId: Tree[\"id\"] },\n patches: Array<Patch>\n) => {\n const tree = await loadById(treeId);\n if (tree === null) {\n throw new Error(`Tree ${treeId} not found`);\n }\n const root = applyPatches(tree.root, patches);\n await prisma.tree.update({\n data: { root: JSON.stringify(root) },\n where: { id: treeId },\n });\n};\n", "import ObjectId from \"bson-objectid\";\nimport { type CssRule, type Instance } from \"@webstudio-is/sdk\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\n\nexport const createInstance = ({\n component,\n id,\n children,\n cssRules,\n}: {\n component: Instance[\"component\"];\n id?: Instance[\"id\"];\n children?: Instance[\"children\"];\n cssRules?: Array<CssRule>;\n}): Instance => {\n const primitive = primitives[component];\n return {\n component,\n id: id === undefined ? ObjectId().toString() : id,\n cssRules: cssRules ?? [],\n children:\n children === undefined\n ? \"children\" in primitive\n ? primitive.children\n : []\n : children,\n };\n};\n", "export * as Box from \"./box\";\nexport * as TextBlock from \"./text-block\";\nexport * as Heading from \"./heading\";\nexport * as Paragraph from \"./paragraph\";\nexport * as Link from \"./link\";\nexport * as Bold from \"./bold\";\nexport * as Italic from \"./italic\";\nexport * as Button from \"./button\";\nexport * as Input from \"./input\";\nexport * as Form from \"./form\";\n", "import { type Style, components } from \"@webstudio-is/sdk\";\nexport { SquareIcon as Icon } from \"apps/designer/app/shared/icons\";\n\n// Webstudio specific default styles for the node type.\nexport const defaultStyle: Style = {\n boxSizing: {\n type: \"keyword\",\n value: \"border-box\",\n },\n};\n\nexport const canAcceptChild = (): boolean => {\n return true;\n};\n\nexport const isContentEditable = false;\n\n// Can only be created from content editable fields\nexport const isInlineOnly = false;\n\nexport const Component = components.Box;\n\nexport const label = \"Box\";\n", "import { type Style, components } from \"@webstudio-is/sdk\";\nexport { TextIcon as Icon } from \"apps/designer/app/shared/icons\";\n\n// Webstudio specific default styles for the node type.\nexport const defaultStyle: Style = {\n minHeight: {\n type: \"unit\",\n unit: \"em\",\n value: 1,\n },\n};\n\nexport const children = [\"Block of text you can edit\"];\n\nexport const canAcceptChild = (): boolean => {\n return false;\n};\n\nexport const isContentEditable = true;\n\n// Can only be created from content editable fields\nexport const isInlineOnly = false;\n\nexport const label = \"Text Block\";\n\nexport const Component = components.TextBlock;\n", "import { type Style, components } from \"@webstudio-is/sdk\";\nexport { HeadingIcon as Icon } from \"apps/designer/app/shared/icons\";\n\n// Webstudio specific default styles for the node type.\nexport const defaultStyle: Style = {};\n\nexport const children = [\"Heading you can edit\"];\n\nexport const canAcceptChild = (): boolean => {\n return false;\n};\n\nexport const isContentEditable = true;\n\n// Can only be created from content editable fields\nexport const isInlineOnly = false;\n\nexport const label = \"Heading\";\n\nexport const Component = components.Heading;\n", "import { type Style, components } from \"@webstudio-is/sdk\";\nexport { TextAlignLeftIcon as Icon } from \"apps/designer/app/shared/icons\";\n\n// Webstudio specific default styles for the node type.\nexport const defaultStyle: Style = {};\n\nexport const children = [\"Pragraph you can edit\"];\n\nexport const canAcceptChild = (): boolean => {\n return false;\n};\n\nexport const isContentEditable = true;\n\n// Can only be created from content editable fields\nexport const isInlineOnly = false;\n\nexport const label = \"Paragraph\";\n\nexport const Component = components.Paragraph;\n", "import { type Style, components } from \"@webstudio-is/sdk\";\nexport { Link2Icon as Icon } from \"apps/designer/app/shared/icons\";\n\n// Webstudio specific default styles for the node type.\nexport const defaultStyle: Style = {\n minHeight: {\n type: \"unit\",\n unit: \"em\",\n value: 1,\n },\n display: {\n type: \"keyword\",\n value: \"inline-block\",\n },\n};\n\nexport const children = [\"Link text you can edit\"];\n\nexport const canAcceptChild = (): boolean => {\n return false;\n};\n\nexport const isContentEditable = true;\n\n// Can only be created from content editable fields\nexport const isInlineOnly = false;\n\nexport const label = \"Link\";\n\nexport const Component = components.Link;\n", "import { components } from \"@webstudio-is/sdk\";\nexport { FontBoldIcon as Icon } from \"apps/designer/app/shared/icons\";\n\nexport const canAcceptChild = (): boolean => {\n return false;\n};\n\nexport const isContentEditable = false;\n\nexport const label = \"Bold Text\";\n\n// Can only be created from content editable fields\nexport const isInlineOnly = true;\n\nexport const Component = components.Bold;\n", "import { components } from \"@webstudio-is/sdk\";\nexport { FontBoldIcon as Icon } from \"apps/designer/app/shared/icons\";\n\nexport const canAcceptChild = (): boolean => {\n return false;\n};\n\nexport const isContentEditable = false;\n\nexport const label = \"Italic Text\";\n\n// Can only be created from content editable fields\nexport const isInlineOnly = true;\n\nexport const Component = components.Italic;\n", "import { type Style, components } from \"@webstudio-is/sdk\";\nexport { ButtonIcon as Icon } from \"apps/designer/app/shared/icons\";\n\n// Webstudio specific default styles for the node type.\nexport const defaultStyle: Style = {};\n\nexport const canAcceptChild = (): boolean => {\n // @todo could accept an icon in the future\n return false;\n};\n\nexport const isContentEditable = true;\n\n// Can only be created from content editable fields\nexport const isInlineOnly = false;\n\nexport const children = [\"Button text you can edit\"];\n\nexport const Component = components.Button;\n\nexport const label = \"Button\";\n", "import { type Style, components } from \"@webstudio-is/sdk\";\nexport { InputIcon as Icon } from \"apps/designer/app/shared/icons\";\n\n// Webstudio specific default styles for the node type.\nexport const defaultStyle: Style = {};\n\nexport const canAcceptChild = (): boolean => {\n return false;\n};\n\nexport const isContentEditable = false;\n\n// Can only be created from content editable fields\nexport const isInlineOnly = false;\n\nexport const Component = components.Input;\n\n// @todo we can't render label as a tag using psuedo elements for an input\n// we either need to start rendering tags outside or wrap elements which can't have children\nexport const label = \"Input\";\n", "import { type Style, components } from \"@webstudio-is/sdk\";\nexport { FormIcon as Icon } from \"apps/designer/app/shared/icons\";\n\n// Webstudio specific default styles for the node type.\nexport const defaultStyle: Style = {\n minHeight: {\n type: \"unit\",\n unit: \"px\",\n value: 20,\n },\n boxSizing: {\n type: \"keyword\",\n value: \"border-box\",\n },\n};\n\nexport const canAcceptChild = (): boolean => {\n return true;\n};\n\nexport const isContentEditable = false;\n\n// Can only be created from content editable fields\nexport const isInlineOnly = false;\n\nexport const Component = components.Form;\n\nexport const label = \"Form\";\n", "import { type Instance } from \"@webstudio-is/sdk\";\n\nexport const deleteInstanceMutable = (\n instance: Instance,\n instanceId: Instance[\"id\"]\n): boolean => {\n if (instance.id === instanceId) return true;\n\n for (const child of instance.children) {\n if (typeof child === \"string\") continue;\n const shouldDelete = deleteInstanceMutable(child, instanceId);\n if (shouldDelete === true) {\n const index = instance.children.indexOf(child);\n instance.children.splice(index, 1);\n return false;\n }\n }\n return false;\n};\n", "import { type Instance } from \"@webstudio-is/sdk\";\n\nexport type InstanceInsertionSpec = {\n parentId: Instance[\"id\"];\n position: number | \"end\";\n};\n\nexport const insertInstanceMutable = (\n rootInstance: Instance,\n instance: Instance,\n spec: InstanceInsertionSpec\n): boolean => {\n if (spec.parentId !== rootInstance.id) {\n for (const child of rootInstance.children) {\n if (typeof child === \"string\") continue;\n const hasInserted = insertInstanceMutable(child, instance, spec);\n if (hasInserted === true) return true;\n }\n return false;\n }\n\n // Inserting inside the selected/hovered instance.\n if (typeof spec.position === \"number\") {\n rootInstance.children.splice(spec.position, 0, instance);\n return true;\n }\n\n // Inserting after all children\n if (spec.position === \"end\") {\n rootInstance.children.push(instance);\n return true;\n }\n\n return true;\n};\n", "import { type Instance } from \"@webstudio-is/sdk\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\n\n/**\n * Populate instance with:\n * - defaultStyles\n * @todo rewrite using immer\n */\nexport const populateInstance = (instance: Instance): Instance => {\n const populatedInstance = { ...instance };\n const primitive = primitives[instance.component];\n if (primitive !== undefined && \"defaultStyle\" in primitive) {\n const cssRule = {\n breakpoint: \"\",\n style: primitive.defaultStyle,\n };\n populatedInstance.cssRules.push(cssRule);\n }\n return populatedInstance;\n};\n", "import { type Instance } from \"@webstudio-is/sdk\";\n\n// @todo should be optimized because it will be a frequent operation on a potentially large tree.\nexport const findInstanceById = (\n instance: Instance,\n id: Instance[\"id\"]\n): Instance | undefined => {\n if (instance.id === id) {\n return instance;\n }\n\n if (instance.children !== undefined) {\n for (const child of instance.children) {\n if (typeof child === \"string\") continue;\n const foundInstance = findInstanceById(child, id);\n if (foundInstance !== undefined) return foundInstance;\n }\n }\n};\n", "export * from \"./create-instance\";\nexport * from \"./delete-instance\";\nexport * from \"./insert-instance\";\nexport * from \"./populate\";\nexport * from \"./find-instance\";\nexport { createElementsTree, type OnChangeChildren } from \"@webstudio-is/sdk\";\nexport * from \"./set-instance-style\";\nexport * from \"./set-instance-children\";\nexport * from \"./get-instance-path\";\nexport * from \"./find-closest-sibling-instance\";\nexport * from \"./find-parent-instance\";\nexport * from \"./clone-instance\";\n", "import { Breakpoint, type Instance } from \"@webstudio-is/sdk\";\nimport { type StyleUpdates } from \"apps/designer/app/shared/canvas-components\";\nimport { findInstanceById } from \"./find-instance\";\n\nexport const setInstanceStyleMutable = (\n rootInstance: Instance,\n id: Instance[\"id\"],\n updates: StyleUpdates[\"updates\"],\n breakpoint: Breakpoint\n) => {\n const instance = findInstanceById(rootInstance, id);\n if (instance === undefined) return false;\n let cssRule = instance.cssRules.find(\n (cssRule) => cssRule.breakpoint === breakpoint.id\n );\n if (cssRule === undefined) {\n cssRule = { style: {}, breakpoint: breakpoint.id };\n instance.cssRules.push(cssRule);\n }\n\n for (const update of updates) {\n cssRule.style[update.property] = update.value;\n }\n return true;\n};\n", "import { type ChildrenUpdates } from \"@webstudio-is/sdk\";\nimport { type Instance } from \"@webstudio-is/sdk\";\nimport { createInstance } from \"./create-instance\";\nimport { findInstanceById } from \"./find-instance\";\n\n/**\n * Update children of an instance with new text.\n * When child is an instance - we update it's children with a single text entry.\n */\nexport const setInstanceChildrenMutable = (\n id: Instance[\"id\"],\n // Not a consistent format now, maybe better:\n // [{set: 'string'}, {set: instance}, {update: {id,text}}]\n updates: ChildrenUpdates,\n rootInstance: Instance\n) => {\n const instance = findInstanceById(rootInstance, id);\n if (instance === undefined) return false;\n const children = [];\n\n for (const update of updates) {\n // Set a string as a child\n if (typeof update === \"string\") {\n children.push(update);\n continue;\n }\n // We need to create an instance\n if (\"createInstance\" in update) {\n const childInstance = createInstance({\n id: update.id,\n component: update.component,\n children: [update.text],\n });\n children.push(childInstance);\n continue;\n }\n\n // Set text as a single child of a child instance\n if (\"text\" in update) {\n const childInstance = findInstanceById(instance, update.id);\n // It should be impossible to have not found that instance\n if (childInstance === undefined) continue;\n children.push({ ...childInstance, children: [update.text] });\n continue;\n }\n\n // It's a new instance.\n children.push(update);\n }\n\n instance.children = children;\n return true;\n};\n", "import { Instance } from \"@webstudio-is/sdk\";\n\nexport const getInstancePath = (\n instance: Instance,\n instanceId: Instance[\"id\"]\n) => {\n const path = [];\n\n const find = (instance: Instance) => {\n if (instance.id === instanceId) return true;\n for (const child of instance.children) {\n if (typeof child === \"string\") continue;\n const found = find(child);\n if (found) {\n path.push(child);\n return true;\n }\n }\n };\n\n if (find(instance)) {\n path.push(instance);\n }\n\n return path.reverse();\n};\n", "import { type Instance } from \"@webstudio-is/sdk\";\n\nexport const findClosestSiblingInstance = (\n instance: Instance,\n instanceId: Instance[\"id\"]\n): Instance | undefined => {\n if (instance.children.length === 0) return;\n const children = instance.children.filter(\n (instance) => typeof instance === \"object\"\n ) as Array<Instance>;\n const index = children.findIndex((instance) => instance.id === instanceId);\n if (index === -1) return;\n const nextInstance = children[index + 1];\n if (nextInstance !== undefined) return nextInstance;\n const previousInstance = children[index - 1];\n return previousInstance;\n};\n", "import { type Instance } from \"@webstudio-is/sdk\";\n\nexport const findParentInstance = (\n instance: Instance,\n instanceId: Instance[\"id\"]\n): Instance | undefined => {\n const find = (\n childInstance: Instance,\n parentInstance?: Instance\n ): Instance | undefined => {\n if (childInstance.id === instanceId) return parentInstance;\n for (const child of childInstance.children) {\n if (typeof child === \"string\") continue;\n const foundInstance = find(child, childInstance);\n if (foundInstance !== undefined) return foundInstance;\n }\n };\n return find(instance);\n};\n", "import ObjectId from \"bson-objectid\";\nimport produce from \"immer\";\nimport { type Instance } from \"@webstudio-is/sdk\";\n\nconst updateIds = (instance: Instance) => {\n instance.id = ObjectId().toString();\n for (const child of instance.children) {\n if (typeof child === \"string\") continue;\n updateIds(child);\n }\n};\n\nexport const cloneInstance = (instance: Instance): Instance =>\n produce(updateIds)(instance);\n", "/**\n * Sort by minWidth descending.\n * We want media querries with bigger minWidth to override the smaller once.\n */\nexport const sort = <BreakpointSubset extends { minWidth: number }>(\n breakpoints: Array<BreakpointSubset>\n) => {\n return [...breakpoints].sort((breakpointA, breakpointB) => {\n return breakpointA.minWidth - breakpointB.minWidth;\n });\n};\n", "import slugify from \"slugify\";\nimport { nanoid } from \"nanoid\";\nimport type { Project as BaseProject, User } from \"@webstudio-is/sdk\";\nimport { prisma, Prisma } from \"./prisma.server\";\nimport * as db from \".\";\n\nexport type Project = Omit<BaseProject, \"prodTreeIdHistory\"> & {\n prodTreeIdHistory: string[];\n};\n\nconst parseProject = (project: BaseProject | null): Project | null =>\n project\n ? {\n ...project,\n prodTreeIdHistory: JSON.parse(project.prodTreeIdHistory),\n }\n : null;\n\nexport const loadById = async (\n projectId?: Project[\"id\"]\n): Promise<Project | null> => {\n if (typeof projectId !== \"string\") {\n throw new Error(\"Project ID required\");\n }\n\n const project = await prisma.project.findUnique({\n where: { id: projectId },\n });\n\n return parseProject(project);\n};\n\nexport const loadByDomain = async (domain: string): Promise<Project | null> => {\n const project = await prisma.project.findUnique({ where: { domain } });\n\n return parseProject(project);\n};\n\nexport const loadManyByUserId = async (\n userId: User[\"id\"]\n): Promise<Array<Project>> => {\n const projects = await prisma.project.findMany({\n where: {\n User: {\n id: userId,\n },\n },\n });\n\n return projects.map(parseProject) as Project[];\n};\n\nconst slugifyOptions = { lower: true, strict: true };\n\nconst MIN_DOMAIN_LENGTH = 10;\nconst MIN_TITLE_LENGTH = 2;\n\nconst generateDomain = (title: string) => {\n const slugifiedTitle = slugify(title, slugifyOptions);\n const domain = `${slugifiedTitle}-${nanoid(\n // If user entered a long title already, we just add 5 chars generated id\n // Otherwise we add the amount of chars to satisfy min length\n Math.max(MIN_DOMAIN_LENGTH - slugifiedTitle.length - 1, 5)\n )}`;\n return domain;\n};\n\nexport const create = async ({\n userId,\n title,\n}: {\n userId: string;\n title: string;\n}): Promise<Project | null> => {\n if (title.length < MIN_TITLE_LENGTH) {\n throw new Error(`Minimum ${MIN_TITLE_LENGTH} characters required`);\n }\n\n const domain = generateDomain(title);\n const breakpoints = db.breakpoints.getBreakpointsWithId();\n const tree = await db.tree.create(db.tree.createRootInstance(breakpoints));\n const project = await prisma.project.create({\n data: {\n userId,\n title,\n domain,\n devTreeId: tree.id,\n },\n });\n\n await db.breakpoints.create(tree.id, breakpoints);\n return parseProject(project);\n};\n\nexport const clone = async (\n clonableDomain: string,\n userId: string\n): Promise<Project> => {\n const clonableProject = await loadByDomain(clonableDomain);\n if (clonableProject === null) {\n throw new Error(`Not found project \"${clonableDomain}\"`);\n }\n if (clonableProject.prodTreeId === null) {\n throw new Error(\"Expected project to be published first\");\n }\n\n const tree = await db.tree.clone(clonableProject.prodTreeId);\n const domain = generateDomain(clonableProject.title);\n const [project] = await Promise.all([\n prisma.project.create({\n data: {\n userId: userId,\n title: clonableProject.title,\n domain,\n devTreeId: tree.id,\n },\n }),\n db.props.clone({\n previousTreeId: clonableProject.prodTreeId,\n nextTreeId: tree.id,\n }),\n db.breakpoints.clone({\n previousTreeId: clonableProject.prodTreeId,\n nextTreeId: tree.id,\n }),\n ]);\n\n const parsedProject = parseProject(project);\n if (parsedProject === null) {\n throw new Error(`Not found project \"${clonableDomain}\"`);\n }\n return parsedProject;\n};\n\nexport const update = async ({\n id,\n ...data\n}: {\n id: string;\n domain?: string;\n prodTreeId?: string;\n devTreeId?: string;\n prodTreeIdHistory: Array<string>;\n}): Promise<BaseProject> => {\n if (data.domain) {\n data.domain = slugify(data.domain, slugifyOptions);\n if (data.domain.length < MIN_DOMAIN_LENGTH) {\n throw new Error(`Minimum ${MIN_DOMAIN_LENGTH} characters required`);\n }\n }\n\n try {\n const project = await prisma.project.update({\n data: {\n ...data,\n prodTreeIdHistory: JSON.stringify(data.prodTreeIdHistory),\n },\n where: { id },\n });\n return project;\n } catch (error) {\n if (\n error instanceof Prisma.PrismaClientKnownRequestError &&\n error.code === \"P2002\"\n ) {\n throw new Error(`Domain \"${data.domain}\" is already used`);\n }\n throw error;\n }\n};\n", "import { type Tree, type AllUserProps } from \"@webstudio-is/sdk\";\nimport { applyPatches, type Patch } from \"immer\";\nimport { prisma } from \"./prisma.server\";\nimport { Project } from \"./project.server\";\n\nexport const loadByProject = async (\n project: Project | null,\n env: \"production\" | \"development\" = \"development\"\n) => {\n if (project === null) {\n throw new Error(\"Project required\");\n }\n\n const treeId = env === \"production\" ? project.prodTreeId : project.devTreeId;\n\n if (treeId === null) {\n throw new Error(\"Site needs to be published, production tree ID is null.\");\n }\n\n return loadByTreeId(treeId);\n};\n\nexport const loadByTreeId = async (treeId: Tree[\"id\"]) => {\n const instancePropsEntries = await prisma.instanceProps.findMany({\n where: { treeId },\n });\n\n return instancePropsEntries.map((tree) => ({\n ...tree,\n props: JSON.parse(tree.props),\n }));\n};\n\nexport const clone = async ({\n previousTreeId,\n nextTreeId,\n}: {\n previousTreeId: string;\n nextTreeId: string;\n}) => {\n const props = await prisma.instanceProps.findMany({\n where: { treeId: previousTreeId },\n });\n if (props.length === 0) return;\n const data = props.map(({ id: _id, treeId: _treeId, ...rest }) => ({\n ...rest,\n treeId: nextTreeId,\n }));\n\n await prisma.$transaction(\n data.map((prop) =>\n prisma.instanceProps.create({\n data: prop,\n })\n )\n );\n};\n\nexport const patch = async (\n { treeId }: { treeId: Tree[\"id\"]; projectId: Project[\"id\"] },\n patches: Array<Patch>\n) => {\n const allProps = await loadByTreeId(treeId);\n\n // We should get rid of this by applying patches on the client to the original\n // model instead of the instanceId map.\n // The map is handy for accessing props, but probably should be just cached interface, not the main data structure.\n const allPropsMapByInstanceId = allProps.reduce((acc, prop) => {\n acc[prop.instanceId] = prop;\n return acc;\n }, {} as AllUserProps);\n const nextProps = applyPatches<AllUserProps>(\n allPropsMapByInstanceId,\n patches\n );\n\n await Promise.all(\n Object.values(nextProps).map(({ id, instanceId, treeId, props }) =>\n prisma.instanceProps.upsert({\n where: { id: id },\n create: { id: id, instanceId, treeId, props: JSON.stringify(props) },\n update: {\n props: JSON.stringify(props),\n },\n })\n )\n );\n};\n", "import * as db from \".\";\n\n/**\n * Conceptually publishing is cloning all data that affects user site\n * and referencing it under a new tree id.\n */\nexport const publish = async ({\n projectId,\n domain,\n}: {\n projectId: string | null;\n domain: string | null;\n}) => {\n if (projectId === null) {\n throw new Error(\"Project ID required\");\n }\n if (domain === null) {\n throw new Error(\"Domain required\");\n }\n\n const project = await db.project.loadById(projectId);\n if (project === null) {\n throw new Error(`Project \"${projectId}\" not found`);\n }\n\n const tree = await db.tree.clone(project.devTreeId);\n await db.props.clone({\n previousTreeId: project.devTreeId,\n nextTreeId: tree.id,\n });\n await db.breakpoints.clone({\n previousTreeId: project.devTreeId,\n nextTreeId: tree.id,\n });\n const prodTreeIdHistory = project.prodTreeIdHistory;\n if (project.prodTreeId) {\n prodTreeIdHistory.push(project.prodTreeId);\n }\n const updatedProject = await db.project.update({\n id: projectId,\n domain,\n prodTreeId: tree.id,\n prodTreeIdHistory,\n });\n return updatedProject;\n};\n", "import { type Data } from \"@webstudio-is/sdk\";\nimport * as db from \".\";\nimport { Project } from \"./project.server\";\n\nexport type CanvasData = Data & { project: Project };\n\nexport type ErrorData = {\n errors: string;\n};\n\nconst loadData = async (projectId: Project[\"id\"]) => {\n const project = await db.project.loadById(projectId);\n\n if (project === null) throw new Error(`Project \"${projectId}\" not found`);\n\n const [tree, props, breakpoints] = await Promise.all([\n db.tree.loadByProject(project, \"development\"),\n db.props.loadByProject(project, \"development\"),\n db.breakpoints.load(project.devTreeId),\n ]);\n\n if (tree === null) {\n throw new Error(\n `Tree ${project.devTreeId} not found for project ${projectId}`\n );\n }\n\n if (breakpoints === null) {\n throw new Error(`Breakpoints not found for project ${projectId}`);\n }\n\n return {\n tree,\n props,\n project,\n breakpoints: breakpoints.values,\n };\n};\n\nexport const loadCanvasData = async ({\n projectId,\n}: {\n projectId: Project[\"id\"];\n}): Promise<CanvasData | ErrorData> => {\n return await loadData(projectId);\n};\n\nexport type PreviewData = Data;\n\nexport const loadPreviewData = async ({\n projectId,\n}: {\n projectId: Project[\"id\"];\n}): Promise<PreviewData | ErrorData> => {\n const { tree, props, breakpoints } = await loadData(projectId);\n return { tree, props, breakpoints };\n};\n", "import {\n initialBreakpoints,\n type Project,\n type Tree,\n type Breakpoint,\n} from \"@webstudio-is/sdk\";\nimport ObjectId from \"bson-objectid\";\nimport { applyPatches, type Patch } from \"immer\";\nimport { prisma } from \"./prisma.server\";\n\nexport const load = async (treeId?: Tree[\"id\"]) => {\n if (typeof treeId !== \"string\") {\n throw new Error(\"Tree ID required\");\n }\n\n const breakpoint = await prisma.breakpoints.findUnique({\n where: { treeId },\n });\n\n if (breakpoint === null) {\n throw new Error(\"Breakpoint not found\");\n }\n\n return {\n ...breakpoint,\n values: JSON.parse(breakpoint.values),\n };\n};\n\nexport const getBreakpointsWithId = () =>\n initialBreakpoints.map((breakpoint) => ({\n ...breakpoint,\n id: ObjectId().toString(),\n }));\n\nexport const create = async (\n treeId: Project[\"id\"],\n breakpoints: Array<Breakpoint>\n) => {\n const data = {\n treeId,\n values: JSON.stringify(breakpoints),\n };\n await prisma.breakpoints.create({ data });\n return {\n ...data,\n breakpoints,\n };\n};\n\nexport const clone = async ({\n previousTreeId,\n nextTreeId,\n}: {\n previousTreeId: Tree[\"id\"];\n nextTreeId: Tree[\"id\"];\n}) => {\n const breakpoints = await load(previousTreeId);\n if (breakpoints === null) {\n throw new Error(`Didn't find breakpoints with tree id \"${previousTreeId}\"`);\n }\n await create(nextTreeId, breakpoints.values);\n};\n\nexport const patch = async (\n { treeId }: { treeId: Tree[\"id\"]; projectId: Project[\"id\"] },\n patches: Array<Patch>\n) => {\n const breakpoints = await load(treeId);\n if (breakpoints === null) return;\n const nextBreakpoints = applyPatches(breakpoints.values, patches);\n await prisma.breakpoints.update({\n where: { treeId },\n data: { values: nextBreakpoints },\n });\n};\n", "import { type LoaderFunction, redirect } from \"@remix-run/node\";\nimport type { User } from \"@webstudio-is/sdk\";\nimport * as db from \"apps/designer/app/shared/db\";\nimport { ensureUserCookie } from \"apps/designer/app/shared/session\";\nimport config from \"apps/designer/app/config\";\nimport type { Project } from \"apps/designer/app/shared/db/project.server\";\n\nconst ensureProject = async ({\n userId,\n domain,\n}: {\n userId: User[\"id\"];\n domain: string;\n}): Promise<Project> => {\n const projects = await db.project.loadManyByUserId(userId);\n if (projects.length !== 0) return projects[0];\n\n return await db.project.clone(domain, userId);\n};\n\n/**\n * Currently this is used to demo the designer from landing page without\n * having to sign up.\n *\n * 1. Set cookie with a random user id if not already set\n * 2. Clone the project by domain if user doesn't have any projects yet\n * 3. Redirect user to the designer with the cloned project\n */\nexport const loader: LoaderFunction = async ({ request, params }) => {\n if (params.domain === undefined) return { errors: \"Domain required\" };\n const { headers, userId } = await ensureUserCookie(request);\n try {\n const project = await ensureProject({ userId, domain: params.domain });\n return redirect(`${config.designerPath}/${project?.id}`, { headers });\n } catch (error: unknown) {\n if (error instanceof Error) {\n return { errors: error.message };\n }\n }\n return { errors: \"Unexpected error\" };\n};\n", "import ObjectId from \"bson-objectid\";\nimport { createCookie } from \"@remix-run/node\";\n\nconst userIdParser = createCookie(\"user-id\", {\n maxAge: 604_800, // one week\n});\n\nexport const ensureUserCookie = async (\n request: Request\n): Promise<{ userId: string; headers?: { [key: string]: string } }> => {\n const cookieString = request.headers.get(\"Cookie\");\n const userId = await userIdParser.parse(cookieString);\n if (userId !== null) return { userId };\n // We use a generated id temporarily as a way to demonstrate the designer\n // to a new user without a signup.\n const generatedUserId = ObjectId().toString();\n return {\n headers: {\n \"Set-Cookie\": await userIdParser.serialize(generatedUserId),\n },\n userId: userId || generatedUserId,\n };\n};\n", "import isNil from \"lodash/isNil\";\nimport { useEffect, useState } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { sentryException } from \"../sentry\";\n\nexport const AUTH_PROVIDERS = {\n LOGIN_DEV: \"login_dev\",\n LOGIN_GITHUB: \"login_github\",\n LOGIN_GOOGLE: \"login_google\",\n};\n\nexport const LOGIN_ERROR_MESSAGES = {\n [AUTH_PROVIDERS.LOGIN_DEV]: \"There has been an issue logging you in with dev\",\n [AUTH_PROVIDERS.LOGIN_GITHUB]:\n \"There has been an issue logging you in with Github\",\n [AUTH_PROVIDERS.LOGIN_GOOGLE]:\n \"There has been an issue logging you in with Google\",\n};\n\nexport const useLoginErrorMessage = (): string => {\n const [searchParams, setSearchParams] = useSearchParams();\n const [messageToReturn, setMessageToReturn] = useState(\"\");\n\n useEffect(() => {\n const error = searchParams.get(\"error\");\n const message = searchParams.get(\"message\");\n\n const hasMessageToShow =\n error !== null && !isNil(message) && message !== \"\";\n\n if (hasMessageToShow) {\n sentryException({\n message: message,\n });\n setMessageToReturn(message);\n\n setSearchParams({});\n return;\n }\n\n switch (error) {\n case AUTH_PROVIDERS.LOGIN_DEV:\n setMessageToReturn(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_DEV]);\n break;\n case AUTH_PROVIDERS.LOGIN_GITHUB:\n setMessageToReturn(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_GITHUB]);\n break;\n case AUTH_PROVIDERS.LOGIN_GOOGLE:\n setMessageToReturn(LOGIN_ERROR_MESSAGES[AUTH_PROVIDERS.LOGIN_GOOGLE]);\n break;\n\n default:\n break;\n }\n\n setSearchParams({});\n }, [searchParams, setSearchParams]);\n\n return messageToReturn;\n};\n", "import { type LoaderFunction } from \"@remix-run/node\";\nimport { type InstanceProps } from \"@webstudio-is/sdk\";\nimport * as db from \"apps/designer/app/shared/db\";\n\ntype ErrorData = {\n errors: string;\n};\n\nexport const loader: LoaderFunction = async ({\n params,\n}): Promise<Array<InstanceProps> | ErrorData> => {\n try {\n const project = await db.project.loadById(params.projectId);\n return await db.props.loadByProject(project, \"production\");\n } catch (error) {\n if (error instanceof Error) {\n return {\n errors: error.message,\n };\n }\n }\n return { errors: \"Unexpected error\" };\n};\n", "import { type LoaderFunction } from \"@remix-run/node\";\nimport type { Tree } from \"@webstudio-is/sdk\";\nimport * as db from \"apps/designer/app/shared/db\";\n\nexport type ErrorData = {\n errors: string;\n};\n\nexport const loader: LoaderFunction = async ({\n params,\n}): Promise<Tree | null | ErrorData> => {\n try {\n const project = await db.project.loadById(params.projectId);\n return await db.tree.loadByProject(project, \"production\");\n } catch (error) {\n if (error instanceof Error) {\n return {\n errors: error.message,\n };\n }\n }\n return { errors: \"Unexpected error\" };\n};\n", "import { type ActionFunction } from \"@remix-run/node\";\nimport * as db from \"apps/designer/app/shared/db\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const formData = await request.formData();\n const domain = formData.get(\"domain\") as string | null;\n const projectId = formData.get(\"projectId\") as string | null;\n try {\n const project = await db.misc.publish({ projectId, domain });\n return { domain: project.domain };\n } catch (error) {\n if (error instanceof Error) {\n return {\n errors: error.message,\n };\n }\n }\n return { errors: \"Unexpected error\" };\n};\n", "import { ActionFunction, redirect } from \"@remix-run/node\";\nimport config from \"apps/designer/app/config\";\nimport { authenticator } from \"apps/designer/app/services/auth.server\";\nimport { sentryException } from \"apps/designer/app/shared/sentry\";\nimport {\n ensureUserCookie,\n AUTH_PROVIDERS,\n} from \"apps/designer/app/shared/session\";\n\nexport default function GH() {\n return null;\n}\n\nexport const action: ActionFunction = async ({ request }) => {\n try {\n const { userId } = await ensureUserCookie(request);\n return await authenticator.authenticate(\"github\", request, {\n context: {\n userId,\n },\n successRedirect: config.dashboardPath,\n throwOnError: true,\n });\n } catch (error: unknown) {\n // all redirects are basically errors and in that case we don't want to catch it\n if (error instanceof Response) return error;\n if (error instanceof Error) {\n sentryException({\n message: error.message,\n extra: {\n loginMethod: AUTH_PROVIDERS.LOGIN_GITHUB,\n },\n });\n return redirect(\n `${config.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GITHUB}&message=${\n error?.message || \"\"\n }`\n );\n }\n }\n};\n", "import { User } from \"@prisma/client\";\nimport { Authenticator } from \"remix-auth\";\nimport { FormStrategy } from \"remix-auth-form\";\nimport { GitHubStrategy } from \"remix-auth-github\";\nimport { GoogleStrategy } from \"remix-auth-google\";\nimport config from \"apps/designer/app/config\";\nimport { sessionStorage } from \"apps/designer/app/services/session.server\";\nimport {\n createOrLoginWithDev,\n createOrLoginWithGithub,\n createOrLoginWithGoogle,\n} from \"apps/designer/app/shared/db/user.server\";\nimport { sentryException } from \"apps/designer/app/shared/sentry\";\nimport { AUTH_PROVIDERS } from \"apps/designer/app/shared/session\";\n\nconst url = `${\n process.env.VERCEL_URL\n ? `https://${process.env.VERCEL_URL}`\n : `http://localhost:${process.env.PORT || 3000}`\n}${config.authPath}`;\n\nconst github = new GitHubStrategy(\n {\n clientID: process.env.GH_CLIENT_ID as string,\n clientSecret: process.env.GH_CLIENT_SECRET as string,\n callbackURL: `${url}${config.githubCallbackPath}`,\n },\n async ({ profile, context }) => {\n const user = await createOrLoginWithGithub(profile, context?.userId);\n\n return user;\n }\n);\n\nconst google = new GoogleStrategy(\n {\n clientID: process.env.GOOGLE_CLIENT_ID as string,\n clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,\n callbackURL: `${url}${config.googleCallbackPath}`,\n },\n async ({ profile, context }) => {\n const user = await createOrLoginWithGoogle(profile, context?.userId);\n\n return user;\n }\n);\n\n// Create an instance of the authenticator, pass a generic with what\n// strategies will return and will store in the session\nexport const authenticator = new Authenticator<User>(sessionStorage);\nif (process.env.GH_CLIENT_ID && process.env.GH_CLIENT_SECRET) {\n authenticator.use(github, \"github\");\n}\nif (process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET) {\n authenticator.use(google, \"google\");\n}\nif (process.env.DEV_LOGIN === \"true\") {\n authenticator.use(\n new FormStrategy(async ({ form }) => {\n const secret = form.get(\"secret\");\n\n if (secret === process.env.AUTH_SECRET) {\n try {\n const user = await createOrLoginWithDev(secret);\n return user;\n } catch (error: unknown) {\n if (error instanceof Error) {\n sentryException({\n message: error.message,\n extra: {\n loginMethod: AUTH_PROVIDERS.LOGIN_DEV,\n },\n });\n }\n }\n }\n\n throw new Error(\"The dev login code is incorrect\");\n }),\n \"dev\"\n );\n}\n", "import { createCookieSessionStorage } from \"@remix-run/node\";\n\n// export the whole sessionStorage object\nexport const sessionStorage = createCookieSessionStorage({\n cookie: {\n maxAge: 60 * 60 * 24 * 30,\n name: \"_session\", // use any name you want here\n sameSite: \"lax\", // this helps with CSRF\n path: \"/\", // remember to add this so the cookie will work in all routes\n httpOnly: true, // for security reasons, make this cookie http only\n secrets: process.env.AUTH_SECRET ? [process.env.AUTH_SECRET] : undefined, // replace this with an actual secret\n secure: process.env.NODE_ENV === \"production\", // enable this in prod only\n },\n});\n\n// you can also export the methods individually for your own usage\nexport const { getSession, commitSession, destroySession } = sessionStorage;\n", "import { User } from \"@prisma/client\";\nimport { GitHubProfile } from \"remix-auth-github\";\nimport { GoogleProfile } from \"remix-auth-google\";\nimport { prisma } from \"./prisma.server\";\n\nconst genericCreateAccount = async (\n userData: {\n email: string;\n username: string;\n image: string;\n provider: string;\n },\n userId: string\n): Promise<User> => {\n const existingUserWithId = await prisma.user.findUnique({\n where: {\n id: userId,\n },\n });\n if (existingUserWithId) {\n const connectedUser = await prisma.user.update({\n where: {\n id: userId,\n },\n data: userData,\n });\n\n if (connectedUser.teamId) {\n return connectedUser;\n }\n\n await prisma.team.create({\n data: {\n users: {\n connect: {\n id: connectedUser.id,\n },\n },\n },\n });\n\n return connectedUser;\n }\n\n const existingUserWithEmail = await prisma.user.findUnique({\n where: {\n email: userData.email,\n },\n });\n\n if (existingUserWithEmail) {\n if (existingUserWithEmail.teamId) {\n return existingUserWithEmail;\n }\n await prisma.team.create({\n data: {\n users: {\n connect: {\n id: existingUserWithEmail.id,\n },\n },\n },\n });\n\n return existingUserWithEmail;\n }\n\n const newTeam = await prisma.team.create({\n data: {\n users: {\n create: {\n id: userId,\n ...userData,\n },\n },\n },\n include: {\n users: {\n where: {\n id: userId,\n },\n },\n },\n });\n\n return newTeam.users[0];\n};\n\nexport const createOrLoginWithGithub = async (\n profile: GitHubProfile,\n userId: string\n): Promise<User> => {\n const userData = {\n email: profile._json.email,\n username: profile.displayName,\n image: profile._json.avatar_url,\n provider: profile.provider,\n };\n const newUser = await genericCreateAccount(userData, userId);\n return newUser;\n};\n\nexport const createOrLoginWithGoogle = async (\n profile: GoogleProfile,\n userId: string\n): Promise<User> => {\n const userData = {\n email: profile._json.email,\n username: profile.displayName,\n image: profile._json.picture,\n provider: profile.provider,\n };\n const newUser = await genericCreateAccount(userData, userId);\n return newUser;\n};\n\nexport const createOrLoginWithDev = async (userId: string): Promise<User> => {\n const userData = {\n email: \"[email protected]\",\n username: \"admin\",\n image: \"\",\n provider: \"dev\",\n };\n\n const newUser = await genericCreateAccount(userData, userId);\n return newUser;\n};\n", "import { LoaderFunction, redirect } from \"@remix-run/node\";\nimport config from \"apps/designer/app/config\";\nimport { authenticator } from \"apps/designer/app/services/auth.server\";\nimport {\n ensureUserCookie,\n AUTH_PROVIDERS,\n} from \"apps/designer/app/shared/session\";\n\nexport const loader: LoaderFunction = async ({ request }) => {\n const { userId } = await ensureUserCookie(request);\n const url = new URL(request.url);\n const error = url.searchParams.get(\"error\");\n const error_description = url.searchParams.get(\"error_description\");\n if (error) {\n return redirect(\n `${config.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GITHUB}&message=${\n error_description || error\n }`\n );\n }\n return authenticator.authenticate(\"github\", request, {\n context: {\n userId,\n },\n successRedirect: config.dashboardPath,\n failureRedirect: config.loginPath,\n });\n};\n", "import { ActionFunction, LoaderFunction, redirect } from \"@remix-run/node\";\nimport config from \"apps/designer/app/config\";\nimport { authenticator } from \"apps/designer/app/services/auth.server\";\nimport { sentryException } from \"apps/designer/app/shared/sentry\";\nimport {\n ensureUserCookie,\n AUTH_PROVIDERS,\n} from \"apps/designer/app/shared/session\";\n\nexport default function Google() {\n return null;\n}\n\nexport const loader: LoaderFunction = () => redirect(\"/login\");\n\nexport const action: ActionFunction = async ({ request }) => {\n try {\n const { userId } = await ensureUserCookie(request);\n return await authenticator.authenticate(\"google\", request, {\n context: {\n userId,\n },\n successRedirect: config.dashboardPath,\n throwOnError: true,\n });\n } catch (error: unknown) {\n // all redirects are basically errors and in that case we don't want to catch it\n if (error instanceof Response) return error;\n if (error instanceof Error) {\n sentryException({\n message: error.message,\n extra: {\n loginMethod: AUTH_PROVIDERS.LOGIN_GOOGLE,\n },\n });\n return redirect(\n `${config.loginPath}?error=${AUTH_PROVIDERS.LOGIN_GOOGLE}&message=${\n error?.message || \"\"\n }`\n );\n }\n }\n};\n", "import { LoaderFunction } from \"@remix-run/node\";\nimport config from \"apps/designer/app/config\";\nimport { authenticator } from \"apps/designer/app/services/auth.server\";\nimport { ensureUserCookie } from \"apps/designer/app/shared/session\";\n\nexport const loader: LoaderFunction = async ({ request }) => {\n const { userId } = await ensureUserCookie(request);\n return authenticator.authenticate(\"google\", request, {\n successRedirect: config.dashboardPath,\n failureRedirect: config.loginPath,\n context: {\n userId,\n },\n });\n};\n", "import { type ActionFunction } from \"@remix-run/node\";\nimport * as db from \"apps/designer/app/shared/db\";\nimport { type SyncItem } from \"immerhin\";\nimport { type Project, type Tree } from \"@webstudio-is/sdk\";\n\nconst updaters = {\n root: db.tree.patchRoot,\n props: db.props.patch,\n breakpoints: db.breakpoints.patch,\n};\n\ntype UpdaterKey = keyof typeof updaters;\n\ntype PatchData = {\n transactions: Array<SyncItem>;\n treeId: Tree[\"id\"];\n projectId: Project[\"id\"];\n};\n\nexport const action: ActionFunction = async ({ request }) => {\n const { treeId, projectId, transactions }: PatchData = await request.json();\n if (treeId === undefined) return { errors: \"Tree id required\" };\n if (projectId === undefined) return { errors: \"Project id required\" };\n // @todo parallelize the updates\n // currently not possible because we fetch the entire tree\n // and parallelized updates will cause unpredictable side effects\n for await (const transaction of transactions) {\n for await (const change of transaction.changes) {\n const { namespace, patches } = change;\n if (namespace in updaters === false) {\n return { errors: `Unknown namespace \"${namespace}\"` };\n }\n await updaters[namespace as UpdaterKey]({ treeId, projectId }, patches);\n }\n }\n return { status: \"ok\" };\n};\n", "import type { LoaderFunction, MetaFunction } from \"@remix-run/node\";\nimport { Designer } from \"apps/designer/app/shared/documents/designer\";\nimport env from \"apps/designer/app/env.server\";\n\nexport const loader: LoaderFunction = () => ({\n env,\n});\n\nexport const meta: MetaFunction = () => {\n return { title: \"Webstudio Dashboard\" };\n};\n\nexport default Designer;\n", "import { Links, LiveReload, Meta, Outlet, Scripts } from \"@remix-run/react\";\nimport { CriticalCss } from \"@webstudio-is/sdk\";\nimport { darkTheme } from \"apps/designer/app/shared/design-system\";\nimport { Env } from \"apps/designer/app/shared/env\";\n\nexport const Designer = () => {\n return (\n <html lang=\"en\">\n <head>\n <meta charSet=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n <Meta />\n <Links />\n <CriticalCss />\n </head>\n <body className={darkTheme}>\n <Outlet />\n <Env />\n <Scripts />\n {process.env.NODE_ENV === \"development\" && <LiveReload />}\n </body>\n </html>\n );\n};\n", "// Environment variables we want to send to the UI inlined in the document.\n// Never use a private key here, because it will become public.\nconst env = {\n SENTRY_DSN: process.env.SENTRY_DSN,\n VERCEL_ENV: process.env.VERCEL_ENV,\n} as const;\n\nexport default env;\n\nexport type Env = typeof env;\n", "import { useLoaderData } from \"@remix-run/react\";\nimport {\n redirect,\n type LoaderFunction,\n type ActionFunction,\n json,\n} from \"@remix-run/node\";\nimport { Dashboard, links } from \"apps/designer/app/dashboard\";\nimport * as db from \"apps/designer/app/shared/db\";\nimport config from \"apps/designer/app/config\";\nimport { ensureUserCookie } from \"apps/designer/app/shared/session\";\nimport { authenticator } from \"apps/designer/app/services/auth.server\";\nexport { links };\n\nexport const action: ActionFunction = async ({ request }) => {\n const formData = await request.formData();\n const title = formData.get(\"project\");\n if (typeof title !== \"string\") return { errors: \"Title required\" };\n const { userId, headers } = await ensureUserCookie(request);\n const authenticatedUser = await authenticator.isAuthenticated(request);\n try {\n const project = await db.project.create({\n title,\n userId: authenticatedUser?.id || userId,\n });\n return redirect(`${config.designerPath}/${project?.id}`, { headers });\n } catch (error) {\n if (error instanceof Error) {\n return { errors: error.message };\n }\n }\n return { errors: \"Unexpected error\" };\n};\n\nexport const loader: LoaderFunction = async ({ request }) => {\n const user = await authenticator.isAuthenticated(request);\n if (!user) {\n return redirect(config.loginPath);\n }\n const { headers } = await ensureUserCookie(request);\n const projects = await db.project.loadManyByUserId(user.id);\n return json({ config, projects, user }, headers);\n};\n\nconst DashboardRoute = () => {\n const { config, projects, user } = useLoaderData();\n return <Dashboard config={config} user={user} projects={projects} />;\n};\n\nexport default DashboardRoute;\n", "import { useActionData } from \"@remix-run/react\";\n\nimport { Flex } from \"apps/designer/app/shared/design-system\";\nimport interStyles from \"~/shared/font-faces/inter.css\";\nimport dashboardStyles from \"./dashboard.css\";\nimport { User } from \"@prisma/client\";\nimport { DashboardHeader } from \"./components/header\";\nimport { SelectProjectCard } from \"./components/card\";\n\nexport const links = () => {\n return [\n {\n rel: \"stylesheet\",\n href: interStyles,\n },\n {\n rel: \"stylesheet\",\n href: dashboardStyles,\n },\n ];\n};\n\ntype DashboardProps = {\n projects?: Array<{ id: string; title: string }>;\n user: User;\n config: { designerPath: \"string\" };\n};\n\nexport const Dashboard = ({ projects = [], config, user }: DashboardProps) => {\n const actionData = useActionData();\n return (\n <>\n <DashboardHeader user={user} />\n <Flex\n css={{ height: \"100vh\" }}\n direction=\"column\"\n align=\"center\"\n justify=\"center\"\n >\n <SelectProjectCard\n projects={projects}\n config={config}\n errors={actionData?.errors}\n />\n </Flex>\n </>\n );\n};\n", "import { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport { Avatar } from \"apps/designer/app/shared/design-system/components/avatar\";\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n Button,\n Text,\n Flex,\n} from \"apps/designer/app/shared/design-system\";\nimport { User } from \"@prisma/client\";\nimport { useNavigate } from \"react-router-dom\";\n\nexport const DashboardHeader = ({ user }: { user: User }) => {\n const navigate = useNavigate();\n const userNameFallback = (user?.username || user?.email || \"X\")\n .charAt(0)\n .toLocaleUpperCase();\n\n return (\n <Flex\n as=\"header\"\n align=\"center\"\n justify=\"end\"\n css={{\n p: \"$1\",\n bc: \"$loContrast\",\n borderBottom: \"1px solid $slate8\",\n }}\n >\n <Flex gap=\"1\" align=\"center\">\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"raw\" aria-label=\"Menu Button\">\n <Flex gap=\"1\" align=\"center\" css={{ height: \"$5\" }}>\n <Avatar\n src={user?.image || undefined}\n fallback={userNameFallback}\n />\n\n <ChevronDownIcon width={15} height={15} color=\"white\" />\n </Flex>\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={() => navigate(\"/logout\")}>\n <Text>Logout</Text>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </Flex>\n </Flex>\n );\n};\n", "import React from \"react\";\nimport { styled, VariantProps, CSS } from \"../stitches.config\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { Box } from \"./box\";\nimport { Status } from \"./status\";\n\nconst StyledAvatar = styled(AvatarPrimitive.Root, {\n alignItems: \"center\",\n justifyContent: \"center\",\n verticalAlign: \"middle\",\n overflow: \"hidden\",\n userSelect: \"none\",\n boxSizing: \"border-box\",\n display: \"flex\",\n flexShrink: 0,\n position: \"relative\",\n border: \"none\",\n fontFamily: \"inherit\",\n lineHeight: \"1\",\n margin: \"0\",\n outline: \"none\",\n padding: \"0\",\n fontWeight: \"500\",\n color: \"$hiContrast\",\n\n \"&::before\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: \"inherit\",\n boxShadow: \"inset 0px 0px 1px rgba(0, 0, 0, 0.12)\",\n },\n\n variants: {\n size: {\n \"1\": {\n width: \"$3\",\n height: \"$3\",\n },\n \"2\": {\n width: \"$5\",\n height: \"$5\",\n },\n \"3\": {\n width: \"$6\",\n height: \"$6\",\n },\n \"4\": {\n width: \"$7\",\n height: \"$7\",\n },\n \"5\": {\n width: \"$8\",\n height: \"$8\",\n },\n \"6\": {\n width: \"$9\",\n height: \"$9\",\n },\n },\n variant: {\n hiContrast: {\n backgroundColor: \"$hiContrast\",\n color: \"$loContrast\",\n },\n gray: {\n backgroundColor: \"$slate5\",\n },\n tomato: {\n backgroundColor: \"$tomato5\",\n },\n red: {\n backgroundColor: \"$red5\",\n },\n crimson: {\n backgroundColor: \"$crimson5\",\n },\n pink: {\n backgroundColor: \"$pink5\",\n },\n plum: {\n backgroundColor: \"$plum5\",\n },\n purple: {\n backgroundColor: \"$purple5\",\n },\n violet: {\n backgroundColor: \"$violet5\",\n },\n indigo: {\n backgroundColor: \"$indigo5\",\n },\n blue: {\n backgroundColor: \"$blue5\",\n },\n cyan: {\n backgroundColor: \"$cyan5\",\n },\n teal: {\n backgroundColor: \"$teal5\",\n },\n green: {\n backgroundColor: \"$green5\",\n },\n grass: {\n backgroundColor: \"$grass5\",\n },\n brown: {\n backgroundColor: \"$brown5\",\n },\n bronze: {\n backgroundColor: \"$bronze5\",\n },\n gold: {\n backgroundColor: \"$gold5\",\n },\n sky: {\n backgroundColor: \"$sky5\",\n },\n mint: {\n backgroundColor: \"$mint5\",\n },\n lime: {\n backgroundColor: \"$lime5\",\n },\n yellow: {\n backgroundColor: \"$yellow5\",\n },\n amber: {\n backgroundColor: \"$amber5\",\n },\n orange: {\n backgroundColor: \"$orange5\",\n },\n },\n shape: {\n square: {\n borderRadius: \"$2\",\n },\n circle: {\n borderRadius: \"50%\",\n },\n },\n inactive: {\n true: {\n opacity: \".3\",\n },\n },\n interactive: {\n true: {\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: \"0\",\n right: \"0\",\n bottom: \"0\",\n left: \"0\",\n backgroundColor: \"rgba(0,0,0,.08)\",\n opacity: \"0\",\n pointerEvents: \"none\",\n transition: \"opacity 25ms linear\",\n },\n \"@hover\": {\n \"&:hover\": {\n \"&::after\": {\n opacity: \"1\",\n },\n },\n },\n '&[data-state=\"open\"]': {\n \"&::after\": {\n backgroundColor: \"rgba(0,0,0,.12)\",\n opacity: \"1\",\n },\n },\n },\n },\n },\n defaultVariants: {\n size: \"2\",\n variant: \"gray\",\n shape: \"circle\",\n },\n});\n\nconst StyledAvatarImage = styled(AvatarPrimitive.Image, {\n display: \"flex\",\n objectFit: \"cover\",\n boxSizing: \"border-box\",\n height: \"100%\",\n verticalAlign: \"middle\",\n width: \"100%\",\n});\n\nconst StyledAvatarFallback = styled(AvatarPrimitive.Fallback, {\n textTransform: \"uppercase\",\n borderRadius: \"50%\",\n variants: {\n size: {\n \"1\": {\n fontSize: \"10px\",\n lineHeight: \"15px\",\n },\n \"2\": {\n fontSize: \"$3\",\n },\n \"3\": {\n fontSize: \"$6\",\n },\n \"4\": {\n fontSize: \"$7\",\n },\n \"5\": {\n fontSize: \"$8\",\n },\n \"6\": {\n fontSize: \"$9\",\n },\n },\n },\n defaultVariants: {\n size: \"2\",\n },\n});\n\nexport const AvatarNestedItem = styled(\"div\", {\n boxShadow: \"0 0 0 2px $colors$loContrast\",\n borderRadius: \"50%\",\n});\n\nexport const AvatarGroup = styled(\"div\", {\n display: \"flex\",\n flexDirection: \"row-reverse\",\n [`& ${AvatarNestedItem}:nth-child(n+2)`]: {\n marginRight: \"-$1\",\n },\n});\n\ntype StatusVariants = React.ComponentProps<typeof Status>;\ntype StatusColors = Pick<StatusVariants, \"variant\">;\n\ntype AvatarVariants = VariantProps<typeof StyledAvatar>;\ntype AvatarPrimitiveProps = React.ComponentProps<typeof AvatarPrimitive.Root>;\ntype AvatarOwnProps = AvatarPrimitiveProps &\n AvatarVariants & {\n css?: CSS;\n alt?: string;\n src?: string;\n fallback?: React.ReactNode;\n status?: StatusColors[\"variant\"];\n };\n\nexport const Avatar = React.forwardRef<\n React.ElementRef<typeof StyledAvatar>,\n AvatarOwnProps\n>(\n (\n { alt, src, fallback, size, variant, shape, css, status, ...props },\n forwardedRef\n ) => {\n return (\n <Box\n css={{\n ...css,\n position: \"relative\",\n height: \"fit-content\",\n width: \"fit-content\",\n }}\n >\n <StyledAvatar\n {...props}\n ref={forwardedRef}\n size={size}\n variant={variant}\n shape={shape}\n >\n <StyledAvatarImage alt={alt} src={src} />\n <StyledAvatarFallback size={size}>{fallback}</StyledAvatarFallback>\n </StyledAvatar>\n {status && (\n <Box\n css={{\n position: \"absolute\",\n bottom: \"0\",\n right: \"0\",\n boxShadow: \"0 0 0 3px $colors$loContrast\",\n borderRadius: \"$round\",\n mr: \"-3px\",\n mb: \"-3px\",\n }}\n >\n <Status size={size && size > 2 ? \"2\" : \"1\"} variant={status} />\n </Box>\n )}\n </Box>\n );\n }\n);\n\nAvatar.displayName = \"Avatar\";\n", "import { styled } from \"../stitches.config\";\n\nexport const Status = styled(\"div\", {\n borderRadius: \"50%\",\n flexShrink: 0,\n\n variants: {\n size: {\n \"1\": {\n width: 5,\n height: 5,\n },\n \"2\": {\n width: 9,\n height: 9,\n },\n },\n variant: {\n gray: {\n backgroundColor: \"$slate7\",\n },\n blue: {\n backgroundColor: \"$blue9\",\n },\n green: {\n backgroundColor: \"$green9\",\n },\n yellow: {\n backgroundColor: \"$yellow9\",\n },\n red: {\n backgroundColor: \"$red9\",\n },\n },\n },\n defaultVariants: {\n size: \"2\",\n variant: \"gray\",\n },\n});\n", "import { useState } from \"react\";\nimport { Form, useTransition } from \"@remix-run/react\";\nimport { useNavigate } from \"react-router-dom\";\n\nimport {\n Flex,\n Card,\n Select,\n TextField,\n Button,\n Heading,\n Text,\n} from \"apps/designer/app/shared/design-system\";\n\ntype SelectProjectProjectCardProps = {\n projects: Array<{ id: string; title: string }>;\n config: { designerPath: \"string\" };\n errors: string;\n};\n\nexport const SelectProjectCard = ({\n projects,\n config,\n errors,\n}: SelectProjectProjectCardProps) => {\n const [selectedProject, setSelectedProject] = useState(\"\");\n const [newProject, setNewProject] = useState(\"My awesome project\");\n const navigate = useNavigate();\n const transition = useTransition();\n\n const handleOpen = () => {\n navigate(`${config.designerPath}/${selectedProject}`);\n };\n\n const options = [\"\", ...projects.map((project) => project.id)];\n\n return (\n <Card size={2}>\n <Flex direction=\"column\" gap=\"4\">\n <Heading size=\"2\" css={{ textAlign: \"center\" }}>\n Select a project\n </Heading>\n <Select\n size={2}\n name=\"project\"\n options={options}\n onChange={setSelectedProject}\n value={selectedProject}\n placeholder=\"Create new project\"\n getLabel={(option) =>\n projects.find((project) => project.id === option)?.title ||\n \"Create new project\"\n }\n />\n {selectedProject === \"\" ? (\n <Form method=\"post\">\n <Flex gap=\"1\">\n <TextField\n size={2}\n state={errors ? \"invalid\" : undefined}\n name=\"project\"\n defaultValue={newProject}\n onFocus={(event) => {\n event.target.select();\n }}\n onChange={(event) => {\n setNewProject(event.target.value);\n }}\n />\n <Button\n size={2}\n disabled={\n newProject.length === 0 || transition.state === \"submitting\"\n }\n type=\"submit\"\n >\n {transition.state === \"submitting\" ? \"Creating...\" : \"Create\"}\n </Button>\n </Flex>\n {errors ? (\n <Text variant=\"red\" css={{ marginTop: \"$1\" }}>\n {errors}\n </Text>\n ) : null}\n </Form>\n ) : (\n <Button onClick={handleOpen} size={2}>\n Open\n </Button>\n )}\n </Flex>\n </Card>\n );\n};\n", "import { ActionFunction, redirect } from \"@remix-run/node\";\nimport config from \"apps/designer/app/config\";\nimport { authenticator } from \"apps/designer/app/services/auth.server\";\nimport { AUTH_PROVIDERS } from \"apps/designer/app/shared/session\";\n\nexport default function Dev() {\n return null;\n}\n\nexport const action: ActionFunction = async ({ request }) => {\n try {\n return await authenticator.authenticate(\"dev\", request, {\n successRedirect: config.dashboardPath,\n throwOnError: true,\n });\n } catch (error: unknown) {\n // all redirects are basically errors and in that case we don't want to catch it\n if (error instanceof Response) return error;\n if (error instanceof Error) {\n return redirect(\n `${config.loginPath}?error=${AUTH_PROVIDERS.LOGIN_DEV}&message=${\n error?.message || \"\"\n }`\n );\n }\n }\n};\n", "import type { LoaderFunction, MetaFunction } from \"@remix-run/node\";\nimport { Designer } from \"apps/designer/app/shared/documents/designer\";\nimport env from \"apps/designer/app/env.server\";\n\nexport const loader: LoaderFunction = () => ({\n env,\n});\n\nexport const meta: MetaFunction = () => {\n return { title: \"Webstudio\" };\n};\n\nexport default Designer;\n", "import { useLoaderData } from \"@remix-run/react\";\nimport type { LoaderFunction } from \"@remix-run/node\";\nimport type { Project } from \"@webstudio-is/sdk\";\nimport { Designer, links } from \"apps/designer/app/designer\";\nimport * as db from \"apps/designer/app/shared/db\";\nimport config from \"apps/designer/app/config\";\nimport env from \"apps/designer/app/env.server\";\nexport { links };\n\nexport const loader: LoaderFunction = async ({ params }) => {\n if (params.id === undefined) throw new Error(\"Project id undefined\");\n const project = await db.project.loadById(params.id);\n if (project === null) {\n return { errors: `Project \"${params.id}\" not found` };\n }\n return { config, project, env };\n};\n\ntype Data = {\n config: typeof config;\n project: Project;\n};\n\ntype Error = {\n errors: \"string\";\n};\n\nconst DesignerRoute = () => {\n const data = useLoaderData<Data | Error>();\n if (\"errors\" in data) {\n return <p>{data.errors}</p>;\n }\n return <Designer {...data} />;\n};\n\nexport default DesignerRoute;\n", "import { useCallback, useState } from \"react\";\nimport { DndProvider } from \"react-dnd\";\nimport { HTML5Backend } from \"react-dnd-html5-backend\";\nimport { type Project, useSubscribe, usePublish } from \"@webstudio-is/sdk\";\nimport type { Config } from \"apps/designer/app/config\";\nimport type {\n HoveredInstanceData,\n SelectedInstanceData,\n} from \"apps/designer/app/shared/canvas-components\";\nimport {\n Box,\n Flex,\n Grid,\n type CSS,\n} from \"apps/designer/app/shared/design-system\";\nimport interStyles from \"~/shared/font-faces/inter.css\";\nimport { SidebarLeft } from \"./features/sidebar-left\";\nimport { Inspector } from \"./features/inspector\";\nimport {\n useHoveredInstanceData,\n useSelectedInstanceData,\n useSyncStatus,\n} from \"./shared/nano-states\";\nimport { Topbar } from \"./features/topbar\";\nimport designerStyles from \"./designer.css\";\nimport { Breadcrumbs } from \"./features/breadcrumbs\";\nimport { TreePrevew } from \"./features/tree-preview\";\nimport {\n useUpdateCanvasWidth,\n useSubscribeBreakpoints,\n} from \"./features/breakpoints\";\nimport {\n useReadCanvasRect,\n Workspace,\n CanvasIframe,\n} from \"./features/workspace\";\nimport { usePublishShortcuts } from \"./shared/shortcuts\";\nimport { type SyncStatus } from \"apps/designer/app/shared/sync\";\nimport {\n useIsPreviewMode,\n useRootInstance,\n} from \"apps/designer/app/shared/nano-states\";\n\nexport const links = () => {\n return [\n { rel: \"stylesheet\", href: interStyles },\n { rel: \"stylesheet\", href: designerStyles },\n ];\n};\n\nconst useSubscribeRootInstance = () => {\n const [, setValue] = useRootInstance();\n useSubscribe<\"loadRootInstance\">(\"loadRootInstance\", setValue);\n};\n\nconst useSubscribeSelectedInstanceData = () => {\n const [, setValue] = useSelectedInstanceData();\n useSubscribe<\"selectInstance\", SelectedInstanceData>(\n \"selectInstance\",\n setValue\n );\n};\n\nconst useSubscribeHoveredInstanceData = () => {\n const [, setValue] = useHoveredInstanceData();\n useSubscribe<\"hoverInstance\", HoveredInstanceData>(\"hoverInstance\", setValue);\n};\n\nconst useSubscribeSyncStatus = () => {\n const [, setValue] = useSyncStatus();\n useSubscribe<\"syncStatus\", SyncStatus>(\"syncStatus\", setValue);\n};\n\nconst useIsDragging = (): [boolean, (isDragging: boolean) => void] => {\n const [isDragging, setIsDragging] = useState<boolean>(false);\n useSubscribe<\"dragStartInstance\">(\"dragStartInstance\", () => {\n setIsDragging(true);\n });\n useSubscribe<\"dragEndInstance\">(\"dragEndInstance\", () => {\n setIsDragging(false);\n });\n return [isDragging, setIsDragging];\n};\n\ntype SidePanelProps = {\n children: JSX.Element | Array<JSX.Element>;\n isPreviewMode: boolean;\n css?: CSS;\n gridArea: \"inspector\" | \"sidebar\";\n};\n\nconst SidePanel = ({\n children,\n isPreviewMode,\n gridArea,\n css,\n}: SidePanelProps) => {\n if (isPreviewMode === true) return null;\n return (\n <Box\n as=\"aside\"\n css={{\n gridArea,\n display: \"flex\",\n px: 0,\n fg: 0,\n // Left sidebar tabs won't be able to pop out to the right if we set overflowX to auto.\n //overflowY: \"auto\",\n bc: \"$loContrast\",\n height: \"100%\",\n ...css,\n }}\n >\n {children}\n </Box>\n );\n};\n\nconst Main = ({ children }: { children: Array<JSX.Element> }) => (\n <Flex\n as=\"main\"\n direction=\"column\"\n css={{\n gridArea: \"main\",\n overflow: \"hidden\",\n }}\n >\n {children}\n </Flex>\n);\n\ntype ChromeWrapperProps = {\n children: Array<JSX.Element>;\n isPreviewMode: boolean;\n};\n\nconst ChromeWrapper = ({ children, isPreviewMode }: ChromeWrapperProps) => {\n const gridLayout = isPreviewMode\n ? {\n gridTemplateColumns: \"auto 1fr\",\n gridTemplateRows: \"auto 1fr\",\n gridTemplateAreas: `\n \"header header\"\n \"sidebar main\"\n `,\n }\n : {\n gridTemplateColumns: \"auto 1fr 240px\",\n gridTemplateRows: \"auto 1fr\",\n gridTemplateAreas: `\n \"header header header\"\n \"sidebar main inspector\"\n `,\n };\n return (\n <Grid\n css={{\n height: \"100vh\",\n overflow: \"hidden\",\n display: \"grid\",\n ...gridLayout,\n }}\n >\n {children}\n </Grid>\n );\n};\n\ntype DesignerProps = {\n config: Config;\n project: Project;\n};\n\nexport const Designer = ({ config, project }: DesignerProps) => {\n useSubscribeSyncStatus();\n useSubscribeRootInstance();\n useSubscribeSelectedInstanceData();\n useSubscribeHoveredInstanceData();\n useSubscribeBreakpoints();\n const [publish, publishRef] = usePublish();\n const [isPreviewMode] = useIsPreviewMode();\n const [isDragging, setIsDragging] = useIsDragging();\n usePublishShortcuts(publish);\n const onRefReadCanvasWidth = useUpdateCanvasWidth();\n const { onRef: onRefReadCanvas, onTransitionEnd } = useReadCanvasRect();\n\n const iframeRefCallback = useCallback(\n (ref) => {\n publishRef.current = ref;\n onRefReadCanvasWidth(ref);\n onRefReadCanvas(ref);\n },\n [publishRef, onRefReadCanvasWidth, onRefReadCanvas]\n );\n\n return (\n <DndProvider backend={HTML5Backend}>\n <ChromeWrapper isPreviewMode={isPreviewMode}>\n <SidePanel gridArea=\"sidebar\" isPreviewMode={isPreviewMode}>\n <SidebarLeft onDragChange={setIsDragging} publish={publish} />\n </SidePanel>\n <Topbar\n css={{ gridArea: \"header\" }}\n config={config}\n project={project}\n publish={publish}\n />\n <Main>\n <Workspace onTransitionEnd={onTransitionEnd} publish={publish}>\n <CanvasIframe\n ref={iframeRefCallback}\n src={`${config.canvasPath}/${project.id}`}\n pointerEvents={isDragging ? \"none\" : \"all\"}\n title={project.title}\n css={{\n height: \"100%\",\n width: \"100%\",\n }}\n />\n </Workspace>\n <Breadcrumbs publish={publish} />\n </Main>\n <SidePanel\n gridArea=\"inspector\"\n isPreviewMode={isPreviewMode}\n css={{ overflow: \"hidden\" }}\n >\n {isDragging ? <TreePrevew /> : <Inspector publish={publish} />}\n </SidePanel>\n </ChromeWrapper>\n </DndProvider>\n );\n};\n", "import { useState, useCallback } from \"react\";\nimport { useSubscribe, type Publish } from \"@webstudio-is/sdk\";\nimport {\n Box,\n SidebarTabs,\n SidebarTabsContent,\n SidebarTabsList,\n SidebarTabsTrigger,\n} from \"apps/designer/app/shared/design-system\";\nimport { useSelectedInstanceData } from \"../../shared/nano-states\";\nimport * as panels from \"./panels\";\nimport type { TabName } from \"./types\";\n\nconst sidebarTabsContentStyle = {\n position: \"absolute\",\n left: \"100%\",\n width: 250,\n height: \"100%\",\n bc: \"$loContrast\",\n outline: \"1px solid $slate6\",\n};\n\nconst none = { TabContent: () => null };\n\ntype SidebarLeftProps = {\n onDragChange: (isDragging: boolean) => void;\n publish: Publish;\n};\n\nexport const SidebarLeft = ({ onDragChange, publish }: SidebarLeftProps) => {\n const [selectedInstanceData] = useSelectedInstanceData();\n const [activeTab, setActiveTab] = useState<TabName>(\"none\");\n const [isDragging, setIsDragging] = useState(false);\n const { TabContent } = activeTab === \"none\" ? none : panels[activeTab];\n\n useSubscribe<\"clickCanvas\">(\"clickCanvas\", () => {\n setActiveTab(\"none\");\n });\n useSubscribe(\"dragStartInstance\", () => {\n setIsDragging(true);\n });\n useSubscribe(\"dragEndInstance\", () => {\n setIsDragging(false);\n });\n\n const handleDragChange = useCallback(\n (isDragging: boolean) => {\n // After dragging is done, container is going to become visible\n // and we need to close it for good.\n if (isDragging === false) setActiveTab(\"none\");\n setIsDragging(isDragging);\n onDragChange(isDragging);\n },\n [onDragChange]\n );\n\n return (\n <Box css={{ position: \"relative\", zIndex: 1 }}>\n <SidebarTabs activationMode=\"manual\" value={activeTab}>\n <SidebarTabsList>\n {(Object.keys(panels) as Array<TabName>).map((tabName: TabName) => (\n <SidebarTabsTrigger\n aria-label={tabName}\n key={tabName}\n value={tabName}\n onClick={() => {\n setActiveTab(activeTab !== tabName ? tabName : \"none\");\n }}\n >\n {tabName === \"none\" ? null : panels[tabName].icon}\n </SidebarTabsTrigger>\n ))}\n </SidebarTabsList>\n <SidebarTabsContent\n value={activeTab === \"none\" ? \"\" : activeTab}\n css={{\n ...sidebarTabsContentStyle,\n // We need the node to be rendered but hidden\n // to keep receiving the drag events.\n visibility: isDragging ? \"hidden\" : \"visible\",\n overflow: \"auto\",\n }}\n >\n <TabContent\n selectedInstanceData={selectedInstanceData}\n publish={publish}\n onSetActiveTab={setActiveTab}\n onDragChange={handleDragChange}\n />\n </SidebarTabsContent>\n </SidebarTabs>\n </Box>\n );\n};\n", "import { createValueContainer, useValue } from \"react-nano-state\";\nimport { type Breakpoint } from \"@webstudio-is/sdk\";\nimport {\n type SelectedInstanceData,\n type HoveredInstanceData,\n} from \"apps/designer/app/shared/canvas-components\";\nimport { type SyncStatus } from \"apps/designer/app/shared/sync\";\n\nconst selectedInstanceDataContainer = createValueContainer<\n SelectedInstanceData | undefined\n>();\nexport const useSelectedInstanceData = () =>\n useValue(selectedInstanceDataContainer);\n\nconst hoveredInstanceDataContainer = createValueContainer<\n HoveredInstanceData | undefined\n>();\nexport const useHoveredInstanceData = () =>\n useValue(hoveredInstanceDataContainer);\n\nconst isShareDialogOpenContainer = createValueContainer<boolean>(false);\nexport const useIsShareDialogOpen = () => useValue(isShareDialogOpenContainer);\n\nconst isPublishDialogOpenContainer = createValueContainer<boolean>(false);\nexport const useIsPublishDialogOpen = () =>\n useValue(isPublishDialogOpenContainer);\n\nconst selectedBreakpointContainer = createValueContainer<\n Breakpoint | undefined\n>();\nexport const useSelectedBreakpoint = () =>\n useValue(selectedBreakpointContainer);\n\nconst zoomContainer = createValueContainer<number>(100);\nexport const useZoom = () => useValue(zoomContainer);\n\nconst canvasWidthContainer = createValueContainer<number>(0);\nexport const useCanvasWidth = () => useValue(canvasWidthContainer);\n\nconst canvasRectContainer = createValueContainer<DOMRect | undefined>();\nexport const useCanvasRect = () => useValue(canvasRectContainer);\n\nconst syncStatusContainer = createValueContainer<SyncStatus>(\"idle\");\nexport const useSyncStatus = () => useValue(syncStatusContainer);\n\nconst selectionRectContainer = createValueContainer<DOMRect | undefined>();\nexport const useSelectionRect = () => useValue(selectionRectContainer);\n", "export * as components from \"./components\";\nexport * as tree from \"./tree\";\n", "export * from \"./components\";\n", "import { useEffect, useRef, type MouseEventHandler, useCallback } from \"react\";\nimport { useDrag } from \"react-dnd\";\nimport { getEmptyImage } from \"react-dnd-html5-backend\";\nimport { type Instance, type Publish } from \"@webstudio-is/sdk\";\nimport { Flex } from \"apps/designer/app/shared/design-system\";\nimport { PlusIcon } from \"apps/designer/app/shared/icons\";\nimport {\n primitives,\n type DragData,\n} from \"apps/designer/app/shared/canvas-components\";\nimport { createInstance } from \"apps/designer/app/shared/tree-utils\";\nimport type { TabName } from \"../../types\";\nimport { CustomDragLayer } from \"./custom-drag-layer\";\nimport { ComponentThumb } from \"./component-thumb\";\n\ntype UseDraggableProps = {\n component: Instance[\"component\"];\n onDragChange: (isDragging: boolean) => void;\n};\n\nconst useDraggable = ({ component, onDragChange }: UseDraggableProps) => {\n const lastIsDragging = useRef<boolean | void>();\n const [{ isDragging }, dragRef, preview] = useDrag(\n () => ({\n type: component,\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n }),\n }),\n []\n );\n\n useEffect(() => {\n if (lastIsDragging.current !== undefined) onDragChange(isDragging);\n lastIsDragging.current = isDragging;\n }, [isDragging, onDragChange]);\n\n useEffect(() => {\n preview(getEmptyImage(), { captureDraggingState: true });\n }, [preview]);\n\n return dragRef;\n};\n\ntype DraggableThumbProps = {\n onClick: MouseEventHandler<HTMLDivElement>;\n} & UseDraggableProps;\n\nconst DraggableThumb = ({\n component,\n onDragChange,\n onClick,\n}: DraggableThumbProps) => {\n const dragRef = useDraggable({ component, onDragChange });\n return (\n <ComponentThumb component={component} ref={dragRef} onClick={onClick} />\n );\n};\n\ntype TabContentProps = {\n onDragChange: UseDraggableProps[\"onDragChange\"];\n onSetActiveTab: (tabName: TabName) => void;\n publish: Publish;\n};\n\nexport const TabContent = ({\n onDragChange,\n publish,\n onSetActiveTab,\n}: TabContentProps) => {\n const components = (\n Object.keys(primitives) as Array<Instance[\"component\"]>\n ).filter((component) => primitives[component].isInlineOnly === false);\n\n const handleDragChange = useCallback(\n (isDragging: boolean) => {\n onDragChange(isDragging);\n publish<\"dragStartInstance\" | \"dragEndInstance\">({\n type: isDragging === true ? \"dragStartInstance\" : \"dragEndInstance\",\n });\n },\n [onDragChange, publish]\n );\n\n return (\n <Flex gap=\"1\" wrap=\"wrap\" css={{ padding: \"$1\" }}>\n {components.map((component: Instance[\"component\"]) => (\n <DraggableThumb\n key={component}\n component={component}\n onClick={() => {\n onSetActiveTab(\"none\");\n publish<\"insertInstance\", { instance: Instance }>({\n type: \"insertInstance\",\n payload: { instance: createInstance({ component }) },\n });\n }}\n onDragChange={handleDragChange}\n />\n ))}\n <CustomDragLayer\n onDrag={(dragData) => {\n publish<\"dragInstance\", DragData>({\n type: \"dragInstance\",\n payload: {\n instance: createInstance({ component: dragData.component }),\n currentOffset: dragData.currentOffset,\n },\n });\n }}\n />\n </Flex>\n );\n};\n\nexport const icon = <PlusIcon />;\n", "import { useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useDragLayer, type XYCoord } from \"react-dnd\";\nimport { type Instance } from \"@webstudio-is/sdk\";\nimport {\n useCanvasRect,\n useZoom,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { ComponentThumb } from \"./component-thumb\";\n\nconst layerStyles = {\n position: \"absolute\",\n pointerEvents: \"none\",\n zIndex: 1,\n left: 0,\n top: 0,\n width: \"100%\",\n height: \"100%\",\n} as const;\n\nexport type CustomDragLayerProps = {\n onDrag: (dragData: {\n component: Instance[\"component\"];\n currentOffset: XYCoord;\n }) => void;\n};\n\nexport const CustomDragLayer = ({ onDrag }: CustomDragLayerProps) => {\n const { component, isDragging, clientOffset, sourceClientOffset } =\n useDragLayer((monitor) => ({\n component: monitor.getItemType() as Instance[\"component\"],\n isDragging: monitor.isDragging(),\n clientOffset: monitor.getClientOffset(),\n sourceClientOffset: monitor.getSourceClientOffset(),\n }));\n const [canvasRect] = useCanvasRect();\n const [zoom] = useZoom();\n\n useEffect(() => {\n if (\n clientOffset === null ||\n component === null ||\n canvasRect === undefined\n ) {\n return;\n }\n\n const scale = zoom / 100;\n const currentOffset = {\n x: (clientOffset.x - canvasRect.x) / scale,\n y: (clientOffset.y - canvasRect.y) / scale,\n };\n\n onDrag({\n currentOffset,\n component,\n });\n }, [clientOffset, component, onDrag, zoom, canvasRect]);\n\n if (isDragging === false || sourceClientOffset === null) return null;\n\n return createPortal(\n <div style={layerStyles}>\n <ComponentThumb\n component={component}\n style={{\n transform: `translate3d(${sourceClientOffset.x}px, ${sourceClientOffset.y}px, 0)`,\n }}\n state=\"dragging\"\n />\n </div>,\n document.body\n );\n};\n", "import { type Instance } from \"@webstudio-is/sdk\";\nimport { forwardRef, type ElementRef, type ComponentProps } from \"react\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\nimport { Flex, Text, styled } from \"apps/designer/app/shared/design-system\";\n\nconst Thumb = styled(Flex, {\n px: 5,\n width: 75,\n height: 75,\n border: \"1px solid $slate6\",\n userSelect: \"none\",\n color: \"$hiContrast\",\n cursor: \"grab\",\n \"&:hover\": {\n background: \"$slate3\",\n },\n variants: {\n state: {\n dragging: {\n background: \"$slate3\",\n },\n },\n },\n});\n\ntype ComponentThumbProps = {\n component: Instance[\"component\"];\n} & ComponentProps<typeof Thumb>;\n\nexport const ComponentThumb = forwardRef<\n ElementRef<typeof Thumb>,\n ComponentThumbProps\n>(({ component, ...rest }, ref) => {\n const { Icon, label } = primitives[component];\n return (\n <Thumb\n direction=\"column\"\n align=\"center\"\n justify=\"center\"\n gap=\"3\"\n ref={ref}\n {...rest}\n >\n <Icon width={30} height={30} />\n <Text size=\"1\">{label}</Text>\n </Thumb>\n );\n});\n\nComponentThumb.displayName = \"ComponentThumb\";\n", "import { type Instance, type Publish } from \"@webstudio-is/sdk\";\nimport { ListNestedIcon } from \"apps/designer/app/shared/icons\";\nimport { Flex } from \"apps/designer/app/shared/design-system\";\nimport { type SelectedInstanceData } from \"apps/designer/app/shared/canvas-components\";\nimport { useSelectedInstancePath } from \"apps/designer/app/designer/shared/instance/use-selected-instance-path\";\nimport { Tree } from \"apps/designer/app/designer/shared/tree\";\nimport { useRootInstance } from \"apps/designer/app/shared/nano-states\";\n\ntype TabContentProps = {\n publish: Publish;\n selectedInstanceData?: SelectedInstanceData;\n};\n\nexport const TabContent = ({\n publish,\n selectedInstanceData,\n}: TabContentProps) => {\n const [rootInstance] = useRootInstance();\n const selectedInstancePath = useSelectedInstancePath(\n selectedInstanceData?.id\n );\n\n if (rootInstance === undefined) return null;\n\n return (\n <Flex gap=\"3\" direction=\"column\" css={{ padding: \"$1\" }}>\n <Tree\n instance={rootInstance}\n selectedInstancePath={selectedInstancePath}\n selectedInstanceId={selectedInstanceData?.id}\n onSelect={(instance) => {\n publish<\"selectInstanceById\", Instance[\"id\"]>({\n type: \"selectInstanceById\",\n payload: instance.id,\n });\n }}\n />\n </Flex>\n );\n};\n\nexport const icon = <ListNestedIcon />;\n", "import { Instance } from \"@webstudio-is/sdk\";\nimport { useMemo } from \"react\";\nimport { useRootInstance } from \"apps/designer/app/shared/nano-states\";\nimport { getInstancePath } from \"apps/designer/app/shared/tree-utils\";\n\nexport const useSelectedInstancePath = (\n selectedInstanceId?: Instance[\"id\"]\n): Array<Instance> => {\n const [rootInstance] = useRootInstance();\n return useMemo(\n () =>\n selectedInstanceId !== undefined && rootInstance !== undefined\n ? getInstancePath(rootInstance, selectedInstanceId)\n : [],\n [selectedInstanceId, rootInstance]\n );\n};\n", "import { createValueContainer, useValue } from \"react-nano-state\";\nimport { type Breakpoint, type Instance } from \"@webstudio-is/sdk\";\n\nexport const rootInstanceContainer = createValueContainer<\n Instance | undefined\n>();\nexport const useRootInstance = () => useValue(rootInstanceContainer);\n\nexport const breakpointsContainer = createValueContainer<Array<Breakpoint>>([]);\nexport const useBreakpoints = () => useValue(breakpointsContainer);\n\nconst isPreviewModeContainer = createValueContainer<boolean>(false);\nexport const useIsPreviewMode = () => useValue(isPreviewModeContainer);\n\nconst selectedInstanceRectContainer = createValueContainer<\n DOMRect | undefined\n>();\nexport const useSelectedInstanceRect = () =>\n useValue(selectedInstanceRectContainer);\n\nconst hoveredInstanceRectContainer = createValueContainer<\n DOMRect | undefined\n>();\nexport const useHoveredInstanceRect = () =>\n useValue(hoveredInstanceRectContainer);\n\nconst isScrollingContainer = createValueContainer<boolean>(false);\nexport const useIsScrolling = () => useValue(isScrollingContainer);\n\n// We are editing the text of that instance in text editor.\nconst textEditingInstanceIdContainer = createValueContainer<\n Instance[\"id\"] | undefined\n>();\nexport const useTextEditingInstanceId = () =>\n useValue(textEditingInstanceIdContainer);\n", "import { useSubscribe } from \"@webstudio-is/sdk\";\nimport { useIsScrolling } from \"./nano-states\";\n\nexport const useSubscribeScrollState = () => {\n const [, setIsScrolling] = useIsScrolling();\n useSubscribe<\"scrollState\", boolean>(\"scrollState\", setIsScrolling);\n};\n", "import { useState, useMemo, useEffect } from \"react\";\nimport { type Instance } from \"@webstudio-is/sdk\";\nimport {\n Flex,\n Text,\n Collapsible,\n Button,\n keyframes,\n styled,\n} from \"apps/designer/app/shared/design-system\";\nimport {\n TriangleRightIcon,\n TriangleDownIcon,\n} from \"apps/designer/app/shared/icons\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\nimport noop from \"lodash.noop\";\n\nconst openKeyframes = keyframes({\n from: { height: 0 },\n to: { height: \"var(--radix-collapsible-content-height)\" },\n});\n\nconst closeKeyframes = keyframes({\n from: { height: \"var(--radix-collapsible-content-height)\" },\n to: { height: 0 },\n});\n\nconst CollapsibleContentAnimated = styled(Collapsible.Content, {\n overflow: \"hidden\",\n '&[data-state=\"open\"]': {\n animation: `${openKeyframes} 150ms ease-in-out`,\n },\n '&[data-state=\"closed\"]': {\n animation: `${closeKeyframes} 150ms ease-in-out`,\n },\n});\n\nconst CollapsibleContentUnanimated = styled(Collapsible.Content, {\n overflow: \"hidden\",\n});\n\ntype TreeProps = {\n instance: Instance;\n selectedInstanceId?: Instance[\"id\"];\n selectedInstancePath: Array<Instance>;\n level?: number;\n onSelect?: (instance: Instance) => void;\n animate?: boolean;\n};\n\nexport const Tree = ({\n instance,\n selectedInstanceId,\n selectedInstancePath,\n level = 0,\n onSelect = noop,\n animate = true,\n}: TreeProps) => {\n const [isOpen, setIsOpen] = useState(selectedInstancePath.includes(instance));\n\n useEffect(() => {\n setIsOpen(selectedInstancePath.includes(instance));\n }, [selectedInstancePath, instance]);\n\n // Text nodes have only one child which is a string.\n const showChildren =\n instance.children.length > 1 || typeof instance.children[0] === \"object\";\n\n const children = useMemo(() => {\n if (isOpen === false || showChildren === false) {\n return null;\n }\n const children = [];\n for (const child of instance.children) {\n if (typeof child === \"string\") continue;\n children.push(\n <Tree\n instance={child}\n selectedInstanceId={selectedInstanceId}\n selectedInstancePath={selectedInstancePath}\n level={level + 1}\n key={child.id}\n onSelect={onSelect}\n animate={animate}\n />\n );\n }\n return children;\n }, [\n instance,\n level,\n isOpen,\n selectedInstanceId,\n selectedInstancePath,\n onSelect,\n showChildren,\n animate,\n ]);\n\n const { Icon, label } = primitives[instance.component];\n const CollapsibleContent = animate\n ? CollapsibleContentAnimated\n : CollapsibleContentUnanimated;\n\n return (\n <Collapsible.Root open={isOpen} onOpenChange={setIsOpen}>\n <Flex\n css={{\n // @todo don't hardcode the padding\n paddingLeft: level * 15 + (showChildren ? 0 : 15),\n color: \"$hiContrast\",\n alignItems: \"center\",\n }}\n >\n {showChildren && (\n <Collapsible.Trigger asChild>\n {isOpen ? <TriangleDownIcon /> : <TriangleRightIcon />}\n </Collapsible.Trigger>\n )}\n <Button\n {...(instance.id === selectedInstanceId\n ? { state: \"active\" }\n : { ghost: true })}\n css={{ display: \"flex\", gap: \"$1\", padding: \"$1\" }}\n onFocus={() => {\n onSelect(instance);\n }}\n >\n <Icon />\n <Text>{label}</Text>\n </Button>\n </Flex>\n <CollapsibleContent>{children}</CollapsibleContent>\n </Collapsible.Root>\n );\n};\n", "import { type Breakpoint } from \"@webstudio-is/sdk\";\n\nexport const willRender = (breakpoint: Breakpoint, canvasWidth: number) =>\n canvasWidth >= breakpoint.minWidth;\n", "import { useState, useMemo, useEffect, useCallback } from \"react\";\nimport type {\n SelectedInstanceData,\n StyleUpdates,\n} from \"apps/designer/app/shared/canvas-components\";\nimport { type StyleProperty, type Publish } from \"@webstudio-is/sdk\";\nimport { useSelectedBreakpoint } from \"../../shared/nano-states\";\nimport { parseCssValue } from \"./parse-css-value\";\nimport { getInheritedStyle } from \"./get-inherited-style\";\nimport { getCssRuleForBreakpoint } from \"./lib/utils/get-css-rule-for-breakpoint\";\nimport { useRootInstance } from \"apps/designer/app/shared/nano-states\";\n\ntype UseStyleData = {\n publish: Publish;\n selectedInstanceData?: SelectedInstanceData;\n};\n\ntype StyleUpdateOptions = { isEphemeral: boolean };\n\nexport type SetProperty = (\n property: StyleProperty\n) => (value: string, options?: StyleUpdateOptions) => void;\n\nexport const useStyleData = ({\n selectedInstanceData,\n publish,\n}: UseStyleData) => {\n const [rootInstance] = useRootInstance();\n const [selectedBreakpoint] = useSelectedBreakpoint();\n const cssRule = useMemo(\n () =>\n getCssRuleForBreakpoint(\n selectedInstanceData?.cssRules,\n selectedBreakpoint\n ),\n [selectedInstanceData?.cssRules, selectedBreakpoint]\n );\n\n const getCurrentStyle = useCallback(\n () => ({\n ...selectedInstanceData?.browserStyle,\n ...cssRule?.style,\n }),\n [selectedInstanceData, cssRule]\n );\n\n const [currentStyle, setCurrentStyle] = useState(getCurrentStyle());\n\n useEffect(() => {\n const currentStyle = getCurrentStyle();\n setCurrentStyle(currentStyle);\n }, [getCurrentStyle]);\n\n const inheritedStyle = useMemo(() => {\n if (\n currentStyle === undefined ||\n selectedInstanceData === undefined ||\n rootInstance === undefined\n ) {\n return;\n }\n return getInheritedStyle(rootInstance, selectedInstanceData.id);\n }, [currentStyle, selectedInstanceData, rootInstance]);\n\n const publishUpdates = (\n type: \"update\" | \"preview\",\n updates: StyleUpdates[\"updates\"]\n ) => {\n if (\n updates.length === 0 ||\n selectedInstanceData === undefined ||\n selectedBreakpoint == undefined\n ) {\n return;\n }\n publish<string, StyleUpdates>({\n type:\n type === \"update\"\n ? \"updateStyle\"\n : `previewStyle:${selectedInstanceData.id}`,\n payload: {\n id: selectedInstanceData.id,\n updates,\n breakpoint: selectedBreakpoint,\n },\n });\n };\n\n const setProperty: SetProperty = (property) => {\n return (input, options = { isEphemeral: false }) => {\n if (currentStyle === undefined) return;\n const currentValue = currentStyle[property];\n const defaultUnit =\n currentValue?.type === \"unit\" ? currentValue?.unit : undefined;\n const nextValue = parseCssValue(property, input, defaultUnit);\n if (nextValue.type !== \"invalid\") {\n const updates = [{ property, value: nextValue }];\n const type = options.isEphemeral ? \"preview\" : \"update\";\n publishUpdates(type, updates);\n }\n if (options.isEphemeral === false) {\n setCurrentStyle({ ...currentStyle, [property]: nextValue });\n }\n };\n };\n\n return { currentStyle, inheritedStyle, setProperty };\n};\n", "import hyphenate from \"hyphenate-style-name\";\nimport { units } from \"@webstudio-is/sdk\";\nimport type { StyleProperty, StyleValue, Unit } from \"@webstudio-is/sdk\";\n\nconst unitRegex = new RegExp(`${units.join(\"|\")}`);\n\nconst isValid = (property: string, value: string): boolean => {\n // Only browsers with houdini api will provide validation for now\n // @todo add a polyfill maybe\n if (\n typeof CSSStyleValue === \"undefined\" ||\n typeof CSSStyleValue.parse === \"undefined\"\n ) {\n return true;\n }\n\n try {\n CSSStyleValue.parse(hyphenate(property), value);\n } catch (error) {\n return false;\n }\n return true;\n};\n\n// wtf?\n// eslint-disable-next-line no-useless-escape\nconst mathRegex = /[\\+\\-\\*\\/]/;\n\n// - 2+2px\n// - 2*2\nconst evaluate = (input: string, parsedUnit: [Unit] | null) => {\n const parsed = parseFloat(input);\n // If its not a number, it can't be a math expression.\n if (isNaN(parsed)) return parsed;\n\n // It's a math expression\n if (mathRegex.test(input)) {\n // Get rid of the unit\n if (parsedUnit !== null) {\n input = input.replace(parsedUnit[0], \"\");\n }\n try {\n return eval(`(${input})`);\n } catch (err) {\n return parsed;\n }\n }\n\n return parsed;\n};\n\n// Helper to let user input:\n// - 10\n// - 10p\n// - 10px > px as unit\n// - empty string\n// - a keyword\nexport const parseCssValue = (\n property: StyleProperty,\n input: string,\n defaultUnit?: Unit\n): StyleValue => {\n const invalidValue = {\n type: \"invalid\",\n value: input,\n } as const;\n\n if (input.length === 0) {\n return invalidValue;\n }\n\n const parsedUnit = unitRegex.exec(input) as [Unit] | null;\n const number = evaluate(input, parsedUnit);\n\n // If we get a unit but there is no number - we assume its an accidental\n // unit match and its a keyword value.\n if (isNaN(number) === true) {\n if (isValid(property, input)) {\n return {\n type: \"keyword\",\n value: input,\n } as const;\n }\n return invalidValue;\n }\n\n // If user didn't enter a unit, use the previous known unit otherwise fallback to px.\n const fallbackUnit: Unit = defaultUnit ?? \"number\";\n const [unit] = parsedUnit || [fallbackUnit];\n\n if (isValid(property, number) || isValid(property, number + unit)) {\n return {\n type: \"unit\",\n unit,\n value: number,\n };\n }\n\n return invalidValue;\n};\n", "import {\n properties,\n type StyleValue,\n type StyleProperty,\n} from \"@webstudio-is/sdk\";\nimport { type Instance } from \"@webstudio-is/sdk\";\n\nexport type InheritedStyle = {\n [property in StyleProperty]: {\n instance: Instance;\n value: StyleValue;\n };\n};\n\ntype InheritableProperties = { [property in StyleProperty]: true };\nconst propertyNames = Object.keys(properties) as Array<StyleProperty>;\n// All inheritable properties we support\nconst inheritableProperties: InheritableProperties = propertyNames.reduce(\n (acc: InheritableProperties, property: StyleProperty) => {\n const config = properties[property];\n if (config.inherited) {\n acc[property as StyleProperty] = true;\n }\n return acc;\n },\n {} as InheritableProperties\n);\n\nconst findParents = (\n instance: Instance,\n instanceId: Instance[\"id\"]\n): Array<Instance> => {\n const parents: Array<Instance> = [];\n\n for (const child of instance.children) {\n if (typeof child === \"string\") {\n continue;\n }\n // I am your father\n if (child.id === instanceId) {\n parents.push(instance);\n break;\n }\n const foundParents = findParents(child, instanceId);\n // eslint-disable-next-line prefer-spread\n parents.push.apply(parents, foundParents);\n }\n return parents;\n};\n\n// - Walk down the tree and remember all parent instances until the found instance\n// - Walk back up and find a value for each inheritable property and where value is not \"inherit\"\n// @todo this also has to match the media query, otheriwse its wrong\nexport const getInheritedStyle = (\n rootInstance: Instance,\n instanceId: Instance[\"id\"]\n): InheritedStyle => {\n const parents = findParents(rootInstance, instanceId).reverse();\n const inheritedStyle = {} as InheritedStyle;\n for (const parent of parents) {\n for (const cssRule of parent.cssRules) {\n for (const property in cssRule.style) {\n const isInheritable = property in inheritableProperties;\n const value = cssRule.style[property as StyleProperty];\n const hasValue = value !== undefined && value.value !== \"inherit\";\n const isFirst = property in inheritedStyle === false;\n if (isInheritable && hasValue && isFirst) {\n inheritedStyle[property as StyleProperty] = {\n instance: parent,\n value,\n };\n }\n }\n }\n }\n return inheritedStyle;\n};\n", "import { type CssRule, type Breakpoint } from \"@webstudio-is/sdk\";\n\n/**\n * Find a instance css rule that is set on the provided breakpoint.\n */\nexport const getCssRuleForBreakpoint = (\n cssRules: Array<CssRule> = [],\n breakpoint?: Breakpoint\n) => {\n if (breakpoint === undefined) return;\n return cssRules.find((cssRule) => cssRule.breakpoint === breakpoint.id);\n};\n", "import { createValueContainer, useValue } from \"react-nano-state\";\nimport {\n Flex,\n Text,\n Collapsible,\n} from \"apps/designer/app/shared/design-system\";\nimport {\n TriangleRightIcon,\n TriangleDownIcon,\n} from \"apps/designer/app/shared/icons\";\n\ntype CollapsibleSectionProps = {\n label: string;\n children: JSX.Element;\n isOpenDefault?: boolean;\n isOpen?: boolean;\n rightSlot?: JSX.Element;\n};\n\nconst stateContainer = createValueContainer<{ [label: string]: boolean }>({});\n\n// Preserves the open/close state even when component gets unmounted\nconst useOpenState = (\n label: string,\n initialValue: boolean\n): [boolean, (value: boolean) => void] => {\n const [state, setState] = useValue(stateContainer);\n const isOpen = label in state ? state[label] : initialValue;\n const setIsOpen = (isOpen: boolean) => {\n setState({ ...state, [label]: isOpen });\n };\n return [isOpen, setIsOpen];\n};\n\nexport const CollapsibleSection = ({\n label,\n children,\n isOpenDefault = false,\n isOpen,\n rightSlot,\n}: CollapsibleSectionProps) => {\n const [isOpenByUser, setIsOpenByUser] = useOpenState(label, isOpenDefault);\n const isOpenFinal = isOpen === undefined ? isOpenByUser : isOpen;\n return (\n <Collapsible.Root open={isOpenFinal} onOpenChange={setIsOpenByUser}>\n <Collapsible.Trigger asChild>\n <Flex\n align=\"center\"\n gap=\"1\"\n justify=\"between\"\n css={{\n py: \"$3\",\n px: \"$1\",\n color: \"$hiContrast\",\n cursor: \"default\",\n }}\n >\n {isOpenFinal ? <TriangleDownIcon /> : <TriangleRightIcon />}\n <Text size=\"3\" css={{ flexGrow: 1 }}>\n {label}\n </Text>\n {rightSlot}\n </Flex>\n </Collapsible.Trigger>\n <Collapsible.Content asChild>\n <Flex\n gap=\"3\"\n direction=\"column\"\n css={{ p: \"$2\", borderBottom: \"1px solid $slate6\" }}\n >\n {children}\n </Flex>\n </Collapsible.Content>\n </Collapsible.Root>\n );\n};\n", "import { Flex, Text } from \"apps/designer/app/shared/design-system\";\nimport type { SelectedInstanceData } from \"apps/designer/app/shared/canvas-components\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\n\nexport const ComponentInfo = ({\n selectedInstanceData,\n}: {\n selectedInstanceData: SelectedInstanceData;\n}) => {\n return (\n <Flex justify=\"between\" align=\"center\">\n <Text>{`Selected: ${\n primitives[selectedInstanceData.component].label\n }`}</Text>\n </Flex>\n );\n};\n", "import { useState } from \"react\";\nimport hyphenate from \"hyphenate-style-name\";\nimport {\n categories,\n type CssRule,\n type Category,\n type Style,\n} from \"@webstudio-is/sdk\";\nimport {\n Box,\n Flex,\n Collapsible,\n Button,\n} from \"apps/designer/app/shared/design-system\";\nimport {\n TriangleRightIcon,\n TriangleDownIcon,\n} from \"apps/designer/app/shared/icons\";\nimport {\n styleConfigs,\n type StyleConfig,\n} from \"apps/designer/app/shared/style-panel-configs\";\nimport { CollapsibleSection } from \"apps/designer/app/designer/shared/inspector\";\nimport { renderProperty } from \"./render-property\";\nimport { dependencies } from \"./dependencies\";\nimport { type InheritedStyle } from \"./get-inherited-style\";\nimport { type SetProperty } from \"./use-style-data\";\nimport { type SelectedInstanceData } from \"apps/designer/app/shared/canvas-components\";\n\n// Finds a property/value by using any available form: property, label, value\nconst filterProperties = (properties: Array<string>, search: string) => {\n const searchParts = search.split(\" \").map((part) => part.trim());\n const includes = (property: string) => {\n if (property.toLowerCase().includes(search)) return true;\n if (hyphenate(property).includes(search)) return true;\n // Enables \"ba co\" to match \"backgorund color\"\n return searchParts.every((searchPart) =>\n property.toLowerCase().includes(searchPart)\n );\n };\n return properties.filter((property) => {\n for (const styleConfig of styleConfigs) {\n if (styleConfig.property !== property) continue;\n if (includes(styleConfig.property)) return true;\n if (includes(styleConfig.label)) return true;\n for (const item of styleConfig.items) {\n if (includes(item.name) || includes(item.label)) {\n return true;\n }\n }\n }\n return false;\n });\n};\n\nconst appliesTo = (styleConfig: StyleConfig, currentStyle: Style): boolean => {\n const { appliesTo } = styleConfig;\n if (appliesTo in dependencies) {\n const dependency = dependencies[appliesTo];\n if (dependency === undefined) return false;\n const currentValue = currentStyle[dependency.property]?.value;\n if (currentValue === undefined) return false;\n if (Array.isArray(dependency.values))\n return dependency.values.includes(String(currentValue));\n if (Array.isArray(dependency.notValues))\n return dependency.notValues.includes(String(currentValue)) === false;\n }\n\n return true;\n};\n\nconst didRender = (category: Category, { property }: StyleConfig): boolean => {\n // We only want to render the first thing in spacing since the widget will be the way to set all margin and padding\n if (category === \"spacing\" && property !== categories.spacing.properties[0]) {\n return true;\n }\n return false;\n};\n\nconst ShowMore = ({ styleConfigs }: { styleConfigs: Array<JSX.Element> }) => {\n const [isOpen, setIsOpen] = useState(false);\n if (styleConfigs.length === 0) return null;\n return (\n <Collapsible.Root asChild onOpenChange={setIsOpen}>\n <Flex direction=\"column\" gap=\"3\">\n <Collapsible.Trigger asChild>\n <Button css={{ width: \"100%\", gap: \"$1\" }}>\n {isOpen ? <TriangleDownIcon /> : <TriangleRightIcon />}Show more\n </Button>\n </Collapsible.Trigger>\n <Collapsible.Content asChild>\n <Flex direction=\"column\" gap=\"3\">\n {styleConfigs}\n </Flex>\n </Collapsible.Content>\n </Flex>\n </Collapsible.Root>\n );\n};\n\ntype VisualSettingsProps = {\n currentStyle: Style;\n inheritedStyle: InheritedStyle;\n cssRule?: CssRule;\n setProperty: SetProperty;\n selectedInstanceData: SelectedInstanceData;\n search: string;\n};\n\nexport const VisualSettings = ({\n currentStyle,\n search,\n ...rest\n}: VisualSettingsProps) => {\n const isSearchMode = search.length !== 0;\n const all = [];\n let category: Category;\n for (category in categories) {\n // @todo seems like properties are the exact strings and styleConfig.property is not?\n const categoryProperties = filterProperties(\n categories[category].properties as unknown as Array<string>,\n search\n );\n const { moreFrom } = categories[category];\n const styleConfigsByCategory: Array<JSX.Element> = [];\n const moreStyleConfigsByCategory: Array<JSX.Element> = [];\n\n for (const styleConfig of styleConfigs) {\n const isInCategory = categoryProperties.includes(styleConfig.property);\n // We don't want to filter out inapplicable styles if user wants to apply them anyway\n const isApplicable = isSearchMode\n ? true\n : appliesTo(styleConfig, currentStyle);\n const isRendered = didRender(category, styleConfig);\n\n if (isInCategory && isApplicable && isRendered === false) {\n const element = renderProperty({\n ...rest,\n currentStyle,\n styleConfig,\n category,\n });\n\n // We are making a separate array of properties which come after the \"moreFrom\"\n // so we can make them collapsable\n if (\n (styleConfig.property === moreFrom ||\n moreStyleConfigsByCategory.length !== 0) &&\n isSearchMode === false\n ) {\n moreStyleConfigsByCategory.push(element);\n continue;\n }\n\n styleConfigsByCategory.push(element);\n }\n }\n\n if (styleConfigsByCategory.length === 0) continue;\n\n all.push(\n <CollapsibleSection\n isOpen={isSearchMode ? true : undefined}\n label={categories[category].label}\n key={category}\n >\n <>\n {styleConfigsByCategory}\n <ShowMore styleConfigs={moreStyleConfigsByCategory} />\n </>\n </CollapsibleSection>\n );\n }\n return <Box css={{ overflow: \"auto\" }}>{all}</Box>;\n};\n", "import {\n properties,\n categories,\n keywordValues,\n type Category,\n type StyleProperty,\n} from \"@webstudio-is/sdk\";\nimport type { StyleConfig, Control } from \"./types\";\nimport { humanizeString } from \"../string-utils\";\n\ntype Property = keyof typeof keywordValues;\n\nconst getControl = (property: StyleProperty): Control => {\n if (property.toLocaleLowerCase().includes(\"color\")) {\n return \"Color\";\n }\n // Spacing properties is more narrow than StyleProperty,\n // so we have to widen it to be able to run .includes.\n // @todo do better\n const spacing = categories.spacing\n .properties as unknown as Array<StyleProperty>;\n if (spacing.includes(property)) {\n return \"Spacing\";\n }\n\n return \"Combobox\";\n};\n\nconst createStyleConfigs = () => {\n // We have same properties in different categories: alignSelf is in grid children and flex children\n // but this list has to contain only unique props\n const map: { [prop in Property]?: StyleConfig } = {};\n\n let category: Category;\n\n for (category in categories) {\n for (const prop of categories[category].properties) {\n // @todo prop is more narrow, only the props\n // in that category, we are widening the type to include all properties\n const property = prop as Property;\n const keywords = keywordValues[property] || [];\n const label = humanizeString(property);\n\n map[property] = {\n label,\n property,\n appliesTo: properties[property].appliesTo,\n control: getControl(property),\n items: keywords.map((keyword: string) => ({\n label: keyword,\n name: keyword,\n })),\n };\n }\n }\n\n return Object.values(map);\n};\n\nexport const styleConfigs: Array<StyleConfig> = createStyleConfigs();\n", "import snakeCase from \"lodash.snakecase\";\nimport capitalize from \"lodash.capitalize\";\n\nexport const humanizeString = (string: string): string => {\n return snakeCase(string).split(\"_\").map(capitalize).join(\" \");\n};\n", "import {\n Flex,\n Grid,\n Label,\n Text,\n Combobox,\n} from \"apps/designer/app/shared/design-system\";\nimport type { StyleConfig } from \"apps/designer/app/shared/style-panel-configs\";\nimport {\n categories,\n type Style,\n type StyleProperty,\n type Category,\n type StyleValue,\n} from \"@webstudio-is/sdk\";\nimport type { SetProperty } from \"./use-style-data\";\nimport type { InheritedStyle } from \"./get-inherited-style\";\nimport { ColorPicker } from \"./lib/color-picker\";\nimport {\n SpacingWidget,\n type SpacingProperty,\n type SpacingStyles,\n} from \"./lib/spacing-widget\";\nimport { useIsFromCurrentBreakpoint } from \"./lib/utils/use-is-from-current-breakpoint\";\nimport { propertyNameColorForSelectedBreakpoint } from \"./lib/constants\";\n\nconst getFinalValue = ({\n currentStyle,\n inheritedStyle,\n property,\n}: {\n currentStyle: Style;\n inheritedStyle: InheritedStyle;\n property: StyleProperty;\n}): StyleValue | void => {\n const currentValue = currentStyle[property];\n const inheritedValue =\n property in inheritedStyle ? inheritedStyle[property].value : undefined;\n if (currentValue?.value === \"inherit\" && inheritedValue !== undefined) {\n return inheritedValue;\n }\n return currentValue;\n};\n\ntype PropertyProps = {\n property: StyleProperty;\n label: string;\n};\n\nconst PropertyName = ({ property, label }: PropertyProps) => {\n const isCurrentBreakpoint = useIsFromCurrentBreakpoint(property);\n\n return (\n <Label\n css={{\n gridColumn: \"1\",\n color: isCurrentBreakpoint\n ? propertyNameColorForSelectedBreakpoint\n : \"$hiContrast\",\n }}\n variant=\"contrast\"\n size=\"1\"\n htmlFor={property}\n >\n {label}\n </Label>\n );\n};\n\nconst Unit = ({ value }: { value: StyleValue }) => {\n if (value.type !== \"unit\" || value.unit === \"number\") return null;\n return (\n <Text\n css={{\n fontSize: \"$1\",\n cursor: \"default\",\n }}\n >\n {value.unit}\n </Text>\n );\n};\n\ntype ControlProps = {\n setProperty: SetProperty;\n currentStyle: Style;\n inheritedStyle: InheritedStyle;\n styleConfig: StyleConfig;\n};\n\nconst ColorControl = ({\n currentStyle,\n inheritedStyle,\n setProperty,\n styleConfig,\n}: ControlProps) => {\n if (styleConfig.control !== \"Color\") return null;\n // @todo show which instance we inherited the value from\n const value = getFinalValue({\n currentStyle,\n inheritedStyle,\n property: styleConfig.property,\n });\n if (value === undefined) return null;\n const setValue = setProperty(styleConfig.property);\n\n return (\n <Grid columns={2} align=\"center\" gapX=\"1\">\n <PropertyName property={styleConfig.property} label={styleConfig.label} />\n <Flex align=\"center\" css={{ gridColumn: \"2/4\" }} gap=\"1\">\n <ColorPicker\n id={styleConfig.property}\n value={String(value.value)}\n onChange={(value) => {\n setValue(value, { isEphemeral: true });\n }}\n onChangeComplete={setValue}\n />\n </Flex>\n </Grid>\n );\n};\n\nconst SpacingControl = ({\n currentStyle,\n inheritedStyle,\n setProperty,\n styleConfig,\n}: ControlProps) => {\n if (styleConfig.control !== \"Spacing\") return null;\n\n const styles = categories.spacing.properties.reduce(\n (acc: SpacingStyles, property: SpacingProperty): SpacingStyles => {\n const value = getFinalValue({\n currentStyle,\n inheritedStyle,\n property,\n });\n if (value !== undefined) {\n if (property.includes(\"margin\")) {\n acc.margins[property] = value;\n } else {\n acc.paddings[property] = value;\n }\n }\n\n return acc;\n },\n { margins: {}, paddings: {} } as SpacingStyles\n );\n\n return <SpacingWidget setProperty={setProperty} values={styles} />;\n};\n\n// @todo\n// This is a cursor image for drag&drop value changing on the input by dragging horizontally\n//const svgCursor =\n// '<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.00012 1.5C8.00012 1.22386 7.77626 1 7.50012 1C7.22398 1 7.00012 1.22386 7.00012 1.5V13.5C7.00012 13.7761 7.22398 14 7.50012 14C7.77626 14 8.00012 13.7761 8.00012 13.5V1.5ZM3.31812 5.818C3.49386 5.64227 3.49386 5.35734 3.31812 5.18161C3.14239 5.00587 2.85746 5.00587 2.68173 5.18161L0.681729 7.18161C0.505993 7.35734 0.505993 7.64227 0.681729 7.818L2.68173 9.818C2.85746 9.99374 3.14239 9.99374 3.31812 9.818C3.49386 9.64227 3.49386 9.35734 3.31812 9.18161L2.08632 7.9498H5.50017C5.7487 7.9498 5.95017 7.74833 5.95017 7.4998C5.95017 7.25128 5.7487 7.0498 5.50017 7.0498H2.08632L3.31812 5.818ZM12.3181 5.18161C12.1424 5.00587 11.8575 5.00587 11.6817 5.18161C11.506 5.35734 11.506 5.64227 11.6817 5.818L12.9135 7.0498H9.50017C9.25164 7.0498 9.05017 7.25128 9.05017 7.4998C9.05017 7.74833 9.25164 7.9498 9.50017 7.9498H12.9135L11.6817 9.18161C11.506 9.35734 11.506 9.64227 11.6817 9.818C11.8575 9.99374 12.1424 9.99374 12.3181 9.818L14.3181 7.818C14.4939 7.64227 14.4939 7.35734 14.3181 7.18161L12.3181 5.18161Z\" fill=\"#fff\"></path></svg>';\n\n//const cursorUrl = `data:image/svg+xml;base64,${btoa(svgCursor)}`;\n\nconst ComboboxControl = ({\n currentStyle,\n inheritedStyle,\n setProperty,\n styleConfig,\n}: ControlProps) => {\n if (styleConfig.control !== \"Combobox\") return null;\n\n // @todo show which instance we inherited the value from\n const value = getFinalValue({\n currentStyle,\n inheritedStyle,\n property: styleConfig.property,\n });\n\n if (value === undefined) return null;\n\n const setValue = setProperty(styleConfig.property);\n\n return (\n <Grid columns={2} align=\"center\" gapX=\"1\">\n <PropertyName property={styleConfig.property} label={styleConfig.label} />\n <Flex align=\"center\" css={{ gridColumn: \"2/4\" }} gap=\"1\">\n <Combobox\n id={styleConfig.property}\n items={styleConfig.items}\n variant=\"ghost\"\n css={{\n // @todo drag&drop cursor to adjust numeric value\n // const cursorUrl = data:image/svg+xml;base64,${btoa(svgCursor)}\n //cursor: `url(${cursorUrl}), text`,\n textAlign: \"right\",\n }}\n state={value.type === \"invalid\" ? \"invalid\" : undefined}\n value={String(value.value)}\n onValueSelect={setValue}\n onValueEnter={setValue}\n onItemEnter={(value) => {\n setValue(value, { isEphemeral: true });\n }}\n onItemLeave={() => {\n setValue(String(value.value), { isEphemeral: true });\n }}\n />\n <Unit value={value} />\n </Flex>\n </Grid>\n );\n};\n\nconst controls: {\n [key: string]: (props: ControlProps) => JSX.Element | null;\n} = {\n Color: ColorControl,\n Spacing: SpacingControl,\n Combobox: ComboboxControl,\n};\n\ntype RenderPropertyProps = {\n setProperty: SetProperty;\n currentStyle: Style;\n inheritedStyle: InheritedStyle;\n styleConfig: StyleConfig;\n category: Category;\n};\n\nexport const renderProperty = ({\n currentStyle,\n inheritedStyle,\n setProperty,\n styleConfig,\n category,\n}: RenderPropertyProps) => {\n const Control = controls[styleConfig.control];\n\n return (\n <Control\n key={category + \"-\" + styleConfig.property}\n currentStyle={currentStyle}\n inheritedStyle={inheritedStyle}\n setProperty={setProperty}\n styleConfig={styleConfig}\n />\n );\n};\n", "import { useState } from \"react\";\nimport { ColorResult, RGBColor, SketchPicker } from \"react-color\";\nimport {\n Box,\n Flex,\n Popover,\n PopoverTrigger,\n PopoverContent,\n TextField,\n} from \"apps/designer/app/shared/design-system\";\n\nconst stringifyRGBA = (color: RGBColor) => {\n const { r, g, b, a = 1 } = color;\n\n return `rgba(${r},${g},${b},${a})`;\n};\n\ntype ColorPickerProps = {\n onChange: (value: string) => void;\n onChangeComplete: (value: string) => void;\n value: string;\n id: string;\n};\n\nexport const ColorPicker = ({\n value,\n onChange,\n onChangeComplete,\n id,\n}: ColorPickerProps) => {\n const [displayColorPicker, setDisplayColorPicker] = useState(false);\n // Color picker will use 0 as alpha value, which will force user to set alpha every time they have to change from transparent\n if (value === \"transparent\") value = \"\";\n\n return (\n <Popover\n modal\n open={displayColorPicker}\n onOpenChange={setDisplayColorPicker}\n >\n <PopoverTrigger asChild aria-label=\"Open color picker\">\n <Flex>\n <Box\n css={{\n width: \"$5\",\n height: \"$5\",\n background: value,\n }}\n />\n <TextField\n onChange={(e) => onChange(e.target.value)}\n onClick={() => setDisplayColorPicker((shown) => !shown)}\n variant=\"ghost\"\n value={value}\n id={id}\n />\n </Flex>\n </PopoverTrigger>\n\n <PopoverContent>\n <SketchPicker\n color={value}\n onChange={(color: ColorResult) => onChange(stringifyRGBA(color.rgb))}\n onChangeComplete={(color: ColorResult) => {\n onChangeComplete(stringifyRGBA(color.rgb));\n }}\n // @todo to remove both when we have preset colors\n presetColors={[]}\n styles={{\n default: {\n picker: {\n padding: 10,\n },\n },\n }}\n />\n </PopoverContent>\n </Popover>\n );\n};\n", "import { useEffect, useState } from \"react\";\nimport {\n toValue,\n type StyleProperty,\n type StyleValue,\n} from \"@webstudio-is/sdk\";\nimport { Box } from \"apps/designer/app/shared/design-system\";\nimport { SetProperty } from \"../use-style-data\";\nimport { useIsFromCurrentBreakpoint } from \"./utils/use-is-from-current-breakpoint\";\nimport { propertyNameColorForSelectedBreakpoint } from \"./constants\";\n\ntype SpacingSingularStyle = { [property in SpacingProperty]?: StyleValue };\n\nexport type SpacingStyles = {\n paddings: SpacingSingularStyle;\n margins: SpacingSingularStyle;\n};\n\nexport type SpacingProperty = Margin | Padding;\n\ntype Margin = \"marginTop\" | \"marginRight\" | \"marginBottom\" | \"marginLeft\";\n\ntype Padding = \"paddingTop\" | \"paddingRight\" | \"paddingBottom\" | \"paddingLeft\";\n\nconst grid = {\n margin: {\n marginTop: \"1 / 2 / 2 / 3\",\n marginRight: \"2 / 3 / 3 / 4\",\n marginBottom: \"3 / 2 / 4 / 3\",\n marginLeft: \"2 / 1 / 3 / 2\",\n },\n padding: {\n paddingTop: \"1 / 2 / 2 / 3\",\n paddingRight: \"2 / 3 / 3 / 4\",\n paddingBottom: \"3 / 2 / 4 / 3\",\n paddingLeft: \"2 / 1 / 3 / 2\",\n },\n};\n\nconst styles = {\n spacingEdit: {\n fontSize: \"$1\",\n // @todo use a color from design system\n color: \"rgb(217, 217, 217)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n wrapper: {\n display: \"grid\",\n height: 130,\n gridTemplateColumns: \"$5 $1 $5 1fr $5 $1 $5\",\n gridTemplateRows: \"$5 $1 $5 1fr $5 $1 $5\",\n },\n input: {\n fontSize: 10,\n fontWeight: 400,\n fontFamily: \"inherit\",\n display: \"block\",\n background: \"transparent\",\n color: \"$hiContrast\",\n zIndex: 99,\n margin: \"auto\",\n // @todo need to fit more chars\n width: 40,\n border: \"none\",\n textAlign: \"center\",\n outline: \"none\",\n },\n inputFromCurrentBreakpoint: {\n color: propertyNameColorForSelectedBreakpoint,\n },\n emptySpace: {\n gridArea: \"2 / 2 / 3 / 2\",\n background: \"$loContrast\",\n width: \"$6\",\n margin: \"auto\",\n height: \"100%\",\n borderRadius: \"$1\",\n },\n marginGrid: {\n gridArea: \"1 / 1 / -1 / -1\",\n display: \"grid\",\n gridTemplateColumns: \"$5 1fr $5\",\n gridTemplateRows: \"$5 minmax($3, 1fr) $5\",\n height: 130,\n backgroundColor: \"$gray6\",\n borderRadius: \"$1\",\n px: 2,\n },\n text: {\n fontWeight: \"bold\",\n color: \"$gray12\",\n fontSize: 8,\n margin: \"$1\",\n },\n paddingGrid: {\n gridArea: \"3 / 3 / span 3 / span 3\",\n display: \"grid\",\n gridTemplateColumns: \"$5 1fr $5\",\n gridTemplateRows: \"$5 minmax($3, 1fr) $5\",\n border: \"2px solid\",\n borderColor: \"$loContrast\",\n borderRadius: \"$1\",\n },\n};\n\ntype TextFieldProps = {\n property: StyleProperty;\n value: string | undefined;\n onEnter: (value: string) => void;\n};\n\nconst TextField = ({ property, value, onEnter }: TextFieldProps) => {\n const [currentValue, setCurrentValue] = useState<string>(value ?? \"\");\n const isFromCurrentBreakpoint = useIsFromCurrentBreakpoint(property);\n\n useEffect(() => {\n setCurrentValue(value ?? \"\");\n }, [value]);\n\n return (\n <Box\n as=\"input\"\n name={property}\n aria-label={`${property} edit`}\n value={currentValue}\n onKeyDown={(event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\") {\n onEnter(currentValue);\n }\n }}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n setCurrentValue(event.target.value);\n }}\n css={\n isFromCurrentBreakpoint\n ? { ...styles.input, ...styles.inputFromCurrentBreakpoint }\n : styles.input\n }\n />\n );\n};\n\nconst toCss = (style: SpacingSingularStyle) => {\n const css: Record<string, string> = {};\n let property: SpacingProperty;\n for (property in style) {\n const value = style[property];\n if (value === undefined) continue;\n css[property] = toValue(value);\n }\n return css;\n};\n\ntype SpacingWidgetProps = {\n setProperty: SetProperty;\n values: SpacingStyles;\n};\n\nexport const SpacingWidget = ({ setProperty, values }: SpacingWidgetProps) => {\n const margins = toCss(values.margins);\n const paddings = toCss(values.paddings);\n\n const updateSpacing = ({\n value,\n property,\n }: {\n value: string;\n property: StyleProperty;\n }) => {\n setProperty(property)(value);\n };\n\n return (\n <Box css={styles.wrapper}>\n <Box css={styles.marginGrid}>\n {(Object.keys(margins) as Array<Margin>).map((property: Margin) => (\n <Box\n key={property}\n css={{\n ...styles.spacingEdit,\n gridArea: grid.margin[property],\n }}\n >\n <TextField\n property={property}\n value={margins[property]}\n onEnter={(value: string) => {\n updateSpacing({\n value,\n property,\n });\n }}\n />\n </Box>\n ))}\n </Box>\n <Box css={styles.paddingGrid}>\n {(Object.keys(paddings) as Array<Padding>).map((property: Padding) => (\n <Box\n key={property}\n css={{\n ...styles.spacingEdit,\n gridArea: grid.padding[property],\n }}\n >\n <TextField\n property={property}\n value={paddings[property]}\n onEnter={(value: string) => {\n updateSpacing({\n value,\n property,\n });\n }}\n />\n </Box>\n ))}\n <Box css={styles.emptySpace} />\n </Box>\n <Box\n css={{\n ...styles.text,\n gridArea: \"3 / 3 / span 3 / span 3\",\n }}\n >\n PADDING\n </Box>\n\n <Box\n css={{\n ...styles.text,\n gridArea: \"1 / 1 / -1 / -1\",\n }}\n >\n MARGIN\n </Box>\n </Box>\n );\n};\n", "import { useMemo } from \"react\";\nimport { type StyleProperty } from \"@webstudio-is/sdk\";\nimport {\n useSelectedBreakpoint,\n useSelectedInstanceData,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { getCssRuleForBreakpoint } from \"./get-css-rule-for-breakpoint\";\n\n/**\n * Identify if the provided property is defined in the instance css rule matching the selected breakpoint.\n */\nexport const useIsFromCurrentBreakpoint = (property: StyleProperty) => {\n const [selectedBreakpoint] = useSelectedBreakpoint();\n const [selectedInstanceData] = useSelectedInstanceData();\n const cssRule = useMemo(\n () =>\n getCssRuleForBreakpoint(\n selectedInstanceData?.cssRules,\n selectedBreakpoint\n ),\n [selectedInstanceData, selectedBreakpoint]\n );\n if (cssRule === undefined) return false;\n return property in cssRule.style;\n};\n", "// When a style value is defined on a selected breakpoint, we want to highlight the property name with this color.\nexport const propertyNameColorForSelectedBreakpoint = \"$blue11\";\n", "import type { AppliesTo, StyleProperty } from \"@webstudio-is/sdk\";\n\nconst displayInline = [\n \"inline\",\n \"inline-block\",\n \"inline-table\",\n \"inline-list-item\",\n \"inline-flex\",\n \"inline-grid\",\n];\n\ntype Dependencies = {\n [appliesTo in AppliesTo]?: {\n property: StyleProperty;\n values?: Array<string>;\n notValues?: Array<string>;\n };\n};\n\n// @todo many conditions apply based on element type,\n// currently its wrong, because e.g. display: block is already defined on a div,\n// but we expect it to be defined in currentStyle.\nexport const dependencies: Dependencies = {\n blockContainers: {\n property: \"display\",\n values: [\"block\"],\n },\n blockContainerElements: {\n property: \"display\",\n values: [\"block\"],\n },\n flexContainers: {\n property: \"display\",\n values: [\"flex\"],\n },\n // @todo this should actually check on parent\n flexItemsAndInFlowPseudos: {\n property: \"display\",\n values: [\"flex\"],\n },\n // @todo needs to also check flex-wrap\n multilineFlexContainers: {\n property: \"flexWrap\",\n values: [\"wrap\", \"wrap-reverse\"],\n },\n\n // Used by alignSelf\n // @todo needs to check parent to be display: flex or grid, position: absolute\n //flexItemsGridItemsAndAbsolutelyPositionedBoxes: {\n // property: \"display\",\n // values: [\"flex\", 'grid'],\n //},\n\n // Used by order\n // @todo Same thing as above\n //flexItemsGridItemsAbsolutelyPositionedContainerChildren: {\n // property: \"display\",\n // values: [\"flex\"],\n //},\n\n gridContainers: {\n property: \"display\",\n values: [\"grid\"],\n },\n gridItemsAndBoxesWithinGridContainer: {\n property: \"display\",\n values: [\"grid\"],\n },\n positionedElements: {\n property: \"position\",\n notValues: [\"static\"],\n },\n allElementsNoEffectIfDisplayNone: {\n property: \"display\",\n notValues: [\"none\"],\n },\n blockLevelElements: {\n property: \"clear\",\n values: [\"block\", \"flex\", \"grid\", \"table\"],\n },\n allElementsExceptTableDisplayTypes: {\n property: \"display\",\n notValues: [\"table\"],\n },\n allElementsExceptInternalTableDisplayTypes: {\n property: \"display\",\n notValues: [\n \"table-row-group\",\n \"table-header-group\",\n \"table-footer-group\",\n \"table-row\",\n \"table-cell\",\n \"table-column-group\",\n \"table-column\",\n \"table-caption\",\n ],\n },\n allElementsButNonReplacedAndTableColumns: {\n property: \"display\",\n notValues: [\"table-column-group\", \"table-column\"],\n },\n allElementsButNonReplacedAndTableRows: {\n property: \"display\",\n notValues: [\"table-row-group\", \"table-row\"],\n },\n blockContainersFlexContainersGridContainers: {\n property: \"display\",\n values: [\"block\", \"flex\", \"grid\"],\n },\n sameAsWidthAndHeight: {\n property: \"display\",\n notValues: [\n \"table-column-group\",\n \"table-column\",\n \"table-row-group\",\n \"table-row\",\n ],\n },\n nonReplacedInlineElements: {\n property: \"display\",\n values: displayInline,\n },\n inlineLevelAndTableCellElements: {\n property: \"display\",\n values: [...displayInline, \"table-cell\"],\n },\n absolutelyPositionedElements: {\n property: \"position\",\n values: [\"absolute\"],\n },\n};\n", "import { useState } from \"react\";\nimport {\n css,\n IconButton,\n TextField,\n} from \"apps/designer/app/shared/design-system\";\nimport { Cross1Icon } from \"apps/designer/app/shared/icons\";\n\nconst formStyle = css({\n position: \"relative\",\n});\n\nconst resetStyle = css({\n position: \"absolute\",\n right: 0,\n});\n\ntype OnSearch = (search: string) => void;\n\nconst useSearch = (onSearch: OnSearch): [string, OnSearch] => {\n const [search, setSearch] = useState(\"\");\n return [\n search,\n (search: string) => {\n setSearch(search);\n onSearch(search);\n },\n ];\n};\n\ntype SearchProps = {\n onSearch: OnSearch;\n};\n\nexport const Search = ({ onSearch }: SearchProps) => {\n const [search, setSearch] = useSearch(onSearch);\n return (\n <form\n className={formStyle()}\n onReset={() => {\n setSearch(\"\");\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.currentTarget.reset();\n }\n }}\n >\n <TextField\n value={search}\n css={{ paddingRight: \"$5\" }}\n placeholder=\"Search property or value\"\n onChange={(event) => {\n const { value } = event.target;\n setSearch(value.toLowerCase());\n }}\n />\n <IconButton\n disabled={search.length === 0}\n type=\"reset\"\n aria-label=\"Reset search\"\n className={resetStyle()}\n >\n <Cross1Icon />\n </IconButton>\n </form>\n );\n};\n", "import type { Publish } from \"@webstudio-is/sdk\";\nimport { willRender } from \"apps/designer/app/designer/shared/breakpoints\";\nimport { Box, Card, Paragraph } from \"apps/designer/app/shared/design-system\";\nimport type { SelectedInstanceData } from \"apps/designer/app/shared/canvas-components\";\nimport { useStyleData } from \"./use-style-data\";\nimport { ComponentInfo } from \"../../shared/inspector\";\nimport { VisualSettings } from \"./settings\";\nimport { Search } from \"./search\";\nimport { useState } from \"react\";\nimport {\n useCanvasWidth,\n useSelectedBreakpoint,\n} from \"apps/designer/app/designer/shared/nano-states\";\n\ntype StylePanelProps = {\n publish: Publish;\n selectedInstanceData?: SelectedInstanceData;\n};\n\nexport const StylePanel = ({\n selectedInstanceData,\n publish,\n}: StylePanelProps) => {\n const { currentStyle, inheritedStyle, setProperty } = useStyleData({\n selectedInstanceData,\n publish,\n });\n const [breakpoint] = useSelectedBreakpoint();\n const [canvasWidth] = useCanvasWidth();\n const [search, setSearch] = useState(\"\");\n\n if (\n currentStyle === undefined ||\n inheritedStyle === undefined ||\n selectedInstanceData === undefined ||\n breakpoint === undefined\n ) {\n return null;\n }\n\n if (willRender(breakpoint, canvasWidth) === false) {\n return (\n <Box css={{ p: \"$2\" }}>\n <Card css={{ p: \"$3\", mt: \"$3\" }}>\n <Paragraph css={{ marginBottom: \"$2\" }}>\n {`Please increase the canvas width.`}\n </Paragraph>\n <Paragraph>\n {`\"${breakpoint.label}\" breakpoint minimum width is ${breakpoint.minWidth}px.`}\n </Paragraph>\n </Card>\n </Box>\n );\n }\n\n return (\n <>\n <Box css={{ p: \"$2\" }}>\n <ComponentInfo selectedInstanceData={selectedInstanceData} />\n </Box>\n <Box css={{ p: \"$2\" }}>\n <Search onSearch={setSearch} />\n </Box>\n <VisualSettings\n search={search}\n selectedInstanceData={selectedInstanceData}\n currentStyle={currentStyle}\n inheritedStyle={inheritedStyle}\n setProperty={setProperty}\n />\n </>\n );\n};\n", "import {\n componentsMeta,\n type Instance,\n type Publish,\n type UserProp,\n} from \"@webstudio-is/sdk\";\nimport { Control } from \"apps/designer/app/designer/features/props-panel/control\";\nimport {\n CollapsibleSection,\n ComponentInfo,\n} from \"apps/designer/app/designer/shared/inspector\";\nimport type { SelectedInstanceData } from \"apps/designer/app/shared/canvas-components\";\nimport {\n Box,\n Button,\n Grid,\n TextField,\n} from \"apps/designer/app/shared/design-system\";\nimport { PlusIcon, TrashIcon } from \"apps/designer/app/shared/icons\";\nimport { handleChangePropType, usePropsLogic } from \"./use-props-logic\";\n\ntype PropertyProps = UserProp & {\n component: Instance[\"component\"];\n onChange: handleChangePropType;\n onDelete: (id: UserProp[\"id\"]) => void;\n};\n\nconst Property = ({\n id,\n prop,\n value,\n required,\n component,\n onChange,\n onDelete,\n}: PropertyProps) => {\n const meta = componentsMeta[component];\n const argType = meta?.argTypes?.[prop as keyof typeof meta.argTypes];\n const type = argType?.control.type;\n const defaultValue = argType?.control.defaultValue;\n const options = argType?.options;\n return (\n <Grid gap=\"1\" css={{ gridTemplateColumns: \"auto 1fr auto\" }}>\n <TextField\n readOnly={required}\n variant=\"ghost\"\n placeholder=\"Property\"\n name=\"prop\"\n value={prop}\n onChange={(event) => {\n onChange(id, \"prop\", event.target.value);\n }}\n />\n <Control\n type={type}\n required={required}\n defaultValue={defaultValue}\n options={options}\n value={value}\n onChange={(value: UserProp[\"value\"]) => onChange(id, \"value\", value)}\n />\n <Button\n ghost\n disabled={required}\n onClick={() => {\n onDelete(id);\n }}\n >\n <TrashIcon />\n </Button>\n </Grid>\n );\n};\n\ntype PropsPanelProps = {\n publish: Publish;\n selectedInstanceData: SelectedInstanceData;\n};\n\nexport const PropsPanel = ({\n selectedInstanceData,\n publish,\n}: PropsPanelProps) => {\n const { userProps, addEmptyProp, handleChangeProp, handleDeleteProp } =\n usePropsLogic({ selectedInstanceData, publish });\n\n const addButton = (\n <Button\n ghost\n onClick={(event) => {\n event.preventDefault();\n addEmptyProp();\n }}\n >\n <PlusIcon />\n </Button>\n );\n return (\n <>\n <Box css={{ p: \"$2\" }}>\n <ComponentInfo selectedInstanceData={selectedInstanceData} />\n </Box>\n <CollapsibleSection\n label=\"Properties\"\n rightSlot={addButton}\n isOpenDefault\n >\n <>\n {userProps.map(({ id, prop, value, required }) => (\n <Property\n key={id}\n id={id}\n prop={prop}\n value={value}\n required={required}\n component={selectedInstanceData.component}\n onChange={handleChangeProp}\n onDelete={handleDeleteProp}\n />\n ))}\n </>\n </CollapsibleSection>\n </>\n );\n};\n", "import { UserProp } from \"@webstudio-is/sdk\";\nimport React, { ComponentProps } from \"react\";\nimport {\n Flex,\n Label,\n Radio,\n RadioGroup,\n Select,\n Slider,\n Switch,\n Text,\n TextField,\n} from \"apps/designer/app/shared/design-system\";\nimport { Checkbox } from \"apps/designer/app/shared/design-system/components/checkbox\";\n\ntype BaseControlProps<T = UserProp[\"value\"]> = {\n value?: T;\n defaultValue?: T;\n onChange: (value: T) => void;\n required?: boolean;\n};\ntype TextControlProps = BaseControlProps & {\n type?: ComponentProps<typeof TextField>[\"type\"];\n defaultValue?: UserProp[\"value\"];\n};\nconst TextControl = ({\n value,\n defaultValue,\n type,\n onChange,\n}: TextControlProps) => (\n <TextField\n type={type}\n variant=\"ghost\"\n placeholder=\"Value\"\n name=\"value\"\n value={String(value || defaultValue || \"\")}\n onChange={(event) => {\n onChange(event.target.value);\n }}\n />\n);\ntype CheckboxControlProps = BaseControlProps & {\n options: Array<string>;\n};\nconst CheckboxControl = ({\n value,\n options,\n defaultValue,\n onChange,\n}: CheckboxControlProps) => (\n <RadioGroup\n css={{ flexDirection: \"column\" }}\n name=\"value\"\n value={String(value || defaultValue || \"\")}\n onValueChange={onChange}\n >\n {options.map((value) => (\n <Flex align=\"center\" gap=\"1\" key={value}>\n <Checkbox value={value} />\n <Label>{value}</Label>\n </Flex>\n ))}\n </RadioGroup>\n);\ntype RadioControlProps = BaseControlProps & {\n options: Array<string>;\n};\nconst RadioControl = ({\n value,\n options,\n defaultValue,\n onChange,\n}: RadioControlProps) => (\n <RadioGroup\n css={{ flexDirection: \"column\" }}\n name=\"value\"\n value={String(value || defaultValue || \"\")}\n onValueChange={onChange}\n >\n {options.map((value) => (\n <Flex align=\"center\" gap=\"1\" key={value}>\n <Radio value={value} id={value} />\n <Label htmlFor={value}>{value}</Label>\n </Flex>\n ))}\n </RadioGroup>\n);\n\ntype SelectControlProps = BaseControlProps & {\n options: Array<string>;\n};\n\nconst SelectControl = ({\n value,\n options,\n defaultValue,\n onChange,\n}: SelectControlProps) => (\n <Select\n name=\"value\"\n value={String(value || defaultValue || \"\")}\n options={options}\n onChange={onChange}\n />\n);\n\nconst BooleanControl = ({\n value,\n defaultValue,\n onChange,\n}: BaseControlProps) => (\n <Switch\n name=\"value\"\n defaultChecked={Boolean(defaultValue)}\n checked={value === true}\n onCheckedChange={onChange}\n />\n);\n\nconst RangeControl = ({\n value,\n defaultValue,\n onChange,\n min,\n max,\n step,\n}: RangeControlProps) => (\n <Flex direction=\"column\" gap={1}>\n <Slider\n value={value}\n defaultValue={defaultValue}\n onValueChange={(values) => {\n onChange(values[0]);\n }}\n min={min}\n max={max}\n step={step}\n />\n <Flex direction=\"row\" justify=\"between\">\n <Text size={1}>{min}</Text>\n <Text size={1}>{max}</Text>\n </Flex>\n </Flex>\n);\n\nconst NotImplemented = () => <div />;\n\ntype PrimitiveControlProps = BaseControlProps & {\n type: \"array\" | \"boolean\" | \"date\" | \"number\" | \"object\" | \"text\";\n};\n\ntype ColorControlProps = BaseControlProps & {\n type: \"color\";\n presetColors?: Array<string>;\n};\n\ntype FileControlProps = BaseControlProps & {\n type: \"file\";\n accept: string;\n};\n\ntype RangeControlProps = BaseControlProps<number> & {\n type: \"range\";\n min: number;\n max: number;\n step: number;\n};\n\ntype OptionsControlProps = BaseControlProps & {\n type:\n | \"radio\"\n | \"inline-radio\"\n | \"check\"\n | \"inline-check\"\n | \"select\"\n | \"multi-select\";\n options: Array<string>;\n};\n\nexport type ControlProps =\n | PrimitiveControlProps\n | OptionsControlProps\n | FileControlProps\n | ColorControlProps\n | RangeControlProps;\n\n// eslint-disable-next-line func-style\nexport function Control(props: ControlProps) {\n switch (props.type) {\n case \"array\":\n return <TextControl {...props} />;\n case \"boolean\":\n return <BooleanControl {...props} />;\n case \"color\":\n return <TextControl {...props} type=\"color\" />;\n case \"date\":\n return <TextControl {...props} type=\"date\" />;\n case \"file\":\n return <TextControl {...props} type=\"file\" />;\n case \"number\":\n return <TextControl {...props} type=\"number\" />;\n case \"range\":\n return <RangeControl {...props} />;\n case \"object\":\n return <TextControl {...props} />;\n case \"radio\":\n return <RadioControl {...props} />;\n case \"inline-radio\":\n return <RadioControl {...props} />;\n case \"check\":\n return <CheckboxControl {...props} />;\n case \"inline-check\":\n return <CheckboxControl {...props} />;\n case \"select\":\n return <SelectControl {...props} />;\n case \"multi-select\":\n return <CheckboxControl {...props} />;\n case \"text\":\n return <TextControl {...props} />;\n default: {\n const _exhaustiveCheck: never = props;\n return <NotImplemented />;\n }\n }\n}\n", "import React from \"react\";\nimport { styled, CSS, VariantProps } from \"../stitches.config\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"apps/designer/app/shared/icons\";\n\nconst StyledCheckbox = styled(CheckboxPrimitive.Root, {\n all: \"unset\",\n boxSizing: \"border-box\",\n userSelect: \"none\",\n \"&::before\": {\n boxSizing: \"border-box\",\n },\n \"&::after\": {\n boxSizing: \"border-box\",\n },\n\n alignItems: \"center\",\n appearance: \"none\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n lineHeight: \"1\",\n margin: \"0\",\n outline: \"none\",\n padding: \"0\",\n WebkitTapHighlightColor: \"rgba(0,0,0,0)\",\n\n color: \"$hiContrast\",\n boxShadow: \"inset 0 0 0 1px $colors$slate7\",\n overflow: \"hidden\",\n \"@hover\": {\n \"&:hover\": {\n boxShadow: \"inset 0 0 0 1px $colors$slate8\",\n },\n },\n \"&:focus\": {\n outline: \"none\",\n borderColor: \"$red7\",\n boxShadow: \"inset 0 0 0 1px $colors$blue9, 0 0 0 1px $colors$blue9\",\n },\n\n variants: {\n size: {\n \"1\": {\n width: \"$3\",\n height: \"$3\",\n borderRadius: \"$1\",\n },\n \"2\": {\n width: \"$5\",\n height: \"$5\",\n borderRadius: \"$2\",\n },\n },\n },\n defaultVariants: {\n size: \"1\",\n },\n});\n\nconst StyledIndicator = styled(CheckboxPrimitive.Indicator, {\n alignItems: \"center\",\n display: \"flex\",\n height: \"100%\",\n justifyContent: \"center\",\n width: \"100%\",\n});\n\ntype CheckboxPrimitiveProps = React.ComponentProps<\n typeof CheckboxPrimitive.Root\n>;\ntype CheckboxVariants = VariantProps<typeof StyledCheckbox>;\ntype CheckboxProps = CheckboxPrimitiveProps & CheckboxVariants & { css?: CSS };\n\nexport const Checkbox = React.forwardRef<\n React.ElementRef<typeof StyledCheckbox>,\n CheckboxProps\n>((props, forwardedRef) => (\n <StyledCheckbox {...props} ref={forwardedRef}>\n <StyledIndicator>\n <CheckIcon />\n </StyledIndicator>\n </StyledCheckbox>\n));\n\nCheckbox.displayName = \"Checkbox\";\n", "import type {\n DeleteProp,\n Publish,\n UserProp,\n UserPropsUpdates,\n} from \"@webstudio-is/sdk\";\nimport { componentsMeta } from \"@webstudio-is/sdk\";\nimport ObjectId from \"bson-objectid\";\nimport produce from \"immer\";\nimport uniqBy from \"lodash/uniqBy\";\nimport debounce from \"lodash/debounce\";\nimport { useRef, useState } from \"react\";\nimport type { SelectedInstanceData } from \"apps/designer/app/shared/canvas-components\";\n\nexport type handleChangePropType = (\n id: UserProp[\"id\"],\n field: \"prop\" | \"value\",\n value: UserProp[\"prop\"] | UserProp[\"value\"]\n) => void;\n\nconst getRequiredProps = (\n selectedInstanceData: SelectedInstanceData\n): UserProp[] => {\n const { component } = selectedInstanceData;\n const meta = componentsMeta[component];\n const argTypes = meta?.argTypes || {};\n return Object.entries(argTypes)\n .filter(([_, value]) => value.required)\n .map(([prop, _]) => ({\n id: ObjectId().toString(),\n prop,\n value: \"\",\n required: true,\n }));\n};\n\n// @todo: This returns same props for all instances.\n// See the failing test in use-props-logic.test.ts\nconst getPropsWithDefaultValue = (\n selectedInstanceData: SelectedInstanceData\n): UserProp[] => {\n const { component } = selectedInstanceData;\n const meta = componentsMeta[component];\n const argTypes = meta?.argTypes || {};\n return Object.entries(argTypes)\n .filter(([_, value]) => value.defaultValue != null)\n .map(([prop, propObj]) => {\n const { defaultValue } = propObj;\n const value = \"value\" in defaultValue ? defaultValue.value : defaultValue;\n return {\n id: ObjectId().toString(),\n prop,\n value,\n };\n });\n};\n\ntype UsePropsLogic = {\n publish: Publish;\n selectedInstanceData: SelectedInstanceData;\n};\n\nexport const usePropsLogic = ({\n selectedInstanceData,\n publish,\n}: UsePropsLogic) => {\n const props =\n selectedInstanceData.props === undefined ||\n selectedInstanceData.props.props.length === 0\n ? []\n : selectedInstanceData.props.props;\n\n const initialState = uniqBy(\n [\n ...props,\n ...getPropsWithDefaultValue(selectedInstanceData),\n ...getRequiredProps(selectedInstanceData),\n ],\n \"prop\"\n );\n\n const [userProps, setUserProps] = useState<Array<UserProp>>(initialState);\n const propsToPublishRef = useRef<{\n [id: UserProp[\"id\"]]: true;\n }>({});\n\n // @todo this may call the last callback after unmount\n const updateProps = debounce((updates: UserPropsUpdates[\"updates\"]) => {\n publish<\"updateProps\", UserPropsUpdates>({\n type: \"updateProps\",\n payload: {\n treeId: selectedInstanceData.props.treeId,\n propsId: selectedInstanceData.props.id,\n instanceId: selectedInstanceData.id,\n updates,\n },\n });\n for (const update of updates) {\n delete propsToPublishRef.current[update.id];\n }\n }, 1000);\n\n const deleteProp = (id: UserProp[\"id\"]) => {\n publish<\"deleteProp\", DeleteProp>({\n type: \"deleteProp\",\n payload: {\n instanceId: selectedInstanceData.id,\n propId: id,\n },\n });\n };\n\n const handleChangeProp: handleChangePropType = (id, field, value) => {\n const index = userProps.findIndex((item) => item.id === id);\n const nextUserProps = produce((draft: Array<UserProp>) => {\n const isPropRequired = draft[index].required;\n switch (field) {\n case \"prop\":\n if (!isPropRequired) {\n // TODO: Use discriminant type to make this more clear or separate into 2 functions\n draft[index].prop = value as UserProp[\"prop\"];\n }\n break;\n case \"value\":\n draft[index].value = value;\n break;\n }\n })(userProps);\n setUserProps(nextUserProps);\n\n propsToPublishRef.current[id] = true;\n const updates = Object.keys(propsToPublishRef.current)\n .map((id) => nextUserProps.find((prop) => prop.id === id))\n // Could be empty if you quickly remove props which have pending changes\n .filter(Boolean) as Array<UserProp>;\n updateProps(updates);\n };\n\n const handleDeleteProp = (id: UserProp[\"id\"]) => {\n const nextUserProps = [...userProps];\n const prop = userProps.find((prop) => prop.id === id);\n\n // Required prop should never be deleted\n if (prop === undefined || prop.required) return;\n\n const index = nextUserProps.indexOf(prop);\n nextUserProps.splice(index, 1);\n setUserProps(nextUserProps);\n deleteProp(id);\n };\n\n const addEmptyProp = () => {\n setUserProps([\n ...userProps,\n {\n id: ObjectId().toString(),\n prop: \"\",\n value: \"\",\n },\n ]);\n };\n\n return {\n addEmptyProp,\n userProps,\n handleChangeProp,\n handleDeleteProp,\n };\n};\n", "import type { Publish } from \"@webstudio-is/sdk\";\nimport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n Card,\n Paragraph,\n Box,\n} from \"apps/designer/app/shared/design-system\";\nimport { StylePanel } from \"apps/designer/app/designer/features/style-panel\";\nimport { PropsPanel } from \"apps/designer/app/designer/features/props-panel\";\nimport { BrushIcon, GearIcon } from \"apps/designer/app/shared/icons\";\nimport { useSelectedInstanceData } from \"apps/designer/app/designer/shared/nano-states\";\n\ntype InspectorProps = {\n publish: Publish;\n};\n\nconst contentStyle = {\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"auto\",\n};\n\nexport const Inspector = ({ publish }: InspectorProps) => {\n const [selectedInstanceData] = useSelectedInstanceData();\n\n if (selectedInstanceData === undefined) {\n return (\n <Box css={{ p: \"$2\" }}>\n <Card css={{ p: \"$3\", mt: \"$3\" }}>\n <Paragraph>Select an instance on the canvas</Paragraph>\n </Card>\n </Box>\n );\n }\n\n return (\n <Tabs defaultValue=\"style\" css={{ width: \"100%\", gap: \"$2\" }}>\n <TabsList>\n <TabsTrigger value=\"style\">\n <BrushIcon />\n </TabsTrigger>\n <TabsTrigger value=\"props\">\n <GearIcon />\n </TabsTrigger>\n </TabsList>\n <TabsContent value=\"style\" css={contentStyle}>\n <StylePanel\n publish={publish}\n selectedInstanceData={selectedInstanceData}\n />\n </TabsContent>\n <TabsContent value=\"props\" css={contentStyle}>\n <PropsPanel\n publish={publish}\n key={selectedInstanceData.id /* Re-render when instance changes */}\n selectedInstanceData={selectedInstanceData}\n />\n </TabsContent>\n </Tabs>\n );\n};\n", "import { useSubscribe, type Publish } from \"@webstudio-is/sdk\";\nimport { EyeOpenIcon } from \"apps/designer/app/shared/icons\";\nimport { SimpleToggle } from \"apps/designer/app/shared/design-system\";\nimport { useIsPreviewMode } from \"apps/designer/app/shared/nano-states\";\n\ntype PreviewButtonProps = {\n publish: Publish;\n};\n\nexport const PreviewButton = ({ publish }: PreviewButtonProps) => {\n const [isPreviewMode, setIsPreviewMode] = useIsPreviewMode();\n\n const setValue = (value: boolean) => {\n setIsPreviewMode(value);\n publish<\"previewMode\", boolean>({\n type: \"previewMode\",\n payload: value,\n });\n };\n\n useSubscribe<\"togglePreviewMode\">(\"togglePreviewMode\", () => {\n setValue(!isPreviewMode);\n });\n\n return (\n <SimpleToggle\n onPressedChange={setValue}\n pressed={isPreviewMode}\n aria-label=\"Toggle Preview\"\n >\n <EyeOpenIcon />\n </SimpleToggle>\n );\n};\n", "import {\n Button,\n Flex,\n IconButton,\n Popover,\n PopoverContent,\n PopoverTrigger,\n TextField,\n} from \"apps/designer/app/shared/design-system\";\nimport { Share1Icon } from \"apps/designer/app/shared/icons\";\nimport { type Project } from \"@webstudio-is/sdk\";\nimport { useIsShareDialogOpen } from \"../../shared/nano-states\";\n\ntype ShareButtonProps = { path: string; project: Project };\n\nconst Content = ({ path, project }: ShareButtonProps) => {\n if (typeof location === \"undefined\") {\n return null;\n }\n const url = new URL(\n `${location.protocol}//${location.host}${path}/${project.id}`\n );\n return (\n <PopoverContent\n css={{ padding: \"$3\" }}\n onFocusOutside={(event) => {\n // Used to prevent closing when opened from the main dropdown menu\n event.preventDefault();\n }}\n >\n <form\n onSubmit={(event) => {\n event.preventDefault();\n window.open(url.toString(), \"_blank\");\n }}\n >\n <Flex gap=\"2\">\n <TextField\n variant=\"ghost\"\n readOnly\n defaultValue={url.toString()}\n onFocus={(event) => {\n event?.target.select();\n }}\n />\n <Button aria-label=\"Open in a new tab\" variant=\"blue\" type=\"submit\">\n Open\n </Button>\n </Flex>\n </form>\n </PopoverContent>\n );\n};\n\nexport const ShareButton = ({ path, project }: ShareButtonProps) => {\n const [isOpen, setIsOpen] = useIsShareDialogOpen();\n return (\n <Popover open={isOpen} onOpenChange={setIsOpen}>\n <PopoverTrigger asChild aria-label=\"Share project\">\n <IconButton>\n <Share1Icon />\n </IconButton>\n </PopoverTrigger>\n <Content path={path} project={project} />\n </Popover>\n );\n};\n", "import { useState, useEffect } from \"react\";\nimport { useFetcher } from \"@remix-run/react\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { RocketIcon, ExternalLinkIcon } from \"apps/designer/app/shared/icons\";\nimport { type Project } from \"@webstudio-is/sdk\";\nimport {\n Button,\n Flex,\n Popover,\n PopoverContent,\n PopoverTrigger,\n TextField,\n Text,\n Label,\n Link,\n} from \"apps/designer/app/shared/design-system\";\nimport { useIsPublishDialogOpen } from \"../../shared/nano-states\";\n\ntype PublishButtonProps = { project: Project };\n\nconst host =\n typeof location === \"object\"\n ? location.host.includes(\"webstudio.is\")\n ? \"wstd.io\"\n : location.host\n : \"\";\n\nconst Content = ({ project }: PublishButtonProps) => {\n const id = useId();\n const fetcher = useFetcher();\n const [url, setUrl] = useState<string>();\n const domain = fetcher.data?.domain || project.domain;\n\n useEffect(() => {\n if (typeof location !== \"object\" || !domain) {\n return;\n }\n setUrl(`${location.protocol}//${domain}.${host}`);\n }, [domain]);\n\n return (\n <PopoverContent\n css={{ padding: \"$3\" }}\n onFocusOutside={(event) => {\n // Used to prevent closing when opened from the main dropdown menu\n event.preventDefault();\n }}\n >\n <fetcher.Form method=\"post\" action=\"/rest/publish\">\n <Flex direction=\"column\" gap=\"2\">\n {url !== undefined && (\n <Link\n href={url}\n target=\"_blank\"\n css={{\n display: \"flex\",\n gap: \"$0\",\n }}\n >\n <Text\n css={{\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {`${domain}.${host}`}{\" \"}\n </Text>\n <ExternalLinkIcon />\n </Link>\n )}\n <Flex gap=\"2\" align=\"center\">\n <input type=\"hidden\" name=\"projectId\" value={project.id} />\n <Label htmlFor={id}>Domain:</Label>\n <TextField id={id} name=\"domain\" defaultValue={domain} />\n </Flex>\n {fetcher.data?.errors !== undefined && (\n <Text variant=\"red\">{fetcher.data?.errors}</Text>\n )}\n {fetcher.state === \"idle\" ? (\n <Button variant=\"blue\" type=\"submit\">\n Publish\n </Button>\n ) : (\n <Button disabled>Publishing\u2026</Button>\n )}\n </Flex>\n </fetcher.Form>\n </PopoverContent>\n );\n};\n\nexport const PublishButton = ({ project }: PublishButtonProps) => {\n const [isOpen, setIsOpen] = useIsPublishDialogOpen();\n return (\n <Popover open={isOpen} onOpenChange={setIsOpen}>\n <PopoverTrigger asChild aria-label=\"Publish\">\n <Button ghost css={{ display: \"flex\", gap: \"$1\" }}>\n <RocketIcon />\n <Text size=\"1\">Publish</Text>\n </Button>\n </PopoverTrigger>\n <Content project={project} />\n </Popover>\n );\n};\n", "import {\n Flex,\n keyframes,\n AccessibleIcon,\n} from \"apps/designer/app/shared/design-system\";\nimport { CheckIcon, DotsHorizontalIcon } from \"apps/designer/app/shared/icons\";\nimport { useSyncStatus } from \"../../shared/nano-states\";\n\nconst iconSize = 15;\n\nconst ellipsisKeyframes = keyframes({\n to: { width: iconSize },\n});\n\nconst AnimatedDotsIcon = () => {\n return (\n <Flex\n direction=\"column\"\n css={{\n animation: `${ellipsisKeyframes} steps(4,end) 900ms infinite`,\n width: 0,\n overflow: \"hidden\",\n }}\n >\n <DotsHorizontalIcon width=\"12\" height=\"12\" />\n </Flex>\n );\n};\n\nexport const SyncStatus = () => {\n const [status] = useSyncStatus();\n return (\n <Flex\n align=\"center\"\n justify=\"center\"\n css={{\n mx: \"$1\",\n width: iconSize,\n height: iconSize,\n backgroundColor: \"$green9\",\n borderRadius: \"100%\",\n }}\n >\n <AccessibleIcon label={`Sync status: ${status}`}>\n {status === \"syncing\" ? <AnimatedDotsIcon /> : <CheckIcon />}\n </AccessibleIcon>\n </Flex>\n );\n};\n", "import { useNavigate } from \"react-router-dom\";\nimport { type Publish } from \"@webstudio-is/sdk\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n DropdownMenuArrow,\n DropdownMenuSeparator,\n IconButton,\n Text,\n} from \"apps/designer/app/shared/design-system\";\nimport { HamburgerMenuIcon } from \"apps/designer/app/shared/icons\";\nimport type { Config } from \"apps/designer/app/config\";\nimport { ShortcutHint } from \"./shortcut-hint\";\nimport {\n useIsShareDialogOpen,\n useIsPublishDialogOpen,\n} from \"apps/designer/app/designer/shared/nano-states\";\n\nconst menuItemCss = {\n display: \"flex\",\n gap: \"$3\",\n justifyContent: \"start\",\n flexGrow: 1,\n minWidth: 140,\n};\n\nconst textCss = {\n flexGrow: 1,\n fontSize: \"$1\",\n};\n\ntype MenuProps = {\n config: Config;\n publish: Publish;\n};\n\nexport const Menu = ({ config, publish }: MenuProps) => {\n const navigate = useNavigate();\n const [, setIsShareOpen] = useIsShareDialogOpen();\n const [, setIsPublishOpen] = useIsPublishDialogOpen();\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <IconButton aria-label=\"Menu Button\">\n <HamburgerMenuIcon />\n </IconButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n navigate(config.dashboardPath);\n }}\n >\n <Text css={textCss}>Dashboard</Text>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish<\"shortcut\", string>({\n type: \"shortcut\",\n payload: \"undo\",\n });\n }}\n >\n <Text css={textCss}>Undo</Text>\n <ShortcutHint value={[\"cmd\", \"z\"]} />\n </DropdownMenuItem>\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish<\"shortcut\", string>({\n type: \"shortcut\",\n payload: \"redo\",\n });\n }}\n >\n <Text css={textCss}>Redo</Text>\n <ShortcutHint value={[\"shift\", \"cmd\", \"z\"]} />\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish<\"shortcut\", string>({\n type: \"shortcut\",\n payload: \"copy\",\n });\n }}\n >\n <Text css={textCss}>Copy</Text>\n <ShortcutHint value={[\"cmd\", \"c\"]} />\n </DropdownMenuItem>\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish<\"shortcut\", string>({\n type: \"shortcut\",\n payload: \"paste\",\n });\n }}\n >\n <Text css={textCss}>Paste</Text>\n <ShortcutHint value={[\"cmd\", \"v\"]} />\n </DropdownMenuItem>\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish<\"shortcut\", string>({\n type: \"shortcut\",\n payload: \"delete\",\n });\n }}\n >\n <Text css={textCss}>Delete</Text>\n <ShortcutHint value={[\"backspace\"]} />\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish({ type: \"openBreakpointsMenu\" });\n }}\n >\n <Text css={textCss}>Breakpoints</Text>\n <ShortcutHint value={[\"cmd\", \"b\"]} />\n </DropdownMenuItem>\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish({\n type: \"zoom\",\n payload: \"zoomIn\",\n });\n }}\n >\n <Text css={textCss}>Zoom in</Text>\n <ShortcutHint value={[\"cmd\", \"+\"]} />\n </DropdownMenuItem>\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish({\n type: \"zoom\",\n payload: \"zoomOut\",\n });\n }}\n >\n <Text css={textCss}>Zoom out</Text>\n <ShortcutHint value={[\"cmd\", \"-\"]} />\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n publish<\"togglePreviewMode\">({\n type: \"togglePreviewMode\",\n });\n }}\n >\n <Text css={textCss}>Preview</Text>\n <ShortcutHint value={[\"cmd\", \"shift\", \"p\"]} />\n </DropdownMenuItem>\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n setIsShareOpen(true);\n }}\n >\n <Text css={textCss}>Share</Text>\n </DropdownMenuItem>\n <DropdownMenuItem\n css={menuItemCss}\n onSelect={() => {\n setIsPublishOpen(true);\n }}\n >\n <Text css={textCss}>Publish</Text>\n </DropdownMenuItem>\n <DropdownMenuArrow offset={10} />\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n", "import { Text } from \"apps/designer/app/shared/design-system\";\n\nconst isMac =\n typeof navigator === \"object\" ? /mac/i.test(navigator.platform) : false;\n\nconst shortcutSymbolMap: Record<string, string> = {\n cmd: \"\u2318\",\n ctrl: \"\u2303\",\n shift: \"\u21E7\",\n option: \"\u2325\",\n backspace: \"\u232B\",\n};\n\nconst shortcutWinMap: Record<string, string> = {\n cmd: \"ctrl\",\n};\n\ntype ShortcutDefinition = Array<string>;\n\n// @todo check what linux needs\n// Converts commands to OS specific equivalent, e.g. cmd on mac to ctrl on win\nconst mapToOs = (value: ShortcutDefinition) => {\n if (isMac) return value;\n return value.map((key) => shortcutWinMap[key] || key);\n};\n\nconst format = (value: ShortcutDefinition) => {\n return mapToOs(value).map(\n (shortcut) => shortcutSymbolMap[shortcut] ?? shortcut.toUpperCase()\n );\n};\n\nexport const ShortcutHint = ({ value }: { value: ShortcutDefinition }) => {\n return (\n <Text size=\"1\" css={{ letterSpacing: 1.5 }}>\n {format(value)}\n </Text>\n );\n};\n", "import { useEffect, useState } from \"react\";\nimport { useSubscribe, type Breakpoint, type Publish } from \"@webstudio-is/sdk\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n DropdownMenuArrow,\n DropdownMenuSeparator,\n DropdownMenuCheckboxItem,\n Text,\n Flex,\n} from \"apps/designer/app/shared/design-system\";\nimport { sort } from \"apps/designer/app/shared/breakpoints\";\nimport {\n useSelectedBreakpoint,\n useCanvasWidth,\n} from \"../../shared/nano-states\";\nimport { willRender } from \"apps/designer/app/designer/shared/breakpoints\";\nimport { BreakpointsEditor } from \"./breakpoints-editor\";\nimport { Preview } from \"./preview\";\nimport { ZoomSetting } from \"./zoom-setting\";\nimport { TriggerButton } from \"./trigger-button\";\nimport { WidthSetting } from \"./width-setting\";\nimport {\n useSubscribeZoomFromShortcut,\n useSubscribeSelectBreakpointFromShortcut,\n} from \"./use-subscribe-shortcuts\";\nimport { ConfirmationDialog } from \"./confirmation-dialog\";\nimport { useBreakpoints } from \"apps/designer/app/shared/nano-states\";\n\ntype BreakpointSelectorItemProps = {\n breakpoint: Breakpoint;\n};\n\nconst BreakpointSelectorItem = ({\n breakpoint,\n}: BreakpointSelectorItemProps) => {\n const [canvasWidth] = useCanvasWidth();\n return (\n <Flex align=\"center\" justify=\"between\" gap=\"3\" css={{ flexGrow: 1 }}>\n <Text size=\"1\" css={{ flexGrow: 1 }}>\n {breakpoint.label}\n </Text>\n <Text\n size=\"1\"\n variant={willRender(breakpoint, canvasWidth) ? \"contrast\" : \"gray\"}\n >\n {breakpoint.minWidth}\n </Text>\n </Flex>\n );\n};\nconst menuItemCss = {\n display: \"flex\",\n gap: \"$3\",\n justifyContent: \"start\",\n flexGrow: 1,\n minWidth: 180,\n};\n\ntype BreakpointsProps = {\n publish: Publish;\n};\n\nexport const Breakpoints = ({ publish }: BreakpointsProps) => {\n const [view, setView] = useState<\n \"selector\" | \"editor\" | \"confirmation\" | undefined\n >();\n const [breakpointToDelete, setBreakpointToDelete] = useState<\n Breakpoint | undefined\n >();\n const [breakpoints, setBreakpoints] = useBreakpoints();\n const [selectedBreakpoint, setSelectedBreakpoint] = useSelectedBreakpoint();\n const [breakpointPreview, setBreakpointPreview] =\n useState(selectedBreakpoint);\n useSubscribeSelectBreakpointFromShortcut();\n useSubscribeZoomFromShortcut();\n\n useEffect(() => {\n setBreakpointPreview(selectedBreakpoint);\n }, [selectedBreakpoint]);\n\n useSubscribe(\"openBreakpointsMenu\", () => {\n setView(\"selector\");\n });\n\n useSubscribe(\"clickCanvas\", () => {\n setView(undefined);\n });\n\n if (selectedBreakpoint === undefined) return null;\n\n const handleDelete = () => {\n if (breakpointToDelete === undefined) return;\n const nextBreakpoints = [...breakpoints];\n const index = breakpoints.indexOf(breakpointToDelete);\n nextBreakpoints.splice(index, 1);\n setBreakpoints(nextBreakpoints);\n if (breakpointToDelete === selectedBreakpoint) {\n setSelectedBreakpoint(sort(nextBreakpoints)[0]);\n }\n publish({\n type: \"breakpointDelete\",\n payload: breakpointToDelete,\n });\n setBreakpointToDelete(undefined);\n setView(\"editor\");\n };\n\n return (\n // @todo this should be a popover instead\n // there is a bunch of accessibility issues here\n <DropdownMenu\n open={view !== undefined}\n onOpenChange={(isOpen) => {\n setView(isOpen ? \"selector\" : undefined);\n }}\n >\n <DropdownMenuTrigger asChild>\n <TriggerButton />\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n {view === \"confirmation\" && (\n <ConfirmationDialog\n breakpoint={selectedBreakpoint}\n onAbort={() => {\n setBreakpointToDelete(undefined);\n setView(\"editor\");\n }}\n onConfirm={handleDelete}\n />\n )}\n {view === \"editor\" && (\n <>\n <BreakpointsEditor\n breakpoints={breakpoints}\n publish={publish}\n onDelete={(breakpoint) => {\n setBreakpointToDelete(breakpoint);\n setView(\"confirmation\");\n }}\n />\n <DropdownMenuSeparator />\n <DropdownMenuItem\n css={{ justifyContent: \"center\" }}\n onSelect={(event) => {\n event.preventDefault();\n setView(\"selector\");\n }}\n >\n {\"Done\"}\n </DropdownMenuItem>\n </>\n )}\n {view === \"selector\" && (\n <>\n {sort(breakpoints).map((breakpoint) => {\n return (\n <DropdownMenuCheckboxItem\n checked={breakpoint === selectedBreakpoint}\n key={breakpoint.id}\n css={menuItemCss}\n onMouseEnter={() => {\n setBreakpointPreview(breakpoint);\n }}\n onMouseLeave={() => {\n setBreakpointPreview(selectedBreakpoint);\n }}\n onSelect={() => {\n setSelectedBreakpoint(breakpoint);\n }}\n >\n <BreakpointSelectorItem breakpoint={breakpoint} />\n </DropdownMenuCheckboxItem>\n );\n })}\n <DropdownMenuSeparator />\n <form>\n <ZoomSetting />\n <WidthSetting />\n </form>\n <DropdownMenuSeparator />\n <Preview breakpoint={breakpointPreview} />\n <DropdownMenuSeparator />\n <DropdownMenuItem\n css={{ justifyContent: \"center\" }}\n onSelect={(event) => {\n event.preventDefault();\n setView(\"editor\");\n }}\n >\n {\"Edit breakpoints\"}\n </DropdownMenuItem>\n </>\n )}\n <DropdownMenuArrow offset={10} />\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n", "import { useState } from \"react\";\nimport useDebounce from \"react-use/lib/useDebounce\";\nimport { type Breakpoint, type Publish } from \"@webstudio-is/sdk\";\nimport {\n Button,\n TextField,\n Flex,\n Text,\n} from \"apps/designer/app/shared/design-system\";\nimport { PlusIcon, TrashIcon } from \"apps/designer/app/shared/icons\";\nimport ObjectId from \"bson-objectid\";\nimport { useBreakpoints } from \"apps/designer/app/shared/nano-states\";\n\ntype BreakpointEditorItemProps = {\n breakpoint: Breakpoint;\n onChange: (breakpoint: Breakpoint) => void;\n onDelete: (breakpoint: Breakpoint) => void;\n};\n\nconst BreakpointEditorItem = ({\n breakpoint: initialBreakpoint,\n onChange,\n onDelete,\n}: BreakpointEditorItemProps) => {\n const [breakpoint, setBreakpoint] = useState(initialBreakpoint);\n\n useDebounce(\n () => {\n if (breakpoint !== initialBreakpoint) {\n onChange(breakpoint);\n }\n },\n 500,\n [breakpoint]\n );\n\n return (\n <form\n onKeyDown={(event) => {\n event.stopPropagation();\n }}\n onChange={(event) => {\n event.stopPropagation();\n const form = event.currentTarget;\n if (form.reportValidity() === false) {\n return;\n }\n const data = new FormData(form);\n const nextBreakpoint: Breakpoint = {\n ...breakpoint,\n label: String(data.get(\"label\")),\n minWidth: Number(data.get(\"minWidth\")),\n };\n setBreakpoint(nextBreakpoint);\n }}\n >\n <Flex gap=\"1\" css={{ paddingLeft: \"$4\", paddingRight: \"$3\" }}>\n <TextField\n css={{ width: 100, flexGrow: 1 }}\n type=\"text\"\n variant=\"ghost\"\n defaultValue={breakpoint.label}\n placeholder=\"Breakpoint name\"\n name=\"label\"\n minLength={2}\n required\n />\n <TextField\n css={{ textAlign: \"right\", width: 50 }}\n variant=\"ghost\"\n defaultValue={breakpoint.minWidth}\n type=\"number\"\n name=\"minWidth\"\n min={0}\n required\n />\n <Button\n type=\"button\"\n ghost\n onClick={() => {\n onDelete(breakpoint);\n }}\n >\n <TrashIcon />\n </Button>\n </Flex>\n </form>\n );\n};\n\ntype BreakpointsEditorProps = {\n breakpoints: Array<Breakpoint>;\n publish: Publish;\n onDelete: (breakpoint: Breakpoint) => void;\n};\n\nexport const BreakpointsEditor = ({\n publish,\n onDelete,\n}: BreakpointsEditorProps) => {\n const [breakpoints, setBreakpoints] = useBreakpoints();\n return (\n <Flex gap=\"2\" direction=\"column\">\n <Flex\n align=\"center\"\n gap=\"1\"\n justify=\"between\"\n css={{ paddingLeft: \"$5\", paddingRight: \"$3\", py: \"$1\" }}\n >\n <Text>Breakpoints</Text>\n <Button\n ghost\n onClick={() => {\n setBreakpoints([\n ...breakpoints,\n {\n id: ObjectId().toString(),\n label: \"\",\n minWidth: 0,\n },\n ]);\n }}\n >\n <PlusIcon />\n </Button>\n </Flex>\n {breakpoints.map((breakpoint) => {\n return (\n <BreakpointEditorItem\n key={breakpoint.id}\n breakpoint={breakpoint}\n onChange={(updatedBreakpoint) => {\n publish({ type: \"breakpointChange\", payload: updatedBreakpoint });\n const nextBreakpoints = breakpoints.map((breakpoint) => {\n if (breakpoint.id === updatedBreakpoint.id) {\n return updatedBreakpoint;\n }\n return breakpoint;\n });\n setBreakpoints(nextBreakpoints);\n }}\n onDelete={onDelete}\n />\n );\n })}\n </Flex>\n );\n};\n", "import { type Breakpoint } from \"@webstudio-is/sdk\";\nimport { Paragraph, Flex, Text } from \"apps/designer/app/shared/design-system\";\n\ntype PreviewProps = {\n breakpoint?: Breakpoint;\n};\n\nexport const Preview = ({ breakpoint }: PreviewProps) => {\n return (\n <Flex css={{ px: \"$5\", py: \"$1\" }} gap=\"1\" direction=\"column\">\n <Text size=\"1\">CSS Preview</Text>\n <Paragraph css={{ fontSize: \"$1\" }} variant=\"gray\">\n {breakpoint === undefined\n ? \"No breakpoint selected\"\n : `@media (min-width: ${breakpoint.minWidth}px)`}\n </Paragraph>\n </Flex>\n );\n};\n", "import { useZoom } from \"apps/designer/app/designer/shared/nano-states\";\nimport { Slider, Text, Flex } from \"apps/designer/app/shared/design-system\";\n\nexport const minZoom = 10;\n\nexport const ZoomSetting = () => {\n const [value, setValue] = useZoom();\n return (\n <Flex css={{ px: \"$5\", py: \"$1\" }} gap=\"1\" direction=\"column\">\n <Text size=\"1\">Zoom</Text>\n <Flex gap=\"3\" align=\"center\">\n <Slider\n min={minZoom}\n value={[value]}\n onValueChange={([value]) => {\n setValue(value);\n }}\n />\n <Text size=\"1\">{value}%</Text>\n </Flex>\n </Flex>\n );\n};\n", "import { forwardRef, type ComponentProps, type ElementRef } from \"react\";\nimport { type Breakpoint } from \"@webstudio-is/sdk\";\nimport {\n useCanvasWidth,\n useZoom,\n useSelectedBreakpoint,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { willRender } from \"apps/designer/app/designer/shared/breakpoints\";\nimport { Button, Text } from \"apps/designer/app/shared/design-system\";\nimport {\n DesktopIcon,\n LaptopIcon,\n MobileIcon,\n TabletIcon,\n} from \"apps/designer/app/shared/icons\";\n\ntype TriggerButtonProps = ComponentProps<typeof Button>;\n\nconst renderIcon = (breakpoint: Breakpoint, variant: \"contrast\" | \"gray\") => {\n const color = variant === \"contrast\" ? \"white\" : \"gray\";\n if (breakpoint.minWidth >= 1280) {\n return <DesktopIcon color={color} />;\n }\n if (breakpoint.minWidth >= 1024) {\n return <LaptopIcon color={color} />;\n }\n if (breakpoint.minWidth >= 768) {\n return <TabletIcon color={color} />;\n }\n return <MobileIcon color={color} />;\n};\n\nexport const TriggerButton = forwardRef<\n ElementRef<typeof Button>,\n TriggerButtonProps\n>((props, ref) => {\n const [zoom] = useZoom();\n const [breakpoint] = useSelectedBreakpoint();\n const [canvasWidth] = useCanvasWidth();\n if (breakpoint === undefined) return null;\n const variant = willRender(breakpoint, canvasWidth) ? \"contrast\" : \"gray\";\n\n return (\n <Button\n {...props}\n ref={ref}\n css={{ gap: \"$1\" }}\n ghost\n aria-label=\"Show breakpoints\"\n >\n {renderIcon(breakpoint, variant)}\n <Text size=\"1\" variant={variant}>\n {`${breakpoint.label} ${canvasWidth}px / ${zoom}%`}\n </Text>\n </Button>\n );\n});\n\nTriggerButton.displayName = \"TriggerButton\";\n", "import { useMemo } from \"react\";\nimport {\n useCanvasWidth,\n useSelectedBreakpoint,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { Slider, Text, Flex } from \"apps/designer/app/shared/design-system\";\nimport { sort } from \"apps/designer/app/shared/breakpoints\";\nimport {\n useBreakpoints,\n useIsPreviewMode,\n} from \"apps/designer/app/shared/nano-states\";\n\n// Doesn't make sense to allow resizing the canvas lower/higher than this.\nexport const minWidth = 50;\nexport const maxWidth = 3000;\n\n/**\n * Return the next breakpoint from the currently selected one, sorted by the `sort()`\n */\nconst useNextBreakpoint = () => {\n const [selectedBreakpoint] = useSelectedBreakpoint();\n const [breakpoints] = useBreakpoints();\n\n const sortedBreakpoints = useMemo(() => sort(breakpoints), [breakpoints]);\n\n return useMemo(() => {\n if (selectedBreakpoint === undefined) return;\n const index = sortedBreakpoints.findIndex(\n (breakpoint) => breakpoint.id === selectedBreakpoint.id\n );\n if (index === -1) return undefined;\n return sortedBreakpoints[index + 1];\n }, [sortedBreakpoints, selectedBreakpoint]);\n};\n\nexport const WidthSetting = () => {\n const [value, setValue] = useCanvasWidth();\n const [selectedBreakpoint] = useSelectedBreakpoint();\n const nextBreakpoint = useNextBreakpoint();\n const [isPreviewMode] = useIsPreviewMode();\n\n if (selectedBreakpoint === undefined) return null;\n\n // We want to enable unconstrained resizing in a preview mode\n const min = isPreviewMode\n ? minWidth\n : Math.max(minWidth, selectedBreakpoint.minWidth);\n const max = isPreviewMode\n ? maxWidth\n : Math.min(\n maxWidth,\n nextBreakpoint ? nextBreakpoint.minWidth - 1 : maxWidth\n );\n\n return (\n <Flex css={{ px: \"$5\", py: \"$1\" }} gap=\"1\" direction=\"column\">\n <Text size=\"1\">Canvas width</Text>\n <Flex gap=\"3\" align=\"center\">\n <Slider\n min={min}\n max={max}\n value={[value]}\n onValueChange={([value]) => {\n setValue(value);\n }}\n />\n <Text size=\"1\">{`${value}px`}</Text>\n </Flex>\n </Flex>\n );\n};\n", "import { useSubscribe } from \"@webstudio-is/sdk\";\nimport { sort } from \"apps/designer/app/shared/breakpoints\";\nimport { useBreakpoints } from \"apps/designer/app/shared/nano-states\";\nimport { useZoom, useSelectedBreakpoint } from \"../../shared/nano-states\";\nimport { minZoom } from \"./zoom-setting\";\n\nexport const useSubscribeSelectBreakpointFromShortcut = () => {\n const [breakpoints] = useBreakpoints();\n const [, setSelectedBreakpoint] = useSelectedBreakpoint();\n useSubscribe<\"selectBreakpointFromShortcut\", number>(\n \"selectBreakpointFromShortcut\",\n (index) => {\n const breakpoint = sort(breakpoints)[index - 1];\n if (breakpoint) setSelectedBreakpoint(breakpoint);\n }\n );\n};\n\nconst zoomStep = 20;\n\nexport const useSubscribeZoomFromShortcut = () => {\n const [zoom, setZoom] = useZoom();\n useSubscribe<\"zoom\", \"zoomIn\" | \"zoomOut\">(\"zoom\", (direction) => {\n if (direction === \"zoomIn\") {\n setZoom(Math.min(zoom + zoomStep, 100));\n return;\n }\n\n setZoom(Math.max(zoom - zoomStep, minZoom));\n });\n};\n", "import { type Breakpoint } from \"@webstudio-is/sdk\";\nimport { Button, Flex, Text } from \"apps/designer/app/shared/design-system\";\n\ntype ConfirmationDialogProps = {\n onAbort: () => void;\n onConfirm: () => void;\n breakpoint: Breakpoint;\n};\n\nexport const ConfirmationDialog = ({\n breakpoint,\n onConfirm,\n onAbort,\n}: ConfirmationDialogProps) => {\n return (\n <Flex gap=\"2\" direction=\"column\" css={{ px: \"$5\", py: \"$2\", width: 300 }}>\n <Text size=\"2\" css={{ lineHeight: 1.5 }}>\n {`Are you sure you want to delete \"${breakpoint.label}\"?`}\n </Text>\n <Text size=\"2\" css={{ lineHeight: 1.5 }}>\n {`Deleting a breakpoint will also delete all styles associated with this\n breakpoint.`}\n </Text>\n <Flex justify=\"end\" gap=\"2\">\n <Button\n onClick={() => {\n onConfirm();\n }}\n >\n Delete\n </Button>\n <Button\n autoFocus\n onClick={() => {\n onAbort();\n }}\n >\n Abort\n </Button>\n </Flex>\n </Flex>\n );\n};\n", "import { useCallback, useEffect } from \"react\";\nimport {\n useSelectedBreakpoint,\n useCanvasWidth,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { useIsPreviewMode } from \"apps/designer/app/shared/nano-states\";\nimport { minWidth } from \"./width-setting\";\n\nexport const useUpdateCanvasWidth = () => {\n const [selectedBreakpoint] = useSelectedBreakpoint();\n const [canvasWidth, setCanvasWidth] = useCanvasWidth();\n const [isPreviewMode] = useIsPreviewMode();\n\n // Ensure the size is within currently selected breakpoint when returning to design mode out of preview mode,\n // because preview mode enables resizing without constraining to the selected breakpoint.\n useEffect(() => {\n if (isPreviewMode === true || selectedBreakpoint === undefined) return;\n setCanvasWidth(Math.max(selectedBreakpoint.minWidth, minWidth));\n }, [isPreviewMode, selectedBreakpoint, setCanvasWidth]);\n\n useEffect(() => {\n if (selectedBreakpoint === undefined) {\n return;\n }\n\n if (selectedBreakpoint.minWidth === 0) {\n setCanvasWidth(minWidth);\n return;\n }\n\n setCanvasWidth(Math.max(selectedBreakpoint.minWidth, minWidth));\n }, [selectedBreakpoint, setCanvasWidth]);\n\n // Set the initial canvas width based on the selected breakpoint upper bound, which starts where the next breakpoint begins.\n return useCallback(\n (iframe: HTMLIFrameElement | null) => {\n // Once canvasWidth is set, it means we have already set the initial width.\n if (\n iframe === null ||\n selectedBreakpoint === undefined ||\n canvasWidth !== 0\n ) {\n return;\n }\n\n setCanvasWidth(minWidth);\n },\n [canvasWidth, selectedBreakpoint, setCanvasWidth]\n );\n};\n", "import { useEffect } from \"react\";\nimport { Breakpoint, useSubscribe } from \"@webstudio-is/sdk\";\nimport { useSelectedBreakpoint } from \"apps/designer/app/designer/shared/nano-states\";\nimport { sort } from \"apps/designer/app/shared/breakpoints\";\nimport { useBreakpoints } from \"apps/designer/app/shared/nano-states\";\n\nexport const useSubscribeBreakpoints = () => {\n const [breakpoints, setBreakpoints] = useBreakpoints();\n const [selectedBreakpoint, setSelectedBreakpoint] = useSelectedBreakpoint();\n\n useSubscribe<\"loadBreakpoints\", Array<Breakpoint>>(\n \"loadBreakpoints\",\n setBreakpoints\n );\n\n useEffect(() => {\n // Set the initial selected breakpoint\n if (selectedBreakpoint === undefined && breakpoints.length !== 0) {\n setSelectedBreakpoint(sort(breakpoints)[0]);\n }\n\n // Breakpoints must have changed, lets update the selected breakpoint\n if (\n selectedBreakpoint !== undefined &&\n breakpoints.includes(selectedBreakpoint) === false\n ) {\n const nextSelectedBreakpoint = breakpoints.find(\n (breakpoint) => breakpoint.id === selectedBreakpoint.id\n );\n if (nextSelectedBreakpoint !== undefined)\n setSelectedBreakpoint(nextSelectedBreakpoint);\n }\n }, [breakpoints, selectedBreakpoint, setSelectedBreakpoint]);\n};\n", "import type { Project, Publish } from \"@webstudio-is/sdk\";\nimport { Flex, type CSS } from \"apps/designer/app/shared/design-system\";\nimport type { Config } from \"apps/designer/app/config\";\nimport { PreviewButton } from \"./preview\";\nimport { ShareButton } from \"./share\";\nimport { PublishButton } from \"./publish\";\nimport { SyncStatus } from \"./sync-status\";\nimport { Menu } from \"./menu\";\nimport { Breakpoints } from \"../breakpoints\";\n\ntype TopbarProps = {\n config: Config;\n css: CSS;\n project: Project;\n publish: Publish;\n};\n\nexport const Topbar = ({ config, css, project, publish }: TopbarProps) => {\n return (\n <Flex\n as=\"header\"\n align=\"center\"\n justify=\"between\"\n css={{\n p: \"$1\",\n bc: \"$loContrast\",\n borderBottom: \"1px solid $slate8\",\n ...css,\n }}\n >\n <Menu config={config} publish={publish} />\n <Breakpoints publish={publish} />\n <Flex gap=\"1\" align=\"center\">\n <SyncStatus />\n <PreviewButton publish={publish} />\n <ShareButton path={config.previewPath} project={project} />\n <PublishButton project={project} />\n </Flex>\n </Flex>\n );\n};\n", "import { ChevronRightIcon } from \"apps/designer/app/shared/icons\";\nimport { Button, Flex, Text } from \"apps/designer/app/shared/design-system\";\nimport { useSelectedInstancePath } from \"../../shared/instance/use-selected-instance-path\";\nimport { type Publish, type Instance } from \"@webstudio-is/sdk\";\nimport { useSelectedInstanceData } from \"apps/designer/app/designer/shared/nano-states\";\n\ntype BreadcrumbProps = {\n component: Instance[\"component\"];\n onClick: () => void;\n};\n\nconst Breadcrumb = ({ component, onClick }: BreadcrumbProps) => {\n return (\n <Flex align=\"center\">\n <Button ghost css={{ color: \"$loContrast\", px: 0 }} onClick={onClick}>\n {component}\n </Button>{\" \"}\n <ChevronRightIcon />\n </Flex>\n );\n};\n\nconst EmptyState = () => (\n <Text variant=\"loContrast\" size=\"1\">\n No instance selected\n </Text>\n);\n\ntype BreadcrumbsProps = {\n publish: Publish;\n};\nexport const Breadcrumbs = ({ publish }: BreadcrumbsProps) => {\n const [selectedInstanceData] = useSelectedInstanceData();\n const selectedInstancePath = useSelectedInstancePath(\n selectedInstanceData?.id\n );\n return (\n <Flex\n as=\"footer\"\n align=\"center\"\n css={{ height: \"$5\", background: \"$hiContrast\", padding: \"$1\" }}\n >\n {selectedInstancePath.length === 0 ? (\n <EmptyState />\n ) : (\n selectedInstancePath.map((instance) => (\n <Breadcrumb\n key={instance.id}\n component={instance.component}\n onClick={() => {\n publish<\"selectInstanceById\", Instance[\"id\"]>({\n type: \"selectInstanceById\",\n payload: instance.id,\n });\n }}\n />\n ))\n )}\n </Flex>\n );\n};\n", "import { Instance, useSubscribe } from \"@webstudio-is/sdk\";\nimport produce from \"immer\";\nimport { useState } from \"react\";\nimport { Tree } from \"apps/designer/app/designer/shared/tree\";\nimport {\n type DragData,\n type DropData,\n} from \"apps/designer/app/shared/canvas-components\";\nimport { Flex } from \"apps/designer/app/shared/design-system\";\nimport { useRootInstance } from \"apps/designer/app/shared/nano-states\";\nimport {\n findInstanceById,\n getInstancePath,\n insertInstanceMutable,\n deleteInstanceMutable,\n} from \"apps/designer/app/shared/tree-utils\";\n\nexport const TreePrevew = () => {\n const [rootInstance] = useRootInstance();\n const [draftRootInstance, setDraftRootInstance] = useState(rootInstance);\n const [instanceId, setInstanceId] = useState<Instance[\"id\"]>();\n\n useSubscribe<\"dropPreview\", { dragData: DragData; dropData: DropData }>(\n \"dropPreview\",\n ({ dragData, dropData }) => {\n if (rootInstance === undefined) return;\n setInstanceId(dragData.instance.id);\n\n const isNew =\n findInstanceById(rootInstance, dragData.instance.id) === undefined;\n\n const updatedRootInstance = produce((rootInstanceDraft) => {\n // - Only delete if the instance existed before.\n // - Can't reparent an instance inside itself.\n if (isNew === false && dropData.instance.id !== dragData.instance.id) {\n deleteInstanceMutable(rootInstanceDraft, dragData.instance.id);\n }\n insertInstanceMutable(rootInstanceDraft, dragData.instance, {\n parentId: dropData.instance.id,\n position: dropData.position,\n });\n })(rootInstance);\n setDraftRootInstance(updatedRootInstance);\n }\n );\n\n if (draftRootInstance === undefined || instanceId === undefined) {\n return null;\n }\n\n const selectedInstancePath = getInstancePath(draftRootInstance, instanceId);\n\n if (selectedInstancePath.length === 0) return null;\n\n return (\n <Flex gap=\"3\" direction=\"column\" css={{ padding: \"$1\" }}>\n <Tree\n instance={draftRootInstance}\n selectedInstancePath={selectedInstancePath}\n selectedInstanceId={instanceId}\n animate={false}\n />\n </Flex>\n );\n};\n", "import { useMemo } from \"react\";\nimport { styled } from \"apps/designer/app/shared/design-system\";\n\nconst OutlineContainer = styled(\"div\", {\n position: \"absolute\",\n pointerEvents: \"none\",\n outline: \"1px solid $blue9\",\n outlineOffset: -1,\n top: 0,\n left: 0,\n});\n\nconst useStyle = (rect?: DOMRect) => {\n return useMemo(() => {\n if (rect === undefined) return;\n return {\n transform: `translate3d(${rect.left}px, ${rect.top}px, 0)`,\n width: rect.width,\n height: rect.height,\n };\n }, [rect]);\n};\n\ntype OutlineProps = {\n children: JSX.Element;\n rect?: DOMRect;\n};\n\nexport const Outline = ({ children, rect }: OutlineProps) => {\n const style = useStyle(rect);\n return <OutlineContainer style={style}>{children}</OutlineContainer>;\n};\n", "import { useCallback, useState } from \"react\";\nimport { styled } from \"apps/designer/app/shared/design-system\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\nimport { type Instance } from \"@webstudio-is/sdk\";\n\ntype LabelPosition = \"top\" | \"inside\" | \"bottom\";\ntype LabelRefCallback = (element: HTMLElement | null) => void;\n\n/**\n * Detects if there is no space on top and for the label and tells to show it inside.\n * - if there is enough space for the label on top of the instance - top\n * - else if instance height is more than 250px - bottom\n * - else inside-top - last resort because it covers a bit of the instance content\n */\nconst useLabelPosition = (\n instanceRect: DOMRect\n): [LabelRefCallback, LabelPosition] => {\n const [position, setPosition] = useState<LabelPosition>(\"top\");\n\n const ref = useCallback(\n (element) => {\n if (element === null || instanceRect === undefined) return;\n const labelRect = element.getBoundingClientRect();\n let nextPosition: LabelPosition = \"top\";\n if (labelRect.height > instanceRect.top) {\n nextPosition = instanceRect.height < 250 ? \"bottom\" : \"inside\";\n }\n setPosition(nextPosition);\n },\n [instanceRect]\n );\n\n return [ref, position];\n};\n\nconst LabelContainer = styled(\n \"div\",\n {\n position: \"absolute\",\n display: \"flex\",\n padding: \"0 $1\",\n height: \"$4\",\n color: \"$hiContrast\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"$1\",\n fontSize: \"$2\",\n fontFamily: \"$sans\",\n lineHeight: 1,\n minWidth: \"$6\",\n whiteSpace: \"nowrap\",\n backgroundColor: \"$blue9\",\n pointerEvents: \"auto\",\n },\n {\n variants: {\n position: {\n top: {\n top: \"-$4\",\n },\n inside: {\n top: 0,\n },\n bottom: {\n bottom: \"-$4\",\n },\n },\n },\n }\n);\n\ntype LabelProps = {\n component: Instance[\"component\"];\n instanceRect: DOMRect;\n};\n\nexport const Label = ({ component, instanceRect }: LabelProps) => {\n const [labelRef, position] = useLabelPosition(instanceRect);\n const primitive = primitives[component];\n const { Icon } = primitive;\n return (\n <LabelContainer position={position} ref={labelRef}>\n <Icon width=\"1em\" height=\"1em\" />\n {primitive.label}\n </LabelContainer>\n );\n};\n", "import {\n useSelectedInstanceRect,\n useTextEditingInstanceId,\n} from \"apps/designer/app/shared/nano-states\";\nimport { useSelectedInstanceData } from \"apps/designer/app/designer/shared/nano-states\";\nimport { Outline } from \"./outline\";\nimport { Label } from \"./label\";\n\nexport const SelectedInstanceOutline = () => {\n const [instanceRect] = useSelectedInstanceRect();\n const [instanceData] = useSelectedInstanceData();\n const [textEditingInstanceId] = useTextEditingInstanceId();\n\n const isEditingCurrentInstance =\n textEditingInstanceId !== undefined &&\n textEditingInstanceId === instanceData?.id;\n\n if (\n instanceData === undefined ||\n instanceRect === undefined ||\n isEditingCurrentInstance\n ) {\n return null;\n }\n\n return (\n <Outline rect={instanceRect}>\n <Label component={instanceData.component} instanceRect={instanceRect} />\n </Outline>\n );\n};\n", "import {\n useHoveredInstanceRect,\n useTextEditingInstanceId,\n} from \"apps/designer/app/shared/nano-states\";\nimport {\n useHoveredInstanceData,\n useSelectedInstanceData,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { Outline } from \"./outline\";\nimport { Label } from \"./label\";\n\nexport const HoveredInstanceOutline = () => {\n const [selectedInstanceData] = useSelectedInstanceData();\n const [instanceRect] = useHoveredInstanceRect();\n const [hoveredInstanceData] = useHoveredInstanceData();\n const [textEditingInstanceId] = useTextEditingInstanceId();\n\n const isEditingText = textEditingInstanceId !== undefined;\n const isHoveringSelectedInstance =\n selectedInstanceData?.id === hoveredInstanceData?.id;\n\n if (\n hoveredInstanceData === undefined ||\n instanceRect === undefined ||\n isHoveringSelectedInstance ||\n isEditingText\n ) {\n return null;\n }\n\n return (\n <Outline rect={instanceRect}>\n <Label\n component={hoveredInstanceData.component}\n instanceRect={instanceRect}\n />\n </Outline>\n );\n};\n", "import { type Instance, type Publish } from \"@webstudio-is/sdk\";\nimport { useMemo, useState, type MouseEventHandler } from \"react\";\nimport {\n useSelectedInstanceData,\n useSelectionRect,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { ToggleGroup, type CSS } from \"apps/designer/app/shared/design-system\";\nimport {\n FontBoldIcon,\n FontItalicIcon,\n Link2Icon,\n} from \"apps/designer/app/shared/icons\";\nimport { createInstance } from \"apps/designer/app/shared/tree-utils\";\n\nconst getPlacement = ({\n toolbarRect,\n selectionRect,\n}: {\n toolbarRect?: DOMRect;\n selectionRect: DOMRect;\n}) => {\n let align = \"top\";\n let left = selectionRect.x + selectionRect.width / 2;\n // We measure the size in a hidden state after we render the menu,\n // then show it\n let visibility = \"hidden\";\n if (toolbarRect !== undefined) {\n visibility = \"visible\";\n // Prevent going further than left 0\n left = Math.max(left, toolbarRect.width / 2);\n // Prevent going further than window width\n left = Math.min(left, window.innerWidth - toolbarRect.width / 2);\n align = selectionRect.y > toolbarRect.height ? \"top\" : \"bottom\";\n }\n\n const marginBottom = align === \"bottom\" ? \"-$5\" : 0;\n const marginTop = align === \"bottom\" ? 0 : \"-$5\";\n const transform = \"translateX(-50%)\";\n const top =\n align === \"top\"\n ? Math.max(selectionRect.y - selectionRect.height, 0)\n : Math.max(selectionRect.y + selectionRect.height);\n\n return { top, left, marginBottom, marginTop, transform, visibility };\n};\n\ntype Value = \"Bold\" | \"Italic\" | \"Link\";\n\nconst onClickPreventDefault: MouseEventHandler<HTMLDivElement> = (event) => {\n event.preventDefault();\n event.stopPropagation();\n};\n\ntype ToolbarProps = {\n css?: CSS;\n onValueChange: (value: Value) => void;\n rootRef: React.Ref<HTMLDivElement>;\n};\n\nconst Toolbar = ({ css, onValueChange, rootRef }: ToolbarProps) => {\n return (\n <ToggleGroup.Root\n ref={rootRef}\n type=\"single\"\n onValueChange={onValueChange}\n onClick={onClickPreventDefault}\n css={{\n position: \"absolute\",\n borderRadius: \"$1\",\n padding: \"$1 $2\",\n pointerEvents: \"auto\",\n ...css,\n }}\n >\n <ToggleGroup.Item value=\"Bold\">\n <FontBoldIcon />\n </ToggleGroup.Item>\n <ToggleGroup.Item value=\"Italic\">\n <FontItalicIcon />\n </ToggleGroup.Item>\n <ToggleGroup.Item value=\"Link\">\n <Link2Icon />\n </ToggleGroup.Item>\n </ToggleGroup.Root>\n );\n};\n\ntype TextToolbarProps = {\n publish: Publish;\n};\n\nexport const TextToolbar = ({ publish }: TextToolbarProps) => {\n const [selectionRect] = useSelectionRect();\n const [selectedIntsanceData] = useSelectedInstanceData();\n const [element, setElement] = useState<HTMLElement | null>(null);\n const placement = useMemo(() => {\n if (selectionRect === undefined || element === null) return;\n const toolbarRect = element.getBoundingClientRect();\n return getPlacement({ toolbarRect, selectionRect });\n }, [selectionRect, element]);\n\n if (selectionRect === undefined || selectedIntsanceData === undefined) {\n return null;\n }\n\n return (\n <Toolbar\n rootRef={setElement}\n css={placement}\n onValueChange={(component) => {\n const instance = createInstance({ component });\n publish<\"insertInlineInstance\", Instance>({\n type: \"insertInlineInstance\",\n payload: instance,\n });\n }}\n />\n );\n};\n", "import { useSubscribe } from \"@webstudio-is/sdk\";\nimport {\n useSelectedInstanceRect,\n useHoveredInstanceRect,\n} from \"apps/designer/app/shared/nano-states\";\n\nexport const useSubscribeInstanceRect = () => {\n const [, setSelectedRect] = useSelectedInstanceRect();\n useSubscribe<\"selectedInstanceRect\", DOMRect>(\n \"selectedInstanceRect\",\n setSelectedRect\n );\n const [, setHoveredRect] = useHoveredInstanceRect();\n useSubscribe<\"hoveredInstanceRect\", DOMRect>(\n \"hoveredInstanceRect\",\n setHoveredRect\n );\n};\n", "import { useSubscribe } from \"@webstudio-is/sdk\";\nimport { useSelectionRect } from \"apps/designer/app/designer/shared/nano-states\";\n\nexport const useSubscribeSelectionRect = () => {\n const [, setSelectionRect] = useSelectionRect();\n useSubscribe<\"selectionRect\", DOMRect>(\"selectionRect\", setSelectionRect);\n};\n", "import { type Instance, useSubscribe } from \"@webstudio-is/sdk\";\nimport { useTextEditingInstanceId } from \"apps/designer/app/shared/nano-states\";\n\nexport const useSubscribeTextEditingInstanceId = () => {\n const [, setInstanceId] = useTextEditingInstanceId();\n useSubscribe<\"textEditingInstanceId\", Instance[\"id\"] | undefined>(\n \"textEditingInstanceId\",\n setInstanceId\n );\n};\n", "import { type Publish } from \"@webstudio-is/sdk\";\nimport { Box } from \"apps/designer/app/shared/design-system\";\nimport {\n useIsPreviewMode,\n useIsScrolling,\n useSubscribeScrollState,\n} from \"apps/designer/app/shared/nano-states\";\nimport { HoveredInstanceOutline, SelectedInstanceOutline } from \"./outline\";\nimport { TextToolbar } from \"./text-toolbar\";\nimport { useSubscribeInstanceRect } from \"./hooks/use-subscribe-instance-rect\";\nimport { useSubscribeSelectionRect } from \"./hooks/use-subscribe-selection-rect\";\nimport { useSubscribeTextEditingInstanceId } from \"./hooks/use-subscribe-editing-instance-id\";\n\nconst toolsStyle = {\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n pointerEvents: \"none\",\n overflow: \"hidden\",\n};\n\ntype CanvasToolsProps = {\n publish: Publish;\n};\n\nexport const CanvasTools = ({ publish }: CanvasToolsProps) => {\n useSubscribeInstanceRect();\n useSubscribeSelectionRect();\n useSubscribeScrollState();\n useSubscribeTextEditingInstanceId();\n\n const [isPreviewMode] = useIsPreviewMode();\n const [isScrolling] = useIsScrolling();\n if (isPreviewMode || isScrolling) {\n return null;\n }\n return (\n <Box css={toolsStyle}>\n <SelectedInstanceOutline />\n <HoveredInstanceOutline />\n <TextToolbar publish={publish} />\n </Box>\n );\n};\n", "import { Box, Flex } from \"apps/designer/app/shared/design-system\";\nimport {\n useCanvasWidth,\n useZoom,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { CanvasTools } from \"./canvas-tools\";\nimport { type Publish } from \"@webstudio-is/sdk\";\n\nconst workspaceStyle = {\n flexGrow: 1,\n background: \"$gray8\",\n overflow: \"auto\",\n scrollbarGutter: \"stable\",\n};\n\nconst zoomStyle = {\n transformStyle: \"preserve-3d\",\n transition: \"transform 200ms ease-out\",\n height: \"100%\",\n width: \"100%\",\n};\n\nconst canvasContainerStyle = {\n position: \"relative\",\n height: \"100%\",\n};\n\ntype WorkspaceProps = {\n children: JSX.Element;\n onTransitionEnd: () => void;\n publish: Publish;\n};\n\nexport const Workspace = ({\n children,\n onTransitionEnd,\n publish,\n}: WorkspaceProps) => {\n const [zoom] = useZoom();\n const [canvasWidth] = useCanvasWidth();\n\n const handleWorkspaceClick = () => {\n publish<\"unselectInstance\">({ type: \"unselectInstance\" });\n };\n\n return (\n <Box css={workspaceStyle} onClick={handleWorkspaceClick}>\n <Flex\n direction=\"column\"\n align=\"center\"\n css={zoomStyle}\n style={{ transform: `scale(${zoom / 100})` }}\n onTransitionEnd={onTransitionEnd}\n >\n <Box css={canvasContainerStyle} style={{ width: canvasWidth }}>\n {children}\n <CanvasTools publish={publish} />\n </Box>\n </Flex>\n </Box>\n );\n};\n", "import { useCallback, useEffect, useState } from \"react\";\nimport { useZoom } from \"apps/designer/app/designer/shared/nano-states\";\nimport {\n useCanvasRect,\n useCanvasWidth,\n} from \"apps/designer/app/designer/shared/nano-states\";\nimport { useWindowResize } from \"apps/designer/app/shared/dom-hooks\";\n\n/**\n * Reads the canvas iframe dom rect and puts it into nano state\n * so that this is the only place we do it.\n */\nexport const useReadCanvasRect = () => {\n const [iframeElement, setIframeElement] = useState<HTMLIFrameElement | null>(\n null\n );\n const [, setCanvasRect] = useCanvasRect();\n const [canvasWidth] = useCanvasWidth();\n const [zoom] = useZoom();\n const [recalcFlag, forceRecalc] = useState(false);\n useWindowResize(() => {\n forceRecalc(!recalcFlag);\n });\n\n const readRect = useCallback(\n () => {\n if (iframeElement === null) return;\n requestAnimationFrame(() => {\n const rect = iframeElement.getBoundingClientRect();\n setCanvasRect(rect);\n });\n },\n // canvasWidth will change the canvas width, so we need to React it to it and update the rect, even though we don't necessary usenthe value\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [iframeElement, setCanvasRect, canvasWidth, zoom, recalcFlag]\n );\n\n useEffect(readRect, [readRect]);\n\n return {\n onRef: setIframeElement,\n onTransitionEnd: readRect,\n };\n};\n", "import { useEffect } from \"react\";\nimport mitt from \"mitt\";\n\nconst emitter = mitt();\n\nif (typeof window === \"object\") {\n window.addEventListener(\n \"resize\",\n () => {\n emitter.emit(\"resize\");\n },\n false\n );\n}\n\n/**\n * Subscribe to DOM resize event only once and then notify all listeners over js only.\n * This allows us to subscribe to resize by many listeners without perf issues, since its going to be the same resize event.\n * TODO: We can add throttling and RAF if needed.\n */\nexport const useWindowResize = (onResize: () => void) => {\n useEffect(() => {\n emitter.on(\"resize\", onResize);\n return () => {\n emitter.off(\"resize\", onResize);\n };\n }, [onResize]);\n};\n", "// This hook is based on https://github.com/streamich/react-use/blob/master/src/useMeasure.ts\n// The problem is that contentRect has wrong x/y values for absolutely positioned element.\n// We have to use getBoundingClientRect instead.\n// @todo optimize for the case when many consumers need to measure the same element\n\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useScrollState } from \"./use-scroll-state\";\n\nexport type UseMeasureRef<MeasuredElement extends HTMLElement = HTMLElement> = (\n element: MeasuredElement | null\n) => void;\nexport type UseMeasureResult<\n MeasuredElement extends HTMLElement = HTMLElement\n> = [UseMeasureRef<MeasuredElement>, DOMRect | undefined];\n\nexport const useMeasure = <\n MeasuredElement extends HTMLElement = HTMLElement\n>(): UseMeasureResult<MeasuredElement> => {\n const [element, setElement] = useState<MeasuredElement | null>(null);\n const [rect, setRect] = useState<DOMRect>();\n\n const handleChange = useCallback(() => {\n if (element === null) return;\n setRect(element.getBoundingClientRect());\n }, [element]);\n\n useScrollState({\n onScrollEnd: handleChange,\n });\n\n const observer = useMemo(() => {\n if (typeof window === \"undefined\") return;\n return new window.ResizeObserver(handleChange);\n }, [handleChange]);\n\n useEffect(() => {\n if (observer) {\n if (element === null) observer.disconnect();\n else observer.observe(element);\n }\n return () => {\n observer?.disconnect();\n };\n }, [element, observer]);\n\n useEffect(handleChange, [handleChange]);\n\n return [setElement, rect];\n};\n", "import { useEffect } from \"react\";\nimport mitt from \"mitt\";\nimport noop from \"lodash.noop\";\n\n// Using a JS emitter to avoid overhead with subscribing scroll event directly on the DOM by many listeners\nconst emitter = mitt();\n\nif (typeof window === \"object\") {\n const eventOptions = {\n passive: true,\n capture: true,\n };\n window.addEventListener(\n \"scroll\",\n () => {\n emitter.emit(\"scroll\");\n },\n eventOptions\n );\n\n let timeoutId = 0;\n let isScrolling = false;\n\n emitter.on(\"scroll\", () => {\n isScrolling = true;\n emitter.emit(\"scrollStart\");\n clearTimeout(timeoutId);\n timeoutId = window.setTimeout(() => {\n if (isScrolling === false) return;\n isScrolling = false;\n emitter.emit(\"scrollEnd\");\n }, 150);\n });\n}\n\ntype UseScrollState = {\n onScroll?: () => void;\n onScrollStart?: () => void;\n onScrollEnd?: () => void;\n};\n\n/**\n * Scroll state abstraction that can handle a lot of subscribers well.\n * Potentially could add rate limiting and actual scroll top/left values.\n */\nexport const useScrollState = ({\n onScroll = noop,\n onScrollStart = noop,\n onScrollEnd = noop,\n}: UseScrollState) => {\n useEffect(() => {\n emitter.on(\"scrollStart\", onScrollStart);\n emitter.on(\"scroll\", onScroll);\n emitter.on(\"scrollEnd\", onScrollEnd);\n\n return () => {\n emitter.off(\"scrollStart\", onScrollStart);\n emitter.off(\"scroll\", onScroll);\n emitter.off(\"scrollEnd\", onScrollEnd);\n };\n }, [onScroll, onScrollEnd, onScrollStart]);\n};\n", "import { forwardRef } from \"react\";\nimport { CSS, css } from \"apps/designer/app/shared/design-system\";\n\nconst iframeStyle = css({\n border: \"none\",\n variants: {\n pointerEvents: {\n none: {\n pointerEvents: \"none\",\n },\n all: {\n pointerEvents: \"all\",\n },\n },\n },\n});\n\ntype CanvasIframeProps = {\n pointerEvents: \"all\" | \"none\";\n css: CSS;\n} & JSX.IntrinsicElements[\"iframe\"];\n\nexport const CanvasIframe = forwardRef<HTMLIFrameElement, CanvasIframeProps>(\n ({ pointerEvents = \"all\", css, ...rest }, ref) => {\n return (\n <iframe\n {...rest}\n ref={ref}\n className={iframeStyle({ pointerEvents, css })}\n />\n );\n }\n);\n\nCanvasIframe.displayName = \"CanvasIframe\";\n", "import { useHotkeys } from \"react-hotkeys-hook\";\nimport { type Publish } from \"@webstudio-is/sdk\";\nimport { shortcuts, options } from \"apps/designer/app/shared/shortcuts\";\n\nconst names = Object.keys(shortcuts) as Array<keyof typeof shortcuts>;\n\n/**\n * Forwarding shortcuts to the canvas.\n */\nexport const usePublishShortcuts = (publish: Publish) => {\n names.forEach((name) => {\n // as long as the array is static, it's ok\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useHotkeys(\n shortcuts[name],\n (event) => {\n event.preventDefault();\n publish<\"shortcut\", { name: string; key: string }>({\n type: \"shortcut\",\n payload: { name, key: event.key },\n });\n },\n options,\n []\n );\n });\n};\n", "export const shortcuts = {\n undo: \"cmd+z, ctrl+z\",\n redo: \"cmd+shift+z, ctrl+shift+z\",\n preview: \"cmd+shift+p, ctrl+shift+p\",\n copy: \"cmd+c, ctrl+c\",\n paste: \"cmd+v, ctrl+v\",\n breakpointsMenu: \"cmd+b, ctrl+b\",\n breakpoint: Array.from(new Array(9))\n .map((_, index) => `cmd+${index + 1}, ctrl+${index + 1}`)\n .join(\", \"),\n zoom: \"cmd+=, ctrl+=, cmd+-, ctrl+-\",\n} as const;\n\nexport const options = { splitKey: \"+\", keydown: true };\n", "import { LoaderFunction, type MetaFunction } from \"@remix-run/node\";\nimport { Canvas } from \"apps/designer/app/shared/documents/canvas\";\nimport env from \"apps/designer/app/env.server\";\n\nexport const loader: LoaderFunction = () => ({\n env,\n});\n\nexport const meta: MetaFunction = () => {\n return { title: \"Webstudio site preview\" };\n};\n\nexport default Canvas;\n", "import {\n Links,\n LiveReload,\n Meta,\n Outlet as DefaultOutlet,\n Scripts,\n ScrollRestoration,\n} from \"@remix-run/react\";\nimport { CriticalCss } from \"@webstudio-is/sdk\";\nimport { Env } from \"apps/designer/app/shared/env\";\n\n/**\n * We are using Outlet prop from index layout when user renders site from a subdomain.\n */\nexport const Canvas = ({\n Outlet = DefaultOutlet,\n}: {\n Outlet: typeof DefaultOutlet;\n}) => {\n return (\n <html lang=\"en\">\n <head>\n <meta charSet=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n <link rel=\"icon\" href=\"/favicon.ico\" type=\"image/x-icon\" />\n <link rel=\"shortcut icon\" href=\"/favicon.ico\" type=\"image/x-icon\" />\n <Meta />\n <Links />\n <CriticalCss />\n </head>\n <body>\n <Outlet />\n <ScrollRestoration />\n <Env />\n <Scripts />\n {process.env.NODE_ENV === \"development\" && <LiveReload />}\n </body>\n </html>\n );\n};\n", "import { useLoaderData } from \"@remix-run/react\";\nimport type { LoaderFunction } from \"@remix-run/node\";\nimport { Root } from \"@webstudio-is/sdk\";\nimport {\n loadPreviewData,\n type PreviewData,\n type ErrorData,\n} from \"apps/designer/app/shared/db\";\nimport env, { Env } from \"apps/designer/app/env.server\";\n\ntype LoaderReturnType = Promise<\n (PreviewData & { env: Env }) | (ErrorData & { env: Env })\n>;\n\nexport const loader: LoaderFunction = async ({ params }): LoaderReturnType => {\n if (params.projectId === undefined) {\n return { errors: \"Missing projectId\", env };\n }\n try {\n const previewData = await loadPreviewData({ projectId: params.projectId });\n return {\n ...previewData,\n env,\n };\n } catch (error) {\n if (error instanceof Error) {\n return {\n errors: error.message,\n env,\n };\n }\n }\n return { errors: \"Unexpected error\", env };\n};\n\nconst PreviewRoute = () => {\n const data = useLoaderData<PreviewData | ErrorData>();\n if (\"errors\" in data) {\n return <p>{data.errors}</p>;\n }\n return <Root data={data} />;\n};\n\nexport default PreviewRoute;\n", "import { LoaderFunction, type MetaFunction } from \"@remix-run/node\";\nimport { Canvas } from \"apps/designer/app/shared/documents/canvas\";\nimport env from \"apps/designer/app/env.server\";\n\nexport const loader: LoaderFunction = () => ({\n env,\n});\n\nexport const meta: MetaFunction = () => {\n return { title: \"Webstudio canvas\" };\n};\n\nexport default Canvas;\n", "import { useLoaderData } from \"@remix-run/react\";\nimport type { LoaderFunction } from \"@remix-run/node\";\nimport { Canvas } from \"apps/designer/app/canvas\";\nimport {\n loadCanvasData,\n type ErrorData,\n type CanvasData,\n} from \"apps/designer/app/shared/db\";\nimport env, { Env } from \"apps/designer/app/env.server\";\n\ntype LoaderReturnTypes = Promise<\n (CanvasData & { env: Env }) | (ErrorData & { env: Env })\n>;\n\nexport const loader: LoaderFunction = async ({ params }): LoaderReturnTypes => {\n if (params.projectId === undefined) {\n return { errors: \"Missing projectId\", env };\n }\n try {\n const canvasData = await loadCanvasData({ projectId: params.projectId });\n return {\n ...canvasData,\n env,\n };\n } catch (error) {\n if (error instanceof Error) {\n return {\n errors: error.message,\n env,\n };\n }\n }\n return { errors: \"Unexpected error\", env };\n};\n\nconst CanvasRoute = () => {\n const data = useLoaderData<CanvasData | ErrorData>();\n // @todo how should we treat this kind of errors?\n if (\"errors\" in data) {\n return <p>{data.errors}</p>;\n }\n return <Canvas data={data} />;\n};\n\nexport default CanvasRoute;\n", "import { useCallback, useMemo, useState } from \"react\";\nimport { DndProvider } from \"react-dnd\";\nimport { TouchBackend } from \"react-dnd-touch-backend\";\nimport store from \"immerhin\";\nimport {\n type OnChangeChildren,\n type Data,\n type Tree,\n useAllUserProps,\n WrapperComponent,\n globalStyles,\n useSubscribe,\n} from \"@webstudio-is/sdk\";\nimport {\n createElementsTree,\n setInstanceChildrenMutable,\n} from \"apps/designer/app/shared/tree-utils\";\nimport { useDragDropHandlers } from \"./shared/use-drag-drop-handlers\";\nimport { useShortcuts } from \"./shared/use-shortcuts\";\nimport {\n usePopulateRootInstance,\n useInsertInstance,\n useDeleteInstance,\n useReparentInstance,\n usePublishSelectedInstanceData,\n usePublishRootInstance,\n useUpdateSelectedInstance,\n usePublishSelectedInstanceDataRect,\n usePublishHoveredInstanceRect,\n usePublishHoveredInstanceData,\n useSetHoveredInstance,\n useUnselectInstance,\n usePublishTextEditingInstanceId,\n} from \"./shared/instance\";\nimport { useUpdateStyle } from \"./shared/style\";\nimport { useTrackSelectedElement } from \"./shared/use-track-selected-element\";\nimport { WrapperComponentDev } from \"./features/wrapper-component\";\nimport { useSync } from \"./shared/sync\";\nimport { useManageProps } from \"./shared/props\";\nimport {\n useHandleBreakpoints,\n useInitializeBreakpoints,\n} from \"./shared/breakpoints\";\nimport type { Project } from \"apps/designer/app/shared/db/project.server\";\nimport {\n rootInstanceContainer,\n useBreakpoints,\n useRootInstance,\n useSubscribeScrollState,\n} from \"apps/designer/app/shared/nano-states\";\nimport { registerContainers } from \"./shared/immerhin\";\nimport { useTrackHoveredElement } from \"./shared/use-track-hovered-element\";\nimport { usePublishScrollState } from \"./shared/use-publish-scroll-state\";\nimport {\n LexicalComposer,\n config,\n} from \"apps/designer/app/canvas/features/wrapper-component/text-editor\";\n\nregisterContainers();\n\nconst useElementsTree = () => {\n const [rootInstance] = useRootInstance();\n const [breakpoints] = useBreakpoints();\n\n const onChangeChildren: OnChangeChildren = useCallback((change) => {\n store.createTransaction([rootInstanceContainer], (rootInstance) => {\n if (rootInstance === undefined) return;\n\n const { instanceId, updates } = change;\n setInstanceChildrenMutable(instanceId, updates, rootInstance);\n });\n }, []);\n\n return useMemo(() => {\n if (rootInstance === undefined) return;\n\n return createElementsTree({\n instance: rootInstance,\n breakpoints,\n Component: WrapperComponentDev,\n onChangeChildren,\n });\n }, [rootInstance, breakpoints, onChangeChildren]);\n};\n\nconst useSubscribePreviewMode = () => {\n const [isPreviewMode, setIsPreviewMode] = useState<boolean>(false);\n useSubscribe<\"previewMode\", boolean>(\"previewMode\", setIsPreviewMode);\n return isPreviewMode;\n};\n\nconst PreviewMode = () => {\n const [rootInstance] = useRootInstance();\n const [breakpoints] = useBreakpoints();\n if (rootInstance === undefined) return null;\n return createElementsTree({\n breakpoints,\n instance: rootInstance,\n Component: WrapperComponent,\n });\n};\n\ntype DesignModeProps = {\n treeId: Tree[\"id\"];\n project: Project;\n};\n\nconst dndOptions = { enableMouseEvents: true };\n\nconst DesignMode = ({ treeId, project }: DesignModeProps) => {\n useDragDropHandlers();\n useUpdateStyle();\n useManageProps();\n usePublishSelectedInstanceData(treeId);\n usePublishHoveredInstanceData();\n useHandleBreakpoints();\n useInsertInstance();\n useReparentInstance();\n useDeleteInstance();\n usePublishRootInstance();\n useTrackSelectedElement();\n useTrackHoveredElement();\n useSetHoveredInstance();\n useSync({ project });\n useUpdateSelectedInstance();\n usePublishSelectedInstanceDataRect();\n usePublishHoveredInstanceRect();\n useUnselectInstance();\n usePublishScrollState();\n useSubscribeScrollState();\n usePublishTextEditingInstanceId();\n const elements = useElementsTree();\n return (\n // Using touch backend becuase html5 drag&drop doesn't fire drag events in our case\n <DndProvider backend={TouchBackend} options={dndOptions}>\n {elements && (\n <LexicalComposer initialConfig={config}>{elements}</LexicalComposer>\n )}\n </DndProvider>\n );\n};\n\ntype CanvasProps = {\n data: Data & { project: Project };\n};\n\nexport const Canvas = ({ data }: CanvasProps): JSX.Element | null => {\n if (data.tree === null) {\n throw new Error(\"Tree is null\");\n }\n useInitializeBreakpoints(data.breakpoints);\n globalStyles();\n useAllUserProps(data.props);\n usePopulateRootInstance(data.tree);\n // e.g. toggling preview is still needed in both modes\n useShortcuts();\n const isPreviewMode = useSubscribePreviewMode();\n\n if (isPreviewMode) {\n return <PreviewMode />;\n }\n\n return <DesignMode treeId={data.tree.id} project={data.project} />;\n};\n", "import { useState } from \"react\";\nimport { publish, useSubscribe } from \"@webstudio-is/sdk\";\nimport {\n type DragData,\n type DropData,\n} from \"apps/designer/app/shared/canvas-components\";\nimport { findInstanceById } from \"apps/designer/app/shared/tree-utils\";\nimport {\n findClosestChild,\n findInsertionIndex,\n getDragOverInfo,\n} from \"apps/designer/app/shared/dom-utils\";\nimport {\n useDropData,\n useHoveredElement,\n useHoveredInstance,\n useSelectedInstance,\n} from \"./nano-states\";\nimport { useRootInstance } from \"apps/designer/app/shared/nano-states\";\nimport memoize from \"lodash.memoize\";\n//import {usePointerOutline} from './use-pointer-outline'\n\nconst getBoundingClientRect = memoize((element: Element | HTMLElement) =>\n element.getBoundingClientRect()\n);\n\nconst getComputedStyle = memoize((element: Element | HTMLElement) =>\n window.getComputedStyle(element)\n);\n\nexport const useDragDropHandlers = () => {\n const [rootInstance] = useRootInstance();\n const [, setSelectedInstance] = useSelectedInstance();\n const [, setHoveredInstance] = useHoveredInstance();\n const [, setHoveredElement] = useHoveredElement();\n const [dropData, setDropData] = useDropData();\n const [dragData, setDragData] = useState<DragData>();\n\n useSubscribe<\"dragStartInstance\">(\"dragStartInstance\", () => {\n setSelectedInstance(undefined);\n });\n\n useSubscribe<\"dragEndInstance\">(\"dragEndInstance\", () => {\n // Cleanup\n if (getBoundingClientRect.cache?.clear) getBoundingClientRect.cache.clear();\n if (getComputedStyle.cache?.clear) getComputedStyle.cache.clear();\n setDropData(undefined);\n setDragData(undefined);\n\n if (\n rootInstance === undefined ||\n dropData === undefined ||\n dragData === undefined ||\n // Can't reparent an instance inside itself\n dropData.instance.id === dragData.instance.id\n ) {\n return;\n }\n\n const isNew =\n findInstanceById(rootInstance, dragData.instance.id) === undefined;\n\n const data = {\n instance: dragData.instance,\n dropData,\n };\n\n if (isNew) {\n publish<\"insertInstance\", typeof data>({\n type: \"insertInstance\",\n payload: data,\n });\n return;\n }\n\n publish<\"reparentInstance\", typeof data>({\n type: \"reparentInstance\",\n payload: data,\n });\n });\n\n //const updatePointerOutline = usePointerOutline();\n useSubscribe<\"dragInstance\", DragData>(\"dragInstance\", (dragData) => {\n const { currentOffset } = dragData;\n // updatePointerOutline(currentOffset)\n const dragOver = getDragOverInfo(currentOffset, getBoundingClientRect);\n\n if (rootInstance === undefined || dragOver.element === undefined) return;\n\n const dropInstance = findInstanceById(rootInstance, dragOver.element.id);\n\n if (dropInstance === undefined) return;\n\n const closestChild = findClosestChild(\n dragOver.element,\n currentOffset,\n getBoundingClientRect,\n getComputedStyle\n );\n\n let position = 0;\n\n // When element has children.\n if (dragOver.element !== undefined && closestChild !== undefined) {\n position = findInsertionIndex(dragOver, closestChild);\n }\n\n const dropData = {\n instance: dropInstance,\n position,\n };\n\n setDragData(dragData);\n setDropData(dropData);\n setHoveredInstance(dropInstance);\n setHoveredElement(dragOver.element);\n publish<\"dropPreview\", { dropData: DropData; dragData: DragData }>({\n type: \"dropPreview\",\n payload: { dropData, dragData },\n });\n });\n};\n", "import type { Coordinate, ClosestChildInfo } from \"./types\";\n\nconst calculateDistance = (coordinate: Coordinate, rect: DOMRect): number => {\n const distanceX = Math.max(\n rect.left - coordinate.x,\n 0,\n coordinate.x - rect.right\n );\n const distanceY = Math.max(\n rect.top - coordinate.y,\n 0,\n coordinate.y - rect.bottom\n );\n return Math.sqrt(distanceX * distanceX + distanceY * distanceY);\n};\n\nconst sortNumbers = (a: number, b: number): number => a - b;\n\n// There is a gotcha with relative position, it can have top/right/bottom/left too and so will not\n// be positioned by layout, but we ignore this for now.\nconst isPositionedElement = (\n element: Element,\n getComputedStyle: (element: Element) => CSSStyleDeclaration\n): boolean => {\n const { position } = getComputedStyle(element);\n return position !== \"static\" && position !== \"relative\";\n};\n\n/**\n * Find the closest element relative to coordinates inside a parent element.\n */\nexport const findClosestChild = (\n parentElement: Element,\n coordinate: Coordinate,\n getBoundingClientRect: (element: Element) => DOMRect,\n getComputedStyle: (element: Element) => CSSStyleDeclaration\n): ClosestChildInfo | void => {\n // Collect bounding client rects for all children.\n if (parentElement.children.length === 0) return;\n\n // Find the closest child by coordinate\n const distances = [];\n const distanceElementMap = new Map();\n for (const child of parentElement.children) {\n if (isPositionedElement(child, getComputedStyle)) continue;\n const rect = getBoundingClientRect(child);\n const distance = calculateDistance(coordinate, rect);\n distances.push(distance);\n distanceElementMap.set(distance, child);\n }\n\n distances.sort(sortNumbers);\n\n // For now we are only interested if we are nearing the element from the top or bottom\n const element = distanceElementMap.get(distances[0]);\n const rect = getBoundingClientRect(element);\n\n const relativePosition =\n coordinate.y - rect.top < 0\n ? \"before\"\n : coordinate.y - rect.bottom > 0\n ? \"after\"\n : \"inside\";\n\n return { element, relativePosition };\n};\n", "import type { DragOverInfo, ClosestChildInfo } from \"./types\";\n\nexport const findInsertionIndex = (\n dragOver: DragOverInfo,\n closestChildInfo: ClosestChildInfo\n): number => {\n const index = [...(dragOver.element?.children || [])].indexOf(\n closestChildInfo.element\n );\n let insertionIndex = 0;\n if (closestChildInfo.relativePosition == \"inside\") {\n if (dragOver.edge === \"top\") insertionIndex = index;\n else if (dragOver.edge === \"bottom\") insertionIndex = index + 1;\n else return 0;\n } else {\n insertionIndex =\n closestChildInfo.relativePosition === \"before\" ? index - 1 : index + 1;\n }\n if (insertionIndex < 0) return 0;\n return insertionIndex;\n};\n", "import type { Coordinate, DragOverInfo } from \"./types\";\n\nconst elementFromPoint = (coordinate: Coordinate): HTMLElement | undefined => {\n const element = document.elementFromPoint(coordinate.x, coordinate.y);\n if (element instanceof HTMLElement) return element;\n};\n\n/**\n * Get element we are hovering over from coordinate.\n * When nearing to an edge of an element - return the parent.\n */\nexport const getDragOverInfo = (\n offset: Coordinate,\n getBoundingClientRect: (element: Element) => DOMRect\n): DragOverInfo => {\n let element = elementFromPoint(offset);\n let edge: DragOverInfo[\"edge\"] = \"none\";\n\n if (element === undefined) return { element, edge };\n\n const { bottom, y } = getBoundingClientRect(element);\n // We are at the top/bottom edge and this means user wants\n // to insert after that element into its parent\n if (offset.y - y <= 5) edge = \"top\";\n if (bottom - offset.y <= 5) edge = \"bottom\";\n\n if (edge === \"none\") return { element, edge };\n\n const { parentElement } = element;\n\n if (parentElement !== null && parentElement !== document.body) {\n element = parentElement;\n }\n\n return { element, edge };\n};\n", "import { createValueContainer, useValue } from \"react-nano-state\";\nimport { type Instance } from \"@webstudio-is/sdk\";\nimport { type DropData } from \"apps/designer/app/shared/canvas-components\";\n\nconst dropDataContainer = createValueContainer<DropData | undefined>();\nexport const useDropData = () => useValue(dropDataContainer);\n\nexport const selectedInstanceContainer = createValueContainer<\n Instance | undefined\n>();\nexport const useSelectedInstance = () => useValue(selectedInstanceContainer);\n\nexport const hoveredInstanceContainer = createValueContainer<\n Instance | undefined\n>();\nexport const useHoveredInstance = () => useValue(hoveredInstanceContainer);\n\nconst selectedElementContainer = createValueContainer<\n HTMLElement | undefined\n>();\nexport const useSelectedElement = () => useValue(selectedElementContainer);\n\nconst hoveredElementContainer = createValueContainer<HTMLElement | undefined>();\nexport const useHoveredElement = () => useValue(hoveredElementContainer);\n", "import { useHotkeys } from \"react-hotkeys-hook\";\nimport store from \"immerhin\";\nimport { type Instance, publish, useSubscribe } from \"@webstudio-is/sdk\";\nimport { shortcuts, options } from \"apps/designer/app/shared/shortcuts\";\nimport { useSelectedInstance } from \"./nano-states\";\nimport { copy, paste } from \"./copy-paste\";\nimport {\n useRootInstance,\n useTextEditingInstanceId,\n} from \"apps/designer/app/shared/nano-states\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\n\nconst inputTags = [\"INPUT\", \"SELECT\", \"TEXTAREA\"] as const;\n\ntype HandlerEvent = {\n key: string;\n preventDefault?: () => void;\n};\n\nconst togglePreviewMode = () => {\n publish<\"togglePreviewMode\">({ type: \"togglePreviewMode\" });\n};\n\nconst publishSelectBreakpoint = ({ key }: HandlerEvent) => {\n publish({\n type: \"selectBreakpointFromShortcut\",\n payload: key,\n });\n};\n\nconst publishZoom = (event: HandlerEvent) => {\n if (event.preventDefault !== undefined) event.preventDefault();\n publish({\n type: \"zoom\",\n payload: event.key === \"-\" ? \"zoomOut\" : \"zoomIn\",\n });\n};\n\nconst publishOpenBreakpointsMenu = () => {\n publish({ type: \"openBreakpointsMenu\" });\n};\n\nexport const useShortcuts = () => {\n const [rootInstance] = useRootInstance();\n const [selectedInstance, setSelectedInstance] = useSelectedInstance();\n const [editingInstanceId, setEditingInstanceId] = useTextEditingInstanceId();\n\n const publishDeleteInstance = () => {\n // @todo tell user they can't delete root\n if (\n selectedInstance === undefined ||\n selectedInstance.id === rootInstance?.id\n ) {\n return;\n }\n publish<\"deleteInstance\", { id: Instance[\"id\"] }>({\n type: \"deleteInstance\",\n payload: {\n id: selectedInstance.id,\n },\n });\n };\n\n const shortcutHandlerMap = {\n undo: store.undo.bind(store),\n redo: store.redo.bind(store),\n delete: publishDeleteInstance,\n preview: togglePreviewMode,\n copy,\n paste,\n breakpointsMenu: publishOpenBreakpointsMenu,\n breakpoint: publishSelectBreakpoint,\n zoom: publishZoom,\n } as const;\n\n useHotkeys(\n \"backspace, delete\",\n shortcutHandlerMap.delete,\n { ...options, enableOnTags: [...inputTags] },\n [shortcutHandlerMap.delete]\n );\n\n useHotkeys(\n \"esc\",\n () => {\n if (selectedInstance === undefined) return;\n // Since we are in text editing mode, we want to first exit that mode without unselecting the instance.\n if (editingInstanceId) {\n setEditingInstanceId(undefined);\n return;\n }\n setSelectedInstance(undefined);\n publish<\"selectInstance\">({ type: \"selectInstance\" });\n },\n { ...options, enableOnContentEditable: true, enableOnTags: [...inputTags] },\n [selectedInstance, editingInstanceId]\n );\n\n useHotkeys(\n \"enter\",\n (event) => {\n if (selectedInstance === undefined) return;\n const { isContentEditable } = primitives[selectedInstance.component];\n if (isContentEditable === false) return;\n // Prevents inserting a newline when entering text-editing mode\n event.preventDefault();\n setEditingInstanceId(selectedInstance.id);\n },\n options,\n [selectedInstance, setEditingInstanceId]\n );\n\n useHotkeys(shortcuts.undo, shortcutHandlerMap.undo, options, []);\n\n useHotkeys(shortcuts.redo, shortcutHandlerMap.redo, options, []);\n\n useHotkeys(shortcuts.preview, shortcutHandlerMap.preview, options, []);\n\n useHotkeys(shortcuts.copy, shortcutHandlerMap.copy, options, [\n shortcutHandlerMap.copy,\n ]);\n\n useHotkeys(shortcuts.paste, shortcutHandlerMap.paste, options, []);\n\n useHotkeys(shortcuts.breakpoint, shortcutHandlerMap.breakpoint, options, []);\n useHotkeys(shortcuts.zoom, shortcutHandlerMap.zoom, options, []);\n useHotkeys(\n shortcuts.breakpointsMenu,\n shortcutHandlerMap.breakpointsMenu,\n options,\n []\n );\n\n // Shortcuts from the parent window\n useSubscribe<\"shortcut\", { name: keyof typeof shortcuts; key: string }>(\n \"shortcut\",\n ({ name, key }) => {\n shortcutHandlerMap[name]({ key });\n }\n );\n};\n", "import {\n type InstanceProps,\n type Instance,\n allUserPropsContainer,\n publish,\n} from \"@webstudio-is/sdk\";\nimport { selectedInstanceContainer } from \"./nano-states\";\nimport { cloneInstance } from \"apps/designer/app/shared/tree-utils\";\nimport { cloneProps } from \"apps/designer/app/shared/props-utils\";\n\nlet currentInstance: Instance | undefined;\nlet currentProps: InstanceProps | undefined;\n\nexport const copy = () => {\n if (selectedInstanceContainer.value === undefined) return;\n currentInstance = selectedInstanceContainer.value;\n currentProps = allUserPropsContainer.value[currentInstance.id];\n};\n\nexport const paste = () => {\n if (currentInstance === undefined) return;\n const instance = cloneInstance(currentInstance);\n const props = currentProps\n ? cloneProps(currentProps, { instanceId: instance.id })\n : undefined;\n publish<\"insertInstance\", { instance: Instance; props?: InstanceProps }>({\n type: \"insertInstance\",\n payload: {\n instance,\n props,\n },\n });\n};\n", "import { type AllUserProps, type UserPropsUpdates } from \"@webstudio-is/sdk\";\n\nexport const updateAllUserPropsMutable = (\n allUserProps: AllUserProps,\n { instanceId, propsId, treeId, updates }: UserPropsUpdates\n) => {\n if (instanceId in allUserProps === false) {\n allUserProps[instanceId] = {\n id: propsId,\n instanceId,\n treeId,\n props: [],\n };\n }\n const instanceProps = allUserProps[instanceId];\n for (const update of updates) {\n const prop = instanceProps.props.find(({ id }) => id === update.id);\n if (prop === undefined) {\n instanceProps.props.push(update);\n } else {\n prop.prop = update.prop;\n prop.value = update.value;\n }\n }\n};\n", "import { type AllUserProps, type DeleteProp } from \"@webstudio-is/sdk\";\n\nexport const deletePropMutable = (\n allProps: AllUserProps,\n deleteProp: DeleteProp\n) => {\n const prop = allProps[deleteProp.instanceId];\n if (prop === undefined) return false;\n const index = prop.props.findIndex(({ id }) => id === deleteProp.propId);\n if (index === -1) return false;\n prop.props.splice(index, 1);\n return true;\n};\n", "import ObjectId from \"bson-objectid\";\nimport produce from \"immer\";\nimport { type InstanceProps, type Instance } from \"@webstudio-is/sdk\";\n\nexport const cloneProps = (\n instanceProps: InstanceProps,\n { instanceId }: { instanceId: Instance[\"id\"] }\n) =>\n produce((instanceProps: InstanceProps) => {\n instanceProps.id = ObjectId().toString();\n instanceProps.instanceId = instanceId;\n for (const prop of instanceProps.props) {\n prop.id = ObjectId().toString();\n }\n })(instanceProps);\n", "import { useCallback, useEffect, useMemo } from \"react\";\nimport ObjectId from \"bson-objectid\";\nimport {\n type InstanceProps,\n type Instance,\n type Tree,\n allUserPropsContainer,\n getBrowserStyle,\n useAllUserProps,\n useSubscribe,\n publish,\n} from \"@webstudio-is/sdk\";\nimport {\n deleteInstanceMutable,\n populateInstance,\n findParentInstance,\n findClosestSiblingInstance,\n insertInstanceMutable,\n findInstanceById,\n} from \"apps/designer/app/shared/tree-utils\";\nimport store from \"immerhin\";\nimport {\n DropData,\n HoveredInstanceData,\n type SelectedInstanceData,\n} from \"apps/designer/app/shared/canvas-components\";\nimport {\n useSelectedInstance,\n useSelectedElement,\n useHoveredElement,\n useHoveredInstance,\n} from \"./nano-states\";\nimport {\n rootInstanceContainer,\n useRootInstance,\n useTextEditingInstanceId,\n} from \"apps/designer/app/shared/nano-states\";\nimport { useMeasure } from \"apps/designer/app/shared/dom-hooks\";\n\nexport const usePopulateRootInstance = (tree: Tree) => {\n const [, setRootInstance] = useRootInstance();\n useEffect(() => {\n setRootInstance(tree.root);\n }, [tree, setRootInstance]);\n};\n\nexport const useInsertInstance = () => {\n const [selectedInstance, setSelectedInstance] = useSelectedInstance();\n\n useSubscribe<\n \"insertInstance\",\n { instance: Instance; dropData?: DropData; props?: InstanceProps }\n >(\"insertInstance\", ({ instance, dropData, props }) => {\n store.createTransaction(\n [rootInstanceContainer, allUserPropsContainer],\n (rootInstance, allUserProps) => {\n if (rootInstance === undefined) return;\n const populatedInstance = populateInstance(instance);\n const hasInserted = insertInstanceMutable(\n rootInstance,\n populatedInstance,\n {\n parentId:\n dropData?.instance.id ?? selectedInstance?.id ?? rootInstance.id,\n position: dropData?.position || \"end\",\n }\n );\n if (hasInserted) {\n setSelectedInstance(instance);\n }\n if (props !== undefined) {\n allUserProps[props.instanceId] = props;\n }\n }\n );\n });\n};\n\nexport const useReparentInstance = () => {\n useSubscribe<\"reparentInstance\", { instance: Instance; dropData: DropData }>(\n \"reparentInstance\",\n ({ instance, dropData }) => {\n store.createTransaction([rootInstanceContainer], (rootInstance) => {\n if (rootInstance === undefined) return;\n deleteInstanceMutable(rootInstance, instance.id);\n insertInstanceMutable(rootInstance, instance, {\n parentId: dropData.instance.id,\n position: dropData.position,\n });\n });\n }\n );\n};\n\nexport const useDeleteInstance = () => {\n const [rootInstance] = useRootInstance();\n const [selectedInstance, setSelectedInstance] = useSelectedInstance();\n useSubscribe<\"deleteInstance\", { id: Instance[\"id\"] }>(\n \"deleteInstance\",\n ({ id }) => {\n if (rootInstance !== undefined && selectedInstance !== undefined) {\n const parentInstance = findParentInstance(rootInstance, id);\n if (parentInstance !== undefined) {\n const siblingInstance = findClosestSiblingInstance(\n parentInstance,\n id\n );\n setSelectedInstance(siblingInstance || parentInstance);\n }\n }\n // @todo deleting instance should involve also deleting it's props\n // If we don't delete them - they just live both on client and db\n // Pros:\n // - if we undo the deletion we don't need to undo the props deletion\n // - in a multiplayer environment, some other user could have changed a prop while we have deleted the instance\n // and then if we restore the instance, we would be restoring it with our props, potentially overwriting other users changes\n // The way it is now it will actually still enable parallel deletion props editing and restoration.\n // Contra: we are piling them up.\n // Potentially we could also solve this by periodically removing unused props after while when instance was deleted\n store.createTransaction([rootInstanceContainer], (rootInstance) => {\n if (rootInstance !== undefined) {\n deleteInstanceMutable(rootInstance, id);\n }\n });\n }\n );\n};\n\nexport const usePublishSelectedInstanceData = (treeId: Tree[\"id\"]) => {\n const [instance] = useSelectedInstance();\n const [selectedElement] = useSelectedElement();\n const [allUserProps] = useAllUserProps();\n const browserStyle = useMemo(\n () => getBrowserStyle(selectedElement),\n [selectedElement]\n );\n\n useEffect(() => {\n // Unselects the instance by `undefined`\n let payload;\n if (instance !== undefined) {\n let props = allUserProps[instance.id];\n if (props === undefined) {\n props = {\n id: ObjectId().toString(),\n instanceId: instance.id,\n treeId,\n props: [],\n };\n }\n payload = {\n id: instance.id,\n component: instance.component,\n cssRules: instance.cssRules,\n browserStyle,\n props,\n };\n }\n publish<\"selectInstance\", SelectedInstanceData>({\n type: \"selectInstance\",\n payload,\n });\n }, [instance, allUserProps, treeId, browserStyle]);\n};\n\nexport const usePublishHoveredInstanceData = () => {\n const [instance] = useHoveredInstance();\n\n useEffect(() => {\n const payload = instance\n ? {\n id: instance.id,\n component: instance.component,\n }\n : undefined;\n publish<\"hoverInstance\", HoveredInstanceData | undefined>({\n type: \"hoverInstance\",\n payload,\n });\n }, [instance]);\n};\n\nexport const usePublishRootInstance = () => {\n const [rootInstance] = useRootInstance();\n useEffect(() => {\n publish<\"loadRootInstance\", Instance>({\n type: \"loadRootInstance\",\n payload: rootInstance,\n });\n }, [rootInstance]);\n};\n\nconst publishRect = (rect: DOMRect) => {\n publish<\"selectedInstanceRect\", DOMRect>({\n type: \"selectedInstanceRect\",\n payload: rect,\n });\n};\n\nexport const usePublishSelectedInstanceDataRect = () => {\n const [element] = useSelectedElement();\n const [refCallback, rect] = useMeasure();\n\n useEffect(() => {\n // Disconnect observer when there is no element.\n refCallback(element ?? null);\n }, [element, refCallback]);\n\n useEffect(() => {\n if (rect !== undefined) publishRect(rect);\n }, [rect]);\n};\n\nexport const usePublishHoveredInstanceRect = () => {\n const [element] = useHoveredElement();\n const publishRect = useCallback(() => {\n if (element === undefined) return;\n publish<\"hoveredInstanceRect\", DOMRect>({\n type: \"hoveredInstanceRect\",\n payload: element.getBoundingClientRect(),\n });\n }, [element]);\n useEffect(publishRect, [publishRect]);\n};\n\nexport const useSetHoveredInstance = () => {\n const [rootInstance] = useRootInstance();\n const [hoveredElement] = useHoveredElement();\n const [, setHoveredInstance] = useHoveredInstance();\n\n useEffect(() => {\n let instance;\n if (rootInstance !== undefined && hoveredElement?.id) {\n instance = findInstanceById(rootInstance, hoveredElement.id);\n }\n setHoveredInstance(instance);\n }, [rootInstance, hoveredElement, setHoveredInstance]);\n};\n\n/**\n * We need to set the selected instance after a any root instance update,\n * because anything that we change on the selected instance is actually done on the root, so\n * when we run \"undo\", root is going to be undone but not the selected instance, unless we update it here.\n */\nexport const useUpdateSelectedInstance = () => {\n const [rootInstance] = useRootInstance();\n const [selectedInstance, setSelectedInstance] = useSelectedInstance();\n\n // When selected instance or root instance changes - we want to make sure the instance with that id still exists in the root.\n useEffect(() => {\n let instance;\n if (rootInstance !== undefined && selectedInstance?.id) {\n instance = findInstanceById(rootInstance, selectedInstance.id);\n }\n // When it's a new inserted instance, it will be undefined, so we can't set it to undefined and remove it.\n if (instance !== undefined) setSelectedInstance(instance);\n }, [rootInstance, selectedInstance, setSelectedInstance]);\n};\n\nexport const useUnselectInstance = () => {\n const [, setSelectedInstance] = useSelectedInstance();\n useSubscribe(\"unselectInstance\", () => {\n setSelectedInstance(undefined);\n });\n};\n\nexport const usePublishTextEditingInstanceId = () => {\n const [editingInstanceId] = useTextEditingInstanceId();\n useEffect(() => {\n publish<\"textEditingInstanceId\", Instance[\"id\"] | undefined>({\n type: \"textEditingInstanceId\",\n payload: editingInstanceId,\n });\n }, [editingInstanceId]);\n};\n", "import store from \"immerhin\";\nimport { useSubscribe } from \"@webstudio-is/sdk\";\nimport { type StyleUpdates } from \"apps/designer/app/shared/canvas-components\";\nimport { setInstanceStyleMutable } from \"apps/designer/app/shared/tree-utils\";\nimport { useSelectedInstance } from \"./nano-states\";\nimport { rootInstanceContainer } from \"apps/designer/app/shared/nano-states\";\n\nexport const useUpdateStyle = () => {\n const [selectedInstance] = useSelectedInstance();\n useSubscribe<\"updateStyle\", StyleUpdates>(\n \"updateStyle\",\n ({ id, updates, breakpoint }) => {\n // Only update styles if they match the selected instance\n // It can potentially happen that we selected a difference instance right after we changed the style in style panel.\n if (id !== selectedInstance?.id) return;\n\n store.createTransaction([rootInstanceContainer], (rootInstance) => {\n if (rootInstance === undefined) {\n return;\n }\n setInstanceStyleMutable(rootInstance, id, updates, breakpoint);\n });\n }\n );\n};\n", "import { useCallback, useEffect, useRef } from \"react\";\nimport { type Instance, publish, useSubscribe } from \"@webstudio-is/sdk\";\nimport { useSelectedElement, useSelectedInstance } from \"./nano-states\";\nimport {\n useRootInstance,\n useTextEditingInstanceId,\n} from \"apps/designer/app/shared/nano-states\";\nimport { findInstanceById } from \"apps/designer/app/shared/tree-utils\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\n\nconst eventOptions = {\n passive: true,\n};\n\nexport const useTrackSelectedElement = () => {\n const [selectedElement, setSelectedElement] = useSelectedElement();\n const [selectedInstance, setSelectedInstance] = useSelectedInstance();\n const [editingInstanceId, setEditingInstanceId] = useTextEditingInstanceId();\n const editingInstanceIdRef = useRef(editingInstanceId);\n editingInstanceIdRef.current = editingInstanceId;\n const [rootInstance] = useRootInstance();\n const selectInstance = useCallback(\n (id) => {\n if (rootInstance === undefined) return;\n const instance = findInstanceById(rootInstance, id);\n setSelectedInstance(instance);\n },\n [setSelectedInstance, rootInstance]\n );\n\n useSubscribe<\"selectInstanceById\", Instance[\"id\"]>(\n \"selectInstanceById\",\n selectInstance\n );\n\n // Focus and select the element when selected instance changes\n useEffect(() => {\n if (\n selectedInstance !== undefined &&\n (selectedElement === undefined ||\n selectedInstance?.id !== selectedElement.id)\n ) {\n const element = document.getElementById(selectedInstance.id);\n if (element === null) return;\n element.focus();\n setSelectedElement(element);\n }\n }, [selectedInstance, selectedElement, setSelectedElement]);\n\n useEffect(() => {\n if (\n editingInstanceIdRef.current !== undefined &&\n selectedInstance?.id !== editingInstanceIdRef.current\n ) {\n setEditingInstanceId(undefined);\n }\n }, [selectedInstance, setEditingInstanceId]);\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n // Notify in general that document was clicked\n // e.g. to hide the side panel\n publish<\"clickCanvas\">({ type: \"clickCanvas\" });\n let element = event.target as HTMLElement;\n\n // If we click on an element that is not a component, we search for a parent component.\n if (element.dataset.component === undefined) {\n const instanceElement =\n element.closest<HTMLElement>(\"[data-component]\");\n if (instanceElement === null) {\n return;\n }\n element = instanceElement;\n }\n\n const { id, dataset } = element;\n\n // Enable clicking inside of content editable without trying to select the element as an instance.\n if (editingInstanceIdRef.current === id) {\n return;\n }\n\n // It's the second click in a double click.\n if (event.detail === 2) {\n const component = dataset.component as Instance[\"component\"];\n if (component === undefined || component in primitives === false) {\n return;\n }\n const { isInlineOnly, isContentEditable } = primitives[component];\n\n if (isContentEditable === false) {\n return;\n }\n\n // When user double clicks on an inline instance, we need to select the parent instance and put it indo text editing mode.\n // Inline instances are not directly, only through parent instance.\n if (isInlineOnly) {\n const parentId = element.parentElement?.id;\n if (parentId) {\n selectInstance(parentId);\n setEditingInstanceId(parentId);\n }\n } else setEditingInstanceId(id);\n return;\n }\n\n selectInstance(id);\n };\n\n window.addEventListener(\"click\", handleClick, eventOptions);\n\n return () => {\n window.removeEventListener(\"click\", handleClick);\n };\n }, [selectInstance, setEditingInstanceId]);\n};\n", "import { useCallback, MouseEvent, FormEvent, useMemo } from \"react\";\nimport type { OnChangeChildren } from \"apps/designer/app/shared/tree-utils\";\nimport {\n type Instance,\n type CSS,\n toCss,\n useUserProps,\n renderWrapperComponentChildren,\n} from \"@webstudio-is/sdk\";\nimport { primitives } from \"apps/designer/app/shared/canvas-components\";\nimport {\n useBreakpoints,\n useTextEditingInstanceId,\n} from \"apps/designer/app/shared/nano-states\";\nimport { useCss } from \"./use-css\";\nimport { useDraggable } from \"./use-draggable\";\nimport { useEnsureFocus } from \"./use-ensure-focus\";\nimport { EditorMemoized, useContentEditable } from \"./text-editor\";\nimport noop from \"lodash.noop\";\nimport { useSelectedElement } from \"apps/designer/app/canvas/shared/nano-states\";\n\ntype WrapperComponentDevProps = {\n instance: Instance;\n css: CSS;\n children: Array<JSX.Element | string>;\n onChangeChildren?: OnChangeChildren;\n};\n\nexport const WrapperComponentDev = ({\n instance,\n css,\n children,\n onChangeChildren = noop,\n ...rest\n}: WrapperComponentDevProps) => {\n const className = useCss({ instance, css });\n const [editingInstanceId] = useTextEditingInstanceId();\n const [, setSelectedElement] = useSelectedElement();\n const isEditing = editingInstanceId === instance.id;\n const [editableRefCallback, editableProps] = useContentEditable(isEditing);\n const { dragRefCallback, ...draggableProps } = useDraggable({\n instance,\n // We can't drag if we are editing text.\n isDisabled: isEditing === true,\n });\n const focusRefCallback = useEnsureFocus();\n\n const refCallback = useCallback(\n (element) => {\n if (isEditing) editableRefCallback(element);\n dragRefCallback(element);\n focusRefCallback(element);\n // When entering text editing we unmount the instance element, so we need to update the reference, otherwise we have a detached element referenced and bounding box will be wrong.\n if (element !== null) setSelectedElement(element);\n },\n [\n dragRefCallback,\n focusRefCallback,\n editableRefCallback,\n setSelectedElement,\n isEditing,\n ]\n );\n\n const userProps = useUserProps(instance.id);\n const readonlyProps =\n instance.component === \"Input\" ? { readOnly: true } : undefined;\n\n const { Component } = primitives[instance.component];\n\n const props = {\n ...userProps,\n ...rest,\n ...draggableProps,\n ...readonlyProps,\n ...editableProps,\n // @todo merge className with props\n className: className,\n // @todo stop using id to free it up to the user\n id: instance.id,\n tabIndex: 0,\n \"data-component\": instance.component,\n \"data-id\": instance.id,\n ref: refCallback,\n onClick: (event: MouseEvent) => {\n if (instance.component === \"Link\") {\n event.preventDefault();\n }\n },\n onSubmit: (event: FormEvent) => {\n // Prevent submitting the form when clicking a button type submit\n event.preventDefault();\n },\n };\n\n if (isEditing) {\n return (\n <EditorMemoized\n instance={instance}\n editable={<Component {...props} />}\n onChange={(updates) => {\n onChangeChildren({ instanceId: instance.id, updates });\n }}\n />\n );\n }\n\n return (\n <Component {...props}>{renderWrapperComponentChildren(children)}</Component>\n );\n};\n\n// Only used for instances inside text editor.\nexport const InlineWrapperComponentDev = ({\n instance,\n ...rest\n}: {\n instance: Instance;\n children: string;\n}) => {\n const [breakpoints] = useBreakpoints();\n const css = useMemo(\n () => toCss(instance.cssRules, breakpoints),\n [instance, breakpoints]\n );\n const className = useCss({ instance, css });\n const userProps = useUserProps(instance.id);\n const { Component } = primitives[instance.component];\n\n return (\n <Component\n {...rest}\n {...userProps}\n data-outline-disabled\n key={instance.id}\n // @todo stop using id to free it up to the user\n id={instance.id}\n // @todo merge className with props\n className={className}\n />\n );\n};\n", "import { useEffect, useMemo, useState } from \"react\";\nimport {\n type Instance,\n css as createCss,\n type CSS,\n useSubscribe,\n toValue,\n} from \"@webstudio-is/sdk\";\nimport { type StyleUpdates } from \"apps/designer/app/shared/canvas-components\";\n\ntype UseCssProps = {\n instance: Instance;\n css: CSS;\n};\n\ntype UpdatesReset = Array<{\n property: string;\n value: undefined;\n}>;\n\nconst usePreviewCss = ({ instance, css }: UseCssProps) => {\n const [previewCss, setPreviewCss] = useState<\n StyleUpdates[\"updates\"] | UpdatesReset\n >([]);\n\n useSubscribe<string, StyleUpdates>(\n `previewStyle:${instance.id}`,\n ({ updates }) => {\n setPreviewCss(updates);\n }\n );\n\n // We are building a map for unsetting the ephemeral values we previously set for the preview\n useEffect(() => {\n const reset = previewCss.map(({ property }) => ({\n property,\n value: undefined,\n }));\n setPreviewCss(reset);\n // previewCss in deps leads to an infinite loop, css is like a cache key in this case,\n // as soon as `css` changes we can reset the preview\n // @todo need a more correct approach than this\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [css]);\n\n return previewCss;\n};\n\nconst voidElements =\n \"area, base, br, col, embed, hr, img, input, link, meta, source, track, wbr\";\nconst rootElement = \"body > div\";\n\nconst defaultStyle = {\n \"&\": {\n // When double clicking into an element to edit text, it should not select the word.\n userSelect: \"none\",\n },\n [`&:not(${voidElements}):not(${rootElement}):empty`]: {\n outline: \"1px dashed #555\",\n outlineOffset: -1,\n paddingTop: 50,\n paddingRight: 50,\n },\n \"&[contenteditable], &:focus\": {\n outline: 0,\n },\n \"&[contenteditable]\": {\n boxShadow: \"0 0 0px 4px rgb(36 150 255 / 20%)\",\n },\n // Text Editor wraps each line into a p, so we need to make sure there is no jump between regular rendering and editing\n \"&[contenteditable] p\": {\n margin: 0,\n },\n};\n\nexport const useCss = ({ instance, css }: UseCssProps): string => {\n const previewCss = usePreviewCss({ instance, css });\n\n return useMemo(() => {\n const overrides: CSS = { ...defaultStyle };\n for (const update of previewCss) {\n if (update.value === undefined) continue;\n overrides[update.property as string] = toValue(update.value);\n }\n\n return createCss(css)({ css: overrides });\n }, [css, previewCss]);\n};\n", "import { useCallback, useEffect, useRef } from \"react\";\nimport { useDrag } from \"react-dnd\";\nimport { type Instance, publish } from \"@webstudio-is/sdk\";\nimport { type DragData } from \"apps/designer/app/shared/canvas-components\";\n//import { usePointerOutline } from \"~/canvas/hooks\";\n\ntype UseDraggable = {\n instance: Instance;\n isDisabled: boolean;\n};\n\nexport const useDraggable = ({ instance, isDisabled }: UseDraggable) => {\n const isDraggingRef = useRef(false);\n\n //const updatePointerOutline = usePointerOutline();\n const [{ isDragging, currentOffset }, dragRefCallback] = useDrag(\n () => ({\n type: instance.component,\n collect(monitor) {\n return {\n isDragging: monitor.isDragging(),\n currentOffset: monitor.getClientOffset(),\n };\n },\n canDrag() {\n return isDisabled === false;\n },\n }),\n [isDisabled]\n );\n\n useEffect(() => {\n // Started\n if (isDragging === true) {\n publish<\"dragStartInstance\">({ type: \"dragStartInstance\" });\n } else {\n // Initial state is false, don't fire event if there was no dragging\n //if (isDraggingRef.current === false) return;\n // Ended\n publish<\"dragEndInstance\", Instance[\"id\"]>({ type: \"dragEndInstance\" });\n }\n isDraggingRef.current = isDragging;\n }, [isDragging, instance.id]);\n\n useEffect(() => {\n if (currentOffset === null || isDragging === false) return;\n // updatePointerOutline(currentOffset);\n publish<\"dragInstance\", DragData>({\n type: \"dragInstance\",\n payload: {\n instance,\n currentOffset,\n },\n });\n }, [instance, currentOffset, isDragging]);\n\n const handleMouseDown = useCallback(\n (event) => {\n // We need to disable d&d on parent components\n // to enable text selection when content editable is enabled.\n if (isDisabled) {\n event.stopPropagation();\n }\n },\n [isDisabled]\n );\n\n return { dragRefCallback, onMouseDownCapture: handleMouseDown };\n};\n", "import { useCallback } from \"react\";\nimport { useSelectedInstance } from \"apps/designer/app/canvas/shared/nano-states\";\n\n/**\n * When instance is created or selected via setInstance, we need to focus it.\n */\nexport const useEnsureFocus = () => {\n const [selectedInstance] = useSelectedInstance();\n return useCallback(\n (element: HTMLElement | null) => {\n if (\n element !== null &&\n element.id === selectedInstance?.id &&\n document.activeElement !== element\n ) {\n element.focus();\n }\n },\n [selectedInstance]\n );\n};\n", "export type {\n EditorConfig,\n EditorState,\n LexicalCommand,\n LexicalEditor,\n LexicalNode,\n RangeSelection,\n SerializedEditorState,\n SerializedLexicalNode,\n SerializedElementNode,\n SerializedTextNode,\n SerializedRootNode,\n ParagraphNode,\n} from \"lexical\";\nexport {\n ElementNode,\n TextNode,\n RootNode,\n createCommand,\n $isRangeSelection,\n $getSelection,\n $getRoot,\n $getNodeByKey,\n $createTextNode,\n $createParagraphNode,\n COMMAND_PRIORITY_EDITOR,\n SELECTION_CHANGE_COMMAND,\n COMMAND_PRIORITY_LOW,\n} from \"lexical\";\nexport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nexport { LexicalComposer } from \"@lexical/react/LexicalComposer\";\nexport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\nexport { ContentEditable } from \"@lexical/react/LexicalContentEditable\";\nexport { HistoryPlugin } from \"@lexical/react/LexicalHistoryPlugin\";\nexport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\nexport { TreeView } from \"@lexical/react/LexicalTreeView\";\n", "import { render } from \"react-dom\";\nimport { type Instance } from \"@webstudio-is/sdk\";\nimport {\n type EditorConfig,\n type SerializedTextNode,\n TextNode,\n} from \"../lexical\";\nimport { InlineWrapperComponentDev } from \"../../wrapper-component\";\n\ntype Options = {\n instance: Instance;\n text: string;\n isNew: boolean;\n};\n\nexport type SerializedInstanceNode = SerializedTextNode & Options;\n\nexport class InstanceNode extends TextNode {\n options: Options;\n\n static getType(): \"instance\" {\n return \"instance\";\n }\n\n static clone(node: InstanceNode) {\n return new InstanceNode(node.options);\n }\n\n constructor(options: Options) {\n // This makes sure caret is at the end of the selection after inserting this node instance\n super(options.text);\n this.options = options;\n }\n\n exportJSON(): SerializedInstanceNode {\n const json = super.exportJSON();\n return {\n ...json,\n ...this.options,\n type: InstanceNode.getType(),\n };\n }\n\n createDOM(config: EditorConfig) {\n const container = super.createDOM(config);\n const element = (\n <InlineWrapperComponentDev instance={this.options.instance}>\n {this.options.text}\n </InlineWrapperComponentDev>\n );\n render(element, container);\n return container;\n }\n\n updateDOM(prevNode: TextNode, dom: HTMLElement, config: EditorConfig) {\n const inner = dom.firstChild as HTMLElement;\n if (inner === null) {\n return true;\n }\n super.updateDOM(prevNode, inner, config);\n\n return false;\n }\n\n isInline(): true {\n return true;\n }\n\n canInsertTextBefore(): false {\n return false;\n }\n\n canInsertTextAfter(): false {\n return false;\n }\n}\n\nexport const $createInstanceNode = (options: Options) => {\n return new InstanceNode(options);\n};\n", "import { InstanceNode } from \"./nodes/node-instance\";\n\nexport const config = {\n namespace: \"ComponentTextEditor\",\n onError(error: Error) {\n throw error;\n },\n nodes: [InstanceNode],\n};\n", "import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { useCallback, useEffect } from \"react\";\n\ntype RefCallback = (rootElement: null | HTMLElement) => void;\n\nconst props = {\n //autoCapitalize: false,\n //autoComplete: false,\n contentEditable: true,\n};\n\nexport const useContentEditable = (\n isEditing: boolean\n): [RefCallback, typeof props | undefined] => {\n const [editor] = useLexicalComposerContext();\n\n const ref: RefCallback = useCallback(\n (rootElement) => {\n editor.setRootElement(rootElement);\n },\n [editor]\n );\n\n useEffect(() => {\n if (isEditing === true) return;\n // Lets unset the root element when we are not editing\n editor.setRootElement(null);\n }, [editor, isEditing]);\n\n return [ref, isEditing ? props : undefined];\n};\n", "import { useEffect } from \"react\";\nimport { useSubscribe, type Instance } from \"@webstudio-is/sdk\";\nimport { $createInstanceNode, InstanceNode } from \"../nodes/node-instance\";\nimport {\n createCommand,\n $isRangeSelection,\n $getSelection,\n $getRoot,\n COMMAND_PRIORITY_EDITOR,\n useLexicalComposerContext,\n type LexicalCommand,\n} from \"../lexical\";\nimport { toLexicalNodes } from \"../utils/to-lexical-nodes\";\n\nconst populateRoot = (children: Instance[\"children\"]) => {\n const nodes = toLexicalNodes(children);\n const root = $getRoot();\n root.clear();\n for (const node of nodes) {\n root.append(node);\n }\n root.selectStart();\n};\n\nconst INSERT_INSTANCE_COMMAND: LexicalCommand<Instance> = createCommand();\n\ntype InstancePluginProps = {\n children: Instance[\"children\"];\n};\n\nexport const InstancePlugin = ({ children }: InstancePluginProps) => {\n const [editor] = useLexicalComposerContext();\n useEffect(() => {\n if (editor.hasNodes([InstanceNode]) === false) {\n throw new Error(\"InstancePlugin: InstanceNode not registered on editor\");\n }\n\n return editor.registerCommand<Instance>(\n INSERT_INSTANCE_COMMAND,\n (instance) => {\n const selection = $getSelection();\n const text = selection?.getTextContent();\n if ($isRangeSelection(selection) && text) {\n const instanceNode = $createInstanceNode({\n instance,\n text,\n isNew: true,\n });\n selection.insertNodes([instanceNode]);\n // Dirty hack. When clicking on toolbar outside of the iframe, we are loosing focus.\n // For some reason we can only refocus after a delay\n requestAnimationFrame(() => {\n editor.update(() => {\n instanceNode.select();\n });\n });\n }\n return true;\n },\n COMMAND_PRIORITY_EDITOR\n );\n }, [editor]);\n\n useEffect(() => {\n editor.update(() => {\n populateRoot(children);\n });\n }, [editor, children]);\n\n useSubscribe<\"insertInlineInstance\", Instance>(\n \"insertInlineInstance\",\n (payload) => {\n editor.dispatchCommand<Instance>(INSERT_INSTANCE_COMMAND, payload);\n }\n );\n\n return null;\n};\n", "import { type Instance } from \"@webstudio-is/sdk\";\nimport { $createInstanceNode } from \"../nodes/node-instance\";\nimport {\n $createTextNode,\n $createParagraphNode,\n type ParagraphNode,\n} from \"../lexical\";\n\nexport const toLexicalNodes = (children: Instance[\"children\"]) => {\n const nodes: Array<ParagraphNode> = [];\n\n let p = $createParagraphNode();\n nodes.push(p);\n\n for (const child of children) {\n if (child === \"\\n\") {\n p = $createParagraphNode();\n nodes.push(p);\n continue;\n }\n\n if (typeof child === \"string\") {\n const textNode = $createTextNode(child);\n p.append(textNode);\n continue;\n }\n\n // Inline components should always have a single child string\n const text = typeof child.children[0] === \"string\" ? child.children[0] : \"\";\n const paragraph = nodes[nodes.length - 1];\n const instanceNode = $createInstanceNode({\n instance: child,\n text,\n isNew: false,\n });\n paragraph.append(instanceNode);\n }\n\n return nodes;\n};\n", "import { useCallback, useEffect, useRef } from \"react\";\nimport { publish } from \"@webstudio-is/sdk\";\n\nimport {\n $isRangeSelection,\n $getSelection,\n SELECTION_CHANGE_COMMAND,\n COMMAND_PRIORITY_LOW,\n useLexicalComposerContext,\n} from \"../lexical\";\n\nexport const ToolbarConnectorPlugin = () => {\n const [editor] = useLexicalComposerContext();\n const lastSelectionRef = useRef<unknown>();\n\n const clearSelectionRect = () => {\n if (lastSelectionRef.current) {\n // Undefined Rect will hide toolbar\n publish<\"selectionRect\">({ type: \"selectionRect\", payload: undefined });\n lastSelectionRef.current = undefined;\n }\n };\n\n const publishSelectionRect = useCallback(() => {\n const selection = $getSelection();\n const text = selection?.getTextContent();\n const nativeSelection = window.getSelection();\n const isTextSelected =\n $isRangeSelection(selection) && Boolean(text) && nativeSelection !== null;\n\n if (isTextSelected) {\n const domRange = nativeSelection.getRangeAt(0);\n const rect = domRange.getBoundingClientRect();\n publish<\"selectionRect\", DOMRect>({\n type: \"selectionRect\",\n payload: rect,\n });\n lastSelectionRef.current = selection;\n return true;\n }\n\n clearSelectionRect();\n\n return true;\n }, []);\n\n useEffect(() => {\n editor.registerCommand(\n SELECTION_CHANGE_COMMAND,\n publishSelectionRect,\n COMMAND_PRIORITY_LOW\n );\n }, [editor, publishSelectionRect]);\n\n useEffect(() => clearSelectionRect, []);\n\n return null;\n};\n", "import { type ChildrenUpdates } from \"@webstudio-is/sdk\";\nimport { useState } from \"react\";\nimport { useDebounce } from \"react-use\";\nimport {\n OnChangePlugin as LexicalOnChangePlugin,\n type EditorState,\n} from \"../lexical\";\nimport { toUpdates } from \"../utils/to-updates\";\n\nexport const OnChangePlugin = ({\n onChange,\n}: {\n onChange: (updates: ChildrenUpdates) => void;\n}) => {\n const [editorState, setEditorState] = useState<EditorState>();\n\n useDebounce(\n () => {\n if (editorState === undefined) return;\n editorState.read(() => {\n const updates = toUpdates(editorState.toJSON().root);\n onChange(updates);\n });\n },\n 500,\n [editorState]\n );\n\n return <LexicalOnChangePlugin onChange={setEditorState} />;\n};\n", "import { type ChildrenUpdates } from \"@webstudio-is/sdk\";\nimport {\n type SerializedTextNode,\n type SerializedElementNode,\n type SerializedRootNode,\n type SerializedLexicalNode,\n} from \"../lexical\";\nimport { type SerializedInstanceNode } from \"../nodes/node-instance\";\n\ntype Node =\n | SerializedRootNode\n | SerializedElementNode\n | SerializedTextNode\n | SerializedLexicalNode\n | SerializedInstanceNode;\n\nexport const toUpdates = (\n node: Node,\n updates: ChildrenUpdates = []\n): ChildrenUpdates => {\n if (node.type === \"text\" && \"text\" in node) {\n updates.push(node.text);\n }\n\n if (node.type === \"instance\" && \"instance\" in node) {\n if (\"isNew\" in node && node.isNew === true) {\n updates.push({\n id: node.instance.id,\n text: node.text,\n component: node.instance.component,\n createInstance: true,\n });\n } else {\n updates.push({\n id: node.instance.id,\n text: node.text,\n });\n }\n }\n\n if (\"children\" in node) {\n for (const child of node.children) {\n if (child.type === \"paragraph\" && updates.length !== 0) {\n updates.push(\"\\n\");\n }\n\n toUpdates(child, updates);\n }\n }\n\n return updates;\n};\n", "import { type ChildrenUpdates, type Instance } from \"@webstudio-is/sdk\";\nimport { RichTextPlugin, HistoryPlugin } from \"./lexical\";\nimport { InstancePlugin } from \"./plugins/plugin-instance\";\nimport { ToolbarConnectorPlugin } from \"./plugins/plugin-toolbar-connector\";\nimport { OnChangePlugin } from \"./plugins/plugin-on-change\";\nimport { memo } from \"react\";\n\ntype EditorProps = {\n children?: JSX.Element;\n editable: JSX.Element;\n instance: Instance;\n onChange: (updates: ChildrenUpdates) => void;\n};\n\nexport const Editor = ({\n instance,\n editable,\n children,\n onChange,\n}: EditorProps) => {\n return (\n <>\n <RichTextPlugin contentEditable={editable} placeholder=\"\" />\n <OnChangePlugin onChange={onChange} />\n <HistoryPlugin />\n <InstancePlugin>{instance.children}</InstancePlugin>\n <ToolbarConnectorPlugin />\n {children}\n </>\n );\n};\n\n// Prevent rerender because in editing mode Editor controls the node.\nexport const EditorMemoized = memo(Editor, () => true);\n", "import useInterval from \"react-use/lib/useInterval\";\nimport { sync } from \"immerhin\";\nimport { enqueue } from \"./queue\";\nimport type { Project } from \"apps/designer/app/shared/db/project.server\";\n\nexport const useSync = ({ project }: { project: Project }) => {\n useInterval(() => {\n const entries = sync();\n if (entries.length === 0) return;\n\n // @todo this entire queueing logic needs to be gone, it's a workaround,\n // because prisma can't do atomic updates yet with embeded documents\n // and backend fetches and updates big objects, so if we send quickly,\n // we end up overwriting things\n enqueue(() =>\n fetch(`/rest/patch`, {\n method: \"post\",\n body: JSON.stringify({\n transactions: entries,\n treeId: project.devTreeId,\n projectId: project.id,\n }),\n })\n );\n }, 1000);\n};\n", "import { type SyncStatus } from \"apps/designer/app/shared/sync\";\nimport { publish } from \"@webstudio-is/sdk\";\n\n// @todo because of limitation with nested models and saving tree as a Json type\n// we load that entire Json to manipulate and if a second request happens before the first one has written\n// the result into the db, the second request will have outdated tree and will then write the outdated tree back\n// to the database\n// For now we will just have to queue the changes for all tree mutations.\n\ntype Job = () => Promise<unknown>;\n\nconst queue: Array<Job> = [];\n\nexport const enqueue = (job: Job) => {\n queue.push(job);\n if (isInProgress === false) dequeue();\n};\n\nlet isInProgress = false;\n\nconst dequeue = () => {\n const job = queue.shift();\n if (job) {\n isInProgress = true;\n publish<\"syncStatus\", SyncStatus>({\n type: \"syncStatus\",\n payload: \"syncing\",\n });\n job().finally(() => {\n isInProgress = false;\n publish<\"syncStatus\", SyncStatus>({\n type: \"syncStatus\",\n payload: \"idle\",\n });\n dequeue();\n });\n }\n};\n", "import {\n type UserPropsUpdates,\n useSubscribe,\n allUserPropsContainer,\n DeleteProp,\n} from \"@webstudio-is/sdk\";\nimport store from \"immerhin\";\nimport {\n updateAllUserPropsMutable,\n deletePropMutable,\n} from \"apps/designer/app/shared/props-utils\";\n\nexport const useManageProps = () => {\n useSubscribe<\"updateProps\", UserPropsUpdates>(\n \"updateProps\",\n (userPropsUpdates) => {\n store.createTransaction([allUserPropsContainer], (allUserProps) => {\n updateAllUserPropsMutable(allUserProps, userPropsUpdates);\n });\n }\n );\n\n useSubscribe<\"deleteProp\", DeleteProp>(\"deleteProp\", (deleteProp) => {\n store.createTransaction([allUserPropsContainer], (allUserProps) => {\n deletePropMutable(allUserProps, deleteProp);\n });\n });\n};\n", "import { useEffect } from \"react\";\nimport store from \"immerhin\";\nimport {\n type Breakpoint,\n useSubscribe,\n setBreakpoints,\n publish,\n} from \"@webstudio-is/sdk\";\nimport { deleteCssRulesByBreakpoint } from \"apps/designer/app/shared/css-utils\";\nimport {\n breakpointsContainer,\n rootInstanceContainer,\n useBreakpoints,\n} from \"apps/designer/app/shared/nano-states\";\n\nexport const useInitializeBreakpoints = (breakpoints: Array<Breakpoint>) => {\n const [, setCurrentBreakpoints] = useBreakpoints();\n useEffect(() => {\n setBreakpoints(breakpoints);\n setCurrentBreakpoints(breakpoints);\n }, [breakpoints, setCurrentBreakpoints]);\n};\n\nconst usePublishBreakpoints = () => {\n const [breakpoints] = useBreakpoints();\n useEffect(() => {\n publish<\"loadBreakpoints\", Array<Breakpoint>>({\n type: \"loadBreakpoints\",\n payload: breakpoints,\n });\n }, [breakpoints]);\n};\n\nconst useBreakpointChange = () => {\n useSubscribe<\"breakpointChange\", Breakpoint>(\n \"breakpointChange\",\n (breakpoint) => {\n store.createTransaction([breakpointsContainer], (breakpoints) => {\n const foundBreakpoint = breakpoints.find(\n ({ id }) => id == breakpoint.id\n );\n if (foundBreakpoint) {\n foundBreakpoint.label = breakpoint.label;\n foundBreakpoint.minWidth = breakpoint.minWidth;\n } else {\n // Its a new breakpoint\n breakpoints.push(breakpoint);\n }\n\n setBreakpoints(breakpoints);\n });\n }\n );\n};\n\nconst useBreakpointDelete = () => {\n useSubscribe<\"breakpointDelete\", Breakpoint>(\n \"breakpointDelete\",\n (breakpoint) => {\n store.createTransaction(\n [breakpointsContainer, rootInstanceContainer],\n (breakpoints, rootInstance) => {\n if (rootInstance === undefined) return;\n\n const index = breakpoints.findIndex(({ id }) => id == breakpoint.id);\n if (index !== -1) {\n breakpoints.splice(index, 1);\n }\n\n deleteCssRulesByBreakpoint(rootInstance, breakpoint.id);\n }\n );\n }\n );\n};\n\nexport const useHandleBreakpoints = () => {\n usePublishBreakpoints();\n useBreakpointChange();\n useBreakpointDelete();\n};\n", "import { type Instance, type Breakpoint } from \"@webstudio-is/sdk\";\n\nexport const deleteCssRulesByBreakpoint = (\n instance: Instance,\n breakpointId: Breakpoint[\"id\"]\n) => {\n const cssRules = [...instance.cssRules];\n cssRules.forEach((cssRule, index) => {\n if (cssRule.breakpoint === breakpointId) {\n instance.cssRules.splice(index, 1);\n }\n });\n\n for (const child of instance.children) {\n if (typeof child === \"string\") continue;\n deleteCssRulesByBreakpoint(child, breakpointId);\n }\n};\n", "import { allUserPropsContainer } from \"@webstudio-is/sdk\";\nimport store from \"immerhin\";\nimport {\n rootInstanceContainer,\n breakpointsContainer,\n} from \"apps/designer/app/shared/nano-states\";\n\nexport const registerContainers = () => {\n store.register(\"breakpoints\", breakpointsContainer);\n store.register(\"root\", rootInstanceContainer);\n store.register(\"props\", allUserPropsContainer);\n};\n", "import { useEffect } from \"react\";\nimport { useSelectedElement, useHoveredElement } from \"./nano-states\";\nimport { useRootInstance } from \"apps/designer/app/shared/nano-states\";\n\nconst eventOptions = {\n passive: true,\n};\n\nexport const useTrackHoveredElement = () => {\n const [rootInstance] = useRootInstance();\n const [, setHoveredElement] = useHoveredElement();\n const [selectedElement] = useSelectedElement();\n\n useEffect(() => {\n const handleMouseOver = (event: MouseEvent) => {\n const element = event.target;\n if (\n rootInstance === undefined ||\n !(element instanceof HTMLElement) ||\n element.dataset.outlineDisabled\n ) {\n return;\n }\n setHoveredElement(element);\n };\n\n const handleMouseOut = () => {\n if (rootInstance === undefined) return;\n setHoveredElement(undefined);\n };\n\n window.addEventListener(\"mouseover\", handleMouseOver, eventOptions);\n window.addEventListener(\"mouseout\", handleMouseOut, eventOptions);\n\n return () => {\n window.removeEventListener(\"mouseover\", handleMouseOver);\n window.removeEventListener(\"mouseout\", handleMouseOut);\n };\n }, [rootInstance, selectedElement, setHoveredElement]);\n};\n", "import { publish } from \"@webstudio-is/sdk\";\nimport { useScrollState } from \"apps/designer/app/shared/dom-hooks\";\n\nexport const usePublishScrollState = () => {\n useScrollState({\n onScrollStart() {\n publish<\"scrollState\", boolean>({ type: \"scrollState\", payload: true });\n },\n onScrollEnd() {\n publish<\"scrollState\", boolean>({\n type: \"scrollState\",\n payload: false,\n });\n },\n });\n};\n", "import { ActionFunction } from \"@remix-run/node\";\nimport config from \"apps/designer/app/config\";\nimport { authenticator } from \"apps/designer/app/services/auth.server\";\n\nexport default function Logout() {\n return null;\n}\n\nexport const loader: ActionFunction = async ({ request }) => {\n await authenticator.logout(request, { redirectTo: config.loginPath });\n};\n", "import { redirect, type LoaderFunction } from \"@remix-run/node\";\nimport { useLoaderData } from \"@remix-run/react\";\nimport { Root, type Data } from \"@webstudio-is/sdk\";\nimport config from \"apps/designer/app/config\";\nimport * as db from \"apps/designer/app/shared/db\";\nimport Document from \"./canvas\";\nimport env, { Env } from \"apps/designer/app/env.server\";\n\n// @todo all this subdomain logic is very hacky\n\ntype Error = { errors: string };\ntype LoaderReturnProps = Promise<\n (Data & { env: Env }) | (Error & { env: Env }) | Response\n>;\n\nexport const loader: LoaderFunction = async ({\n request,\n}): LoaderReturnProps => {\n const host =\n request.headers.get(\"x-forwarded-host\") ||\n request.headers.get(\"host\") ||\n \"\";\n\n const [userDomain, wstdDomain] = host.split(\".\");\n // We render the site from a subdomain\n if (\n typeof userDomain === \"string\" &&\n (wstdDomain === \"wstd\" || wstdDomain?.includes(\"localhost\"))\n ) {\n try {\n const project = await db.project.loadByDomain(userDomain);\n if (project === null) {\n throw new Error(`Unknown domain \"${userDomain}\"`);\n }\n if (project.prodTreeId === null) {\n throw new Error(`Site is not published`);\n }\n const [tree, props, breakpoints] = await Promise.all([\n db.tree.loadByProject(project, \"production\"),\n db.props.loadByTreeId(project.prodTreeId),\n db.breakpoints.load(project.prodTreeId),\n ]);\n if (tree === null) {\n throw new Error(`Tree ${project.prodTreeId} not found`);\n }\n if (breakpoints === null) {\n throw new Error(`Breakpoints for tree ${project.prodTreeId} not found`);\n }\n return { tree, props, breakpoints: breakpoints.values, env };\n } catch (error) {\n if (error instanceof Error) {\n return { errors: error.message, env };\n }\n }\n }\n\n return redirect(config.dashboardPath);\n};\n\nconst Index = () => {\n const data = useLoaderData<Data | Error>();\n if (\"errors\" in data) {\n return <p>{data.errors}</p>;\n }\n\n // We render the site from a subdomain\n if (data.tree && data.props) {\n const Outlet = () => <Root data={data} />;\n\n // @todo This is non-standard for Remix, is there a better way?\n // We need to render essentially the preview route but from the index,\n // so we have to know the layout and the outlet from here.\n // Maybe there is a way to tell remix to use the right outlet somehow and avoid passing it?\n return <Document Outlet={Outlet} />;\n }\n\n return null;\n};\n\nexport default Index;\n", "import { LoaderFunction, type MetaFunction } from \"@remix-run/node\";\nimport { Canvas } from \"apps/designer/app/shared/documents/canvas\";\nimport env from \"apps/designer/app/env.server\";\n\nexport const loader: LoaderFunction = () => ({\n env,\n});\n\nexport const meta: MetaFunction = () => {\n return { title: \"Webstudio canvas\" };\n};\n\nexport default Canvas;\n", "import { LoaderFunction, MetaFunction } from \"@remix-run/node\";\nimport { Designer } from \"apps/designer/app/shared/documents/designer\";\nimport env from \"apps/designer/app/env.server\";\n\nexport const loader: LoaderFunction = () => ({\n env,\n});\n\nexport const meta: MetaFunction = () => {\n return { title: \"Webstudio Login\" };\n};\n\nexport default Designer;\n", "import { LoaderFunction, redirect } from \"@remix-run/node\";\n\nimport { authenticator } from \"apps/designer/app/services/auth.server\";\nimport config from \"apps/designer/app/config\";\nimport env from \"apps/designer/app/env.server\";\n\nimport { Login, links } from \"apps/designer/app/auth\";\nimport { useLoginErrorMessage } from \"apps/designer/app/shared/session\";\n\nexport { links };\n\nexport const loader: LoaderFunction = async ({ request }) => {\n const user = await authenticator.isAuthenticated(request);\n if (user) {\n return redirect(config.dashboardPath);\n }\n return {\n isDevLogin: process.env.DEV_LOGIN === \"true\",\n env,\n isGithubEnabled: Boolean(\n process.env.GH_CLIENT_ID && process.env.GH_CLIENT_SECRET\n ),\n isGoogleEnabled: Boolean(\n process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET\n ),\n };\n};\n\nconst LoginRoute = () => {\n const errorMessage = useLoginErrorMessage();\n return <Login errorMessage={errorMessage} />;\n};\n\nexport default LoginRoute;\n", "import { LinksFunction, MetaFunction } from \"@remix-run/node\";\nimport { Form, useLoaderData } from \"@remix-run/react\";\nimport { useState } from \"react\";\n\nimport {\n Card,\n Flex,\n Heading,\n Text,\n TextField,\n} from \"apps/designer/app/shared/design-system\";\nimport interStyles from \"~/shared/font-faces/inter.css\";\n\nimport {\n GithubIcon,\n CommitIcon,\n GoogleIcon,\n} from \"apps/designer/app/shared/icons\";\nimport { LoginButton } from \"./components/login-button\";\nimport loginStyles from \"./login.css\";\n\nexport const links: LinksFunction = () => {\n return [\n {\n rel: \"stylesheet\",\n href: interStyles,\n },\n {\n rel: \"stylesheet\",\n href: loginStyles,\n },\n ];\n};\n\nexport const meta: MetaFunction = () => {\n return { title: \"Webstudio Login\" };\n};\n\nexport const Login = ({ errorMessage }: { errorMessage: string }) => {\n const [isDevLoginOpen, openDevLogin] = useState(false);\n const data = useLoaderData();\n\n return (\n <Flex\n css={{ height: \"100vh\" }}\n direction=\"column\"\n align=\"center\"\n justify=\"center\"\n >\n <Card size={2}>\n <Flex direction=\"column\" gap=\"4\" align=\"center\">\n <Heading size=\"2\">Login</Heading>\n {errorMessage.length ? (\n <Text css={{ textAlign: \"center\" }} variant=\"red\">\n {errorMessage}\n </Text>\n ) : null}\n <Flex gap=\"2\" direction=\"column\" align=\"center\">\n <Form action=\"/auth/github\" method=\"post\">\n <LoginButton enabled={data.isGithubEnabled}>\n <Flex gap=\"1\">\n <GithubIcon width=\"20\" />\n Login with GitHub\n </Flex>\n </LoginButton>\n </Form>\n <Form action=\"/auth/google\" method=\"post\">\n <LoginButton enabled={data.isGoogleEnabled}>\n <Flex gap=\"1\">\n <GoogleIcon width=\"20\" />\n Login with Google\n </Flex>\n </LoginButton>\n </Form>\n {data.isDevLogin && (\n <>\n {isDevLoginOpen ? (\n <Form action=\"/auth/dev\" method=\"post\">\n <TextField\n size={2}\n css={{ width: \"100%\", flexGrow: 1 }}\n name=\"secret\"\n type=\"text\"\n minLength={2}\n required\n autoFocus\n placeholder=\"Place your auth secret here\"\n />\n </Form>\n ) : (\n <LoginButton\n enabled={data.isDevLogin}\n isDevLogin\n onClick={() => openDevLogin(true)}\n >\n <Flex gap=\"1\" align=\"center\">\n <CommitIcon width=\"20\" />\n Dev Login\n </Flex>\n </LoginButton>\n )}\n </>\n )}\n </Flex>\n </Flex>\n </Card>\n </Flex>\n );\n};\n", "import React from \"react\";\nimport { Button, Tooltip } from \"apps/designer/app/shared/design-system\";\nimport env from \"apps/designer/app/shared/env\";\n\nconst isPreviewEnvironment = env.VERCEL_ENV === \"preview\";\n\nexport const LoginButton = ({\n children,\n isDevLogin = false,\n enabled,\n ...props\n}: {\n children: React.ReactChild;\n isDevLogin?: boolean;\n onClick?: () => void;\n enabled: boolean;\n}) => {\n const isSocialLoginInPreviewEnvironment =\n isPreviewEnvironment && isDevLogin === false;\n const showTooltip = isSocialLoginInPreviewEnvironment || enabled === false;\n if (showTooltip) {\n const content = isSocialLoginInPreviewEnvironment\n ? \"Social login does not work in preview deployments\"\n : \"This login is not configured\";\n\n return (\n <Tooltip content={content} delayDuration={0}>\n <span tabIndex={0} style={{ width: \"100%\", display: \"block\" }}>\n <Button\n {...props}\n css={{ width: \"100%\" }}\n size={3}\n type=\"submit\"\n disabled\n >\n {children}\n </Button>\n </span>\n </Tooltip>\n );\n }\n return (\n <Button {...props} css={{ width: \"100%\" }} size={3} type=\"submit\">\n {children}\n </Button>\n );\n};\n", "export default {'version':'6412d0f3','entry':{'module':'/build/entry.client-BADAYHVI.js','imports':['/build/_shared/chunk-B36H54Q2.js','/build/_shared/chunk-MADQQ4W2.js','/build/_shared/chunk-QD7BDOJK.js','/build/_shared/chunk-QPKOW66L.js','/build/_shared/chunk-SRJHFGUQ.js','/build/_shared/chunk-R6VSS7HB.js']},'routes':{'root':{'id':'root','parentId':undefined,'path':'','index':undefined,'caseSensitive':undefined,'module':'/build/root-HIH74YUZ.js','imports':undefined,'hasAction':false,'hasLoader':false,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/auth/dev':{'id':'routes/auth/dev','parentId':'root','path':'auth/dev','index':undefined,'caseSensitive':undefined,'module':'/build/routes/auth/dev-OY6U6ZZL.js','imports':['/build/_shared/chunk-WWM4X7G7.js','/build/_shared/chunk-TDLYKOPO.js'],'hasAction':true,'hasLoader':false,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/auth/github':{'id':'routes/auth/github','parentId':'root','path':'auth/github','index':undefined,'caseSensitive':undefined,'module':'/build/routes/auth/github-VQ7AN4UG.js','imports':['/build/_shared/chunk-WWM4X7G7.js','/build/_shared/chunk-TDLYKOPO.js'],'hasAction':true,'hasLoader':false,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/auth/github/callback':{'id':'routes/auth/github/callback','parentId':'routes/auth/github','path':'callback','index':undefined,'caseSensitive':undefined,'module':'/build/routes/auth/github/callback-TALPZT4U.js','imports':undefined,'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/auth/google':{'id':'routes/auth/google','parentId':'root','path':'auth/google','index':undefined,'caseSensitive':undefined,'module':'/build/routes/auth/google-IPCRXR2G.js','imports':['/build/_shared/chunk-WWM4X7G7.js','/build/_shared/chunk-TDLYKOPO.js'],'hasAction':true,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/auth/google/callback':{'id':'routes/auth/google/callback','parentId':'routes/auth/google','path':'callback','index':undefined,'caseSensitive':undefined,'module':'/build/routes/auth/google/callback-SJVT2W6T.js','imports':undefined,'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/canvas':{'id':'routes/canvas','parentId':'root','path':'canvas','index':undefined,'caseSensitive':undefined,'module':'/build/routes/canvas-BNYCH64M.js','imports':['/build/_shared/chunk-CHKIVGVF.js','/build/_shared/chunk-VDMDGISW.js','/build/_shared/chunk-6KWPSJTY.js','/build/_shared/chunk-D4F75PJ7.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/canvas/$projectId':{'id':'routes/canvas/$projectId','parentId':'routes/canvas','path':':projectId','index':undefined,'caseSensitive':undefined,'module':'/build/routes/canvas/$projectId-EN7MP3RM.js','imports':['/build/_shared/chunk-6YZOMFAW.js','/build/_shared/chunk-LZQQRXUE.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/dashboard':{'id':'routes/dashboard','parentId':'root','path':'dashboard','index':undefined,'caseSensitive':undefined,'module':'/build/routes/dashboard-GORLGHTU.js','imports':['/build/_shared/chunk-GJEHYJKD.js','/build/_shared/chunk-6KWPSJTY.js','/build/_shared/chunk-D4F75PJ7.js','/build/_shared/chunk-KEIN4CGZ.js','/build/_shared/chunk-LZQQRXUE.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/dashboard/index':{'id':'routes/dashboard/index','parentId':'routes/dashboard','path':undefined,'index':true,'caseSensitive':undefined,'module':'/build/routes/dashboard/index-47ACBDYH.js','imports':['/build/_shared/chunk-7YTDWDGG.js','/build/_shared/chunk-WWM4X7G7.js','/build/_shared/chunk-TDLYKOPO.js'],'hasAction':true,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/designer':{'id':'routes/designer','parentId':'root','path':'designer','index':undefined,'caseSensitive':undefined,'module':'/build/routes/designer-7PTVKO44.js','imports':['/build/_shared/chunk-GJEHYJKD.js','/build/_shared/chunk-6KWPSJTY.js','/build/_shared/chunk-D4F75PJ7.js','/build/_shared/chunk-KEIN4CGZ.js','/build/_shared/chunk-LZQQRXUE.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/designer/$id':{'id':'routes/designer/$id','parentId':'routes/designer','path':':id','index':undefined,'caseSensitive':undefined,'module':'/build/routes/designer/$id-ALVFN3YN.js','imports':['/build/_shared/chunk-6YZOMFAW.js','/build/_shared/chunk-7YTDWDGG.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/index':{'id':'routes/index','parentId':'root','path':undefined,'index':true,'caseSensitive':undefined,'module':'/build/routes/index-O6SAICID.js','imports':['/build/_shared/chunk-CHKIVGVF.js','/build/_shared/chunk-VDMDGISW.js','/build/_shared/chunk-6KWPSJTY.js','/build/_shared/chunk-D4F75PJ7.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/login':{'id':'routes/login','parentId':'root','path':'login','index':undefined,'caseSensitive':undefined,'module':'/build/routes/login-BRUOWCYK.js','imports':['/build/_shared/chunk-GJEHYJKD.js','/build/_shared/chunk-6KWPSJTY.js','/build/_shared/chunk-D4F75PJ7.js','/build/_shared/chunk-KEIN4CGZ.js','/build/_shared/chunk-LZQQRXUE.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/login/index':{'id':'routes/login/index','parentId':'routes/login','path':undefined,'index':true,'caseSensitive':undefined,'module':'/build/routes/login/index-Y3BTJFU4.js','imports':['/build/_shared/chunk-7YTDWDGG.js','/build/_shared/chunk-WWM4X7G7.js','/build/_shared/chunk-TDLYKOPO.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/logout':{'id':'routes/logout','parentId':'root','path':'logout','index':undefined,'caseSensitive':undefined,'module':'/build/routes/logout-O5E6MPSO.js','imports':['/build/_shared/chunk-TDLYKOPO.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/preview':{'id':'routes/preview','parentId':'root','path':'preview','index':undefined,'caseSensitive':undefined,'module':'/build/routes/preview-DNRQO7NW.js','imports':['/build/_shared/chunk-VDMDGISW.js','/build/_shared/chunk-6KWPSJTY.js','/build/_shared/chunk-D4F75PJ7.js'],'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/preview/$projectId':{'id':'routes/preview/$projectId','parentId':'routes/preview','path':':projectId','index':undefined,'caseSensitive':undefined,'module':'/build/routes/preview/$projectId-4SZF7FOL.js','imports':undefined,'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/rest/breakpoints.$projectId':{'id':'routes/rest/breakpoints.$projectId','parentId':'root','path':'rest/breakpoints/:projectId','index':undefined,'caseSensitive':undefined,'module':'/build/routes/rest/breakpoints.$projectId-OC77KFX5.js','imports':undefined,'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/rest/patch':{'id':'routes/rest/patch','parentId':'root','path':'rest/patch','index':undefined,'caseSensitive':undefined,'module':'/build/routes/rest/patch-NSLESHUG.js','imports':undefined,'hasAction':true,'hasLoader':false,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/rest/project/clone.$domain':{'id':'routes/rest/project/clone.$domain','parentId':'root','path':'rest/project/clone/:domain','index':undefined,'caseSensitive':undefined,'module':'/build/routes/rest/project/clone.$domain-KRUZBK37.js','imports':undefined,'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/rest/props.$projectId':{'id':'routes/rest/props.$projectId','parentId':'root','path':'rest/props/:projectId','index':undefined,'caseSensitive':undefined,'module':'/build/routes/rest/props.$projectId-JSZ6VLX5.js','imports':undefined,'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/rest/publish':{'id':'routes/rest/publish','parentId':'root','path':'rest/publish','index':undefined,'caseSensitive':undefined,'module':'/build/routes/rest/publish-4BQNZ4P3.js','imports':undefined,'hasAction':true,'hasLoader':false,'hasCatchBoundary':false,'hasErrorBoundary':false},'routes/rest/tree.$projectId':{'id':'routes/rest/tree.$projectId','parentId':'root','path':'rest/tree/:projectId','index':undefined,'caseSensitive':undefined,'module':'/build/routes/rest/tree.$projectId-4GKHHDNV.js','imports':undefined,'hasAction':false,'hasLoader':true,'hasCatchBoundary':false,'hasErrorBoundary':false}},'url':'/build/manifest-6412D0F3.js'};", "\nimport * as entryServer from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/entry.server.tsx\";\nimport * as route0 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/root.tsx\";\nimport * as route1 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/breakpoints.$projectId.ts\";\nimport * as route2 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/project/clone.$domain.ts\";\nimport * as route3 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/props.$projectId.ts\";\nimport * as route4 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/tree.$projectId.ts\";\nimport * as route5 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/publish.ts\";\nimport * as route6 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/github.tsx\";\nimport * as route7 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/github/callback.tsx\";\nimport * as route8 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/google.tsx\";\nimport * as route9 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/google/callback.tsx\";\nimport * as route10 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/rest/patch.ts\";\nimport * as route11 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/dashboard.tsx\";\nimport * as route12 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/dashboard/index.tsx\";\nimport * as route13 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/auth/dev.tsx\";\nimport * as route14 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/designer.tsx\";\nimport * as route15 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/designer/$id.tsx\";\nimport * as route16 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/preview.tsx\";\nimport * as route17 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/preview/$projectId.tsx\";\nimport * as route18 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/canvas.tsx\";\nimport * as route19 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/canvas/$projectId.tsx\";\nimport * as route20 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/logout.tsx\";\nimport * as route21 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/index.tsx\";\nimport * as route22 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/login.tsx\";\nimport * as route23 from \"/Users/oleg/work/webstudio/webstudio-designer/apps/designer/app/routes/login/index.tsx\";\n export { default as assets } from \"@remix-run/dev/assets-manifest\";\n export const entry = { module: entryServer };\n export const routes = {\n \"root\": {\n id: \"root\",\n parentId: undefined,\n path: \"\",\n index: undefined,\n caseSensitive: undefined,\n module: route0\n },\n \"routes/rest/breakpoints.$projectId\": {\n id: \"routes/rest/breakpoints.$projectId\",\n parentId: \"root\",\n path: \"rest/breakpoints/:projectId\",\n index: undefined,\n caseSensitive: undefined,\n module: route1\n },\n \"routes/rest/project/clone.$domain\": {\n id: \"routes/rest/project/clone.$domain\",\n parentId: \"root\",\n path: \"rest/project/clone/:domain\",\n index: undefined,\n caseSensitive: undefined,\n module: route2\n },\n \"routes/rest/props.$projectId\": {\n id: \"routes/rest/props.$projectId\",\n parentId: \"root\",\n path: \"rest/props/:projectId\",\n index: undefined,\n caseSensitive: undefined,\n module: route3\n },\n \"routes/rest/tree.$projectId\": {\n id: \"routes/rest/tree.$projectId\",\n parentId: \"root\",\n path: \"rest/tree/:projectId\",\n index: undefined,\n caseSensitive: undefined,\n module: route4\n },\n \"routes/rest/publish\": {\n id: \"routes/rest/publish\",\n parentId: \"root\",\n path: \"rest/publish\",\n index: undefined,\n caseSensitive: undefined,\n module: route5\n },\n \"routes/auth/github\": {\n id: \"routes/auth/github\",\n parentId: \"root\",\n path: \"auth/github\",\n index: undefined,\n caseSensitive: undefined,\n module: route6\n },\n \"routes/auth/github/callback\": {\n id: \"routes/auth/github/callback\",\n parentId: \"routes/auth/github\",\n path: \"callback\",\n index: undefined,\n caseSensitive: undefined,\n module: route7\n },\n \"routes/auth/google\": {\n id: \"routes/auth/google\",\n parentId: \"root\",\n path: \"auth/google\",\n index: undefined,\n caseSensitive: undefined,\n module: route8\n },\n \"routes/auth/google/callback\": {\n id: \"routes/auth/google/callback\",\n parentId: \"routes/auth/google\",\n path: \"callback\",\n index: undefined,\n caseSensitive: undefined,\n module: route9\n },\n \"routes/rest/patch\": {\n id: \"routes/rest/patch\",\n parentId: \"root\",\n path: \"rest/patch\",\n index: undefined,\n caseSensitive: undefined,\n module: route10\n },\n \"routes/dashboard\": {\n id: \"routes/dashboard\",\n parentId: \"root\",\n path: \"dashboard\",\n index: undefined,\n caseSensitive: undefined,\n module: route11\n },\n \"routes/dashboard/index\": {\n id: \"routes/dashboard/index\",\n parentId: \"routes/dashboard\",\n path: undefined,\n index: true,\n caseSensitive: undefined,\n module: route12\n },\n \"routes/auth/dev\": {\n id: \"routes/auth/dev\",\n parentId: \"root\",\n path: \"auth/dev\",\n index: undefined,\n caseSensitive: undefined,\n module: route13\n },\n \"routes/designer\": {\n id: \"routes/designer\",\n parentId: \"root\",\n path: \"designer\",\n index: undefined,\n caseSensitive: undefined,\n module: route14\n },\n \"routes/designer/$id\": {\n id: \"routes/designer/$id\",\n parentId: \"routes/designer\",\n path: \":id\",\n index: undefined,\n caseSensitive: undefined,\n module: route15\n },\n \"routes/preview\": {\n id: \"routes/preview\",\n parentId: \"root\",\n path: \"preview\",\n index: undefined,\n caseSensitive: undefined,\n module: route16\n },\n \"routes/preview/$projectId\": {\n id: \"routes/preview/$projectId\",\n parentId: \"routes/preview\",\n path: \":projectId\",\n index: undefined,\n caseSensitive: undefined,\n module: route17\n },\n \"routes/canvas\": {\n id: \"routes/canvas\",\n parentId: \"root\",\n path: \"canvas\",\n index: undefined,\n caseSensitive: undefined,\n module: route18\n },\n \"routes/canvas/$projectId\": {\n id: \"routes/canvas/$projectId\",\n parentId: \"routes/canvas\",\n path: \":projectId\",\n index: undefined,\n caseSensitive: undefined,\n module: route19\n },\n \"routes/logout\": {\n id: \"routes/logout\",\n parentId: \"root\",\n path: \"logout\",\n index: undefined,\n caseSensitive: undefined,\n module: route20\n },\n \"routes/index\": {\n id: \"routes/index\",\n parentId: \"root\",\n path: undefined,\n index: true,\n caseSensitive: undefined,\n module: route21\n },\n \"routes/login\": {\n id: \"routes/login\",\n parentId: \"root\",\n path: \"login\",\n index: undefined,\n caseSensitive: undefined,\n module: route22\n },\n \"routes/login/index\": {\n id: \"routes/login/index\",\n parentId: \"routes/login\",\n path: undefined,\n index: true,\n caseSensitive: undefined,\n module: route23\n }\n };"],- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,YAAuB;;;ACDvB;AAAA;AAAA;AAAA;AAAA,oBAA+B,6BAC/B,iBAA4B;;;ACD5B,iBAGO;;;ACHP,mBAA+B,4BAC/B,gBAmHO,6BAIM;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,IACE,iCAAe;AAAA,EACjB,OAAO;AAAA,IACL,QAAQ,w3BACH,qBACA,sBACA,sBACA,qBACA,sBACA,qBACA,uBACA,oBACA,wBACA,qBACA,qBACA,uBACA,uBACA,uBACA,qBACA,oBACA,qBACA,qBACA,qBACA,sBACA,sBACA,qBACA,uBACA,sBACA,uBACA,sBACA,uBACA,qBAEA,sBACA,uBACA,uBACA,sBACA,uBACA,sBACA,wBACA,qBACA,yBACA,sBACA,sBACA,wBACA,wBACA,wBACA,sBACA,qBACA,sBACA,sBACA,sBACA,uBACA,uBACA,sBACA,wBACA,uBACA,wBACA,uBACA,wBACA,sBAEA,uBACA,uBA5DG;AAAA,MA+DN,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,kBAAkB;AAAA,MAClB,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,MAAM;AAAA;AAAA,IAER,OAAO;AAAA,MACL,MAAM;AAAA,MACN,MAAM;AAAA;AAAA,IAER,OAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;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AU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA;AAAA,EAEZ,6BAA6B;AAAA,IACzB,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA;AAAA,EAEZ,iBAAiB;AAAA,IACb,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA;AAAA,EAEZ,4BAA4B;AAAA,IACxB,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA;AAAA,EAEZ,iBAAiB;AAAA,IACb,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA;AAAA,EAEZ,gBAAgB;AAAA,IACZ,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA;AAAA,EAEZ,gBAAgB;AAAA,IACZ,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA;AAAA,EAEZ,sBAAsB;AAAA,IAClB,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA;AAAA;",- "names": []-}diff --git a/package.json b/package.jsonindex bea980c65e..70e67141f4 100644--- a/package.json+++ b/package.json@@ -8,11 +8,10 @@],"scripts": {"build": "turbo run build",+ "checks": "turbo run checks","dev": "turbo run dev --parallel",- "lint": "turbo run lint","format": "prettier --write \"**/*.{ts,tsx,md}\"",- "prepare": "husky install",- "checks": "turbo run checks"+ "prepare": "husky install"},"devDependencies": {"eslint-config-custom": "*",