sdui-web 0.4.0 → 0.6.0
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.
- package/dist/index.cjs +78 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +77 -28
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +935 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +17 -0
- package/dist/react/index.d.ts +17 -0
- package/dist/react/index.js +908 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +21 -3
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
getComponents: () => getComponents,
|
|
24
|
+
getDevicePresets: () => getDevicePresets,
|
|
24
25
|
render: () => render
|
|
25
26
|
});
|
|
26
27
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -254,36 +255,35 @@ function renderText(component, theme) {
|
|
|
254
255
|
function renderImage(component, theme) {
|
|
255
256
|
const props = component.properties;
|
|
256
257
|
const el = document.createElement("img");
|
|
258
|
+
el.style.display = "block";
|
|
259
|
+
el.style.boxSizing = "border-box";
|
|
257
260
|
if (props?.image) {
|
|
258
261
|
el.src = props.image;
|
|
259
262
|
}
|
|
260
263
|
if (props?.contentDescription) {
|
|
261
264
|
el.alt = props.contentDescription;
|
|
262
265
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
el.style.objectFit = "none";
|
|
285
|
-
break;
|
|
286
|
-
}
|
|
266
|
+
switch (props?.scaleType) {
|
|
267
|
+
case "crop":
|
|
268
|
+
el.style.objectFit = "cover";
|
|
269
|
+
break;
|
|
270
|
+
case "fill_bounds":
|
|
271
|
+
el.style.objectFit = "fill";
|
|
272
|
+
break;
|
|
273
|
+
case "fill_width":
|
|
274
|
+
el.style.objectFit = "cover";
|
|
275
|
+
el.style.width = "100%";
|
|
276
|
+
break;
|
|
277
|
+
case "fill_height":
|
|
278
|
+
el.style.objectFit = "cover";
|
|
279
|
+
el.style.height = "100%";
|
|
280
|
+
break;
|
|
281
|
+
case "none":
|
|
282
|
+
el.style.objectFit = "none";
|
|
283
|
+
break;
|
|
284
|
+
default:
|
|
285
|
+
el.style.objectFit = "contain";
|
|
286
|
+
break;
|
|
287
287
|
}
|
|
288
288
|
if (props?.tintColor) {
|
|
289
289
|
const c = resolveColor(props.tintColor, theme);
|
|
@@ -291,6 +291,9 @@ function renderImage(component, theme) {
|
|
|
291
291
|
el.style.filter = `opacity(0.5) drop-shadow(0 0 0 ${c})`;
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
+
if (props?.aspectRatio != null) {
|
|
295
|
+
el.style.aspectRatio = `${props.aspectRatio}`;
|
|
296
|
+
}
|
|
294
297
|
applyModifier(el, props?.modifier, theme);
|
|
295
298
|
return el;
|
|
296
299
|
}
|
|
@@ -519,6 +522,9 @@ function renderComponent(component, theme) {
|
|
|
519
522
|
}
|
|
520
523
|
const el = renderer(component, theme);
|
|
521
524
|
el.dataset.sduiType = component.type;
|
|
525
|
+
if (component.__builderId) {
|
|
526
|
+
el.dataset.sduiId = component.__builderId;
|
|
527
|
+
}
|
|
522
528
|
if (component.children && component.children.length > 0) {
|
|
523
529
|
for (const child of component.children) {
|
|
524
530
|
el.appendChild(renderComponent(child, theme));
|
|
@@ -605,8 +611,7 @@ function imageModifierDescriptor() {
|
|
|
605
611
|
{ name: "width", label: "Width", type: "object", properties: sizeModelProperties() },
|
|
606
612
|
{ name: "height", label: "Height", type: "object", properties: sizeModelProperties() },
|
|
607
613
|
{ name: "padding", label: "Padding", type: "object", properties: spacingModelProperties() },
|
|
608
|
-
{ name: "margin", label: "Margin", type: "object", properties: spacingModelProperties() }
|
|
609
|
-
{ name: "aspectRatio", label: "Aspect Ratio", type: "number" }
|
|
614
|
+
{ name: "margin", label: "Margin", type: "object", properties: spacingModelProperties() }
|
|
610
615
|
]
|
|
611
616
|
};
|
|
612
617
|
}
|
|
@@ -680,11 +685,12 @@ var COMPONENT_DEFINITIONS = [
|
|
|
680
685
|
label: "Image",
|
|
681
686
|
acceptsChildren: false,
|
|
682
687
|
properties: [
|
|
683
|
-
imageModifierDescriptor(),
|
|
684
688
|
{ name: "image", label: "Image URL", type: "string", required: true },
|
|
685
689
|
{ name: "scaleType", label: "Scale Type", type: "enum", enumValues: ["fit", "crop", "fill_height", "fill_width", "fill_bounds", "inside", "none"] },
|
|
686
690
|
{ name: "contentDescription", label: "Content Description", type: "string" },
|
|
687
|
-
{ name: "
|
|
691
|
+
{ name: "aspectRatio", label: "Aspect Ratio", type: "number" },
|
|
692
|
+
{ name: "tintColor", label: "Tint Color", type: "object", properties: colorModelProperties() },
|
|
693
|
+
imageModifierDescriptor()
|
|
688
694
|
]
|
|
689
695
|
},
|
|
690
696
|
{
|
|
@@ -737,6 +743,49 @@ function getComponents() {
|
|
|
737
743
|
return JSON.parse(JSON.stringify(COMPONENT_DEFINITIONS));
|
|
738
744
|
}
|
|
739
745
|
|
|
746
|
+
// src/device-presets.ts
|
|
747
|
+
var DEVICE_PRESETS = {
|
|
748
|
+
phone: {
|
|
749
|
+
"Google": [
|
|
750
|
+
{ name: "Pixel 10", width: 412, height: 915 },
|
|
751
|
+
{ name: "Pixel 10 Pro", width: 412, height: 915 },
|
|
752
|
+
{ name: "Pixel 10 Pro XL", width: 448, height: 998 },
|
|
753
|
+
{ name: "Pixel 10 Fold", width: 600, height: 748, foldedWidth: 360, foldedHeight: 748 }
|
|
754
|
+
],
|
|
755
|
+
"Samsung": [
|
|
756
|
+
{ name: "Galaxy S26", width: 360, height: 780 },
|
|
757
|
+
{ name: "Galaxy S26 Ultra", width: 412, height: 915 },
|
|
758
|
+
{ name: "Galaxy Z Fold 7", width: 588, height: 748, foldedWidth: 360, foldedHeight: 748 }
|
|
759
|
+
],
|
|
760
|
+
"iOS": [
|
|
761
|
+
{ name: "iPhone 17 Pro Max", width: 440, height: 956 },
|
|
762
|
+
{ name: "iPhone 17 Pro", width: 402, height: 874 },
|
|
763
|
+
{ name: "iPhone 17e", width: 375, height: 812 },
|
|
764
|
+
{ name: "iPhone 17", width: 393, height: 852 },
|
|
765
|
+
{ name: "iPhone Air", width: 402, height: 874 }
|
|
766
|
+
]
|
|
767
|
+
},
|
|
768
|
+
tablet: {
|
|
769
|
+
"Google": [
|
|
770
|
+
{ name: "Pixel Tablet 2", width: 800, height: 1280 }
|
|
771
|
+
],
|
|
772
|
+
"Samsung": [
|
|
773
|
+
{ name: "Galaxy Tab S11", width: 753, height: 1205 },
|
|
774
|
+
{ name: "Galaxy Tab S11+", width: 834, height: 1334 },
|
|
775
|
+
{ name: "Galaxy Tab S11 Ultra", width: 930, height: 1488 }
|
|
776
|
+
],
|
|
777
|
+
"iOS": [
|
|
778
|
+
{ name: 'iPad Pro 13"', width: 1024, height: 1366 },
|
|
779
|
+
{ name: 'iPad Pro 11"', width: 834, height: 1194 },
|
|
780
|
+
{ name: "iPad Air", width: 820, height: 1180 },
|
|
781
|
+
{ name: "iPad mini", width: 744, height: 1133 }
|
|
782
|
+
]
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
function getDevicePresets() {
|
|
786
|
+
return JSON.parse(JSON.stringify(DEVICE_PRESETS));
|
|
787
|
+
}
|
|
788
|
+
|
|
740
789
|
// src/index.ts
|
|
741
790
|
function render(json, container, options) {
|
|
742
791
|
const screen = JSON.parse(json);
|
|
@@ -748,6 +797,7 @@ function render(json, container, options) {
|
|
|
748
797
|
// Annotate the CommonJS export names for ESM import in node:
|
|
749
798
|
0 && (module.exports = {
|
|
750
799
|
getComponents,
|
|
800
|
+
getDevicePresets,
|
|
751
801
|
render
|
|
752
802
|
});
|
|
753
803
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/utils.ts","../src/modifiers.ts","../src/components/text.ts","../src/components/image.ts","../src/components/box.ts","../src/components/column.ts","../src/components/row.ts","../src/components/lazy-column.ts","../src/components/index.ts","../src/render.ts","../src/component-meta.ts"],"sourcesContent":["import type { SduiScreen, Theme } from './types'\nimport { renderComponent } from './render'\n\nexport interface RenderOptions {\n theme?: Theme\n}\n\nexport function render(json: string, container: HTMLElement, options?: RenderOptions): void {\n const screen: SduiScreen = JSON.parse(json)\n const theme: Theme = options?.theme ?? 'light'\n\n const root = renderComponent(screen.root, theme)\n\n container.innerHTML = ''\n container.appendChild(root)\n}\n\nexport { getComponents } from './component-meta'\n\nexport type {\n // Root models\n SduiScreen,\n SduiComponent,\n Theme,\n // Properties\n PropertiesModel,\n TextUiProperties,\n ImageUiProperties,\n BoxUiProperties,\n ColumnUiProperties,\n RowUiProperties,\n LazyColumnUiProperties,\n DefaultUiProperties,\n // Modifiers\n ModifierBase,\n TextUiModifier,\n ContainerUiModifier,\n ImageUiModifier,\n // Base models\n ColorModel,\n SizeModel,\n SpacingModel,\n ActionModel,\n BackgroundColorModel,\n HorizontalArrangementModel,\n VerticalArrangementModel,\n // Enums\n ComponentType,\n AlignmentType,\n FontWeightType,\n SizeUnitType,\n BackgroundColorType,\n ContentScaleType,\n TextAlignType,\n TextOverflowType,\n HorizontalAlignmentType,\n VerticalAlignmentType,\n HorizontalArrangementType,\n VerticalArrangementType,\n // Metadata\n ComponentMeta,\n PropertyDescriptor,\n PropertyType,\n} from './types'\n","import type { ColorModel, SizeModel, SpacingModel, Theme } from './types'\n\nexport function resolveColor(color: ColorModel | undefined, theme: Theme): string | undefined {\n if (!color) return undefined\n if (theme === 'dark') {\n return color.dark ?? color.light\n }\n return color.light ?? color.dark\n}\n\nexport function resolveSize(size: SizeModel | undefined): string | undefined {\n if (!size || !size.unit) return undefined\n switch (size.unit) {\n case 'dp':\n return `${size.value ?? 0}px`\n case 'match_parent':\n return '100%'\n case 'wrap_content':\n return 'fit-content'\n default:\n return undefined\n }\n}\n\nexport function resolveSpacing(spacing: SpacingModel | undefined): {\n top?: string\n bottom?: string\n left?: string\n right?: string\n} {\n if (!spacing) return {}\n return {\n top: spacing.top != null ? `${spacing.top}px` : undefined,\n bottom: spacing.bottom != null ? `${spacing.bottom}px` : undefined,\n left: spacing.start != null ? `${spacing.start}px` : undefined,\n right: spacing.end != null ? `${spacing.end}px` : undefined,\n }\n}\n","import type { BackgroundColorModel, ContainerUiModifier, ImageUiModifier, ModifierBase, TextUiModifier, Theme } from './types'\nimport { resolveColor, resolveSize, resolveSpacing } from './utils'\n\nexport function applyModifier(element: HTMLElement, modifier: ModifierBase | undefined, theme: Theme): void {\n if (!modifier) return\n\n const s = element.style\n\n // alignment → align-self (+ justify-self for 2-axis Box alignments)\n if (modifier.alignment) {\n switch (modifier.alignment) {\n // Single-axis (Column / Row children)\n case 'center':\n case 'center_horizontally':\n case 'center_vertically':\n s.alignSelf = 'center'\n break\n case 'start':\n case 'top':\n s.alignSelf = 'flex-start'\n break\n case 'end':\n case 'bottom':\n s.alignSelf = 'flex-end'\n break\n // Two-axis (Box children — grid layout)\n case 'top_start':\n s.alignSelf = 'start'; s.justifySelf = 'start'\n break\n case 'top_center':\n s.alignSelf = 'start'; s.justifySelf = 'center'\n break\n case 'top_end':\n s.alignSelf = 'start'; s.justifySelf = 'end'\n break\n case 'center_start':\n s.alignSelf = 'center'; s.justifySelf = 'start'\n break\n case 'center_end':\n s.alignSelf = 'center'; s.justifySelf = 'end'\n break\n case 'bottom_start':\n s.alignSelf = 'end'; s.justifySelf = 'start'\n break\n case 'bottom_center':\n s.alignSelf = 'end'; s.justifySelf = 'center'\n break\n case 'bottom_end':\n s.alignSelf = 'end'; s.justifySelf = 'end'\n break\n }\n }\n\n // weight → flex\n if (modifier.weight != null) {\n s.flex = `${modifier.weight}`\n s.minWidth = '0'\n s.minHeight = '0'\n }\n\n // action → click handler\n if (modifier.action) {\n const action = modifier.action\n s.cursor = 'pointer'\n element.addEventListener('click', (e) => {\n e.stopPropagation()\n element.dispatchEvent(new CustomEvent('sdui:action', {\n bubbles: true,\n detail: { type: action.type, params: action.params },\n }))\n })\n }\n\n // Extended modifier fields (width, height, padding, margin, backgroundColor, aspectRatio)\n const mod = modifier as ContainerUiModifier | ImageUiModifier | TextUiModifier\n\n const hasAspectRatio = 'aspectRatio' in mod && mod.aspectRatio != null\n const hasWidth = 'width' in mod && mod.width\n const hasHeight = 'height' in mod && (mod as ContainerUiModifier).height\n\n if (hasWidth) {\n const w = resolveSize(mod.width)\n if (w) s.width = w\n }\n\n if (hasHeight && !(hasAspectRatio && hasWidth)) {\n const h = resolveSize((mod as ContainerUiModifier).height)\n if (h) s.height = h\n }\n\n if (hasAspectRatio) {\n s.aspectRatio = `${(mod as ContainerUiModifier).aspectRatio}`\n }\n\n if ('padding' in mod && mod.padding) {\n const p = resolveSpacing((mod as ContainerUiModifier).padding)\n if (p.top) s.paddingTop = p.top\n if (p.bottom) s.paddingBottom = p.bottom\n if (p.left) s.paddingLeft = p.left\n if (p.right) s.paddingRight = p.right\n }\n\n if ('margin' in mod && mod.margin) {\n const m = resolveSpacing(mod.margin)\n if (m.top) s.marginTop = m.top\n if (m.bottom) s.marginBottom = m.bottom\n if (m.left) s.marginLeft = m.left\n if (m.right) s.marginRight = m.right\n }\n\n if ('backgroundColor' in mod && mod.backgroundColor) {\n applyBackground(s, (mod as ContainerUiModifier).backgroundColor!, theme)\n }\n}\n\nfunction applyBackground(s: CSSStyleDeclaration, bg: BackgroundColorModel, theme: Theme): void {\n if (!bg.colors || bg.colors.length === 0) return\n\n const colors = bg.colors.map((c) => resolveColor(c, theme)).filter(Boolean) as string[]\n if (colors.length === 0) return\n\n switch (bg.type) {\n case 'single':\n s.backgroundColor = colors[0]\n break\n case 'vertical_gradient':\n s.background = `linear-gradient(to bottom, ${colors.join(', ')})`\n break\n case 'horizontal_gradient':\n s.background = `linear-gradient(to right, ${colors.join(', ')})`\n break\n case 'linear_gradient':\n s.background = `linear-gradient(${colors.join(', ')})`\n break\n default:\n if (colors.length === 1) {\n s.backgroundColor = colors[0]\n }\n break\n }\n}\n","import type { SduiComponent, TextUiProperties, Theme } from '../types'\nimport { resolveColor } from '../utils'\nimport { applyModifier } from '../modifiers'\n\nexport function renderText(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as TextUiProperties | undefined\n const el = document.createElement('span')\n\n el.textContent = props?.text ?? ''\n\n if (props?.fontSize != null) {\n el.style.fontSize = `${props.fontSize}px`\n }\n\n if (props?.color) {\n const c = resolveColor(props.color, theme)\n if (c) el.style.color = c\n }\n\n if (props?.fontWeight) {\n switch (props.fontWeight) {\n case 'bold':\n el.style.fontWeight = '700'\n break\n case 'semi_bold':\n el.style.fontWeight = '600'\n break\n case 'medium':\n el.style.fontWeight = '500'\n break\n case 'normal':\n el.style.fontWeight = '400'\n break\n }\n }\n\n if (props?.textAlign) {\n el.style.display = 'block'\n switch (props.textAlign) {\n case 'left':\n case 'start':\n el.style.textAlign = 'left'\n break\n case 'right':\n case 'end':\n el.style.textAlign = 'right'\n break\n case 'center':\n el.style.textAlign = 'center'\n break\n case 'justify':\n el.style.textAlign = 'justify'\n break\n }\n }\n\n if (props?.overflow === 'ellipsis') {\n el.style.textOverflow = 'ellipsis'\n el.style.overflow = 'hidden'\n el.style.whiteSpace = 'nowrap'\n }\n\n if (props?.maxLines != null) {\n el.style.display = '-webkit-box'\n el.style.webkitLineClamp = `${props.maxLines}`\n ;(el.style as unknown as Record<string, string>)['-webkit-box-orient'] = 'vertical'\n el.style.overflow = 'hidden'\n }\n\n if (props?.minLines != null) {\n el.style.minHeight = `${props.minLines * (props.fontSize ?? 16) * 1.4}px`\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, ImageUiProperties, Theme } from '../types'\nimport { resolveColor } from '../utils'\nimport { applyModifier } from '../modifiers'\n\nexport function renderImage(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as ImageUiProperties | undefined\n const el = document.createElement('img') as HTMLImageElement\n\n if (props?.image) {\n el.src = props.image\n }\n\n if (props?.contentDescription) {\n el.alt = props.contentDescription\n }\n\n if (props?.scaleType) {\n switch (props.scaleType) {\n case 'fit':\n case 'inside':\n el.style.objectFit = 'contain'\n break\n case 'crop':\n el.style.objectFit = 'cover'\n break\n case 'fill_bounds':\n el.style.objectFit = 'fill'\n break\n case 'fill_width':\n el.style.objectFit = 'cover'\n el.style.width = '100%'\n break\n case 'fill_height':\n el.style.objectFit = 'cover'\n el.style.height = '100%'\n break\n case 'none':\n el.style.objectFit = 'none'\n break\n }\n }\n\n if (props?.tintColor) {\n const c = resolveColor(props.tintColor, theme)\n if (c) {\n el.style.filter = `opacity(0.5) drop-shadow(0 0 0 ${c})`\n }\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, BoxUiProperties, Theme } from '../types'\nimport { applyModifier } from '../modifiers'\n\nexport function renderBox(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as BoxUiProperties | undefined\n const el = document.createElement('div')\n\n el.style.display = 'grid'\n el.style.position = 'relative'\n\n // All children share the same grid cell (like Compose FrameLayout)\n // Default alignment for all children\n if (props?.alignment) {\n switch (props.alignment) {\n case 'top_start':\n el.style.justifyItems = 'start'\n el.style.alignItems = 'start'\n break\n case 'top_center':\n el.style.justifyItems = 'center'\n el.style.alignItems = 'start'\n break\n case 'top_end':\n el.style.justifyItems = 'end'\n el.style.alignItems = 'start'\n break\n case 'center_start':\n el.style.justifyItems = 'start'\n el.style.alignItems = 'center'\n break\n case 'center':\n el.style.justifyItems = 'center'\n el.style.alignItems = 'center'\n break\n case 'center_end':\n el.style.justifyItems = 'end'\n el.style.alignItems = 'center'\n break\n case 'bottom_start':\n el.style.justifyItems = 'start'\n el.style.alignItems = 'end'\n break\n case 'bottom_center':\n el.style.justifyItems = 'center'\n el.style.alignItems = 'end'\n break\n case 'bottom_end':\n el.style.justifyItems = 'end'\n el.style.alignItems = 'end'\n break\n }\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, ColumnUiProperties, Theme } from '../types'\nimport { applyModifier } from '../modifiers'\n\nexport function renderColumn(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as ColumnUiProperties | undefined\n const el = document.createElement('div')\n\n el.style.display = 'flex'\n el.style.flexDirection = 'column'\n\n if (props?.verticalArrangement) {\n const arr = props.verticalArrangement\n switch (arr.type) {\n case 'top':\n el.style.justifyContent = 'flex-start'\n break\n case 'center':\n el.style.justifyContent = 'center'\n break\n case 'bottom':\n el.style.justifyContent = 'flex-end'\n break\n case 'space_between':\n el.style.justifyContent = 'space-between'\n break\n case 'space_evenly':\n el.style.justifyContent = 'space-evenly'\n break\n case 'space_around':\n el.style.justifyContent = 'space-around'\n break\n case 'spaced_by':\n el.style.justifyContent = 'flex-start'\n if (arr.spacing != null) {\n el.style.gap = `${arr.spacing}px`\n }\n break\n }\n }\n\n if (props?.horizontalAlignment) {\n switch (props.horizontalAlignment) {\n case 'start':\n el.style.alignItems = 'flex-start'\n break\n case 'end':\n el.style.alignItems = 'flex-end'\n break\n case 'center_horizontally':\n el.style.alignItems = 'center'\n break\n }\n }\n\n if (props?.canScroll) {\n el.style.overflowY = 'auto'\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, RowUiProperties, Theme } from '../types'\nimport { applyModifier } from '../modifiers'\n\nexport function renderRow(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as RowUiProperties | undefined\n const el = document.createElement('div')\n\n el.style.display = 'flex'\n el.style.flexDirection = 'row'\n\n if (props?.horizontalArrangement) {\n const arr = props.horizontalArrangement\n switch (arr.type) {\n case 'start':\n el.style.justifyContent = 'flex-start'\n break\n case 'center':\n el.style.justifyContent = 'center'\n break\n case 'end':\n el.style.justifyContent = 'flex-end'\n break\n case 'space_between':\n el.style.justifyContent = 'space-between'\n break\n case 'space_evenly':\n el.style.justifyContent = 'space-evenly'\n break\n case 'space_around':\n el.style.justifyContent = 'space-around'\n break\n case 'spaced_by':\n el.style.justifyContent = 'flex-start'\n if (arr.spacing != null) {\n el.style.gap = `${arr.spacing}px`\n }\n break\n }\n }\n\n if (props?.verticalAlignment) {\n switch (props.verticalAlignment) {\n case 'top':\n el.style.alignItems = 'flex-start'\n break\n case 'bottom':\n el.style.alignItems = 'flex-end'\n break\n case 'center_vertically':\n el.style.alignItems = 'center'\n break\n }\n }\n\n if (props?.canScroll) {\n el.style.overflowX = 'auto'\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, LazyColumnUiProperties, Theme } from '../types'\nimport { applyModifier } from '../modifiers'\n\nexport function renderLazyColumn(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as LazyColumnUiProperties | undefined\n const el = document.createElement('div')\n\n el.style.display = 'flex'\n el.style.flexDirection = 'column'\n el.style.overflowY = 'auto'\n\n if (props?.verticalArrangement) {\n const arr = props.verticalArrangement\n switch (arr.type) {\n case 'top':\n el.style.justifyContent = 'flex-start'\n break\n case 'center':\n el.style.justifyContent = 'center'\n break\n case 'bottom':\n el.style.justifyContent = 'flex-end'\n break\n case 'space_between':\n el.style.justifyContent = 'space-between'\n break\n case 'space_evenly':\n el.style.justifyContent = 'space-evenly'\n break\n case 'space_around':\n el.style.justifyContent = 'space-around'\n break\n case 'spaced_by':\n el.style.justifyContent = 'flex-start'\n if (arr.spacing != null) {\n el.style.gap = `${arr.spacing}px`\n }\n break\n }\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, Theme } from '../types'\nimport { renderText } from './text'\nimport { renderImage } from './image'\nimport { renderBox } from './box'\nimport { renderColumn } from './column'\nimport { renderRow } from './row'\nimport { renderLazyColumn } from './lazy-column'\n\nexport type ComponentRenderer = (component: SduiComponent, theme: Theme) => HTMLElement\n\nconst renderers: Record<string, ComponentRenderer> = {\n text: renderText,\n image: renderImage,\n box: renderBox,\n column: renderColumn,\n row: renderRow,\n lazy_column: renderLazyColumn,\n}\n\nexport function getRenderer(type: string): ComponentRenderer | undefined {\n return renderers[type]\n}\n","import type { SduiComponent, Theme } from './types'\nimport { getRenderer } from './components'\n\nexport function renderComponent(component: SduiComponent, theme: Theme): HTMLElement {\n const renderer = getRenderer(component.type)\n\n if (!renderer) {\n console.warn(`[sdui] Unknown component type: \"${component.type}\"`)\n const el = document.createElement('div')\n el.dataset.sduiUnknown = component.type\n return el\n }\n\n const el = renderer(component, theme)\n el.dataset.sduiType = component.type\n\n if (component.children && component.children.length > 0) {\n for (const child of component.children) {\n el.appendChild(renderComponent(child, theme))\n }\n }\n\n return el\n}\n","import type { ComponentMeta, PropertyDescriptor } from './types'\n\n// === Reusable sub-object property builders ===\n\nfunction sizeModelProperties(): PropertyDescriptor[] {\n return [\n { name: 'value', label: 'Value', type: 'number' },\n { name: 'unit', label: 'Unit', type: 'enum', enumValues: ['dp', 'match_parent', 'wrap_content'] },\n ]\n}\n\nfunction spacingModelProperties(): PropertyDescriptor[] {\n return [\n { name: 'top', label: 'Top', type: 'number' },\n { name: 'bottom', label: 'Bottom', type: 'number' },\n { name: 'start', label: 'Start', type: 'number' },\n { name: 'end', label: 'End', type: 'number' },\n ]\n}\n\nfunction colorModelProperties(): PropertyDescriptor[] {\n return [\n { name: 'light', label: 'Light', type: 'color' },\n { name: 'dark', label: 'Dark', type: 'color' },\n ]\n}\n\nfunction actionModelProperties(): PropertyDescriptor[] {\n return [\n { name: 'type', label: 'Action Type', type: 'string' },\n { name: 'params', label: 'Parameters', type: 'object' },\n ]\n}\n\nfunction backgroundColorModelProperties(): PropertyDescriptor[] {\n return [\n {\n name: 'colors',\n label: 'Colors',\n type: 'object',\n isArray: true,\n properties: colorModelProperties(),\n },\n {\n name: 'type',\n label: 'Background Type',\n type: 'enum',\n enumValues: ['single', 'vertical_gradient', 'horizontal_gradient', 'linear_gradient'],\n },\n ]\n}\n\n// === Modifier builders ===\n\nfunction modifierBaseProperties(): PropertyDescriptor[] {\n return [\n {\n name: 'alignment',\n label: 'Alignment',\n type: 'enum',\n enumValues: ['start', 'end', 'center', 'center_horizontally', 'center_vertically', 'top', 'bottom', 'top_start', 'top_center', 'top_end', 'center_start', 'center_end', 'bottom_start', 'bottom_center', 'bottom_end'],\n },\n { name: 'weight', label: 'Weight', type: 'number' },\n { name: 'action', label: 'Action', type: 'object', properties: actionModelProperties() },\n ]\n}\n\nfunction textModifierDescriptor(): PropertyDescriptor {\n return {\n name: 'modifier',\n label: 'Modifier',\n type: 'object',\n properties: [\n ...modifierBaseProperties(),\n { name: 'width', label: 'Width', type: 'object', properties: sizeModelProperties() },\n { name: 'margin', label: 'Margin', type: 'object', properties: spacingModelProperties() },\n ],\n }\n}\n\nfunction imageModifierDescriptor(): PropertyDescriptor {\n return {\n name: 'modifier',\n label: 'Modifier',\n type: 'object',\n properties: [\n ...modifierBaseProperties(),\n { name: 'width', label: 'Width', type: 'object', properties: sizeModelProperties() },\n { name: 'height', label: 'Height', type: 'object', properties: sizeModelProperties() },\n { name: 'padding', label: 'Padding', type: 'object', properties: spacingModelProperties() },\n { name: 'margin', label: 'Margin', type: 'object', properties: spacingModelProperties() },\n { name: 'aspectRatio', label: 'Aspect Ratio', type: 'number' },\n ],\n }\n}\n\nfunction containerModifierDescriptor(): PropertyDescriptor {\n return {\n name: 'modifier',\n label: 'Modifier',\n type: 'object',\n properties: [\n ...modifierBaseProperties(),\n { name: 'backgroundColor', label: 'Background Color', type: 'object', properties: backgroundColorModelProperties() },\n { name: 'width', label: 'Width', type: 'object', properties: sizeModelProperties() },\n { name: 'height', label: 'Height', type: 'object', properties: sizeModelProperties() },\n { name: 'padding', label: 'Padding', type: 'object', properties: spacingModelProperties() },\n { name: 'margin', label: 'Margin', type: 'object', properties: spacingModelProperties() },\n { name: 'aspectRatio', label: 'Aspect Ratio', type: 'number' },\n ],\n }\n}\n\n// === Arrangement descriptors ===\n\nfunction verticalArrangementDescriptor(): PropertyDescriptor {\n return {\n name: 'verticalArrangement',\n label: 'Vertical Arrangement',\n type: 'object',\n properties: [\n {\n name: 'type',\n label: 'Type',\n type: 'enum',\n enumValues: ['top', 'center', 'bottom', 'space_evenly', 'space_between', 'space_around', 'spaced_by'],\n },\n { name: 'spacing', label: 'Spacing', type: 'number' },\n ],\n }\n}\n\nfunction horizontalArrangementDescriptor(): PropertyDescriptor {\n return {\n name: 'horizontalArrangement',\n label: 'Horizontal Arrangement',\n type: 'object',\n properties: [\n {\n name: 'type',\n label: 'Type',\n type: 'enum',\n enumValues: ['start', 'center', 'end', 'space_between', 'space_evenly', 'space_around', 'spaced_by'],\n },\n { name: 'spacing', label: 'Spacing', type: 'number' },\n ],\n }\n}\n\n// === Component definitions ===\n\nconst COMPONENT_DEFINITIONS: ComponentMeta[] = [\n {\n type: 'text',\n label: 'Text',\n acceptsChildren: false,\n properties: [\n { name: 'text', label: 'Text', type: 'string', required: true, defaultValue: 'Text' },\n { name: 'fontSize', label: 'Font Size', type: 'number' },\n { name: 'color', label: 'Color', type: 'object', properties: colorModelProperties() },\n { name: 'fontWeight', label: 'Font Weight', type: 'enum', enumValues: ['bold', 'medium', 'normal', 'semi_bold'] },\n { name: 'textAlign', label: 'Text Align', type: 'enum', enumValues: ['left', 'right', 'center', 'justify', 'start', 'end', 'unspecified'] },\n { name: 'overflow', label: 'Overflow', type: 'enum', enumValues: ['none', 'ellipsis'] },\n { name: 'maxLines', label: 'Max Lines', type: 'number' },\n { name: 'minLines', label: 'Min Lines', type: 'number', defaultValue: 1 },\n textModifierDescriptor(),\n ],\n },\n {\n type: 'image',\n label: 'Image',\n acceptsChildren: false,\n properties: [\n imageModifierDescriptor(),\n { name: 'image', label: 'Image URL', type: 'string', required: true },\n { name: 'scaleType', label: 'Scale Type', type: 'enum', enumValues: ['fit', 'crop', 'fill_height', 'fill_width', 'fill_bounds', 'inside', 'none'] },\n { name: 'contentDescription', label: 'Content Description', type: 'string' },\n { name: 'tintColor', label: 'Tint Color', type: 'object', properties: colorModelProperties() },\n ],\n },\n {\n type: 'box',\n label: 'Box',\n acceptsChildren: true,\n properties: [\n containerModifierDescriptor(),\n {\n name: 'alignment',\n label: 'Alignment',\n type: 'enum',\n enumValues: ['top_start', 'top_center', 'top_end', 'center_start', 'center', 'center_end', 'bottom_start', 'bottom_center', 'bottom_end'],\n },\n ],\n },\n {\n type: 'column',\n label: 'Column',\n acceptsChildren: true,\n properties: [\n containerModifierDescriptor(),\n verticalArrangementDescriptor(),\n { name: 'horizontalAlignment', label: 'Horizontal Alignment', type: 'enum', enumValues: ['start', 'end', 'center_horizontally'] },\n { name: 'canScroll', label: 'Can Scroll', type: 'boolean' },\n ],\n },\n {\n type: 'row',\n label: 'Row',\n acceptsChildren: true,\n properties: [\n containerModifierDescriptor(),\n { name: 'verticalAlignment', label: 'Vertical Alignment', type: 'enum', enumValues: ['top', 'bottom', 'center_vertically'] },\n horizontalArrangementDescriptor(),\n { name: 'canScroll', label: 'Can Scroll', type: 'boolean' },\n ],\n },\n {\n type: 'lazy_column',\n label: 'Lazy Column',\n acceptsChildren: true,\n properties: [\n containerModifierDescriptor(),\n verticalArrangementDescriptor(),\n ],\n },\n]\n\n// === Public API ===\n\nexport function getComponents(): ComponentMeta[] {\n return JSON.parse(JSON.stringify(COMPONENT_DEFINITIONS))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,SAAS,aAAa,OAA+B,OAAkC;AAC5F,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,UAAU,QAAQ;AACpB,WAAO,MAAM,QAAQ,MAAM;AAA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,KAAK,MAAM,IAAI;AAC1C,QAAM,QAAe,SAAS,SAAS;AAEvC,QAAM,OAAO,gBAAgB,OAAO,MAAM,KAAK;AAE/C,YAAU,YAAY;AACtB,YAAU,YAAY,IAAI;AAC5B;","names":["el"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/utils.ts","../src/modifiers.ts","../src/components/text.ts","../src/components/image.ts","../src/components/box.ts","../src/components/column.ts","../src/components/row.ts","../src/components/lazy-column.ts","../src/components/index.ts","../src/render.ts","../src/component-meta.ts","../src/device-presets.ts"],"sourcesContent":["import type { SduiScreen, Theme } from './types'\nimport { renderComponent } from './render'\n\nexport interface RenderOptions {\n theme?: Theme\n}\n\nexport function render(json: string, container: HTMLElement, options?: RenderOptions): void {\n const screen: SduiScreen = JSON.parse(json)\n const theme: Theme = options?.theme ?? 'light'\n\n const root = renderComponent(screen.root, theme)\n\n container.innerHTML = ''\n container.appendChild(root)\n}\n\nexport { getComponents } from './component-meta'\nexport { getDevicePresets } from './device-presets'\nexport type { DevicePreset, DeviceCategory } from './device-presets'\n\nexport type {\n // Root models\n SduiScreen,\n SduiComponent,\n Theme,\n // Properties\n PropertiesModel,\n TextUiProperties,\n ImageUiProperties,\n BoxUiProperties,\n ColumnUiProperties,\n RowUiProperties,\n LazyColumnUiProperties,\n DefaultUiProperties,\n // Modifiers\n ModifierBase,\n TextUiModifier,\n ContainerUiModifier,\n ImageUiModifier,\n // Base models\n ColorModel,\n SizeModel,\n SpacingModel,\n ActionModel,\n BackgroundColorModel,\n HorizontalArrangementModel,\n VerticalArrangementModel,\n // Enums\n ComponentType,\n AlignmentType,\n FontWeightType,\n SizeUnitType,\n BackgroundColorType,\n ContentScaleType,\n TextAlignType,\n TextOverflowType,\n HorizontalAlignmentType,\n VerticalAlignmentType,\n HorizontalArrangementType,\n VerticalArrangementType,\n // Metadata\n ComponentMeta,\n PropertyDescriptor,\n PropertyType,\n} from './types'\n","import type { ColorModel, SizeModel, SpacingModel, Theme } from './types'\n\nexport function resolveColor(color: ColorModel | undefined, theme: Theme): string | undefined {\n if (!color) return undefined\n if (theme === 'dark') {\n return color.dark ?? color.light\n }\n return color.light ?? color.dark\n}\n\nexport function resolveSize(size: SizeModel | undefined): string | undefined {\n if (!size || !size.unit) return undefined\n switch (size.unit) {\n case 'dp':\n return `${size.value ?? 0}px`\n case 'match_parent':\n return '100%'\n case 'wrap_content':\n return 'fit-content'\n default:\n return undefined\n }\n}\n\nexport function resolveSpacing(spacing: SpacingModel | undefined): {\n top?: string\n bottom?: string\n left?: string\n right?: string\n} {\n if (!spacing) return {}\n return {\n top: spacing.top != null ? `${spacing.top}px` : undefined,\n bottom: spacing.bottom != null ? `${spacing.bottom}px` : undefined,\n left: spacing.start != null ? `${spacing.start}px` : undefined,\n right: spacing.end != null ? `${spacing.end}px` : undefined,\n }\n}\n","import type { BackgroundColorModel, ContainerUiModifier, ImageUiModifier, ModifierBase, TextUiModifier, Theme } from './types'\nimport { resolveColor, resolveSize, resolveSpacing } from './utils'\n\nexport function applyModifier(element: HTMLElement, modifier: ModifierBase | undefined, theme: Theme): void {\n if (!modifier) return\n\n const s = element.style\n\n // alignment → align-self (+ justify-self for 2-axis Box alignments)\n if (modifier.alignment) {\n switch (modifier.alignment) {\n // Single-axis (Column / Row children)\n case 'center':\n case 'center_horizontally':\n case 'center_vertically':\n s.alignSelf = 'center'\n break\n case 'start':\n case 'top':\n s.alignSelf = 'flex-start'\n break\n case 'end':\n case 'bottom':\n s.alignSelf = 'flex-end'\n break\n // Two-axis (Box children — grid layout)\n case 'top_start':\n s.alignSelf = 'start'; s.justifySelf = 'start'\n break\n case 'top_center':\n s.alignSelf = 'start'; s.justifySelf = 'center'\n break\n case 'top_end':\n s.alignSelf = 'start'; s.justifySelf = 'end'\n break\n case 'center_start':\n s.alignSelf = 'center'; s.justifySelf = 'start'\n break\n case 'center_end':\n s.alignSelf = 'center'; s.justifySelf = 'end'\n break\n case 'bottom_start':\n s.alignSelf = 'end'; s.justifySelf = 'start'\n break\n case 'bottom_center':\n s.alignSelf = 'end'; s.justifySelf = 'center'\n break\n case 'bottom_end':\n s.alignSelf = 'end'; s.justifySelf = 'end'\n break\n }\n }\n\n // weight → flex\n if (modifier.weight != null) {\n s.flex = `${modifier.weight}`\n s.minWidth = '0'\n s.minHeight = '0'\n }\n\n // action → click handler\n if (modifier.action) {\n const action = modifier.action\n s.cursor = 'pointer'\n element.addEventListener('click', (e) => {\n e.stopPropagation()\n element.dispatchEvent(new CustomEvent('sdui:action', {\n bubbles: true,\n detail: { type: action.type, params: action.params },\n }))\n })\n }\n\n // Extended modifier fields (width, height, padding, margin, backgroundColor, aspectRatio)\n const mod = modifier as ContainerUiModifier | ImageUiModifier | TextUiModifier\n\n const hasAspectRatio = 'aspectRatio' in mod && mod.aspectRatio != null\n const hasWidth = 'width' in mod && mod.width\n const hasHeight = 'height' in mod && (mod as ContainerUiModifier).height\n\n if (hasWidth) {\n const w = resolveSize(mod.width)\n if (w) s.width = w\n }\n\n if (hasHeight && !(hasAspectRatio && hasWidth)) {\n const h = resolveSize((mod as ContainerUiModifier).height)\n if (h) s.height = h\n }\n\n if (hasAspectRatio) {\n s.aspectRatio = `${(mod as ContainerUiModifier).aspectRatio}`\n }\n\n if ('padding' in mod && mod.padding) {\n const p = resolveSpacing((mod as ContainerUiModifier).padding)\n if (p.top) s.paddingTop = p.top\n if (p.bottom) s.paddingBottom = p.bottom\n if (p.left) s.paddingLeft = p.left\n if (p.right) s.paddingRight = p.right\n }\n\n if ('margin' in mod && mod.margin) {\n const m = resolveSpacing(mod.margin)\n if (m.top) s.marginTop = m.top\n if (m.bottom) s.marginBottom = m.bottom\n if (m.left) s.marginLeft = m.left\n if (m.right) s.marginRight = m.right\n }\n\n if ('backgroundColor' in mod && mod.backgroundColor) {\n applyBackground(s, (mod as ContainerUiModifier).backgroundColor!, theme)\n }\n}\n\nfunction applyBackground(s: CSSStyleDeclaration, bg: BackgroundColorModel, theme: Theme): void {\n if (!bg.colors || bg.colors.length === 0) return\n\n const colors = bg.colors.map((c) => resolveColor(c, theme)).filter(Boolean) as string[]\n if (colors.length === 0) return\n\n switch (bg.type) {\n case 'single':\n s.backgroundColor = colors[0]\n break\n case 'vertical_gradient':\n s.background = `linear-gradient(to bottom, ${colors.join(', ')})`\n break\n case 'horizontal_gradient':\n s.background = `linear-gradient(to right, ${colors.join(', ')})`\n break\n case 'linear_gradient':\n s.background = `linear-gradient(${colors.join(', ')})`\n break\n default:\n if (colors.length === 1) {\n s.backgroundColor = colors[0]\n }\n break\n }\n}\n","import type { SduiComponent, TextUiProperties, Theme } from '../types'\nimport { resolveColor } from '../utils'\nimport { applyModifier } from '../modifiers'\n\nexport function renderText(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as TextUiProperties | undefined\n const el = document.createElement('span')\n\n el.textContent = props?.text ?? ''\n\n if (props?.fontSize != null) {\n el.style.fontSize = `${props.fontSize}px`\n }\n\n if (props?.color) {\n const c = resolveColor(props.color, theme)\n if (c) el.style.color = c\n }\n\n if (props?.fontWeight) {\n switch (props.fontWeight) {\n case 'bold':\n el.style.fontWeight = '700'\n break\n case 'semi_bold':\n el.style.fontWeight = '600'\n break\n case 'medium':\n el.style.fontWeight = '500'\n break\n case 'normal':\n el.style.fontWeight = '400'\n break\n }\n }\n\n if (props?.textAlign) {\n el.style.display = 'block'\n switch (props.textAlign) {\n case 'left':\n case 'start':\n el.style.textAlign = 'left'\n break\n case 'right':\n case 'end':\n el.style.textAlign = 'right'\n break\n case 'center':\n el.style.textAlign = 'center'\n break\n case 'justify':\n el.style.textAlign = 'justify'\n break\n }\n }\n\n if (props?.overflow === 'ellipsis') {\n el.style.textOverflow = 'ellipsis'\n el.style.overflow = 'hidden'\n el.style.whiteSpace = 'nowrap'\n }\n\n if (props?.maxLines != null) {\n el.style.display = '-webkit-box'\n el.style.webkitLineClamp = `${props.maxLines}`\n ;(el.style as unknown as Record<string, string>)['-webkit-box-orient'] = 'vertical'\n el.style.overflow = 'hidden'\n }\n\n if (props?.minLines != null) {\n el.style.minHeight = `${props.minLines * (props.fontSize ?? 16) * 1.4}px`\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, ImageUiProperties, Theme } from '../types'\nimport { resolveColor } from '../utils'\nimport { applyModifier } from '../modifiers'\n\nexport function renderImage(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as ImageUiProperties | undefined\n const el = document.createElement('img') as HTMLImageElement\n el.style.display = 'block'\n el.style.boxSizing = 'border-box'\n\n if (props?.image) {\n el.src = props.image\n }\n\n if (props?.contentDescription) {\n el.alt = props.contentDescription\n }\n\n switch (props?.scaleType) {\n case 'crop':\n el.style.objectFit = 'cover'\n break\n case 'fill_bounds':\n el.style.objectFit = 'fill'\n break\n case 'fill_width':\n el.style.objectFit = 'cover'\n el.style.width = '100%'\n break\n case 'fill_height':\n el.style.objectFit = 'cover'\n el.style.height = '100%'\n break\n case 'none':\n el.style.objectFit = 'none'\n break\n default:\n el.style.objectFit = 'contain'\n break\n }\n\n if (props?.tintColor) {\n const c = resolveColor(props.tintColor, theme)\n if (c) {\n el.style.filter = `opacity(0.5) drop-shadow(0 0 0 ${c})`\n }\n }\n\n if (props?.aspectRatio != null) {\n el.style.aspectRatio = `${props.aspectRatio}`\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, BoxUiProperties, Theme } from '../types'\nimport { applyModifier } from '../modifiers'\n\nexport function renderBox(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as BoxUiProperties | undefined\n const el = document.createElement('div')\n\n el.style.display = 'grid'\n el.style.position = 'relative'\n\n // All children share the same grid cell (like Compose FrameLayout)\n // Default alignment for all children\n if (props?.alignment) {\n switch (props.alignment) {\n case 'top_start':\n el.style.justifyItems = 'start'\n el.style.alignItems = 'start'\n break\n case 'top_center':\n el.style.justifyItems = 'center'\n el.style.alignItems = 'start'\n break\n case 'top_end':\n el.style.justifyItems = 'end'\n el.style.alignItems = 'start'\n break\n case 'center_start':\n el.style.justifyItems = 'start'\n el.style.alignItems = 'center'\n break\n case 'center':\n el.style.justifyItems = 'center'\n el.style.alignItems = 'center'\n break\n case 'center_end':\n el.style.justifyItems = 'end'\n el.style.alignItems = 'center'\n break\n case 'bottom_start':\n el.style.justifyItems = 'start'\n el.style.alignItems = 'end'\n break\n case 'bottom_center':\n el.style.justifyItems = 'center'\n el.style.alignItems = 'end'\n break\n case 'bottom_end':\n el.style.justifyItems = 'end'\n el.style.alignItems = 'end'\n break\n }\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, ColumnUiProperties, Theme } from '../types'\nimport { applyModifier } from '../modifiers'\n\nexport function renderColumn(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as ColumnUiProperties | undefined\n const el = document.createElement('div')\n\n el.style.display = 'flex'\n el.style.flexDirection = 'column'\n\n if (props?.verticalArrangement) {\n const arr = props.verticalArrangement\n switch (arr.type) {\n case 'top':\n el.style.justifyContent = 'flex-start'\n break\n case 'center':\n el.style.justifyContent = 'center'\n break\n case 'bottom':\n el.style.justifyContent = 'flex-end'\n break\n case 'space_between':\n el.style.justifyContent = 'space-between'\n break\n case 'space_evenly':\n el.style.justifyContent = 'space-evenly'\n break\n case 'space_around':\n el.style.justifyContent = 'space-around'\n break\n case 'spaced_by':\n el.style.justifyContent = 'flex-start'\n if (arr.spacing != null) {\n el.style.gap = `${arr.spacing}px`\n }\n break\n }\n }\n\n if (props?.horizontalAlignment) {\n switch (props.horizontalAlignment) {\n case 'start':\n el.style.alignItems = 'flex-start'\n break\n case 'end':\n el.style.alignItems = 'flex-end'\n break\n case 'center_horizontally':\n el.style.alignItems = 'center'\n break\n }\n }\n\n if (props?.canScroll) {\n el.style.overflowY = 'auto'\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, RowUiProperties, Theme } from '../types'\nimport { applyModifier } from '../modifiers'\n\nexport function renderRow(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as RowUiProperties | undefined\n const el = document.createElement('div')\n\n el.style.display = 'flex'\n el.style.flexDirection = 'row'\n\n if (props?.horizontalArrangement) {\n const arr = props.horizontalArrangement\n switch (arr.type) {\n case 'start':\n el.style.justifyContent = 'flex-start'\n break\n case 'center':\n el.style.justifyContent = 'center'\n break\n case 'end':\n el.style.justifyContent = 'flex-end'\n break\n case 'space_between':\n el.style.justifyContent = 'space-between'\n break\n case 'space_evenly':\n el.style.justifyContent = 'space-evenly'\n break\n case 'space_around':\n el.style.justifyContent = 'space-around'\n break\n case 'spaced_by':\n el.style.justifyContent = 'flex-start'\n if (arr.spacing != null) {\n el.style.gap = `${arr.spacing}px`\n }\n break\n }\n }\n\n if (props?.verticalAlignment) {\n switch (props.verticalAlignment) {\n case 'top':\n el.style.alignItems = 'flex-start'\n break\n case 'bottom':\n el.style.alignItems = 'flex-end'\n break\n case 'center_vertically':\n el.style.alignItems = 'center'\n break\n }\n }\n\n if (props?.canScroll) {\n el.style.overflowX = 'auto'\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, LazyColumnUiProperties, Theme } from '../types'\nimport { applyModifier } from '../modifiers'\n\nexport function renderLazyColumn(component: SduiComponent, theme: Theme): HTMLElement {\n const props = component.properties as LazyColumnUiProperties | undefined\n const el = document.createElement('div')\n\n el.style.display = 'flex'\n el.style.flexDirection = 'column'\n el.style.overflowY = 'auto'\n\n if (props?.verticalArrangement) {\n const arr = props.verticalArrangement\n switch (arr.type) {\n case 'top':\n el.style.justifyContent = 'flex-start'\n break\n case 'center':\n el.style.justifyContent = 'center'\n break\n case 'bottom':\n el.style.justifyContent = 'flex-end'\n break\n case 'space_between':\n el.style.justifyContent = 'space-between'\n break\n case 'space_evenly':\n el.style.justifyContent = 'space-evenly'\n break\n case 'space_around':\n el.style.justifyContent = 'space-around'\n break\n case 'spaced_by':\n el.style.justifyContent = 'flex-start'\n if (arr.spacing != null) {\n el.style.gap = `${arr.spacing}px`\n }\n break\n }\n }\n\n applyModifier(el, props?.modifier, theme)\n\n return el\n}\n","import type { SduiComponent, Theme } from '../types'\nimport { renderText } from './text'\nimport { renderImage } from './image'\nimport { renderBox } from './box'\nimport { renderColumn } from './column'\nimport { renderRow } from './row'\nimport { renderLazyColumn } from './lazy-column'\n\nexport type ComponentRenderer = (component: SduiComponent, theme: Theme) => HTMLElement\n\nconst renderers: Record<string, ComponentRenderer> = {\n text: renderText,\n image: renderImage,\n box: renderBox,\n column: renderColumn,\n row: renderRow,\n lazy_column: renderLazyColumn,\n}\n\nexport function getRenderer(type: string): ComponentRenderer | undefined {\n return renderers[type]\n}\n","import type { SduiComponent, Theme } from './types'\nimport { getRenderer } from './components'\n\nexport function renderComponent(component: SduiComponent, theme: Theme): HTMLElement {\n const renderer = getRenderer(component.type)\n\n if (!renderer) {\n console.warn(`[sdui] Unknown component type: \"${component.type}\"`)\n const el = document.createElement('div')\n el.dataset.sduiUnknown = component.type\n return el\n }\n\n const el = renderer(component, theme)\n el.dataset.sduiType = component.type\n if ((component as any).__builderId) {\n el.dataset.sduiId = (component as any).__builderId\n }\n\n if (component.children && component.children.length > 0) {\n for (const child of component.children) {\n el.appendChild(renderComponent(child, theme))\n }\n }\n\n return el\n}\n","import type { ComponentMeta, PropertyDescriptor } from './types'\n\n// === Reusable sub-object property builders ===\n\nfunction sizeModelProperties(): PropertyDescriptor[] {\n return [\n { name: 'value', label: 'Value', type: 'number' },\n { name: 'unit', label: 'Unit', type: 'enum', enumValues: ['dp', 'match_parent', 'wrap_content'] },\n ]\n}\n\nfunction spacingModelProperties(): PropertyDescriptor[] {\n return [\n { name: 'top', label: 'Top', type: 'number' },\n { name: 'bottom', label: 'Bottom', type: 'number' },\n { name: 'start', label: 'Start', type: 'number' },\n { name: 'end', label: 'End', type: 'number' },\n ]\n}\n\nfunction colorModelProperties(): PropertyDescriptor[] {\n return [\n { name: 'light', label: 'Light', type: 'color' },\n { name: 'dark', label: 'Dark', type: 'color' },\n ]\n}\n\nfunction actionModelProperties(): PropertyDescriptor[] {\n return [\n { name: 'type', label: 'Action Type', type: 'string' },\n { name: 'params', label: 'Parameters', type: 'object' },\n ]\n}\n\nfunction backgroundColorModelProperties(): PropertyDescriptor[] {\n return [\n {\n name: 'colors',\n label: 'Colors',\n type: 'object',\n isArray: true,\n properties: colorModelProperties(),\n },\n {\n name: 'type',\n label: 'Background Type',\n type: 'enum',\n enumValues: ['single', 'vertical_gradient', 'horizontal_gradient', 'linear_gradient'],\n },\n ]\n}\n\n// === Modifier builders ===\n\nfunction modifierBaseProperties(): PropertyDescriptor[] {\n return [\n {\n name: 'alignment',\n label: 'Alignment',\n type: 'enum',\n enumValues: ['start', 'end', 'center', 'center_horizontally', 'center_vertically', 'top', 'bottom', 'top_start', 'top_center', 'top_end', 'center_start', 'center_end', 'bottom_start', 'bottom_center', 'bottom_end'],\n },\n { name: 'weight', label: 'Weight', type: 'number' },\n { name: 'action', label: 'Action', type: 'object', properties: actionModelProperties() },\n ]\n}\n\nfunction textModifierDescriptor(): PropertyDescriptor {\n return {\n name: 'modifier',\n label: 'Modifier',\n type: 'object',\n properties: [\n ...modifierBaseProperties(),\n { name: 'width', label: 'Width', type: 'object', properties: sizeModelProperties() },\n { name: 'margin', label: 'Margin', type: 'object', properties: spacingModelProperties() },\n ],\n }\n}\n\nfunction imageModifierDescriptor(): PropertyDescriptor {\n return {\n name: 'modifier',\n label: 'Modifier',\n type: 'object',\n properties: [\n ...modifierBaseProperties(),\n { name: 'width', label: 'Width', type: 'object', properties: sizeModelProperties() },\n { name: 'height', label: 'Height', type: 'object', properties: sizeModelProperties() },\n { name: 'padding', label: 'Padding', type: 'object', properties: spacingModelProperties() },\n { name: 'margin', label: 'Margin', type: 'object', properties: spacingModelProperties() },\n ],\n }\n}\n\nfunction containerModifierDescriptor(): PropertyDescriptor {\n return {\n name: 'modifier',\n label: 'Modifier',\n type: 'object',\n properties: [\n ...modifierBaseProperties(),\n { name: 'backgroundColor', label: 'Background Color', type: 'object', properties: backgroundColorModelProperties() },\n { name: 'width', label: 'Width', type: 'object', properties: sizeModelProperties() },\n { name: 'height', label: 'Height', type: 'object', properties: sizeModelProperties() },\n { name: 'padding', label: 'Padding', type: 'object', properties: spacingModelProperties() },\n { name: 'margin', label: 'Margin', type: 'object', properties: spacingModelProperties() },\n { name: 'aspectRatio', label: 'Aspect Ratio', type: 'number' },\n ],\n }\n}\n\n// === Arrangement descriptors ===\n\nfunction verticalArrangementDescriptor(): PropertyDescriptor {\n return {\n name: 'verticalArrangement',\n label: 'Vertical Arrangement',\n type: 'object',\n properties: [\n {\n name: 'type',\n label: 'Type',\n type: 'enum',\n enumValues: ['top', 'center', 'bottom', 'space_evenly', 'space_between', 'space_around', 'spaced_by'],\n },\n { name: 'spacing', label: 'Spacing', type: 'number' },\n ],\n }\n}\n\nfunction horizontalArrangementDescriptor(): PropertyDescriptor {\n return {\n name: 'horizontalArrangement',\n label: 'Horizontal Arrangement',\n type: 'object',\n properties: [\n {\n name: 'type',\n label: 'Type',\n type: 'enum',\n enumValues: ['start', 'center', 'end', 'space_between', 'space_evenly', 'space_around', 'spaced_by'],\n },\n { name: 'spacing', label: 'Spacing', type: 'number' },\n ],\n }\n}\n\n// === Component definitions ===\n\nconst COMPONENT_DEFINITIONS: ComponentMeta[] = [\n {\n type: 'text',\n label: 'Text',\n acceptsChildren: false,\n properties: [\n { name: 'text', label: 'Text', type: 'string', required: true, defaultValue: 'Text' },\n { name: 'fontSize', label: 'Font Size', type: 'number' },\n { name: 'color', label: 'Color', type: 'object', properties: colorModelProperties() },\n { name: 'fontWeight', label: 'Font Weight', type: 'enum', enumValues: ['bold', 'medium', 'normal', 'semi_bold'] },\n { name: 'textAlign', label: 'Text Align', type: 'enum', enumValues: ['left', 'right', 'center', 'justify', 'start', 'end', 'unspecified'] },\n { name: 'overflow', label: 'Overflow', type: 'enum', enumValues: ['none', 'ellipsis'] },\n { name: 'maxLines', label: 'Max Lines', type: 'number' },\n { name: 'minLines', label: 'Min Lines', type: 'number', defaultValue: 1 },\n textModifierDescriptor(),\n ],\n },\n {\n type: 'image',\n label: 'Image',\n acceptsChildren: false,\n properties: [\n { name: 'image', label: 'Image URL', type: 'string', required: true },\n { name: 'scaleType', label: 'Scale Type', type: 'enum', enumValues: ['fit', 'crop', 'fill_height', 'fill_width', 'fill_bounds', 'inside', 'none'] },\n { name: 'contentDescription', label: 'Content Description', type: 'string' },\n { name: 'aspectRatio', label: 'Aspect Ratio', type: 'number' },\n { name: 'tintColor', label: 'Tint Color', type: 'object', properties: colorModelProperties() },\n imageModifierDescriptor(),\n ],\n },\n {\n type: 'box',\n label: 'Box',\n acceptsChildren: true,\n properties: [\n containerModifierDescriptor(),\n {\n name: 'alignment',\n label: 'Alignment',\n type: 'enum',\n enumValues: ['top_start', 'top_center', 'top_end', 'center_start', 'center', 'center_end', 'bottom_start', 'bottom_center', 'bottom_end'],\n },\n ],\n },\n {\n type: 'column',\n label: 'Column',\n acceptsChildren: true,\n properties: [\n containerModifierDescriptor(),\n verticalArrangementDescriptor(),\n { name: 'horizontalAlignment', label: 'Horizontal Alignment', type: 'enum', enumValues: ['start', 'end', 'center_horizontally'] },\n { name: 'canScroll', label: 'Can Scroll', type: 'boolean' },\n ],\n },\n {\n type: 'row',\n label: 'Row',\n acceptsChildren: true,\n properties: [\n containerModifierDescriptor(),\n { name: 'verticalAlignment', label: 'Vertical Alignment', type: 'enum', enumValues: ['top', 'bottom', 'center_vertically'] },\n horizontalArrangementDescriptor(),\n { name: 'canScroll', label: 'Can Scroll', type: 'boolean' },\n ],\n },\n {\n type: 'lazy_column',\n label: 'Lazy Column',\n acceptsChildren: true,\n properties: [\n containerModifierDescriptor(),\n verticalArrangementDescriptor(),\n ],\n },\n]\n\n// === Public API ===\n\nexport function getComponents(): ComponentMeta[] {\n return JSON.parse(JSON.stringify(COMPONENT_DEFINITIONS))\n}\n","export interface DevicePreset {\n name: string\n width: number\n height: number\n foldedWidth?: number\n foldedHeight?: number\n}\n\nexport type DeviceCategory = 'phone' | 'tablet'\n\nconst DEVICE_PRESETS: Record<DeviceCategory, Record<string, DevicePreset[]>> = {\n phone: {\n 'Google': [\n { name: 'Pixel 10', width: 412, height: 915 },\n { name: 'Pixel 10 Pro', width: 412, height: 915 },\n { name: 'Pixel 10 Pro XL', width: 448, height: 998 },\n { name: 'Pixel 10 Fold', width: 600, height: 748, foldedWidth: 360, foldedHeight: 748 },\n ],\n 'Samsung': [\n { name: 'Galaxy S26', width: 360, height: 780 },\n { name: 'Galaxy S26 Ultra', width: 412, height: 915 },\n { name: 'Galaxy Z Fold 7', width: 588, height: 748, foldedWidth: 360, foldedHeight: 748 },\n ],\n 'iOS': [\n { name: 'iPhone 17 Pro Max', width: 440, height: 956 },\n { name: 'iPhone 17 Pro', width: 402, height: 874 },\n { name: 'iPhone 17e', width: 375, height: 812 },\n { name: 'iPhone 17', width: 393, height: 852 },\n { name: 'iPhone Air', width: 402, height: 874 },\n ],\n },\n tablet: {\n 'Google': [\n { name: 'Pixel Tablet 2', width: 800, height: 1280 },\n ],\n 'Samsung': [\n { name: 'Galaxy Tab S11', width: 753, height: 1205 },\n { name: 'Galaxy Tab S11+', width: 834, height: 1334 },\n { name: 'Galaxy Tab S11 Ultra', width: 930, height: 1488 },\n ],\n 'iOS': [\n { name: 'iPad Pro 13\"', width: 1024, height: 1366 },\n { name: 'iPad Pro 11\"', width: 834, height: 1194 },\n { name: 'iPad Air', width: 820, height: 1180 },\n { name: 'iPad mini', width: 744, height: 1133 },\n ],\n },\n}\n\nexport function getDevicePresets(): Record<DeviceCategory, Record<string, DevicePreset[]>> {\n return JSON.parse(JSON.stringify(DEVICE_PRESETS))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,SAAS,aAAa,OAA+B,OAAkC;AAC5F,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,UAAU,QAAQ;AACpB,WAAO,MAAM,QAAQ,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B,OAAO,KAAK,QAAQ,KAAK;AAAA,IAC3D;AAAA,IACA,OAAO;AAAA,MACL,EAAE,MAAM,gBAAgB,OAAO,MAAM,QAAQ,KAAK;AAAA,MAClD,EAAE,MAAM,gBAAgB,OAAO,KAAK,QAAQ,KAAK;AAAA,MACjD,EAAE,MAAM,YAAY,OAAO,KAAK,QAAQ,KAAK;AAAA,MAC7C,EAAE,MAAM,aAAa,OAAO,KAAK,QAAQ,KAAK;AAAA,IAChD;AAAA,EACF;AACF;AAEO,SAAS,mBAA2E;AACzF,SAAO,KAAK,MAAM,KAAK,UAAU,cAAc,CAAC;AAClD;;;AZ5CO,SAAS,OAAO,MAAc,WAAwB,SAA+B;AAC1F,QAAM,SAAqB,KAAK,MAAM,IAAI;AAC1C,QAAM,QAAe,SAAS,SAAS;AAEvC,QAAM,OAAO,gBAAgB,OAAO,MAAM,KAAK;AAE/C,YAAU,YAAY;AACtB,YAAU,YAAY,IAAI;AAC5B;","names":["el"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -81,6 +81,7 @@ interface ImageUiProperties {
|
|
|
81
81
|
image?: string;
|
|
82
82
|
scaleType?: ContentScaleType;
|
|
83
83
|
contentDescription?: string;
|
|
84
|
+
aspectRatio?: number;
|
|
84
85
|
tintColor?: ColorModel;
|
|
85
86
|
}
|
|
86
87
|
interface BoxUiProperties {
|
|
@@ -136,9 +137,19 @@ interface ComponentMeta {
|
|
|
136
137
|
|
|
137
138
|
declare function getComponents(): ComponentMeta[];
|
|
138
139
|
|
|
140
|
+
interface DevicePreset {
|
|
141
|
+
name: string;
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
foldedWidth?: number;
|
|
145
|
+
foldedHeight?: number;
|
|
146
|
+
}
|
|
147
|
+
type DeviceCategory = 'phone' | 'tablet';
|
|
148
|
+
declare function getDevicePresets(): Record<DeviceCategory, Record<string, DevicePreset[]>>;
|
|
149
|
+
|
|
139
150
|
interface RenderOptions {
|
|
140
151
|
theme?: Theme;
|
|
141
152
|
}
|
|
142
153
|
declare function render(json: string, container: HTMLElement, options?: RenderOptions): void;
|
|
143
154
|
|
|
144
|
-
export { type ActionModel, type AlignmentType, type BackgroundColorModel, type BackgroundColorType, type BoxUiProperties, type ColorModel, type ColumnUiProperties, type ComponentMeta, type ComponentType, type ContainerUiModifier, type ContentScaleType, type DefaultUiProperties, type FontWeightType, type HorizontalAlignmentType, type HorizontalArrangementModel, type HorizontalArrangementType, type ImageUiModifier, type ImageUiProperties, type LazyColumnUiProperties, type ModifierBase, type PropertiesModel, type PropertyDescriptor, type PropertyType, type RenderOptions, type RowUiProperties, type SduiComponent, type SduiScreen, type SizeModel, type SizeUnitType, type SpacingModel, type TextAlignType, type TextOverflowType, type TextUiModifier, type TextUiProperties, type Theme, type VerticalAlignmentType, type VerticalArrangementModel, type VerticalArrangementType, getComponents, render };
|
|
155
|
+
export { type ActionModel, type AlignmentType, type BackgroundColorModel, type BackgroundColorType, type BoxUiProperties, type ColorModel, type ColumnUiProperties, type ComponentMeta, type ComponentType, type ContainerUiModifier, type ContentScaleType, type DefaultUiProperties, type DeviceCategory, type DevicePreset, type FontWeightType, type HorizontalAlignmentType, type HorizontalArrangementModel, type HorizontalArrangementType, type ImageUiModifier, type ImageUiProperties, type LazyColumnUiProperties, type ModifierBase, type PropertiesModel, type PropertyDescriptor, type PropertyType, type RenderOptions, type RowUiProperties, type SduiComponent, type SduiScreen, type SizeModel, type SizeUnitType, type SpacingModel, type TextAlignType, type TextOverflowType, type TextUiModifier, type TextUiProperties, type Theme, type VerticalAlignmentType, type VerticalArrangementModel, type VerticalArrangementType, getComponents, getDevicePresets, render };
|
package/dist/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ interface ImageUiProperties {
|
|
|
81
81
|
image?: string;
|
|
82
82
|
scaleType?: ContentScaleType;
|
|
83
83
|
contentDescription?: string;
|
|
84
|
+
aspectRatio?: number;
|
|
84
85
|
tintColor?: ColorModel;
|
|
85
86
|
}
|
|
86
87
|
interface BoxUiProperties {
|
|
@@ -136,9 +137,19 @@ interface ComponentMeta {
|
|
|
136
137
|
|
|
137
138
|
declare function getComponents(): ComponentMeta[];
|
|
138
139
|
|
|
140
|
+
interface DevicePreset {
|
|
141
|
+
name: string;
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
foldedWidth?: number;
|
|
145
|
+
foldedHeight?: number;
|
|
146
|
+
}
|
|
147
|
+
type DeviceCategory = 'phone' | 'tablet';
|
|
148
|
+
declare function getDevicePresets(): Record<DeviceCategory, Record<string, DevicePreset[]>>;
|
|
149
|
+
|
|
139
150
|
interface RenderOptions {
|
|
140
151
|
theme?: Theme;
|
|
141
152
|
}
|
|
142
153
|
declare function render(json: string, container: HTMLElement, options?: RenderOptions): void;
|
|
143
154
|
|
|
144
|
-
export { type ActionModel, type AlignmentType, type BackgroundColorModel, type BackgroundColorType, type BoxUiProperties, type ColorModel, type ColumnUiProperties, type ComponentMeta, type ComponentType, type ContainerUiModifier, type ContentScaleType, type DefaultUiProperties, type FontWeightType, type HorizontalAlignmentType, type HorizontalArrangementModel, type HorizontalArrangementType, type ImageUiModifier, type ImageUiProperties, type LazyColumnUiProperties, type ModifierBase, type PropertiesModel, type PropertyDescriptor, type PropertyType, type RenderOptions, type RowUiProperties, type SduiComponent, type SduiScreen, type SizeModel, type SizeUnitType, type SpacingModel, type TextAlignType, type TextOverflowType, type TextUiModifier, type TextUiProperties, type Theme, type VerticalAlignmentType, type VerticalArrangementModel, type VerticalArrangementType, getComponents, render };
|
|
155
|
+
export { type ActionModel, type AlignmentType, type BackgroundColorModel, type BackgroundColorType, type BoxUiProperties, type ColorModel, type ColumnUiProperties, type ComponentMeta, type ComponentType, type ContainerUiModifier, type ContentScaleType, type DefaultUiProperties, type DeviceCategory, type DevicePreset, type FontWeightType, type HorizontalAlignmentType, type HorizontalArrangementModel, type HorizontalArrangementType, type ImageUiModifier, type ImageUiProperties, type LazyColumnUiProperties, type ModifierBase, type PropertiesModel, type PropertyDescriptor, type PropertyType, type RenderOptions, type RowUiProperties, type SduiComponent, type SduiScreen, type SizeModel, type SizeUnitType, type SpacingModel, type TextAlignType, type TextOverflowType, type TextUiModifier, type TextUiProperties, type Theme, type VerticalAlignmentType, type VerticalArrangementModel, type VerticalArrangementType, getComponents, getDevicePresets, render };
|
package/dist/index.js
CHANGED
|
@@ -227,36 +227,35 @@ function renderText(component, theme) {
|
|
|
227
227
|
function renderImage(component, theme) {
|
|
228
228
|
const props = component.properties;
|
|
229
229
|
const el = document.createElement("img");
|
|
230
|
+
el.style.display = "block";
|
|
231
|
+
el.style.boxSizing = "border-box";
|
|
230
232
|
if (props?.image) {
|
|
231
233
|
el.src = props.image;
|
|
232
234
|
}
|
|
233
235
|
if (props?.contentDescription) {
|
|
234
236
|
el.alt = props.contentDescription;
|
|
235
237
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
el.style.objectFit = "none";
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
238
|
+
switch (props?.scaleType) {
|
|
239
|
+
case "crop":
|
|
240
|
+
el.style.objectFit = "cover";
|
|
241
|
+
break;
|
|
242
|
+
case "fill_bounds":
|
|
243
|
+
el.style.objectFit = "fill";
|
|
244
|
+
break;
|
|
245
|
+
case "fill_width":
|
|
246
|
+
el.style.objectFit = "cover";
|
|
247
|
+
el.style.width = "100%";
|
|
248
|
+
break;
|
|
249
|
+
case "fill_height":
|
|
250
|
+
el.style.objectFit = "cover";
|
|
251
|
+
el.style.height = "100%";
|
|
252
|
+
break;
|
|
253
|
+
case "none":
|
|
254
|
+
el.style.objectFit = "none";
|
|
255
|
+
break;
|
|
256
|
+
default:
|
|
257
|
+
el.style.objectFit = "contain";
|
|
258
|
+
break;
|
|
260
259
|
}
|
|
261
260
|
if (props?.tintColor) {
|
|
262
261
|
const c = resolveColor(props.tintColor, theme);
|
|
@@ -264,6 +263,9 @@ function renderImage(component, theme) {
|
|
|
264
263
|
el.style.filter = `opacity(0.5) drop-shadow(0 0 0 ${c})`;
|
|
265
264
|
}
|
|
266
265
|
}
|
|
266
|
+
if (props?.aspectRatio != null) {
|
|
267
|
+
el.style.aspectRatio = `${props.aspectRatio}`;
|
|
268
|
+
}
|
|
267
269
|
applyModifier(el, props?.modifier, theme);
|
|
268
270
|
return el;
|
|
269
271
|
}
|
|
@@ -492,6 +494,9 @@ function renderComponent(component, theme) {
|
|
|
492
494
|
}
|
|
493
495
|
const el = renderer(component, theme);
|
|
494
496
|
el.dataset.sduiType = component.type;
|
|
497
|
+
if (component.__builderId) {
|
|
498
|
+
el.dataset.sduiId = component.__builderId;
|
|
499
|
+
}
|
|
495
500
|
if (component.children && component.children.length > 0) {
|
|
496
501
|
for (const child of component.children) {
|
|
497
502
|
el.appendChild(renderComponent(child, theme));
|
|
@@ -578,8 +583,7 @@ function imageModifierDescriptor() {
|
|
|
578
583
|
{ name: "width", label: "Width", type: "object", properties: sizeModelProperties() },
|
|
579
584
|
{ name: "height", label: "Height", type: "object", properties: sizeModelProperties() },
|
|
580
585
|
{ name: "padding", label: "Padding", type: "object", properties: spacingModelProperties() },
|
|
581
|
-
{ name: "margin", label: "Margin", type: "object", properties: spacingModelProperties() }
|
|
582
|
-
{ name: "aspectRatio", label: "Aspect Ratio", type: "number" }
|
|
586
|
+
{ name: "margin", label: "Margin", type: "object", properties: spacingModelProperties() }
|
|
583
587
|
]
|
|
584
588
|
};
|
|
585
589
|
}
|
|
@@ -653,11 +657,12 @@ var COMPONENT_DEFINITIONS = [
|
|
|
653
657
|
label: "Image",
|
|
654
658
|
acceptsChildren: false,
|
|
655
659
|
properties: [
|
|
656
|
-
imageModifierDescriptor(),
|
|
657
660
|
{ name: "image", label: "Image URL", type: "string", required: true },
|
|
658
661
|
{ name: "scaleType", label: "Scale Type", type: "enum", enumValues: ["fit", "crop", "fill_height", "fill_width", "fill_bounds", "inside", "none"] },
|
|
659
662
|
{ name: "contentDescription", label: "Content Description", type: "string" },
|
|
660
|
-
{ name: "
|
|
663
|
+
{ name: "aspectRatio", label: "Aspect Ratio", type: "number" },
|
|
664
|
+
{ name: "tintColor", label: "Tint Color", type: "object", properties: colorModelProperties() },
|
|
665
|
+
imageModifierDescriptor()
|
|
661
666
|
]
|
|
662
667
|
},
|
|
663
668
|
{
|
|
@@ -710,6 +715,49 @@ function getComponents() {
|
|
|
710
715
|
return JSON.parse(JSON.stringify(COMPONENT_DEFINITIONS));
|
|
711
716
|
}
|
|
712
717
|
|
|
718
|
+
// src/device-presets.ts
|
|
719
|
+
var DEVICE_PRESETS = {
|
|
720
|
+
phone: {
|
|
721
|
+
"Google": [
|
|
722
|
+
{ name: "Pixel 10", width: 412, height: 915 },
|
|
723
|
+
{ name: "Pixel 10 Pro", width: 412, height: 915 },
|
|
724
|
+
{ name: "Pixel 10 Pro XL", width: 448, height: 998 },
|
|
725
|
+
{ name: "Pixel 10 Fold", width: 600, height: 748, foldedWidth: 360, foldedHeight: 748 }
|
|
726
|
+
],
|
|
727
|
+
"Samsung": [
|
|
728
|
+
{ name: "Galaxy S26", width: 360, height: 780 },
|
|
729
|
+
{ name: "Galaxy S26 Ultra", width: 412, height: 915 },
|
|
730
|
+
{ name: "Galaxy Z Fold 7", width: 588, height: 748, foldedWidth: 360, foldedHeight: 748 }
|
|
731
|
+
],
|
|
732
|
+
"iOS": [
|
|
733
|
+
{ name: "iPhone 17 Pro Max", width: 440, height: 956 },
|
|
734
|
+
{ name: "iPhone 17 Pro", width: 402, height: 874 },
|
|
735
|
+
{ name: "iPhone 17e", width: 375, height: 812 },
|
|
736
|
+
{ name: "iPhone 17", width: 393, height: 852 },
|
|
737
|
+
{ name: "iPhone Air", width: 402, height: 874 }
|
|
738
|
+
]
|
|
739
|
+
},
|
|
740
|
+
tablet: {
|
|
741
|
+
"Google": [
|
|
742
|
+
{ name: "Pixel Tablet 2", width: 800, height: 1280 }
|
|
743
|
+
],
|
|
744
|
+
"Samsung": [
|
|
745
|
+
{ name: "Galaxy Tab S11", width: 753, height: 1205 },
|
|
746
|
+
{ name: "Galaxy Tab S11+", width: 834, height: 1334 },
|
|
747
|
+
{ name: "Galaxy Tab S11 Ultra", width: 930, height: 1488 }
|
|
748
|
+
],
|
|
749
|
+
"iOS": [
|
|
750
|
+
{ name: 'iPad Pro 13"', width: 1024, height: 1366 },
|
|
751
|
+
{ name: 'iPad Pro 11"', width: 834, height: 1194 },
|
|
752
|
+
{ name: "iPad Air", width: 820, height: 1180 },
|
|
753
|
+
{ name: "iPad mini", width: 744, height: 1133 }
|
|
754
|
+
]
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
function getDevicePresets() {
|
|
758
|
+
return JSON.parse(JSON.stringify(DEVICE_PRESETS));
|
|
759
|
+
}
|
|
760
|
+
|
|
713
761
|
// src/index.ts
|
|
714
762
|
function render(json, container, options) {
|
|
715
763
|
const screen = JSON.parse(json);
|
|
@@ -720,6 +768,7 @@ function render(json, container, options) {
|
|
|
720
768
|
}
|
|
721
769
|
export {
|
|
722
770
|
getComponents,
|
|
771
|
+
getDevicePresets,
|
|
723
772
|
render
|
|
724
773
|
};
|
|
725
774
|
//# sourceMappingURL=index.js.map
|