@developer_tribe/react-builder 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/AttributesEditor.d.ts +3 -1
  2. package/dist/RenderPage.d.ts +2 -1
  3. package/dist/attributes-editor/Field.d.ts +2 -1
  4. package/dist/attributes-editor/SpecialCategorySection.d.ts +2 -1
  5. package/dist/build-components/BackgroundImage/BackgroundImage.d.ts +5 -0
  6. package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +44 -0
  7. package/dist/build-components/Button/ButtonProps.generated.d.ts +7 -0
  8. package/dist/build-components/Carousel/CarouselProps.generated.d.ts +7 -0
  9. package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +7 -0
  10. package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +7 -0
  11. package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +7 -0
  12. package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +7 -0
  13. package/dist/build-components/Image/ImageProps.generated.d.ts +7 -0
  14. package/dist/build-components/Onboard/OnboardProps.generated.d.ts +7 -0
  15. package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +7 -0
  16. package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +7 -0
  17. package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +7 -0
  18. package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +7 -0
  19. package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +7 -0
  20. package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +7 -0
  21. package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +7 -1
  22. package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +7 -0
  23. package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +7 -0
  24. package/dist/build-components/Text/TextProps.generated.d.ts +7 -0
  25. package/dist/build-components/View/ViewProps.generated.d.ts +7 -0
  26. package/dist/build-components/index.d.ts +2 -1
  27. package/dist/build-components/patterns.generated.d.ts +1444 -15
  28. package/dist/components/AttributesEditorPanel.d.ts +3 -4
  29. package/dist/components/Builder.d.ts +2 -1
  30. package/dist/components/BuilderButton.d.ts +9 -0
  31. package/dist/index.cjs.js +5 -5
  32. package/dist/index.cjs.js.map +1 -1
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.esm.js +5 -5
  35. package/dist/index.esm.js.map +1 -1
  36. package/dist/modals/ColorModal.d.ts +3 -1
  37. package/dist/pages/ProjectPage.d.ts +3 -3
  38. package/dist/pages/tabs/BuilderPanel.d.ts +8 -0
  39. package/dist/pages/tabs/{DebugTab.d.ts → SideTool.d.ts} +2 -2
  40. package/dist/store.d.ts +7 -1
  41. package/dist/styles.css +1 -1
  42. package/dist/types/Project.d.ts +11 -0
  43. package/dist/utils/analyseNode.d.ts +1 -0
  44. package/dist/utils/extractTextStyle.d.ts +8 -1
  45. package/dist/utils/extractViewStyle.d.ts +8 -1
  46. package/dist/utils/parseColor.d.ts +7 -0
  47. package/package.json +1 -1
  48. package/src/AttributesEditor.tsx +76 -14
  49. package/src/RenderPage.tsx +82 -4
  50. package/src/attributes-editor/Field.tsx +12 -5
  51. package/src/attributes-editor/SpecialCategorySection.tsx +2 -1
  52. package/src/build-components/BackgroundImage/BackgroundImage.tsx +87 -0
  53. package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +60 -0
  54. package/src/build-components/BackgroundImage/pattern.json +45 -0
  55. package/src/build-components/Button/Button.tsx +31 -4
  56. package/src/build-components/Button/ButtonProps.generated.ts +7 -0
  57. package/src/build-components/Carousel/Carousel.tsx +27 -3
  58. package/src/build-components/Carousel/CarouselProps.generated.ts +7 -0
  59. package/src/build-components/CarouselButtons/CarouselButtons.tsx +19 -4
  60. package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +7 -0
  61. package/src/build-components/CarouselDots/CarouselDots.tsx +13 -4
  62. package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +7 -0
  63. package/src/build-components/CarouselItem/CarouselItem.tsx +20 -4
  64. package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +7 -0
  65. package/src/build-components/CarouselProvider/CarouselProvider.tsx +14 -3
  66. package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +7 -0
  67. package/src/build-components/Image/Image.tsx +29 -4
  68. package/src/build-components/Image/ImageProps.generated.ts +7 -0
  69. package/src/build-components/Onboard/Onboard.tsx +2 -2
  70. package/src/build-components/Onboard/OnboardProps.generated.ts +7 -0
  71. package/src/build-components/OnboardButton/OnboardButton.tsx +11 -4
  72. package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +7 -0
  73. package/src/build-components/OnboardButtons/OnboardButtons.tsx +17 -5
  74. package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +7 -0
  75. package/src/build-components/OnboardDot/OnboardDot.tsx +15 -6
  76. package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +7 -0
  77. package/src/build-components/OnboardDot/pattern.json +1 -1
  78. package/src/build-components/OnboardFooter/OnboardFooter.tsx +15 -5
  79. package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +7 -0
  80. package/src/build-components/OnboardImage/OnboardImage.tsx +28 -6
  81. package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +7 -0
  82. package/src/build-components/OnboardItem/OnboardItem.tsx +14 -3
  83. package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +7 -0
  84. package/src/build-components/OnboardProvider/OnboardProvider.tsx +34 -12
  85. package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +7 -1
  86. package/src/build-components/OnboardProvider/pattern.json +0 -8
  87. package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +7 -0
  88. package/src/build-components/OnboardSubtitle/pattern.json +1 -1
  89. package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +7 -0
  90. package/src/build-components/OnboardTitle/pattern.json +1 -1
  91. package/src/build-components/RenderNode.generated.tsx +3 -0
  92. package/src/build-components/Text/Text.tsx +33 -9
  93. package/src/build-components/Text/TextProps.generated.ts +7 -0
  94. package/src/build-components/View/View.tsx +27 -3
  95. package/src/build-components/View/ViewProps.generated.ts +7 -0
  96. package/src/build-components/View/pattern.json +59 -1
  97. package/src/build-components/index.ts +5 -0
  98. package/src/build-components/patterns.generated.ts +1452 -15
  99. package/src/components/AttributesEditorPanel.tsx +13 -6
  100. package/src/components/Builder.tsx +140 -40
  101. package/src/components/BuilderButton.tsx +127 -0
  102. package/src/index.ts +2 -2
  103. package/src/mockOS/components/MockOSRouter.tsx +11 -3
  104. package/src/modals/ColorModal.tsx +212 -55
  105. package/src/pages/ProjectPage.tsx +293 -55
  106. package/src/pages/tabs/{BuilderTab.tsx → BuilderPanel.tsx} +13 -9
  107. package/src/pages/tabs/SideTool.tsx +259 -0
  108. package/src/size-matters/index.ts +6 -0
  109. package/src/store.ts +13 -1
  110. package/src/styles/base/_global.scss +158 -7
  111. package/src/styles/components/_attributes-editor.scss +12 -0
  112. package/src/styles/components/_editor-shell.scss +23 -0
  113. package/src/styles/foundation/_sizes.scss +1 -1
  114. package/src/styles/layout/_builder.scss +66 -10
  115. package/src/styles/modals/_color-modal.scss +29 -0
  116. package/src/types/Project.ts +14 -0
  117. package/src/utils/analyseNode.ts +98 -0
  118. package/src/utils/extractTextStyle.ts +24 -8
  119. package/src/utils/extractViewStyle.ts +27 -3
  120. package/src/utils/parseColor.ts +43 -0
  121. package/dist/pages/tabs/BuilderTab.d.ts +0 -9
  122. package/dist/pages/tabs/PreviewTab.d.ts +0 -3
  123. package/src/pages/tabs/DebugTab.tsx +0 -64
  124. package/src/pages/tabs/PreviewTab.tsx +0 -206
@@ -1,9 +1,11 @@
1
+ import type { ProjectColors } from '../types/Project';
1
2
  type ColorModalProps = {
2
3
  value?: string;
3
- projectColors?: string[];
4
+ projectColors?: ProjectColors;
4
5
  onSelect: (color: string) => void;
5
6
  onClose: () => void;
6
7
  onClear: () => void;
7
8
  };
9
+ export declare const resolveProjectColorValue: (candidate?: string, projectColors?: ProjectColors) => string | undefined;
8
10
  export declare function ColorModal({ value, projectColors, onSelect, onClose, onClear, }: ColorModalProps): import("react/jsx-runtime").JSX.Element;
9
11
  export default ColorModal;
@@ -1,11 +1,11 @@
1
- import { Project } from '..';
1
+ import { Project, ProjectColors } from '..';
2
2
  import { AppConfig } from '../types/PreviewConfig';
3
3
  import type { LogLevel } from '../types/Project';
4
- export type Tab = 'builder' | 'preview';
5
4
  export type ProjectPageProps = {
6
5
  project: Project;
7
6
  onSaveProject: (project: Project) => void;
8
7
  appConfig?: AppConfig;
9
8
  logLevel?: LogLevel;
9
+ projectColors?: ProjectColors;
10
10
  };
11
- export declare function ProjectPage({ project, appConfig, onSaveProject, logLevel, }: ProjectPageProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function ProjectPage({ project, appConfig, onSaveProject, logLevel, projectColors, }: ProjectPageProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Node } from '../..';
2
+ type BuilderPanelProps = {
3
+ data: Node;
4
+ setData: (data: Node) => void;
5
+ onDeleteNode: (node: Node) => void;
6
+ };
7
+ export declare function BuilderPanel({ data, setData, onDeleteNode, }: BuilderPanelProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { Node } from '../..';
2
- type DebugTabProps = {
2
+ type SideToolProps = {
3
3
  data: Node;
4
4
  setData: (data: Node) => void;
5
5
  };
6
- export declare function DebugTab({ data, setData }: DebugTabProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function SideTool({ data, setData }: SideToolProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
package/dist/store.d.ts CHANGED
@@ -1,14 +1,20 @@
1
1
  import type { Device } from './types/Device';
2
2
  import { type AppConfig } from './types/PreviewConfig';
3
3
  import { Node } from './types/Node';
4
- import type { LogEntry, LogLevel } from './types/Project';
4
+ import type { LogEntry, LogLevel, ProjectColors } from './types/Project';
5
5
  type RenderStore = {
6
6
  copiedNode: Node | null;
7
7
  setCopiedNode: (node: Node | null) => void;
8
+ current: Node | null;
9
+ setCurrent: (node: Node | null) => void;
8
10
  device: Device;
9
11
  setDevice: (device: Device) => void;
10
12
  appConfig: AppConfig;
11
13
  setAppConfig: (appConfig: AppConfig) => void;
14
+ projectColors?: ProjectColors;
15
+ setProjectColors: (projectColors?: ProjectColors) => void;
16
+ previewMode: boolean;
17
+ setPreviewMode: (previewMode: boolean) => void;
12
18
  logs: LogEntry[];
13
19
  logLevel: LogLevel;
14
20
  setLogLevel: (level: LogLevel) => void;
package/dist/styles.css CHANGED
@@ -1 +1 @@
1
- *,*::before,*::after{box-sizing:border-box}html,body,#root{height:100%;margin:0;padding:0}body{background:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow:hidden}button{font-family:inherit}input,button{font-size:100%}p{margin:0;padding:0}html,body,#root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif}.editor-container{height:100vh;width:100vw;display:flex;overflow:hidden}.editor-panel-builder{padding:4px 8px}.app-main{flex:1 1 auto;background:#f3f4f6}.page-bg{background:#f3f4f6}.grid-cards{display:grid;grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));gap:16px}.btn-add{height:120px;border:2px dashed #6b7280;border-radius:8px;background:#fff;cursor:pointer;font-weight:600;color:#111827;transition:border-color .2s ease,transform .1s ease,box-shadow .2s ease;box-shadow:0 1px 2px rgba(0,0,0,.04)}.btn-add:hover{border-color:hsl(220,8.9361702128%,36.0784313725%);transform:translateY(-1px);box-shadow:0 6px 16px rgba(0,0,0,.1)}.split-left{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.25) rgba(0,0,0,0)}.split-left::-webkit-scrollbar{width:8px;height:4px}.split-left{flex:1 1 10%;min-width:0;border-right:1px solid #e5e7eb;overflow:auto}.split-right{position:relative;flex:1 1 45%;max-height:calc(100vh + 60px);padding:16px;padding-bottom:120px;overflow:auto}.split-right__controls{position:sticky;top:12px;z-index:2;display:flex;margin-bottom:12px}.split-third{flex:1 1 25%;min-width:450px;border-right:1px solid #e5e7eb;overflow:auto;max-height:calc(100vh - 120px)}.split-right-background{position:absolute;top:0;left:0;right:0;bottom:0;height:calc(100vh + 60px);background-size:cover;background-position:center;background-repeat:repeat;background-size:500px auto;opacity:.2;z-index:0;pointer-events:none}.stage-wrapper{display:flex;justify-content:center;background:rgba(0,0,0,0);padding:16px;position:relative;z-index:1}.stage{background:#fff;border:1px solid #e5e7eb;border-radius:4px;border:1px solid #e5e7eb;overflow:hidden}.stage .scroll-container::-webkit-scrollbar{width:8px;height:8px}.stage .scroll-container::-webkit-scrollbar-track{background:rgba(0,0,0,0)}.stage .scroll-container::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:8px}.stage .scroll-container{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.25) rgba(0,0,0,0)}.app-header{position:sticky;top:0;z-index:10;background:#fff;border-bottom:1px solid #e5e7eb;height:60px;padding:0 16px;display:flex;align-items:center;justify-content:space-between}.app-header a{color:#111827;text-decoration:none}.app-header__brand{font-weight:700}.app-header__nav{display:flex;gap:16px}.warning{color:#ef4444;font-size:12px;font-weight:600;margin-bottom:16px}.breadcrumb{display:flex;align-items:center;gap:12px;font-size:12px;color:#6b7280}.breadcrumb__back{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:none;color:#111827;font-weight:600;cursor:pointer;transition:color .2s ease}.breadcrumb__back:hover,.breadcrumb__back:focus-visible{color:#2563eb;outline:none}.breadcrumb__back-icon{font-size:14px;line-height:1}.breadcrumb__list{list-style:none;padding:0;margin:0;display:flex;align-items:center;gap:8px}.breadcrumb__item{display:inline-flex;align-items:center}.breadcrumb__item--clickable{cursor:pointer}.breadcrumb__separator{color:#e5e7eb;margin:0 4px}.breadcrumb__link{color:#111827;text-decoration:none}.breadcrumb__link:hover{text-decoration:underline}.breadcrumb__current{color:#6b7280}.device-status-bar{position:relative;z-index:100}.device-navigation-bar{position:relative;z-index:100}.builder{display:flex;flex-direction:column;gap:12px}.builder__breadcrumbs{display:flex;flex-direction:row;gap:8px}.builder__breadcrumb{color:#6b7280;font-size:12px}.builder__current{font-weight:600}.builder__list{display:flex;flex-wrap:wrap;gap:8px}.builder__button{background:#fff;border:1px solid #e5e7eb;border-radius:4px;padding:12px 12px;background:#2563eb;color:#fff}.builder__button-label{font-size:13px;font-weight:600}.builder__button-condition{font-size:10px}.builder__node{background:#fff;border:1px solid #e5e7eb;border-radius:4px;padding:12px}.builder__node-type{margin:0 0 8px 0;font-weight:600}.builder__children{display:flex;flex-direction:column;gap:8px}.builder__text,.builder__placeholder{color:#6b7280;font-size:12px}.editor-controls{display:grid;grid-template-columns:auto 1fr;gap:12px;padding:16px}.editor-section{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:16px}.form-row{display:grid;grid-template-columns:160px 1fr;align-items:center;gap:12px;margin-bottom:12px}.form-actions{display:flex;gap:12px;margin-top:16px}.btn{padding:8px 12px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;transition:background .2s ease,box-shadow .2s ease}.btn:hover{background:#f9fafb;box-shadow:0 6px 16px rgba(0,0,0,.06)}.input{display:inline-flex;align-items:center;height:32px;padding:0 8px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;color:#111827;font:inherit;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.input:focus{border-color:hsl(220,13.0434782609%,82.9803921569%);box-shadow:0 0 0 3px rgba(0,0,0,.04)}.input--color{padding:0;width:40px;height:28px;border-radius:6px;cursor:pointer}.input--color::-webkit-color-swatch-wrapper{padding:0}.input--color::-webkit-color-swatch{border:none;border-radius:4px}.input--color::-moz-color-swatch{border:none;border-radius:4px}.builder-checkbox{display:inline-flex;flex-direction:column;gap:4px}.builder-checkbox__label{display:inline-flex;align-items:center;gap:10px;cursor:pointer;color:#111827;font-weight:600;position:relative;user-select:none}.builder-checkbox__native{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px}.builder-checkbox__control{width:20px;height:20px;border-radius:6px;border:2px solid #e5e7eb;background:#fff;display:inline-flex;align-items:center;justify-content:center;transition:background .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease;box-shadow:0 2px 6px rgba(15,23,42,.12)}.builder-checkbox__control::after{content:"";width:6px;height:12px;border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0);transform:rotate(45deg) scale(0);transform-origin:center;transition:transform .2s ease,border-color .2s ease}.builder-checkbox__label:hover .builder-checkbox__control{transform:translateY(-1px)}.builder-checkbox__native:focus-visible+.builder-checkbox__control{box-shadow:0 0 0 3px rgba(79,70,229,.3)}.builder-checkbox__native:checked+.builder-checkbox__control{background:linear-gradient(135deg, #1f2937, #4f46e5);border-color:rgba(0,0,0,0);box-shadow:0 6px 14px rgba(79,70,229,.35)}.builder-checkbox__native:checked+.builder-checkbox__control::after{border-color:#fff;transform:rotate(45deg) scale(1)}.builder-checkbox__text{font-size:14px;line-height:1.4}.builder-checkbox__helper{font-size:12px;color:#6b7280;margin-left:30px}.builder-checkbox--disabled{opacity:.6}.builder-checkbox--disabled .builder-checkbox__label{cursor:not-allowed}.editor-tabs{display:flex;gap:8px;border-bottom:1px solid #e5e7eb}.editor-tab{cursor:pointer;border:1px solid rgba(0,0,0,0);border-top-left-radius:4px;border-top-right-radius:4px;color:#111827;padding:8px 12px;display:inline-flex;align-items:center;white-space:nowrap}.editor-tab__label{display:inline-flex;align-items:center;white-space:nowrap;line-height:1.2;font-size:clamp(.85rem,.9rem + .2vw,1rem)}.editor-tab--active{background:#fff;border-color:#e5e7eb #e5e7eb #fff #e5e7eb}.editor-panels{padding:12px}.editor-panels.editor-panels-debug{padding:0}.jer-editor-container{padding-left:0 !important;padding-right:0 !important}.editor-panel{display:none}.editor-panel--active{display:block}.editor-header{display:flex;align-items:center;gap:12px;padding:0 16px;height:60px;background:#f3f4f6;border-bottom:1px solid #e5e7eb}.editor-header__title{color:#111827;font-weight:600}.editor-header__devices{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.25) rgba(0,0,0,0)}.editor-header__devices::-webkit-scrollbar{width:8px;height:4px}.editor-header__devices{display:flex;flex-direction:row;align-items:stretch;gap:8px;overflow:auto;height:60px;padding:4px}.editor-device-button{position:relative;min-width:160px;height:100%;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#111827;cursor:pointer;font-size:12px}.editor-device-button.editor-device-button--selected{border-color:#000}.editor-device-button img{position:absolute;bottom:4px;right:4px;width:16px;height:16px}.editor-header__actions{margin-left:auto;display:flex;align-items:center;gap:8px}.editor-button{display:inline-flex;align-items:center;justify-content:center;height:36px;min-width:120px;padding:0 12px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#111827;cursor:pointer}.debug-button{min-width:auto;height:auto;padding:4px 12px;font-size:12px;line-height:1.2;border-radius:999px;background:hsla(0,0%,100%,.95);border-color:rgba(15,23,42,.15);box-shadow:0 2px 4px rgba(15,23,42,.08)}.debug-button:hover{background:#fff;border-color:rgba(15,23,42,.3)}.editor-button:disabled{opacity:.6;cursor:default}.editor-save-button,.editor-save-previewconfig-button{color:#000;font-weight:600;font-size:12px}.builder__add-button{width:100%;margin-top:12px;min-height:52px;border-style:dashed;border-color:#cbd5f5;background:#f8fafc;color:#0f172a;font-weight:600;gap:10px;transition:border-color .2s ease,background .2s ease,color .2s ease}.builder__add-button-icon{display:inline-flex;width:28px;height:28px;border-radius:999px;align-items:center;justify-content:center;background:#2563eb;color:#fff;font-size:18px;line-height:1}.builder__add-button:hover{border-color:#94a3b8;background:#eef2ff;color:#111827}.attributes-editor__component-meta{margin-bottom:20px;padding:12px 16px;border-radius:8px;border:1px solid #eee;background:#f8f8f8}.attributes-editor__component-title,.attributes-editor__field-label{margin:0;font-weight:700}.attributes-editor__component-title{font-size:18px;text-transform:capitalize}.attributes-editor__component-description{margin:6px 0 0;font-size:14px;color:#555}.attributes-editor__tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.attributes-editor__tab-button{padding:6px 12px;border-radius:6px;border:1px solid #ddd;background:#fff;color:#222;cursor:pointer;font-weight:600;transition:background .15s ease,color .15s ease}.attributes-editor__tab-button:disabled{opacity:.4;cursor:default}.attributes-editor__tab-button--active{background:#222;color:#fff}.attributes-editor__field-wrapper{position:relative;margin-bottom:16px;display:flex;flex-direction:column;gap:4px;width:100%}.attributes-editor__field-wrapper--boolean{flex-direction:row;align-items:center;gap:8px}.attributes-editor__field-label{font-size:14px}.attributes-editor__empty-state{padding:8px;opacity:.7}.attributes-editor__size-grid{display:flex;gap:12px;flex-wrap:wrap}.attributes-editor__size-grid-item{flex:1;min-width:140px;max-width:220px}.attributes-editor__size-field{display:flex;gap:6px;align-items:center;width:100%}.attributes-editor__size-field-input{flex:1;min-width:0;height:36px;line-height:36px}.attributes-editor__size-field-select{flex:0 0 72px;min-width:60px;height:36px;line-height:36px;padding-inline:6px}.field-info-tooltip{position:relative}.field-info-tooltip__trigger{position:absolute;top:0;right:0;font-size:11px;line-height:1.2;color:#666;cursor:pointer;font-weight:600;white-space:nowrap;text-transform:uppercase;letter-spacing:.5px;background:rgba(0,0,0,0);border:none;padding:0;font-family:inherit;display:inline-flex;align-items:center;gap:4px}.field-info-tooltip__trigger:focus-visible{outline:2px solid rgba(17,24,39,.4);outline-offset:2px}.field-info-tooltip__bubble{position:absolute;top:50%;right:100%;transform:translate(-8px, -50%);background:#111;color:#fff;padding:6px 10px;border-radius:4px;font-size:12px;line-height:1.4;width:220px;text-align:left;box-shadow:0 6px 16px rgba(0,0,0,.2);z-index:20;opacity:0;pointer-events:none;transition:opacity .15s ease,transform .15s ease}.field-info-tooltip__bubble--visible{opacity:1;transform:translate(-12px, -50%)}.special-category-section{border:1px solid #e0e0e0;border-radius:8px;padding:12px;margin-bottom:16px;background:#fdfdfd}.special-category-section__header{display:flex;justify-content:space-between;align-items:center;gap:8px}.special-category-section__title{margin:0;font-weight:700}.special-category-section__toggle{border:1px solid #ddd;background:#fff;color:#222;border-radius:4px;padding:4px 10px;cursor:pointer;font-weight:600;transition:background .15s ease,color .15s ease,border-color .15s ease}.special-category-section__toggle[data-active=true]{background:#222;color:#fff;border-color:#222}.special-category-section__description{margin:8px 0 0;color:#666;font-size:13px;padding-bottom:16px}.special-category-section__fields{display:grid;gap:8px;margin-top:12px}.special-category-section__fields--box{grid-template-columns:repeat(2, minmax(0, 1fr));grid-template-areas:"top top" "left right" "bottom bottom"}.special-category-section__fields--box>.field-info-tooltip:has([data-field-slot=top]){grid-area:top}.special-category-section__fields--box>.field-info-tooltip:has([data-field-slot=left]){grid-area:left}.special-category-section__fields--box>.field-info-tooltip:has([data-field-slot=right]){grid-area:right}.special-category-section__fields--box>.field-info-tooltip:has([data-field-slot=bottom]){grid-area:bottom}.special-category-section__field{min-width:0}.special-category-section__placeholder{margin-top:8px;font-style:italic;opacity:.7}.mockos-router{width:100%;height:100%;position:relative}.mockos-screen{width:100%;height:100%}.mockos-screen--center{display:flex;flex-direction:column;align-items:center;justify-content:center}.mockos-screen--launchscreen{background-color:#000}.mockos-screen--home{padding:20px;background-color:#f5f5f5}.mockos-screen--onboard{padding:20px;background-color:#fff}.mockos-screen--subscription{padding:20px;background-color:#fff}.mockos-screen__title{font-size:32px;font-weight:bold;color:#000;margin-bottom:16px}.mockos-screen__subtitle{font-size:16px;color:#666}.mockos-screen__heading{font-size:24px;font-weight:bold;margin-bottom:20px}.mockos-screen__text{font-size:16px;color:#333;margin-bottom:12px}.mockos-screen__plan{padding:16px;border-radius:8px;text-align:center;margin-bottom:12px}.mockos-screen__plan--premium{background-color:#007aff;color:#fff}.mockos-screen__plan--basic{background-color:#e5e5e5;color:#333}.mockos-launcher{width:100%;height:100%;padding:40px 20px;display:flex;flex-direction:column}.mockos-launcher__grid{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;padding:20px}.mockos-launcher__app{display:flex;flex-direction:column;align-items:center;gap:8px;background:rgba(0,0,0,0);border:none;cursor:pointer;padding:8px;border-radius:12px;transition:background-color .2s}.mockos-launcher__app:hover{background-color:hsla(0,0%,100%,.1)}.mockos-launcher__app:active{transform:scale(0.95)}.mockos-launcher__app-icon{width:60px;height:60px;border-radius:13px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.3)}.mockos-launcher__app-icon svg{width:100%;height:100%;display:block}.mockos-launcher__app-name{font-size:12px;color:#fff;text-align:center;max-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.modal{position:fixed;inset:0;z-index:10000}.modal__overlay{position:absolute;inset:0;background:rgba(0,0,0,.4);z-index:0}.modal__content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);background:#fff;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.12);width:min(960px,100vw - 40px);max-height:calc(100vh - 120px);display:flex;flex-direction:column;overflow:hidden;z-index:1}.modal__header{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;border-bottom:1px solid #e5e7eb;gap:12px}.modal__title{margin:0;font-size:16px;font-weight:700}.add-component-modal{display:flex;flex-direction:column;height:100%}.add-component-modal__body{flex:1;overflow-y:auto;padding-bottom:24px}.add-component-modal__section{padding:0 24px;margin-bottom:24px}.add-component-modal__section:first-of-type{margin-top:24px}.add-component-modal__section-title{font-size:16px;font-weight:600;margin-bottom:12px}.add-component-modal__toggle{display:flex;align-items:center;gap:12px;margin:0 24px 24px;padding:12px 0;font-weight:500;user-select:none}.add-component-modal__toggle input{width:18px;height:18px}.add-component-modal__group{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px;box-shadow:0 10px 20px rgba(15,23,42,.05)}.add-component-modal__group-title{font-size:14px;font-weight:600;color:#6b7280;margin-bottom:12px}.add-component-modal__grid{padding:16px;display:grid;grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));gap:12px;overflow:auto}.add-component-modal__card{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid #e5e7eb;border-radius:10px;background:#f3f4f6;cursor:pointer;text-align:left;transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease;color:inherit}.add-component-modal__card:hover{border-color:#2563eb;box-shadow:0 10px 25px rgba(37,99,235,.15);transform:translateY(-2px)}.add-component-modal__thumbnail{width:100%;aspect-ratio:4/3;border-radius:8px;background:#f3f4f6;border:1px dashed #e5e7eb;display:flex;align-items:center;justify-content:center;color:#2563eb;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.05em}.add-component-modal__title{font-weight:600;color:#111827}.add-component-modal__empty{margin:12px 0;padding:16px;border:1px dashed #e5e7eb;border-radius:10px;color:#6b7280;font-size:14px;text-align:center}.device-selector-modal{padding-bottom:24px}.device-selector-modal__grid{padding:24px;display:grid;grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));gap:12px;overflow:auto}.device-selector-modal__grid .editor-device-button{height:80px;min-width:unset}.color-modal{width:min(520px,100vw - 32px);max-height:90vh;padding:24px;display:flex;flex-direction:column;gap:16px;overflow-y:auto}.color-modal__selected{display:flex;align-items:center;justify-content:space-between;background:#f3f4f6;border-radius:8px;padding:12px 16px}.color-modal__selected-info{display:flex;align-items:center;gap:12px}.color-modal__selected-preview{width:32px;height:32px;border-radius:6px;border:1px solid rgba(0,0,0,.1)}.color-modal__selected-label{margin:0;font-size:12px;color:#6b7280}.color-modal__selected-value{margin:0;font-weight:600}.color-modal__link-button{border:none;background:none;color:#2563eb;font-weight:600;font-size:13px;cursor:pointer;padding:4px 8px}.color-section{display:flex;flex-direction:column;gap:8px}.color-section__header{display:flex;align-items:center;justify-content:space-between;gap:8px}.color-section__title{margin:0;font-weight:600}.color-section__swatches{display:grid;grid-template-columns:repeat(auto-fill, minmax(120px, 1fr));gap:8px}.color-section__empty{margin:0;font-size:12px;color:#6b7280}.color-modal__swatch{border:1px solid #e5e7eb;border-radius:8px;padding:8px;background:#fff;display:flex;flex-direction:column;gap:6px;text-align:left;cursor:pointer;transition:border-color .2s ease,box-shadow .2s ease}.color-modal__swatch--active{border-color:#111827;box-shadow:0 0 0 1px #111827 inset}.color-modal__swatch-preview{width:100%;height:32px;border-radius:6px}.color-modal__swatch-preview--light{border:1px solid rgba(0,0,0,.1)}.color-modal__swatch-label{font-size:12px;font-weight:600;color:#111827}.color-modal__swatch-value{font-size:11px;color:#6b7280}.color-modal__input{display:none}.localication-modal__content{width:calc(100vw - 32px);height:calc(100vh - 32px);max-width:1600px;max-height:calc(100vh - 32px);padding:0;display:flex;flex-direction:column}.localication-modal__header{padding:16px 24px;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;gap:16px}.localication-modal__header-main{flex:1;display:flex;flex-direction:column;gap:4px}.localication-modal__description{margin:0;font-size:13px;color:#6b7280}.localication-modal__body{flex:1;min-height:0;padding:24px;display:flex;flex-direction:column;gap:16px;overflow:auto}.localication-modal__editor{flex:1;min-height:0;overflow:auto;border:1px solid #e5e7eb;border-radius:8px;background:#f3f4f6}.localication-modal__json-editor{height:100%;width:100%;display:block;padding:12px;overflow:auto}.modal--scrollable .localication-modal__content{overflow:hidden}.modal--scrollable .localication-modal__body{overflow:auto}.embla{max-width:48rem;margin:auto;--slide-height: 19rem;--slide-spacing: 1rem;--slide-size: 70%}.embla__viewport{overflow:hidden}.embla__container{display:flex;touch-action:pan-y pinch-zoom;margin-left:calc(var(--slide-spacing)*-1)}.embla__slide{transform:translate3d(0, 0, 0);min-width:0;padding-left:var(--slide-spacing);flex:0 0 100%}.embla__slide__number{box-shadow:inset 0 0 0 .2rem var(--detail-medium-contrast);border-radius:1.8rem;font-size:4rem;font-weight:600;display:flex;align-items:center;justify-content:center;height:var(--slide-height);user-select:none}.embla__controls{display:grid;grid-template-columns:auto 1fr;justify-content:space-between;gap:1.2rem;margin-top:1.8rem}.embla__buttons{display:grid;grid-template-columns:repeat(2, 1fr);gap:.6rem;align-items:center}.embla__button{-webkit-tap-highlight-color:rgba(var(--text-high-contrast-rgb-value), 0.5);-webkit-appearance:none;appearance:none;background-color:rgba(0,0,0,0);touch-action:manipulation;display:inline-flex;text-decoration:none;cursor:pointer;border:0;padding:0;margin:0;box-shadow:inset 0 0 0 .2rem var(--detail-medium-contrast);width:3.6rem;height:3.6rem;z-index:1;border-radius:50%;color:var(--text-body);display:flex;align-items:center;justify-content:center}.embla__button:disabled{color:var(--detail-high-contrast)}.embla__button__svg{width:35%;height:35%}.embla__dots{flex-wrap:wrap;margin-right:0;height:50px;margin:0 auto}.embla__dot{-webkit-tap-highlight-color:rgba(var(--text-high-contrast-rgb-value), 0.5);-webkit-appearance:none;appearance:none;background-color:rgba(0,0,0,0);touch-action:manipulation;display:inline-flex;text-decoration:none;cursor:pointer;border:0;padding:0;margin:0;width:2.6rem;height:2.6rem;display:flex;align-items:center;border-radius:50%}.embla__dot:after{box-shadow:inset 0 0 0 .2rem var(--detail-medium-contrast);width:1.4rem;height:1.4rem;border-radius:50%;display:flex;align-items:center;content:""}.embla__dot--selected:after{box-shadow:inset 0 0 0 .2rem var(--text-body)}.carousel-provider{height:100%}.embla{height:100%}.embla__viewport{height:100%;display:flex;flex-direction:column}.embla__container{flex:1}
1
+ *,*::before,*::after{box-sizing:border-box}html,body,#root{height:100%;margin:0;padding:0}body{background:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow:hidden}button{font-family:inherit}input,button{font-size:100%}p{margin:0;padding:0}html,body,#root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif}.editor-container{height:100vh;width:100%;display:flex;overflow:hidden}.app-main{flex:1 1 auto;background:#f3f4f6}.page-bg{background:#f3f4f6}.grid-cards{display:grid;grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));gap:16px}.btn-add{height:120px;border:2px dashed #6b7280;border-radius:8px;background:#fff;cursor:pointer;font-weight:600;color:#111827;transition:border-color .2s ease,transform .1s ease,box-shadow .2s ease;box-shadow:0 1px 2px rgba(0,0,0,.04)}.btn-add:hover{border-color:hsl(220,8.9361702128%,36.0784313725%);transform:translateY(-1px);box-shadow:0 6px 16px rgba(0,0,0,.1)}.split-left{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.25) rgba(0,0,0,0)}.split-left::-webkit-scrollbar{width:8px;height:4px}.split-left{flex:1 1 10%;min-width:200px;border-right:1px solid #e5e7eb;overflow:auto}.split-right{position:relative;flex:1 1 45%;min-width:450px;max-height:calc(100vh + 60px);padding:16px;padding-bottom:120px;overflow:auto}.split-right__controls{position:absolute;top:12px;z-index:2;display:flex;margin-bottom:12px}.split-third{flex:1 1 25%;border-right:1px solid #e5e7eb;overflow:auto;max-height:calc(100vh - 120px)}.split-right-background{position:absolute;top:0;left:0;right:0;bottom:0;height:calc(100vh + 60px);background-size:cover;background-position:center;background-repeat:repeat;background-size:500px auto;opacity:.2;z-index:0;pointer-events:none}.stage-wrapper{display:flex;justify-content:center;background:rgba(0,0,0,0);padding:16px;position:relative;z-index:1}.stage{background:#fff;border:1px solid #e5e7eb;border-radius:4px;border:1px solid #e5e7eb;overflow:hidden}.stage .scroll-container::-webkit-scrollbar{width:8px;height:8px}.stage .scroll-container::-webkit-scrollbar-track{background:rgba(0,0,0,0)}.stage .scroll-container::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:8px}.stage .scroll-container{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.25) rgba(0,0,0,0)}.app-header{position:sticky;top:0;z-index:10;background:#fff;border-bottom:1px solid #e5e7eb;height:60px;padding:0 16px;display:flex;align-items:center;justify-content:space-between}.app-header a{color:#111827;text-decoration:none}.app-header__brand{font-weight:700}.app-header__nav{display:flex;gap:16px}.warning{color:#ef4444;font-size:12px;font-weight:600;margin-bottom:16px}.breadcrumb{display:flex;align-items:center;gap:12px;font-size:12px;color:#6b7280}.breadcrumb__back{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:none;color:#111827;font-weight:600;cursor:pointer;transition:color .2s ease}.breadcrumb__back:hover,.breadcrumb__back:focus-visible{color:#2563eb;outline:none}.breadcrumb__back-icon{font-size:14px;line-height:1}.breadcrumb__list{list-style:none;padding:0;margin:0;display:flex;align-items:center;gap:8px}.breadcrumb__item{display:inline-flex;align-items:center}.breadcrumb__item--clickable{cursor:pointer}.breadcrumb__separator{color:#e5e7eb;margin:0 4px}.breadcrumb__link{color:#111827;text-decoration:none}.breadcrumb__link:hover{text-decoration:underline}.breadcrumb__current{color:#6b7280}.device-status-bar{position:relative;z-index:100}.device-navigation-bar{position:relative;z-index:100}.mobile-panel-toggle{display:none;padding:0 16px 12px;gap:8px}.mobile-panel-toggle__button{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;color:#111827;font-weight:600;cursor:pointer;transition:background .2s ease,color .2s ease,border-color .2s ease,box-shadow .2s ease}.mobile-panel-toggle__button:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.mobile-panel-toggle__button--active{background:#111827;color:#fff;border-color:#111827;box-shadow:0 6px 16px rgba(0,0,0,.15)}.mobile-panel-toggle__icon{width:18px;height:12px;display:inline-flex}.mobile-panel-toggle__icon svg{width:100%;height:100%}.mobile-panel-toggle__label{line-height:1}.split-panel__close{display:none;position:absolute;top:12px;right:12px;border:none;border-radius:8px;background:rgba(0,0,0,.7);color:#fff;padding:6px 16px;font-weight:600;cursor:pointer;z-index:5}.editor-container__overlay{display:none}@media(max-width: 1000px){.editor-container{position:relative;min-height:calc(100vh - 60px);flex-direction:column}.split-left,.split-third{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;background:#f3f4f6;box-shadow:0 25px 60px rgba(0,0,0,.15);transition:transform .3s ease,opacity .3s ease;opacity:0;pointer-events:none;z-index:4}.split-left{transform:translate3d(-100%, 0, 0)}.split-third{transform:translate3d(100%, 0, 0)}.split-left.is-open,.split-third.is-open{opacity:1;pointer-events:auto;transform:translate3d(0, 0, 0)}.split-right{flex:1 1 auto;min-width:0;min-height:calc(100vh - 120px);padding:16px;padding-bottom:120px;position:relative}.mobile-panel-toggle{display:flex}.split-panel__close{display:inline-flex}.editor-container__overlay{display:block;position:absolute;inset:0;background:rgba(17,24,39,.35);border:none;padding:0;margin:0;cursor:pointer;z-index:3}}@media(max-width: 900px){.split-right__controls{top:12px;z-index:5;padding-bottom:12px}.split-right__controls .side-tool{width:100%}}.builder{display:flex;flex-direction:column;gap:12px}.builder__breadcrumbs{display:flex;flex-direction:row;gap:8px}.builder__breadcrumb{color:#6b7280;font-size:12px}.builder__current{font-weight:600}.builder__list{display:flex;flex-wrap:wrap;gap:8px}.builder__list-item{flex:1 1 220px;min-width:220px}.builder__button{position:relative;display:flex;align-items:stretch}.builder__button>.builder__button-link{flex:1;min-width:0;display:flex;align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:4px;height:40px;line-height:37px;padding:0 4px;margin:0;background:#2563eb;color:#fff;font-size:clamp(11px,1.3vw,13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.builder__sort-controls{display:flex;flex-direction:column;gap:4px}.builder__sort-button{width:32px;height:18px;border:none;border-radius:4px;background:#f3f4f6;color:#6b7280;font-size:14px;cursor:pointer;line-height:1;box-shadow:inset 0 0 0 1px #e5e7eb;padding:0}.builder__sort-button:disabled{opacity:.4;cursor:not-allowed}.builder__button-condition{position:absolute;bottom:-10px;font-size:8px}.builder__node{background:#fff;border:1px solid #e5e7eb;border-radius:4px;padding:6px}.builder__node-type{margin:0 0 8px 0;font-weight:600}.builder__children{position:relative;display:flex;flex-direction:column;gap:16px}.builder__children>:not(:first-child){margin-left:16px}.builder__children::before{content:"";position:absolute;left:6px;top:24px;bottom:0;width:1px;background:#e5e7eb}.builder__text,.builder__placeholder{color:#6b7280;font-size:12px}.editor-controls{display:grid;grid-template-columns:auto 1fr;gap:12px;padding:16px}.editor-section{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:16px}.form-row{display:grid;grid-template-columns:160px 1fr;align-items:center;gap:12px;margin-bottom:12px}.form-actions{display:flex;gap:12px;margin-top:16px}.btn{padding:8px 12px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;transition:background .2s ease,box-shadow .2s ease}.btn:hover{background:#f9fafb;box-shadow:0 6px 16px rgba(0,0,0,.06)}.input{display:inline-flex;align-items:center;height:32px;padding:0 8px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;color:#111827;font:inherit;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.input:focus{border-color:hsl(220,13.0434782609%,82.9803921569%);box-shadow:0 0 0 3px rgba(0,0,0,.04)}.input--color{padding:0;width:40px;height:28px;border-radius:6px;cursor:pointer}.input--color::-webkit-color-swatch-wrapper{padding:0}.input--color::-webkit-color-swatch{border:none;border-radius:4px}.input--color::-moz-color-swatch{border:none;border-radius:4px}.builder-checkbox{display:inline-flex;flex-direction:column;gap:4px}.builder-checkbox__label{display:inline-flex;align-items:center;gap:10px;cursor:pointer;color:#111827;font-weight:600;position:relative;user-select:none}.builder-checkbox__native{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px}.builder-checkbox__control{width:20px;height:20px;border-radius:6px;border:2px solid #e5e7eb;background:#fff;display:inline-flex;align-items:center;justify-content:center;transition:background .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease;box-shadow:0 2px 6px rgba(15,23,42,.12)}.builder-checkbox__control::after{content:"";width:6px;height:12px;border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0);transform:rotate(45deg) scale(0);transform-origin:center;transition:transform .2s ease,border-color .2s ease}.builder-checkbox__label:hover .builder-checkbox__control{transform:translateY(-1px)}.builder-checkbox__native:focus-visible+.builder-checkbox__control{box-shadow:0 0 0 3px rgba(79,70,229,.3)}.builder-checkbox__native:checked+.builder-checkbox__control{background:linear-gradient(135deg, #1f2937, #4f46e5);border-color:rgba(0,0,0,0);box-shadow:0 6px 14px rgba(79,70,229,.35)}.builder-checkbox__native:checked+.builder-checkbox__control::after{border-color:#fff;transform:rotate(45deg) scale(1)}.builder-checkbox__text{font-size:14px;line-height:1.4}.builder-checkbox__helper{font-size:12px;color:#6b7280;margin-left:30px}.builder-checkbox--disabled{opacity:.6}.builder-checkbox--disabled .builder-checkbox__label{cursor:not-allowed}.editor-tabs{display:flex;gap:8px;border-bottom:1px solid #e5e7eb}.editor-tab{cursor:pointer;border:1px solid rgba(0,0,0,0);border-top-left-radius:4px;border-top-right-radius:4px;color:#111827;padding:8px 12px;display:inline-flex;align-items:center;white-space:nowrap}.editor-tab__label{display:inline-flex;align-items:center;white-space:nowrap;line-height:1.2;font-size:clamp(.85rem,.9rem + .2vw,1rem)}.editor-tab--active{background:#fff;border-color:#e5e7eb #e5e7eb #fff #e5e7eb}.editor-panels{padding:12px}.editor-panels.editor-panels-debug{padding:0}.jer-editor-container{padding-left:0 !important;padding-right:0 !important}.editor-panel{display:none}.editor-panel--active{display:block}.editor-header{display:flex;align-items:center;gap:12px;padding:0 16px;height:60px;background:#f3f4f6;border-bottom:1px solid #e5e7eb}.editor-header__title{color:#111827;font-weight:600}.editor-header__devices{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.25) rgba(0,0,0,0)}.editor-header__devices::-webkit-scrollbar{width:8px;height:4px}.editor-header__devices{display:flex;flex-direction:row;align-items:stretch;gap:8px;overflow:auto;height:60px;padding:4px}.editor-device-button{position:relative;min-width:160px;height:100%;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#111827;cursor:pointer;font-size:12px}.editor-device-button.editor-device-button--selected{border-color:#000}.editor-device-button img{position:absolute;bottom:4px;right:4px;width:16px;height:16px}.editor-header__actions{margin-left:auto;display:flex;align-items:center;gap:8px}.editor-button{display:inline-flex;align-items:center;justify-content:center;height:36px;min-width:120px;padding:0 12px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#111827;cursor:pointer}.debug-button{min-width:auto;height:auto;padding:4px 12px;font-size:12px;line-height:1.2;border-radius:999px;background:hsla(0,0%,100%,.95);border-color:rgba(15,23,42,.15);box-shadow:0 2px 4px rgba(15,23,42,.08)}.debug-button:hover{background:#fff;border-color:rgba(15,23,42,.3)}.editor-button:disabled{opacity:.6;cursor:default}.editor-save-button,.editor-save-previewconfig-button{color:#000;font-weight:600;font-size:12px}.builder__add-button{width:100%;margin-top:12px;min-height:52px;border-style:dashed;border-color:#cbd5f5;background:#f8fafc;color:#0f172a;font-weight:600;gap:10px;transition:border-color .2s ease,background .2s ease,color .2s ease}.builder__add-button-icon{display:inline-flex;width:28px;height:28px;border-radius:999px;align-items:center;justify-content:center;background:#2563eb;color:#fff;font-size:18px;line-height:1}.builder__add-button:hover{border-color:#94a3b8;background:#eef2ff;color:#111827}.side-tool{display:flex;flex-direction:column;gap:4px;padding:4px;border-radius:4px;border:1px solid #e5e7eb;font-size:11px;max-width:220px}.side-tool select{width:100%;font-size:11px;padding:4px 6px}.side-tool .debug-button{border-radius:0;width:100%;justify-content:center}.attributes-editor__component-meta{margin-bottom:20px;padding:12px 16px;border-radius:8px;border:1px solid #eee;background:#f8f8f8}.attributes-editor__component-title,.attributes-editor__field-label{margin:0;font-weight:700}.attributes-editor__component-title{font-size:18px;text-transform:capitalize}.attributes-editor__component-description{margin:6px 0 0;font-size:14px;color:#555}.attributes-editor__tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.attributes-editor__tab-button{padding:6px 12px;border-radius:6px;border:1px solid #ddd;background:#fff;color:#222;cursor:pointer;font-weight:600;transition:background .15s ease,color .15s ease}.attributes-editor__tab-button:disabled{opacity:.4;cursor:default}.attributes-editor__tab-button--active{background:#222;color:#fff}.attributes-editor__field-wrapper{position:relative;margin-bottom:16px;display:flex;flex-direction:column;gap:4px;width:100%}.attributes-editor__field-wrapper--boolean{flex-direction:row;align-items:center;gap:8px}.attributes-editor__field-label{font-size:14px}.attributes-editor__empty-state{padding:8px;opacity:.7}.attributes-editor__size-grid{display:flex;gap:12px;flex-wrap:wrap}.attributes-editor__size-grid-item{flex:1;min-width:140px;max-width:220px}.attributes-editor__size-field{display:flex;gap:6px;align-items:center;width:100%}.attributes-editor__size-field-input{flex:1;min-width:0;height:36px;line-height:36px}.attributes-editor__size-field-select{flex:0 0 72px;min-width:60px;height:36px;line-height:36px;padding-inline:6px}.field-info-tooltip{position:relative}.field-info-tooltip__trigger{position:absolute;top:0;right:0;font-size:11px;line-height:1.2;color:#666;cursor:pointer;font-weight:600;white-space:nowrap;text-transform:uppercase;letter-spacing:.5px;background:rgba(0,0,0,0);border:none;padding:0;font-family:inherit;display:inline-flex;align-items:center;gap:4px}.field-info-tooltip__trigger:focus-visible{outline:2px solid rgba(17,24,39,.4);outline-offset:2px}.field-info-tooltip__bubble{position:absolute;top:50%;right:100%;transform:translate(-8px, -50%);background:#111;color:#fff;padding:6px 10px;border-radius:4px;font-size:12px;line-height:1.4;width:220px;text-align:left;box-shadow:0 6px 16px rgba(0,0,0,.2);z-index:20;opacity:0;pointer-events:none;transition:opacity .15s ease,transform .15s ease}.field-info-tooltip__bubble--visible{opacity:1;transform:translate(-12px, -50%)}.special-category-section{border:1px solid #e0e0e0;border-radius:8px;padding:12px;margin-bottom:16px;background:#fdfdfd}.special-category-section__header{display:flex;justify-content:space-between;align-items:center;gap:8px}.special-category-section__title{margin:0;font-weight:700}.special-category-section__toggle{border:1px solid #ddd;background:#fff;color:#222;border-radius:4px;padding:4px 10px;cursor:pointer;font-weight:600;transition:background .15s ease,color .15s ease,border-color .15s ease}.special-category-section__toggle[data-active=true]{background:#222;color:#fff;border-color:#222}.special-category-section__description{margin:8px 0 0;color:#666;font-size:13px;padding-bottom:16px}.special-category-section__fields{display:grid;gap:8px;margin-top:12px}.special-category-section__fields--box{grid-template-columns:repeat(2, minmax(0, 1fr));grid-template-areas:"top top" "left right" "bottom bottom"}.special-category-section__fields--box>.field-info-tooltip:has([data-field-slot=top]){grid-area:top}.special-category-section__fields--box>.field-info-tooltip:has([data-field-slot=left]){grid-area:left}.special-category-section__fields--box>.field-info-tooltip:has([data-field-slot=right]){grid-area:right}.special-category-section__fields--box>.field-info-tooltip:has([data-field-slot=bottom]){grid-area:bottom}@media(max-width: 1400px){.special-category-section__fields--box{grid-template-columns:minmax(0, 1fr);grid-template-areas:"top" "left" "right" "bottom"}}.special-category-section__field{min-width:0}.special-category-section__placeholder{margin-top:8px;font-style:italic;opacity:.7}.mockos-router{width:100%;height:100%;position:relative}.mockos-screen{width:100%;height:100%}.mockos-screen--center{display:flex;flex-direction:column;align-items:center;justify-content:center}.mockos-screen--launchscreen{background-color:#000}.mockos-screen--home{padding:20px;background-color:#f5f5f5}.mockos-screen--onboard{padding:20px;background-color:#fff}.mockos-screen--subscription{padding:20px;background-color:#fff}.mockos-screen__title{font-size:32px;font-weight:bold;color:#000;margin-bottom:16px}.mockos-screen__subtitle{font-size:16px;color:#666}.mockos-screen__heading{font-size:24px;font-weight:bold;margin-bottom:20px}.mockos-screen__text{font-size:16px;color:#333;margin-bottom:12px}.mockos-screen__plan{padding:16px;border-radius:8px;text-align:center;margin-bottom:12px}.mockos-screen__plan--premium{background-color:#007aff;color:#fff}.mockos-screen__plan--basic{background-color:#e5e5e5;color:#333}.mockos-launcher{width:100%;height:100%;padding:40px 20px;display:flex;flex-direction:column}.mockos-launcher__grid{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;padding:20px}.mockos-launcher__app{display:flex;flex-direction:column;align-items:center;gap:8px;background:rgba(0,0,0,0);border:none;cursor:pointer;padding:8px;border-radius:12px;transition:background-color .2s}.mockos-launcher__app:hover{background-color:hsla(0,0%,100%,.1)}.mockos-launcher__app:active{transform:scale(0.95)}.mockos-launcher__app-icon{width:60px;height:60px;border-radius:13px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.3)}.mockos-launcher__app-icon svg{width:100%;height:100%;display:block}.mockos-launcher__app-name{font-size:12px;color:#fff;text-align:center;max-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.modal{position:fixed;inset:0;z-index:10000}.modal__overlay{position:absolute;inset:0;background:rgba(0,0,0,.4);z-index:0}.modal__content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);background:#fff;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.12);width:min(960px,100vw - 40px);max-height:calc(100vh - 120px);display:flex;flex-direction:column;overflow:hidden;z-index:1}.modal__header{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;border-bottom:1px solid #e5e7eb;gap:12px}.modal__title{margin:0;font-size:16px;font-weight:700}.add-component-modal{display:flex;flex-direction:column;height:100%}.add-component-modal__body{flex:1;overflow-y:auto;padding-bottom:24px}.add-component-modal__section{padding:0 24px;margin-bottom:24px}.add-component-modal__section:first-of-type{margin-top:24px}.add-component-modal__section-title{font-size:16px;font-weight:600;margin-bottom:12px}.add-component-modal__toggle{display:flex;align-items:center;gap:12px;margin:0 24px 24px;padding:12px 0;font-weight:500;user-select:none}.add-component-modal__toggle input{width:18px;height:18px}.add-component-modal__group{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px;box-shadow:0 10px 20px rgba(15,23,42,.05)}.add-component-modal__group-title{font-size:14px;font-weight:600;color:#6b7280;margin-bottom:12px}.add-component-modal__grid{padding:16px;display:grid;grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));gap:12px;overflow:auto}.add-component-modal__card{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid #e5e7eb;border-radius:10px;background:#f3f4f6;cursor:pointer;text-align:left;transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease;color:inherit}.add-component-modal__card:hover{border-color:#2563eb;box-shadow:0 10px 25px rgba(37,99,235,.15);transform:translateY(-2px)}.add-component-modal__thumbnail{width:100%;aspect-ratio:4/3;border-radius:8px;background:#f3f4f6;border:1px dashed #e5e7eb;display:flex;align-items:center;justify-content:center;color:#2563eb;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.05em}.add-component-modal__title{font-weight:600;color:#111827}.add-component-modal__empty{margin:12px 0;padding:16px;border:1px dashed #e5e7eb;border-radius:10px;color:#6b7280;font-size:14px;text-align:center}.device-selector-modal{padding-bottom:24px}.device-selector-modal__grid{padding:24px;display:grid;grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));gap:12px;overflow:auto}.device-selector-modal__grid .editor-device-button{height:80px;min-width:unset}.color-modal{width:min(520px,100vw - 32px);max-height:90vh;padding:24px;display:flex;flex-direction:column;gap:16px;overflow-y:auto}.color-modal__selected{display:flex;align-items:center;justify-content:space-between;background:#f3f4f6;border-radius:8px;padding:12px 16px}.color-modal__selected-info{display:flex;align-items:center;gap:12px}.color-modal__selected-preview{width:32px;height:32px;border-radius:6px;border:1px solid rgba(0,0,0,.1)}.color-modal__selected-label{margin:0;font-size:12px;color:#6b7280}.color-modal__selected-value{margin:0;font-weight:600}.color-modal__toggle{display:flex;flex-direction:column;gap:6px;padding:0 8px}.color-modal__toggle-label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:#111827;cursor:pointer}.color-modal__toggle-input{width:16px;height:16px;accent-color:#2563eb}.color-modal__toggle-description{margin:0;font-size:12px;color:#6b7280}.color-modal__link-button{border:none;background:none;color:#2563eb;font-weight:600;font-size:13px;cursor:pointer;padding:4px 8px}.color-section{display:flex;flex-direction:column;gap:8px}.color-section__header{display:flex;align-items:center;justify-content:space-between;gap:8px}.color-section__title{margin:0;font-weight:600}.color-section__swatches{display:grid;grid-template-columns:repeat(auto-fill, minmax(120px, 1fr));gap:8px}.color-section__empty{margin:0;font-size:12px;color:#6b7280}.color-modal__swatch{border:1px solid #e5e7eb;border-radius:8px;padding:8px;background:#fff;display:flex;flex-direction:column;gap:6px;text-align:left;cursor:pointer;transition:border-color .2s ease,box-shadow .2s ease}.color-modal__swatch--active{border-color:#111827;box-shadow:0 0 0 1px #111827 inset}.color-modal__swatch-preview{width:100%;height:32px;border-radius:6px}.color-modal__swatch-preview--light{border:1px solid rgba(0,0,0,.1)}.color-modal__swatch-label{font-size:12px;font-weight:600;color:#111827}.color-modal__swatch-value{font-size:11px;color:#6b7280}.color-modal__input{display:none}.localication-modal__content{width:calc(100vw - 32px);height:calc(100vh - 32px);max-width:1600px;max-height:calc(100vh - 32px);padding:0;display:flex;flex-direction:column}.localication-modal__header{padding:16px 24px;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;gap:16px}.localication-modal__header-main{flex:1;display:flex;flex-direction:column;gap:4px}.localication-modal__description{margin:0;font-size:13px;color:#6b7280}.localication-modal__body{flex:1;min-height:0;padding:24px;display:flex;flex-direction:column;gap:16px;overflow:auto}.localication-modal__editor{flex:1;min-height:0;overflow:auto;border:1px solid #e5e7eb;border-radius:8px;background:#f3f4f6}.localication-modal__json-editor{height:100%;width:100%;display:block;padding:12px;overflow:auto}.modal--scrollable .localication-modal__content{overflow:hidden}.modal--scrollable .localication-modal__body{overflow:auto}.embla{max-width:48rem;margin:auto;--slide-height: 19rem;--slide-spacing: 1rem;--slide-size: 70%}.embla__viewport{overflow:hidden}.embla__container{display:flex;touch-action:pan-y pinch-zoom;margin-left:calc(var(--slide-spacing)*-1)}.embla__slide{transform:translate3d(0, 0, 0);min-width:0;padding-left:var(--slide-spacing);flex:0 0 100%}.embla__slide__number{box-shadow:inset 0 0 0 .2rem var(--detail-medium-contrast);border-radius:1.8rem;font-size:4rem;font-weight:600;display:flex;align-items:center;justify-content:center;height:var(--slide-height);user-select:none}.embla__controls{display:grid;grid-template-columns:auto 1fr;justify-content:space-between;gap:1.2rem;margin-top:1.8rem}.embla__buttons{display:grid;grid-template-columns:repeat(2, 1fr);gap:.6rem;align-items:center}.embla__button{-webkit-tap-highlight-color:rgba(var(--text-high-contrast-rgb-value), 0.5);-webkit-appearance:none;appearance:none;background-color:rgba(0,0,0,0);touch-action:manipulation;display:inline-flex;text-decoration:none;cursor:pointer;border:0;padding:0;margin:0;box-shadow:inset 0 0 0 .2rem var(--detail-medium-contrast);width:3.6rem;height:3.6rem;z-index:1;border-radius:50%;color:var(--text-body);display:flex;align-items:center;justify-content:center}.embla__button:disabled{color:var(--detail-high-contrast)}.embla__button__svg{width:35%;height:35%}.embla__dots{flex-wrap:wrap;margin-right:0;height:50px;margin:0 auto}.embla__dot{-webkit-tap-highlight-color:rgba(var(--text-high-contrast-rgb-value), 0.5);-webkit-appearance:none;appearance:none;background-color:rgba(0,0,0,0);touch-action:manipulation;display:inline-flex;text-decoration:none;cursor:pointer;border:0;padding:0;margin:0;width:2.6rem;height:2.6rem;display:flex;align-items:center;border-radius:50%}.embla__dot:after{box-shadow:inset 0 0 0 .2rem var(--detail-medium-contrast);width:1.4rem;height:1.4rem;border-radius:50%;display:flex;align-items:center;content:""}.embla__dot--selected:after{box-shadow:inset 0 0 0 .2rem var(--text-body)}.carousel-provider{height:100%}.embla{height:100%}.embla__viewport{height:100%;display:flex;flex-direction:column}.embla__container{flex:1}
@@ -1,10 +1,21 @@
1
1
  import { Node } from '../types/Node';
2
2
  import { AppConfig } from './PreviewConfig';
3
+ export type ProjectColorTokenMap = Record<string, string>;
4
+ export type ProjectThemeColors = {
5
+ light?: ProjectColorTokenMap;
6
+ dark?: ProjectColorTokenMap;
7
+ [themeName: string]: ProjectColorTokenMap | undefined;
8
+ };
9
+ export interface ProjectColors {
10
+ STATIC_COLORS?: ProjectColorTokenMap;
11
+ THEME_COLORS?: ProjectThemeColors;
12
+ }
3
13
  export interface ProjectBase<T> {
4
14
  name: string;
5
15
  version: string;
6
16
  data: T;
7
17
  appConfig?: AppConfig;
18
+ projectColors?: ProjectColors;
8
19
  }
9
20
  export interface Project extends ProjectBase<Node> {
10
21
  }
@@ -7,3 +7,4 @@ export declare function analyseNode(node: Node<NodeDefaultAttribute>): {
7
7
  valid: boolean;
8
8
  message?: string;
9
9
  };
10
+ export declare function analyseAndProccess(node: Node<NodeDefaultAttribute>): Node<NodeDefaultAttribute> | null;
@@ -1,3 +1,10 @@
1
1
  import type { NodeData } from '../types/Node';
2
2
  import type { TextPropsGenerated } from '../build-components/Text/TextProps.generated';
3
- export declare function extractTextStyle<T extends TextPropsGenerated['attributes']>(node: NodeData<T>): import("react").CSSProperties;
3
+ import type { AppConfig } from '../types/PreviewConfig';
4
+ import type { ProjectColors } from '../types/Project';
5
+ type ExtractTextStyleOptions = {
6
+ appConfig?: AppConfig;
7
+ projectColors?: ProjectColors;
8
+ };
9
+ export declare function extractTextStyle<T extends TextPropsGenerated['attributes']>(node: NodeData<T>, options?: ExtractTextStyleOptions): import("react").CSSProperties;
10
+ export {};
@@ -1,3 +1,10 @@
1
1
  import { ViewPropsGenerated } from '../build-components/View/ViewProps.generated';
2
2
  import type { NodeData } from '../types/Node';
3
- export declare function extractViewStyle<T extends ViewPropsGenerated['attributes']>(node: NodeData<T>): import("react").CSSProperties;
3
+ import type { AppConfig } from '../types/PreviewConfig';
4
+ import type { ProjectColors } from '../types/Project';
5
+ type ExtractViewStyleOptions = {
6
+ appConfig?: AppConfig;
7
+ projectColors?: ProjectColors;
8
+ };
9
+ export declare function extractViewStyle<T extends ViewPropsGenerated['attributes']>(node: NodeData<T>, options?: ExtractViewStyleOptions): import("react").CSSProperties;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { AppConfig } from '../types/PreviewConfig';
2
+ import type { ProjectColors } from '../types/Project';
3
+ export type ParseColorOptions = {
4
+ projectColors?: ProjectColors;
5
+ appConfig?: AppConfig;
6
+ };
7
+ export declare function parseColor(value?: string, options?: ParseColorOptions): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@developer_tribe/react-builder",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "restricted": true,
6
6
  "main": "dist/index.cjs.js",
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import { Node, NodeData, NodeDefaultAttribute } from './types/Node';
3
+ import type { ProjectColorTokenMap, ProjectColors } from './types/Project';
3
4
  import { isNodeString } from './utils/analyseNode';
4
5
  import { useLogRender } from './utils/useLogRender';
5
6
  import {
@@ -22,6 +23,7 @@ import useNode from './build-components/useNode';
22
23
  type AttributesEditorProps = {
23
24
  node: Node;
24
25
  onChange: (next: Node) => void;
26
+ projectColors?: ProjectColors;
25
27
  };
26
28
 
27
29
  type TabId = 'style' | 'container' | 'other';
@@ -50,15 +52,30 @@ type TabContentInfo = Record<
50
52
  }
51
53
  >;
52
54
 
53
- export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
55
+ export function AttributesEditor({
56
+ node,
57
+ onChange,
58
+ projectColors,
59
+ }: AttributesEditorProps) {
54
60
  useLogRender('AttributesEditor');
55
61
  if (!node || isNodeString(node)) return null;
56
62
 
57
63
  const baseData = node as NodeData<NodeDefaultAttribute>;
58
64
  const data = useNode(baseData);
59
65
  const appConfig = useRenderStore((state) => state.appConfig);
60
- const projectColors = useMemo(() => {
61
- const colors = new Set<string>();
66
+ const projectColorsForPicker = useMemo<ProjectColors | undefined>(() => {
67
+ if (projectColors) {
68
+ return projectColors;
69
+ }
70
+
71
+ const addColor = (collection: Set<string>, value?: string) => {
72
+ if (typeof value !== 'string') return;
73
+ const trimmed = value.trim();
74
+ if (!trimmed) return;
75
+ collection.add(trimmed);
76
+ };
77
+
78
+ const fallback = new Set<string>();
62
79
  const styles = [
63
80
  appConfig?.screenStyle?.light,
64
81
  appConfig?.screenStyle?.dark,
@@ -70,13 +87,21 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
70
87
  styles.forEach((style) => {
71
88
  ['backgroundColor', 'color', 'seperatorColor'].forEach((key) => {
72
89
  const value = style?.[key as keyof typeof style];
73
- if (typeof value === 'string' && value.trim()) {
74
- colors.add(value.trim());
75
- }
90
+ addColor(fallback, value);
76
91
  });
77
92
  });
78
- return Array.from(colors);
79
- }, [appConfig]);
93
+
94
+ if (fallback.size === 0) {
95
+ return undefined;
96
+ }
97
+
98
+ const fallbackRecord: ProjectColorTokenMap = {};
99
+ Array.from(fallback).forEach((color, index) => {
100
+ fallbackRecord[`FALLBACK_${index + 1}`] = color;
101
+ });
102
+
103
+ return { STATIC_COLORS: fallbackRecord };
104
+ }, [appConfig, projectColors]);
80
105
 
81
106
  const schema = getAttributeSchema(data?.type) ?? {};
82
107
  const attributeMeta = getAttributeMeta(data?.type);
@@ -114,11 +139,13 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
114
139
  [schema],
115
140
  );
116
141
 
117
- const componentMeta = useMemo(
118
- () => (data?.type ? getPatternByType(data.type)?.meta : undefined),
142
+ const patternForType = useMemo(
143
+ () => (data?.type ? getPatternByType(data.type) : undefined),
119
144
  [data?.type],
120
145
  );
121
146
 
147
+ const componentMeta = patternForType?.meta;
148
+
122
149
  const componentTitle = componentMeta?.label ?? data?.type ?? 'Component';
123
150
  const componentDescription = componentMeta?.description;
124
151
 
@@ -220,6 +247,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
220
247
 
221
248
  return buckets;
222
249
  }, [componentMeta?.specialCategories, specialGroups]);
250
+
223
251
  const handleAttributeChange = useCallback(
224
252
  (name: string, val: unknown) => {
225
253
  const next: NodeData<NodeDefaultAttribute> = {
@@ -234,6 +262,17 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
234
262
  [baseData, onChange],
235
263
  );
236
264
 
265
+ const handleChildrenChange = useCallback(
266
+ (val: string) => {
267
+ const next: NodeData<NodeDefaultAttribute> = {
268
+ ...baseData,
269
+ children: val,
270
+ };
271
+ onChange(next);
272
+ },
273
+ [baseData, onChange],
274
+ );
275
+
237
276
  const renderSpecialSection = useCallback(
238
277
  ({ key, entries: sectionEntries, meta }: SpecialSection) => {
239
278
  if (key === 'size') {
@@ -285,7 +324,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
285
324
  value={currentValue}
286
325
  onChange={(val) => handleAttributeChange(name, val)}
287
326
  componentType={data?.type}
288
- projectColors={projectColors}
327
+ projectColors={projectColorsForPicker}
289
328
  layoutContext={layoutContext}
290
329
  viewAttributes={viewAttributes}
291
330
  label={isBoolean ? label : undefined}
@@ -308,7 +347,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
308
347
  attributes={attributes}
309
348
  onAttributeChange={handleAttributeChange}
310
349
  componentType={data?.type}
311
- projectColors={projectColors}
350
+ projectColors={projectColorsForPicker}
312
351
  layoutContext={layoutContext}
313
352
  viewAttributes={viewAttributes}
314
353
  meta={meta}
@@ -321,7 +360,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
321
360
  data?.type,
322
361
  handleAttributeChange,
323
362
  layoutContext,
324
- projectColors,
363
+ projectColorsForPicker,
325
364
  viewAttributes,
326
365
  ],
327
366
  );
@@ -384,6 +423,27 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
384
423
 
385
424
  const activeSpecialSections = specialSectionsByTab[activeTab] ?? [];
386
425
 
426
+ const hasStringChildren =
427
+ !!patternForType?.pattern &&
428
+ (patternForType.pattern as { children?: unknown }).children === 'string';
429
+
430
+ const childrenValue =
431
+ typeof (baseData.children as unknown) === 'string'
432
+ ? (baseData.children as string)
433
+ : '';
434
+
435
+ const childrenSection = hasStringChildren ? (
436
+ <div className="attributes-editor__field-wrapper attributes-editor__field-wrapper--children">
437
+ <p className="attributes-editor__field-label">Text</p>
438
+ <input
439
+ type="text"
440
+ className="attributes-editor__text-input"
441
+ value={childrenValue}
442
+ onChange={(e) => handleChildrenChange(e.target.value)}
443
+ />
444
+ </div>
445
+ ) : null;
446
+
387
447
  const tabsSection = (
388
448
  <div className="attributes-editor__tabs">
389
449
  {tabs.map((tab) => {
@@ -418,6 +478,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
418
478
  <div className="attributes-editor">
419
479
  {headerSection}
420
480
  {tabsSection}
481
+ {childrenSection}
421
482
  {activeSpecialSections.map(renderSpecialSection)}
422
483
  <div className="attributes-editor__empty-state">
423
484
  No editable attributes
@@ -430,6 +491,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
430
491
  <div className="attributes-editor">
431
492
  {headerSection}
432
493
  {tabsSection}
494
+ {childrenSection}
433
495
  {activeSpecialSections.map(renderSpecialSection)}
434
496
 
435
497
  {activeEntries.map(({ name, type }) => {
@@ -455,7 +517,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
455
517
  value={attributes?.[name]}
456
518
  onChange={(val) => handleAttributeChange(name, val)}
457
519
  componentType={data?.type}
458
- projectColors={projectColors}
520
+ projectColors={projectColorsForPicker}
459
521
  layoutContext={layoutContext}
460
522
  viewAttributes={viewAttributes}
461
523
  label={isBoolean ? label : undefined}
@@ -1,5 +1,6 @@
1
+ import { useEffect, useRef } from 'react';
1
2
  import { DeviceMockFrame } from './DeviceMockFrame';
2
- import { Node } from './types/Node';
3
+ import { Node, NodeData } from './types/Node';
3
4
  import { RenderNode } from './build-components';
4
5
  import { useRenderStore } from './store';
5
6
  import { useLogRender } from './utils/useLogRender';
@@ -10,10 +11,85 @@ export type ScreenStyle = {
10
11
  interface RenderPageProps {
11
12
  data: Node;
12
13
  name: string;
14
+ onSelectNode?: (node: Node | null) => void;
13
15
  }
14
- export function RenderPage({ data, name }: RenderPageProps) {
16
+
17
+ function findNodeByKeyNested(node: Node, key: string): Node | null {
18
+ if (node === null || node === undefined) {
19
+ return null;
20
+ }
21
+
22
+ if (typeof node === 'string') {
23
+ return null;
24
+ }
25
+
26
+ if (Array.isArray(node)) {
27
+ for (const child of node) {
28
+ const found = findNodeByKeyNested(child, key);
29
+ if (found) {
30
+ return found;
31
+ }
32
+ }
33
+ return null;
34
+ }
35
+
36
+ const recordData = node as NodeData;
37
+ if (recordData.key === key) {
38
+ return recordData;
39
+ }
40
+
41
+ if (recordData.children) {
42
+ return findNodeByKeyNested(recordData.children as Node, key);
43
+ }
44
+
45
+ return null;
46
+ }
47
+
48
+ export function RenderPage({ data, name, onSelectNode }: RenderPageProps) {
15
49
  useLogRender('RenderPage');
16
- const { device } = useRenderStore((s) => ({ device: s.device }));
50
+ const { device, previewMode, setCurrent } = useRenderStore((s) => ({
51
+ device: s.device,
52
+ previewMode: s.previewMode,
53
+ setCurrent: s.setCurrent,
54
+ }));
55
+ const previewRootRef = useRef<HTMLDivElement | null>(null);
56
+
57
+ useEffect(() => {
58
+ if (!previewMode) {
59
+ return;
60
+ }
61
+
62
+ const root = previewRootRef.current;
63
+ if (!root) return;
64
+
65
+ const handleClick = (event: MouseEvent) => {
66
+ const target = event.target as HTMLElement | null;
67
+ if (!target) return;
68
+
69
+ // Ignore clicks on carousel dots to avoid interfering with navigation
70
+ if (target.closest('.embla__dot')) {
71
+ return;
72
+ }
73
+
74
+ const element = target.closest('[attribute-key]') as HTMLElement | null;
75
+ if (!element) return;
76
+
77
+ const key = element.getAttribute('attribute-key');
78
+
79
+ if (!key) return;
80
+
81
+ const node = findNodeByKeyNested(data, key);
82
+ setCurrent(node);
83
+ onSelectNode?.(node);
84
+ };
85
+
86
+ root.addEventListener('click', handleClick);
87
+
88
+ return () => {
89
+ root.removeEventListener('click', handleClick);
90
+ };
91
+ }, [previewMode, data, onSelectNode, setCurrent]);
92
+
17
93
  const screenPreviewHeight = 800;
18
94
  // The calculation is correct for maintaining the aspect ratio of the target screen size.
19
95
  // It scales the width proportionally to a fixed preview height.
@@ -23,7 +99,9 @@ export function RenderPage({ data, name }: RenderPageProps) {
23
99
 
24
100
  return (
25
101
  <DeviceMockFrame appName={name}>
26
- <RenderNode node={data} />
102
+ <div ref={previewRootRef}>
103
+ <RenderNode node={data} />
104
+ </div>
27
105
  </DeviceMockFrame>
28
106
  );
29
107
  }
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import type { ViewPropsGenerated } from '../build-components/View/ViewProps.generated';
3
- import { ColorModal } from '../modals/ColorModal';
3
+ import { ColorModal, resolveProjectColorValue } from '../modals/ColorModal';
4
+ import type { ProjectColors } from '../types/Project';
4
5
  import {
5
6
  getArrayItemType,
6
7
  getTypeSchema,
@@ -16,7 +17,7 @@ export type FieldProps = {
16
17
  value: any;
17
18
  onChange: (v: any) => void;
18
19
  componentType?: string;
19
- projectColors?: string[];
20
+ projectColors?: ProjectColors;
20
21
  layoutContext?: LayoutContext;
21
22
  viewAttributes?: Partial<ViewPropsGenerated['attributes']>;
22
23
  label?: React.ReactNode;
@@ -441,16 +442,22 @@ export function Field({
441
442
  type ColorPickerButtonProps = {
442
443
  value?: string;
443
444
  onChange: (color?: string) => void;
444
- projectColors?: string[];
445
+ projectColors?: ProjectColors;
445
446
  };
446
447
 
447
448
  function ColorPickerButton({
448
449
  value,
449
450
  onChange,
450
- projectColors = [],
451
+ projectColors,
451
452
  }: ColorPickerButtonProps) {
452
453
  const [isOpen, setIsOpen] = useState(false);
453
454
  const normalizedValue = typeof value === 'string' ? value : undefined;
455
+ const previewColor = useMemo(
456
+ () =>
457
+ resolveProjectColorValue(normalizedValue, projectColors) ??
458
+ normalizedValue,
459
+ [normalizedValue, projectColors],
460
+ );
454
461
 
455
462
  return (
456
463
  <>
@@ -477,7 +484,7 @@ function ColorPickerButton({
477
484
  height: 32,
478
485
  borderRadius: 6,
479
486
  border: '1px solid rgba(0,0,0,0.1)',
480
- background: normalizedValue ?? 'transparent',
487
+ background: previewColor ?? 'transparent',
481
488
  }}
482
489
  />
483
490
  <span style={{ flex: 1, textAlign: 'left', fontWeight: 500 }}>
@@ -1,5 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import { NodeDefaultAttribute } from '../types/Node';
3
+ import type { ProjectColors } from '../types/Project';
3
4
  import { Field } from './Field';
4
5
  import { FieldInfoTooltip } from './FieldInfoTooltip';
5
6
  import {
@@ -16,7 +17,7 @@ type SpecialCategorySectionProps = {
16
17
  attributes: NodeDefaultAttribute;
17
18
  onAttributeChange: (name: string, value: unknown) => void;
18
19
  componentType?: string;
19
- projectColors?: string[];
20
+ projectColors?: ProjectColors;
20
21
  layoutContext?: LayoutContext;
21
22
  viewAttributes?: NodeDefaultAttribute;
22
23
  meta?: {