@developer_tribe/react-builder 1.0.2 → 1.0.4

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 (147) hide show
  1. package/dist/AttributesEditor.d.ts +3 -1
  2. package/dist/RenderPage.d.ts +2 -1
  3. package/dist/android.svg +43 -0
  4. package/dist/apple.svg +16 -0
  5. package/dist/attributes-editor/Field.d.ts +4 -2
  6. package/dist/attributes-editor/SizeField.d.ts +9 -0
  7. package/dist/attributes-editor/SpecialCategorySection.d.ts +2 -1
  8. package/dist/build-components/BackgroundImage/BackgroundImage.d.ts +5 -0
  9. package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +45 -0
  10. package/dist/build-components/Button/ButtonProps.generated.d.ts +8 -0
  11. package/dist/build-components/Carousel/CarouselProps.generated.d.ts +8 -0
  12. package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +8 -0
  13. package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +8 -0
  14. package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +8 -0
  15. package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +8 -0
  16. package/dist/build-components/Image/ImageProps.generated.d.ts +8 -0
  17. package/dist/build-components/Onboard/OnboardProps.generated.d.ts +8 -0
  18. package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +8 -1
  19. package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +8 -0
  20. package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +9 -3
  21. package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +8 -0
  22. package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +9 -1
  23. package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +8 -0
  24. package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +8 -1
  25. package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +8 -0
  26. package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +8 -0
  27. package/dist/build-components/Text/TextProps.generated.d.ts +8 -0
  28. package/dist/build-components/View/ViewProps.generated.d.ts +8 -0
  29. package/dist/build-components/index.d.ts +2 -1
  30. package/dist/build-components/patterns.generated.d.ts +1612 -46
  31. package/dist/components/AttributesEditorPanel.d.ts +3 -4
  32. package/dist/components/Builder.d.ts +2 -1
  33. package/dist/components/BuilderButton.d.ts +9 -0
  34. package/dist/components/JsonTextEditor.d.ts +9 -0
  35. package/dist/index.cjs.js +5 -5
  36. package/dist/index.cjs.js.map +1 -1
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.esm.js +5 -5
  39. package/dist/index.esm.js.map +1 -1
  40. package/dist/modals/ColorModal.d.ts +3 -1
  41. package/dist/pages/ProjectPage.d.ts +3 -3
  42. package/dist/pages/tabs/BuilderPanel.d.ts +8 -0
  43. package/dist/pages/tabs/SideTool.d.ts +8 -0
  44. package/dist/store.d.ts +9 -1
  45. package/dist/styles.css +1 -1
  46. package/dist/types/Project.d.ts +11 -0
  47. package/dist/utils/analyseNode.d.ts +1 -0
  48. package/dist/utils/extractImageStyle.d.ts +2 -1
  49. package/dist/utils/extractTextStyle.d.ts +8 -1
  50. package/dist/utils/extractViewStyle.d.ts +7 -1
  51. package/dist/utils/parseColor.d.ts +7 -0
  52. package/dist/utils/selection.d.ts +7 -0
  53. package/dist/utils/useMergedStyle.d.ts +2 -0
  54. package/package.json +2 -5
  55. package/src/.DS_Store +0 -0
  56. package/src/AttributesEditor.tsx +83 -16
  57. package/src/RenderPage.tsx +86 -4
  58. package/src/attributes-editor/Field.tsx +60 -165
  59. package/src/attributes-editor/SizeField.tsx +184 -0
  60. package/src/attributes-editor/SpecialCategorySection.tsx +12 -4
  61. package/src/build-components/BackgroundImage/BackgroundImage.tsx +77 -0
  62. package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +61 -0
  63. package/src/build-components/BackgroundImage/pattern.json +45 -0
  64. package/src/build-components/Button/Button.tsx +29 -4
  65. package/src/build-components/Button/ButtonProps.generated.ts +8 -0
  66. package/src/build-components/Carousel/Carousel.tsx +25 -3
  67. package/src/build-components/Carousel/CarouselProps.generated.ts +8 -0
  68. package/src/build-components/CarouselButtons/CarouselButtons.tsx +19 -4
  69. package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +8 -0
  70. package/src/build-components/CarouselDots/CarouselDots.tsx +13 -4
  71. package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +8 -0
  72. package/src/build-components/CarouselItem/CarouselItem.tsx +20 -4
  73. package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +8 -0
  74. package/src/build-components/CarouselProvider/CarouselProvider.tsx +14 -3
  75. package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +8 -0
  76. package/src/build-components/Image/Image.tsx +27 -9
  77. package/src/build-components/Image/ImageProps.generated.ts +8 -0
  78. package/src/build-components/Image/pattern.json +1 -9
  79. package/src/build-components/Onboard/Onboard.tsx +2 -2
  80. package/src/build-components/Onboard/OnboardProps.generated.ts +8 -0
  81. package/src/build-components/OnboardButton/OnboardButton.tsx +11 -7
  82. package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +8 -1
  83. package/src/build-components/OnboardButtons/OnboardButtons.tsx +17 -5
  84. package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +8 -0
  85. package/src/build-components/OnboardDot/OnboardDot.tsx +68 -39
  86. package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +9 -3
  87. package/src/build-components/OnboardDot/pattern.json +3 -19
  88. package/src/build-components/OnboardFooter/OnboardFooter.tsx +37 -14
  89. package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +8 -0
  90. package/src/build-components/OnboardImage/OnboardImage.tsx +28 -6
  91. package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +9 -1
  92. package/src/build-components/OnboardItem/OnboardItem.tsx +15 -14
  93. package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +8 -0
  94. package/src/build-components/OnboardProvider/OnboardProvider.tsx +35 -20
  95. package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +8 -1
  96. package/src/build-components/OnboardProvider/pattern.json +0 -8
  97. package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +8 -0
  98. package/src/build-components/OnboardSubtitle/pattern.json +1 -1
  99. package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +8 -0
  100. package/src/build-components/OnboardTitle/pattern.json +1 -1
  101. package/src/build-components/RenderNode.generated.tsx +3 -0
  102. package/src/build-components/Text/Text.tsx +28 -10
  103. package/src/build-components/Text/TextProps.generated.ts +8 -0
  104. package/src/build-components/View/View.tsx +25 -3
  105. package/src/build-components/View/ViewProps.generated.ts +8 -0
  106. package/src/build-components/View/pattern.json +67 -1
  107. package/src/build-components/index.ts +5 -0
  108. package/src/build-components/patterns.generated.ts +1620 -46
  109. package/src/components/AttributesEditorPanel.tsx +13 -6
  110. package/src/components/Builder.tsx +200 -56
  111. package/src/components/BuilderButton.tsx +127 -0
  112. package/src/components/DeviceNavigationBar.tsx +0 -1
  113. package/src/components/EditorHeader.tsx +11 -1
  114. package/src/components/JsonTextEditor.tsx +185 -0
  115. package/src/index.ts +2 -2
  116. package/src/mockOS/components/MockOSRouter.tsx +17 -3
  117. package/src/mockOS/context/MockOSContext.tsx +0 -5
  118. package/src/mockOS/managers/mockPermissionManager.ts +0 -4
  119. package/src/mockOS/managers/navigationManager.ts +1 -6
  120. package/src/modals/ColorModal.tsx +306 -71
  121. package/src/modals/LocalicationModal.tsx +4 -5
  122. package/src/modals/Modal.tsx +8 -1
  123. package/src/pages/ProjectPage.tsx +299 -55
  124. package/src/pages/tabs/{BuilderTab.tsx → BuilderPanel.tsx} +13 -9
  125. package/src/pages/tabs/SideTool.tsx +260 -0
  126. package/src/size-matters/index.ts +6 -0
  127. package/src/store.ts +18 -1
  128. package/src/styles/base/_global.scss +163 -7
  129. package/src/styles/components/_attributes-editor.scss +12 -0
  130. package/src/styles/components/_editor-shell.scss +25 -0
  131. package/src/styles/foundation/_sizes.scss +1 -1
  132. package/src/styles/layout/_builder.scss +66 -10
  133. package/src/styles/modals/_color-modal.scss +59 -1
  134. package/src/styles/utilities/_carousel.scss +9 -8
  135. package/src/types/Project.ts +14 -0
  136. package/src/utils/analyseNode.ts +98 -0
  137. package/src/utils/extractImageStyle.ts +3 -6
  138. package/src/utils/extractTextStyle.ts +19 -82
  139. package/src/utils/extractViewStyle.ts +41 -12
  140. package/src/utils/parseColor.ts +43 -0
  141. package/src/utils/selection.ts +24 -0
  142. package/src/utils/useMergedStyle.ts +16 -0
  143. package/dist/pages/tabs/BuilderTab.d.ts +0 -9
  144. package/dist/pages/tabs/DebugTab.d.ts +0 -7
  145. package/dist/pages/tabs/PreviewTab.d.ts +0 -3
  146. package/src/pages/tabs/DebugTab.tsx +0 -64
  147. 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 {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Node } from '../..';
3
+ type SideToolProps = {
4
+ data: Node;
5
+ setData: React.Dispatch<React.SetStateAction<Node>>;
6
+ };
7
+ export declare function SideTool({ data, setData }: SideToolProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
package/dist/store.d.ts CHANGED
@@ -1,14 +1,22 @@
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;
10
+ forceRender: number;
11
+ incForceRender: () => void;
8
12
  device: Device;
9
13
  setDevice: (device: Device) => void;
10
14
  appConfig: AppConfig;
11
15
  setAppConfig: (appConfig: AppConfig) => void;
16
+ projectColors?: ProjectColors;
17
+ setProjectColors: (projectColors?: ProjectColors) => void;
18
+ previewMode: boolean;
19
+ setPreviewMode: (previewMode: boolean) => void;
12
20
  logs: LogEntry[];
13
21
  logLevel: LogLevel;
14
22
  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)}.rb-node-selected{border:1px solid #2684ff}.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;height:100%;max-width:220px;gap:4px;padding:4px;border-radius:4px;border:1px solid #e5e7eb;font-size:11xpx;background:#fff}.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-modal__add-color{position:relative;display:inline-flex;align-items:center}.color-modal__add-color-input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%;border:0;padding:0;margin:0}.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{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;opacity:0}.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}.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);--embla-dot-color: var(--detail-medium-contrast);touch-action:manipulation;display:inline-flex;text-decoration:none;cursor:pointer;border:0;padding:0;margin:0;width:max(2.6rem,var(--embla-dot-size, 1.4rem) + 1.2rem);height:max(2.6rem,var(--embla-dot-size, 1.4rem) + 1.2rem);display:flex;align-items:center;border-radius:50%}.embla__dot:after{background-color:var(--embla-dot-color);width:var(--embla-dot-size, 1.4rem);height:var(--embla-dot-size, 1.4rem);border-radius:50%;display:flex;align-items:center;content:""}.embla__dot--selected{--embla-dot-color: 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,4 @@
1
1
  import { ImagePropsGenerated } from '../build-components/Image/ImageProps.generated';
2
2
  import type { NodeData } from '../types/Node';
3
- export declare function extractImageStyle<T extends ImagePropsGenerated['attributes']>(node: NodeData<T>): import("react").CSSProperties;
3
+ import { ExtractViewStyleOptions } from './extractViewStyle';
4
+ export declare function extractImageStyle<T extends ImagePropsGenerated['attributes']>(node: NodeData<T>, options?: ExtractViewStyleOptions): import("react").CSSProperties;
@@ -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,9 @@
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
+ export 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;
@@ -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;
@@ -0,0 +1,7 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const SELECTED_OUTLINE_STYLE: CSSProperties;
3
+ export declare function isNodeSelected(args: {
4
+ previewMode: boolean;
5
+ current?: unknown;
6
+ node?: unknown;
7
+ }): boolean;
@@ -0,0 +1,2 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare function useMergedStyle(base?: CSSProperties, override?: CSSProperties): CSSProperties;
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.4",
4
4
  "type": "module",
5
5
  "restricted": true,
6
6
  "main": "dist/index.cjs.js",
@@ -35,7 +35,6 @@
35
35
  "@rollup/plugin-json": "^6.1.0",
36
36
  "@rollup/plugin-node-resolve": "^16.0.1",
37
37
  "@rollup/plugin-url": "^8.0.2",
38
- "@svgr/rollup": "^8.1.0",
39
38
  "@types/node": "^22.7.4",
40
39
  "@types/react": "^18.3.9",
41
40
  "@types/react-dom": "^18.3.0",
@@ -44,7 +43,6 @@
44
43
  "eslint-plugin-react": "^7.37.5",
45
44
  "eslint-plugin-react-hooks": "^5.2.0",
46
45
  "globals": "^16.4.0",
47
- "json-edit-react": "^1.29.0",
48
46
  "lottie-react": "^2.4.1",
49
47
  "prettier": "^3.6.2",
50
48
  "react": "^18.3.1",
@@ -67,8 +65,7 @@
67
65
  "react-router-dom": ">=6.0.0"
68
66
  },
69
67
  "optionalDependencies": {
70
- "embla-carousel-react": ">=8.6.0",
71
- "json-edit-react": ">=1.29.0"
68
+ "embla-carousel-react": ">=8.6.0"
72
69
  },
73
70
  "engines": {
74
71
  "node": ">=18"
package/src/.DS_Store ADDED
Binary file
@@ -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 {
@@ -10,6 +11,7 @@ import {
10
11
  import { useRenderStore } from './store';
11
12
  import { Field } from './attributes-editor/Field';
12
13
  import { SpecialCategorySection } from './attributes-editor/SpecialCategorySection';
14
+ import { toPreferredScale } from './attributes-editor/SizeField';
13
15
  import {
14
16
  LayoutContext,
15
17
  SchemaEntry,
@@ -22,6 +24,7 @@ import useNode from './build-components/useNode';
22
24
  type AttributesEditorProps = {
23
25
  node: Node;
24
26
  onChange: (next: Node) => void;
27
+ projectColors?: ProjectColors;
25
28
  };
26
29
 
27
30
  type TabId = 'style' | 'container' | 'other';
@@ -50,15 +53,30 @@ type TabContentInfo = Record<
50
53
  }
51
54
  >;
52
55
 
53
- export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
56
+ export function AttributesEditor({
57
+ node,
58
+ onChange,
59
+ projectColors,
60
+ }: AttributesEditorProps) {
54
61
  useLogRender('AttributesEditor');
55
62
  if (!node || isNodeString(node)) return null;
56
63
 
57
64
  const baseData = node as NodeData<NodeDefaultAttribute>;
58
65
  const data = useNode(baseData);
59
66
  const appConfig = useRenderStore((state) => state.appConfig);
60
- const projectColors = useMemo(() => {
61
- const colors = new Set<string>();
67
+ const projectColorsForPicker = useMemo<ProjectColors | undefined>(() => {
68
+ if (projectColors) {
69
+ return projectColors;
70
+ }
71
+
72
+ const addColor = (collection: Set<string>, value?: string) => {
73
+ if (typeof value !== 'string') return;
74
+ const trimmed = value.trim();
75
+ if (!trimmed) return;
76
+ collection.add(trimmed);
77
+ };
78
+
79
+ const fallback = new Set<string>();
62
80
  const styles = [
63
81
  appConfig?.screenStyle?.light,
64
82
  appConfig?.screenStyle?.dark,
@@ -70,13 +88,21 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
70
88
  styles.forEach((style) => {
71
89
  ['backgroundColor', 'color', 'seperatorColor'].forEach((key) => {
72
90
  const value = style?.[key as keyof typeof style];
73
- if (typeof value === 'string' && value.trim()) {
74
- colors.add(value.trim());
75
- }
91
+ addColor(fallback, value);
76
92
  });
77
93
  });
78
- return Array.from(colors);
79
- }, [appConfig]);
94
+
95
+ if (fallback.size === 0) {
96
+ return undefined;
97
+ }
98
+
99
+ const fallbackRecord: ProjectColorTokenMap = {};
100
+ Array.from(fallback).forEach((color, index) => {
101
+ fallbackRecord[`FALLBACK_${index + 1}`] = color;
102
+ });
103
+
104
+ return { STATIC_COLORS: fallbackRecord };
105
+ }, [appConfig, projectColors]);
80
106
 
81
107
  const schema = getAttributeSchema(data?.type) ?? {};
82
108
  const attributeMeta = getAttributeMeta(data?.type);
@@ -114,11 +140,13 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
114
140
  [schema],
115
141
  );
116
142
 
117
- const componentMeta = useMemo(
118
- () => (data?.type ? getPatternByType(data.type)?.meta : undefined),
143
+ const patternForType = useMemo(
144
+ () => (data?.type ? getPatternByType(data.type) : undefined),
119
145
  [data?.type],
120
146
  );
121
147
 
148
+ const componentMeta = patternForType?.meta;
149
+
122
150
  const componentTitle = componentMeta?.label ?? data?.type ?? 'Component';
123
151
  const componentDescription = componentMeta?.description;
124
152
 
@@ -220,6 +248,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
220
248
 
221
249
  return buckets;
222
250
  }, [componentMeta?.specialCategories, specialGroups]);
251
+
223
252
  const handleAttributeChange = useCallback(
224
253
  (name: string, val: unknown) => {
225
254
  const next: NodeData<NodeDefaultAttribute> = {
@@ -234,6 +263,17 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
234
263
  [baseData, onChange],
235
264
  );
236
265
 
266
+ const handleChildrenChange = useCallback(
267
+ (val: string) => {
268
+ const next: NodeData<NodeDefaultAttribute> = {
269
+ ...baseData,
270
+ children: val,
271
+ };
272
+ onChange(next);
273
+ },
274
+ [baseData, onChange],
275
+ );
276
+
237
277
  const renderSpecialSection = useCallback(
238
278
  ({ key, entries: sectionEntries, meta }: SpecialSection) => {
239
279
  if (key === 'size') {
@@ -258,7 +298,9 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
258
298
  {sectionEntries.map(({ name, type }) => {
259
299
  const label = attributeMeta?.[name]?.label ?? name;
260
300
  const description = attributeMeta?.[name]?.description;
261
- const preferredScale = attributeMeta?.[name]?.preferedScale;
301
+ const preferredScale = toPreferredScale(
302
+ attributeMeta?.[name]?.preferedScale,
303
+ );
262
304
  const currentValue = (attributes as Record<string, unknown>)[
263
305
  name
264
306
  ];
@@ -285,7 +327,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
285
327
  value={currentValue}
286
328
  onChange={(val) => handleAttributeChange(name, val)}
287
329
  componentType={data?.type}
288
- projectColors={projectColors}
330
+ projectColors={projectColorsForPicker}
289
331
  layoutContext={layoutContext}
290
332
  viewAttributes={viewAttributes}
291
333
  label={isBoolean ? label : undefined}
@@ -308,7 +350,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
308
350
  attributes={attributes}
309
351
  onAttributeChange={handleAttributeChange}
310
352
  componentType={data?.type}
311
- projectColors={projectColors}
353
+ projectColors={projectColorsForPicker}
312
354
  layoutContext={layoutContext}
313
355
  viewAttributes={viewAttributes}
314
356
  meta={meta}
@@ -321,7 +363,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
321
363
  data?.type,
322
364
  handleAttributeChange,
323
365
  layoutContext,
324
- projectColors,
366
+ projectColorsForPicker,
325
367
  viewAttributes,
326
368
  ],
327
369
  );
@@ -384,6 +426,27 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
384
426
 
385
427
  const activeSpecialSections = specialSectionsByTab[activeTab] ?? [];
386
428
 
429
+ const hasStringChildren =
430
+ !!patternForType?.pattern &&
431
+ (patternForType.pattern as { children?: unknown }).children === 'string';
432
+
433
+ const childrenValue =
434
+ typeof (baseData.children as unknown) === 'string'
435
+ ? (baseData.children as string)
436
+ : '';
437
+
438
+ const childrenSection = hasStringChildren ? (
439
+ <div className="attributes-editor__field-wrapper attributes-editor__field-wrapper--children">
440
+ <p className="attributes-editor__field-label">Text</p>
441
+ <input
442
+ type="text"
443
+ className="attributes-editor__text-input"
444
+ value={childrenValue}
445
+ onChange={(e) => handleChildrenChange(e.target.value)}
446
+ />
447
+ </div>
448
+ ) : null;
449
+
387
450
  const tabsSection = (
388
451
  <div className="attributes-editor__tabs">
389
452
  {tabs.map((tab) => {
@@ -418,6 +481,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
418
481
  <div className="attributes-editor">
419
482
  {headerSection}
420
483
  {tabsSection}
484
+ {childrenSection}
421
485
  {activeSpecialSections.map(renderSpecialSection)}
422
486
  <div className="attributes-editor__empty-state">
423
487
  No editable attributes
@@ -430,12 +494,15 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
430
494
  <div className="attributes-editor">
431
495
  {headerSection}
432
496
  {tabsSection}
497
+ {childrenSection}
433
498
  {activeSpecialSections.map(renderSpecialSection)}
434
499
 
435
500
  {activeEntries.map(({ name, type }) => {
436
501
  const label = attributeMeta?.[name]?.label ?? name;
437
502
  const description = attributeMeta?.[name]?.description;
438
- const preferredScale = attributeMeta?.[name]?.preferedScale;
503
+ const preferredScale = toPreferredScale(
504
+ attributeMeta?.[name]?.preferedScale,
505
+ );
439
506
  const isBoolean = isBooleanFieldType(type);
440
507
  const wrapperClassNames = [
441
508
  'attributes-editor__field-wrapper',
@@ -455,7 +522,7 @@ export function AttributesEditor({ node, onChange }: AttributesEditorProps) {
455
522
  value={attributes?.[name]}
456
523
  onChange={(val) => handleAttributeChange(name, val)}
457
524
  componentType={data?.type}
458
- projectColors={projectColors}
525
+ projectColors={projectColorsForPicker}
459
526
  layoutContext={layoutContext}
460
527
  viewAttributes={viewAttributes}
461
528
  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,89 @@ 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, forceRender, setCurrent } = useRenderStore(
51
+ (s) => ({
52
+ device: s.device,
53
+ previewMode: s.previewMode,
54
+ forceRender: s.forceRender,
55
+ setCurrent: s.setCurrent,
56
+ }),
57
+ );
58
+ const previewRootRef = useRef<HTMLDivElement | null>(null);
59
+
60
+ useEffect(() => {
61
+ console.log('previewMode!!!', previewMode);
62
+ if (!previewMode) {
63
+ return;
64
+ }
65
+
66
+ const root = previewRootRef.current;
67
+ if (!root) return;
68
+
69
+ const handleClick = (event: MouseEvent) => {
70
+ const target = event.target as HTMLElement | null;
71
+ if (!target) return;
72
+
73
+ // Ignore clicks on carousel dots to avoid interfering with navigation
74
+ if (target.closest('.embla__dot')) {
75
+ return;
76
+ }
77
+
78
+ const element = target.closest('[attribute-key]') as HTMLElement | null;
79
+ if (!element) return;
80
+
81
+ const key = element.getAttribute('attribute-key');
82
+
83
+ if (!key) return;
84
+
85
+ const node = findNodeByKeyNested(data, key);
86
+ setCurrent(node);
87
+ onSelectNode?.(node);
88
+ };
89
+
90
+ root.addEventListener('click', handleClick);
91
+
92
+ return () => {
93
+ root.removeEventListener('click', handleClick);
94
+ };
95
+ }, [previewMode, data, onSelectNode, setCurrent, forceRender]); // forceRender: retrigger effect when we want to force a refresh (e.g. route change)
96
+
17
97
  const screenPreviewHeight = 800;
18
98
  // The calculation is correct for maintaining the aspect ratio of the target screen size.
19
99
  // It scales the width proportionally to a fixed preview height.
@@ -23,7 +103,9 @@ export function RenderPage({ data, name }: RenderPageProps) {
23
103
 
24
104
  return (
25
105
  <DeviceMockFrame appName={name}>
26
- <RenderNode node={data} />
106
+ <div ref={previewRootRef}>
107
+ <RenderNode node={data} />
108
+ </div>
27
109
  </DeviceMockFrame>
28
110
  );
29
111
  }