create-mendix-widget-gleam 2.0.21 → 3.0.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/README.md CHANGED
@@ -30,7 +30,7 @@ my-widget/
30
30
  widgets/ # .mpk 위젯 파일 (glendix/widget로 바인딩)
31
31
  bindings.json # 외부 React 컴포넌트 바인딩 설정
32
32
  package.json # npm 의존성 (React, 외부 라이브러리 등)
33
- gleam.toml # Gleam 프로젝트 설정 (glendix >= 2.0.20 의존성 포함)
33
+ gleam.toml # Gleam 프로젝트 설정 (glendix >= 3.0.0 의존성 포함)
34
34
  CLAUDE.md # AI 어시스턴트용 프로젝트 컨텍스트
35
35
  ```
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mendix-widget-gleam",
3
- "version": "2.0.21",
3
+ "version": "3.0.0",
4
4
  "description": "Scaffold a Mendix Pluggable Widget powered by Gleam",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/src/i18n.mjs CHANGED
@@ -251,7 +251,7 @@ const templateComments = {
251
251
  // __widget_name__.gleam
252
252
  widget_main_1: '// Mendix Pluggable Widget - "Hello World"',
253
253
  widget_main_2:
254
- "// React functional component: fn(JsProps) -> ReactElement",
254
+ "// React functional component: fn(JsProps) -> Element",
255
255
  widget_main_doc:
256
256
  "/// Main widget function - called by Mendix runtime as a React component",
257
257
 
@@ -297,7 +297,7 @@ const templateComments = {
297
297
  // __widget_name__.gleam
298
298
  widget_main_1: '// Mendix Pluggable Widget - "Hello World"',
299
299
  widget_main_2:
300
- "// React 함수형 컴포넌트: fn(JsProps) -> ReactElement",
300
+ "// React 함수형 컴포넌트: fn(JsProps) -> Element",
301
301
  widget_main_doc:
302
302
  "/// 위젯 메인 함수 - Mendix 런타임이 React 컴포넌트로 호출",
303
303
 
@@ -342,7 +342,7 @@ const templateComments = {
342
342
  // __widget_name__.gleam
343
343
  widget_main_1: '// Mendix Pluggable Widget - "Hello World"',
344
344
  widget_main_2:
345
- "// React関数コンポーネント: fn(JsProps) -> ReactElement",
345
+ "// React関数コンポーネント: fn(JsProps) -> Element",
346
346
  widget_main_doc:
347
347
  "/// ウィジェットメイン関数 - MendixランタイムがReactコンポーネントとして呼び出し",
348
348
 
@@ -41,7 +41,7 @@ IMPORTANT: Breaking these rules will break the build or compromise the architect
41
41
  - **Do not write JSX/JS files directly.** All widget logic and UI must be written in Gleam
42
42
  - **Do not write FFI files (.mjs) in the widget project.** React/Mendix FFI is provided by the glendix package
43
43
  - **Do not manually manage bridge JS files (src/*.js).** glendix auto-generates/deletes them at build time
44
- - **Do not use external Gleam React libraries such as Redraw.** Use only glendix for React bindings
44
+ - **React bindings use \`redraw\`/\`redraw_dom\` packages.** glendix v3.0 no longer provides React bindings directly
45
45
  - The Gleam compilation output path (\`build/dev/javascript/{gleam.toml name}/\`) must match the Rollup input path
46
46
  - Mendix widget names allow only alphabetic characters (a-zA-Z)
47
47
 
@@ -53,7 +53,7 @@ IMPORTANT: Breaking these rules will break the build or compromise the architect
53
53
 
54
54
  ## Architecture
55
55
 
56
- Widget entry point signature: \`pub fn widget(props: JsProps) -> ReactElement\` — identical to a React functional component.
56
+ Widget entry point signature: \`pub fn widget(props: JsProps) -> Element\` — identical to a React functional component. \`JsProps\` from \`glendix/mendix\`, \`Element\` from \`redraw\`.
57
57
 
58
58
  - \`src/${names.snakeCase}.gleam\` — Main widget (called by Mendix runtime)
59
59
  - \`src/editor_config.gleam\` — Studio Pro property panel configuration
@@ -84,7 +84,8 @@ src/*.gleam → gleam build → build/dev/javascript/**/*.mjs → Bridge JS (aut
84
84
  - Mendix props (\`JsProps\`) are accessed via \`mendix.get_prop\`/\`mendix.get_string_prop\` etc.
85
85
  - Mendix complex types (\`EditableValue\`, \`ActionValue\`, \`ListValue\`) are opaque types with FFI accessors
86
86
  - JS \`undefined\` ↔ Gleam \`Option\` conversion is handled automatically at the FFI boundary
87
- - HTML attributes use the Attribute list API: \`[attribute.class("x"), event.on_click(handler)]\`
87
+ - HTML elements use \`redraw/dom/html\`, attributes use \`redraw/dom/attribute\`, events use \`redraw/dom/events\`
88
+ - lustre TEA pattern is supported via \`glendix/lustre\` bridge (optional)
88
89
  - Gleam tuples \`#(a, b)\` = JS \`[a, b]\` — directly compatible with \`useState\` return values
89
90
 
90
91
  ## Reference Docs
@@ -33,19 +33,19 @@ A Mendix Pluggable Widget written in Gleam.
33
33
 
34
34
  ## Core Principles
35
35
 
36
- The Gleam function \`fn(JsProps) -> ReactElement\` has the same signature as a React functional component. glendix provides type-safe access to React primitives and Mendix runtime type accessors, so widget projects only need to focus on business logic.
36
+ The Gleam function \`fn(JsProps) -> Element\` has the same signature as a React functional component. React bindings come from the \`redraw\`/\`redraw_dom\` packages, while glendix handles Mendix API access and JS interop, so widget projects only need to focus on business logic.
37
37
 
38
38
  \`\`\`gleam
39
39
  // src/${names.snakeCase}.gleam
40
- import glendix/mendix
41
- import glendix/react.{type JsProps, type ReactElement}
42
- import glendix/react/attribute
43
- import glendix/react/html
40
+ import glendix/mendix.{type JsProps}
41
+ import redraw.{type Element}
42
+ import redraw/dom/attribute
43
+ import redraw/dom/html
44
44
 
45
- pub fn widget(props: JsProps) -> ReactElement {
45
+ pub fn widget(props: JsProps) -> Element {
46
46
  let sample_text = mendix.get_string_prop(props, "sampleText")
47
47
  html.div([attribute.class("widget-hello-world")], [
48
- react.text("Hello " <> sample_text),
48
+ html.text("Hello " <> sample_text),
49
49
  ])
50
50
  }
51
51
  \`\`\`
@@ -53,11 +53,12 @@ pub fn widget(props: JsProps) -> ReactElement {
53
53
  Mendix complex types can also be used type-safely from Gleam:
54
54
 
55
55
  \`\`\`gleam
56
- import glendix/mendix
56
+ import glendix/mendix.{type JsProps}
57
57
  import glendix/mendix/editable_value
58
58
  import glendix/mendix/action
59
+ import redraw.{type Element}
59
60
 
60
- pub fn widget(props: JsProps) -> ReactElement {
61
+ pub fn widget(props: JsProps) -> Element {
61
62
  // Access EditableValue
62
63
  let name_attr: EditableValue = mendix.get_prop_required(props, "name")
63
64
  let display = editable_value.display_value(name_attr)
@@ -126,7 +127,7 @@ bindings.json # External React component binding configurat
126
127
  package.json # npm dependencies (React, external libraries, etc.)
127
128
  \`\`\`
128
129
 
129
- React/Mendix FFI and JS Interop bindings are provided by the [glendix](https://hexdocs.pm/glendix/) Hex package.
130
+ React bindings come from [redraw](https://hexdocs.pm/redraw/)/[redraw_dom](https://hexdocs.pm/redraw_dom/), while Mendix API and JS Interop bindings are provided by [glendix](https://hexdocs.pm/glendix/).
130
131
 
131
132
  ## Using External React Components
132
133
 
@@ -162,17 +163,18 @@ gleam run -m glendix/install
162
163
 
163
164
  \`\`\`gleam
164
165
  import glendix/binding
165
- import glendix/react.{type ReactElement}
166
- import glendix/react/attribute.{type Attribute}
166
+ import glendix/interop
167
+ import redraw.{type Element}
168
+ import redraw/dom/attribute.{type Attribute}
167
169
 
168
170
  fn m() { binding.module("recharts") }
169
171
 
170
- pub fn pie_chart(attrs: List(Attribute), children: List(ReactElement)) -> ReactElement {
171
- react.component_el(binding.resolve(m(), "PieChart"), attrs, children)
172
+ pub fn pie_chart(attrs: List(Attribute), children: List(Element)) -> Element {
173
+ interop.component_el(binding.resolve(m(), "PieChart"), attrs, children)
172
174
  }
173
175
 
174
- pub fn tooltip(attrs: List(Attribute)) -> ReactElement {
175
- react.void_component_el(binding.resolve(m(), "Tooltip"), attrs)
176
+ pub fn tooltip(attrs: List(Attribute)) -> Element {
177
+ interop.void_component_el(binding.resolve(m(), "Tooltip"), attrs)
176
178
  }
177
179
  \`\`\`
178
180
 
@@ -229,18 +231,19 @@ This automatically:
229
231
 
230
232
  \`\`\`gleam
231
233
  // src/widgets/switch.gleam (auto-generated)
232
- import glendix/mendix
233
- import glendix/react.{type JsProps, type ReactElement}
234
- import glendix/react/attribute
234
+ import glendix/mendix.{type JsProps}
235
+ import glendix/interop
236
+ import redraw.{type Element}
237
+ import redraw/dom/attribute
235
238
  import glendix/widget
236
239
 
237
240
  /// Render Switch widget - reads properties from props and passes them to the widget
238
- pub fn render(props: JsProps) -> ReactElement {
241
+ pub fn render(props: JsProps) -> Element {
239
242
  let boolean_attribute = mendix.get_prop_required(props, "booleanAttribute")
240
243
  let action = mendix.get_prop_required(props, "action")
241
244
 
242
245
  let comp = widget.component("Switch")
243
- react.component_el(
246
+ interop.component_el(
244
247
  comp,
245
248
  [
246
249
  attribute.attribute("booleanAttribute", boolean_attribute),
@@ -267,7 +270,8 @@ Widget names use the \`<name>\` value from the \`.mpk\`'s internal XML, and prop
267
270
  ## Tech Stack
268
271
 
269
272
  - **Gleam** → JavaScript compilation
270
- - **[glendix](https://hexdocs.pm/glendix/)** — React + Mendix API + JS Interop Gleam bindings
273
+ - **[glendix](https://hexdocs.pm/glendix/)** — Mendix API + JS Interop Gleam bindings
274
+ - **[redraw](https://hexdocs.pm/redraw/)** / **[redraw_dom](https://hexdocs.pm/redraw_dom/)** — React Gleam bindings
271
275
  - **Mendix Pluggable Widget** (React 19)
272
276
  - **${pm}** — Package manager
273
277
 
@@ -288,19 +292,19 @@ Gleam 언어로 작성된 Mendix Pluggable Widget.
288
292
 
289
293
  ## 핵심 원리
290
294
 
291
- Gleam 함수 \`fn(JsProps) -> ReactElement\`는 React 함수형 컴포넌트와 동일한 시그니처다. glendix가 React 원시 함수와 Mendix 런타임 타입 접근자를 타입 안전하게 제공하므로, 위젯 프로젝트에서는 비즈니스 로직에만 집중하면 된다.
295
+ Gleam 함수 \`fn(JsProps) -> Element\`는 React 함수형 컴포넌트와 동일한 시그니처다. React 바인딩은 \`redraw\`/\`redraw_dom\` 패키지가, Mendix API 접근과 JS interop은 glendix가 제공하므로, 위젯 프로젝트에서는 비즈니스 로직에만 집중하면 된다.
292
296
 
293
297
  \`\`\`gleam
294
298
  // src/${names.snakeCase}.gleam
295
- import glendix/mendix
296
- import glendix/react.{type JsProps, type ReactElement}
297
- import glendix/react/attribute
298
- import glendix/react/html
299
+ import glendix/mendix.{type JsProps}
300
+ import redraw.{type Element}
301
+ import redraw/dom/attribute
302
+ import redraw/dom/html
299
303
 
300
- pub fn widget(props: JsProps) -> ReactElement {
304
+ pub fn widget(props: JsProps) -> Element {
301
305
  let sample_text = mendix.get_string_prop(props, "sampleText")
302
306
  html.div([attribute.class("widget-hello-world")], [
303
- react.text("Hello " <> sample_text),
307
+ html.text("Hello " <> sample_text),
304
308
  ])
305
309
  }
306
310
  \`\`\`
@@ -308,11 +312,12 @@ pub fn widget(props: JsProps) -> ReactElement {
308
312
  Mendix 복합 타입도 Gleam에서 타입 안전하게 사용할 수 있다:
309
313
 
310
314
  \`\`\`gleam
311
- import glendix/mendix
315
+ import glendix/mendix.{type JsProps}
312
316
  import glendix/mendix/editable_value
313
317
  import glendix/mendix/action
318
+ import redraw.{type Element}
314
319
 
315
- pub fn widget(props: JsProps) -> ReactElement {
320
+ pub fn widget(props: JsProps) -> Element {
316
321
  // EditableValue 접근
317
322
  let name_attr: EditableValue = mendix.get_prop_required(props, "name")
318
323
  let display = editable_value.display_value(name_attr)
@@ -381,7 +386,7 @@ bindings.json # 외부 React 컴포넌트 바인딩 설정
381
386
  package.json # npm 의존성 (React, 외부 라이브러리 등)
382
387
  \`\`\`
383
388
 
384
- React/Mendix FFI 및 JS Interop 바인딩은 [glendix](https://hexdocs.pm/glendix/) Hex 패키지로 제공됩니다.
389
+ React 바인딩은 [redraw](https://hexdocs.pm/redraw/)/[redraw_dom](https://hexdocs.pm/redraw_dom/)이, Mendix API 및 JS Interop 바인딩은 [glendix](https://hexdocs.pm/glendix/) 제공합니다.
385
390
 
386
391
  ## 외부 React 컴포넌트 사용
387
392
 
@@ -417,17 +422,18 @@ gleam run -m glendix/install
417
422
 
418
423
  \`\`\`gleam
419
424
  import glendix/binding
420
- import glendix/react.{type ReactElement}
421
- import glendix/react/attribute.{type Attribute}
425
+ import glendix/interop
426
+ import redraw.{type Element}
427
+ import redraw/dom/attribute.{type Attribute}
422
428
 
423
429
  fn m() { binding.module("recharts") }
424
430
 
425
- pub fn pie_chart(attrs: List(Attribute), children: List(ReactElement)) -> ReactElement {
426
- react.component_el(binding.resolve(m(), "PieChart"), attrs, children)
431
+ pub fn pie_chart(attrs: List(Attribute), children: List(Element)) -> Element {
432
+ interop.component_el(binding.resolve(m(), "PieChart"), attrs, children)
427
433
  }
428
434
 
429
- pub fn tooltip(attrs: List(Attribute)) -> ReactElement {
430
- react.void_component_el(binding.resolve(m(), "Tooltip"), attrs)
435
+ pub fn tooltip(attrs: List(Attribute)) -> Element {
436
+ interop.void_component_el(binding.resolve(m(), "Tooltip"), attrs)
431
437
  }
432
438
  \`\`\`
433
439
 
@@ -484,18 +490,19 @@ gleam run -m glendix/install
484
490
 
485
491
  \`\`\`gleam
486
492
  // src/widgets/switch.gleam (자동 생성)
487
- import glendix/mendix
488
- import glendix/react.{type JsProps, type ReactElement}
489
- import glendix/react/attribute
493
+ import glendix/mendix.{type JsProps}
494
+ import glendix/interop
495
+ import redraw.{type Element}
496
+ import redraw/dom/attribute
490
497
  import glendix/widget
491
498
 
492
499
  /// Switch 위젯 렌더링 - props에서 속성을 읽어 위젯에 전달
493
- pub fn render(props: JsProps) -> ReactElement {
500
+ pub fn render(props: JsProps) -> Element {
494
501
  let boolean_attribute = mendix.get_prop_required(props, "booleanAttribute")
495
502
  let action = mendix.get_prop_required(props, "action")
496
503
 
497
504
  let comp = widget.component("Switch")
498
- react.component_el(
505
+ interop.component_el(
499
506
  comp,
500
507
  [
501
508
  attribute.attribute("booleanAttribute", boolean_attribute),
@@ -522,7 +529,8 @@ switch.render(props)
522
529
  ## 기술 스택
523
530
 
524
531
  - **Gleam** → JavaScript 컴파일
525
- - **[glendix](https://hexdocs.pm/glendix/)** — React + Mendix API + JS Interop Gleam 바인딩
532
+ - **[glendix](https://hexdocs.pm/glendix/)** — Mendix API + JS Interop Gleam 바인딩
533
+ - **[redraw](https://hexdocs.pm/redraw/)** / **[redraw_dom](https://hexdocs.pm/redraw_dom/)** — React Gleam 바인딩
526
534
  - **Mendix Pluggable Widget** (React 19)
527
535
  - **${pm}** — 패키지 매니저
528
536
 
@@ -543,19 +551,19 @@ Gleam言語で作成されたMendix Pluggable Widget。
543
551
 
544
552
  ## 基本原理
545
553
 
546
- Gleam関数 \`fn(JsProps) -> ReactElement\` はReact関数コンポーネントと同一のシグネチャを持つ。glendixがReactプリミティブ関数とMendixランタイム型アクセサを型安全に提供するため、ウィジェットプロジェクトではビジネスロジックにのみ集中すればよい。
554
+ Gleam関数 \`fn(JsProps) -> Element\` はReact関数コンポーネントと同一のシグネチャを持つ。Reactバインディングは\`redraw\`/\`redraw_dom\`パッケージが、Mendix APIアクセスとJS interopはglendixが提供するため、ウィジェットプロジェクトではビジネスロジックにのみ集中すればよい。
547
555
 
548
556
  \`\`\`gleam
549
557
  // src/${names.snakeCase}.gleam
550
- import glendix/mendix
551
- import glendix/react.{type JsProps, type ReactElement}
552
- import glendix/react/attribute
553
- import glendix/react/html
558
+ import glendix/mendix.{type JsProps}
559
+ import redraw.{type Element}
560
+ import redraw/dom/attribute
561
+ import redraw/dom/html
554
562
 
555
- pub fn widget(props: JsProps) -> ReactElement {
563
+ pub fn widget(props: JsProps) -> Element {
556
564
  let sample_text = mendix.get_string_prop(props, "sampleText")
557
565
  html.div([attribute.class("widget-hello-world")], [
558
- react.text("Hello " <> sample_text),
566
+ html.text("Hello " <> sample_text),
559
567
  ])
560
568
  }
561
569
  \`\`\`
@@ -563,11 +571,12 @@ pub fn widget(props: JsProps) -> ReactElement {
563
571
  Mendixの複合型もGleamから型安全に使用できる:
564
572
 
565
573
  \`\`\`gleam
566
- import glendix/mendix
574
+ import glendix/mendix.{type JsProps}
567
575
  import glendix/mendix/editable_value
568
576
  import glendix/mendix/action
577
+ import redraw.{type Element}
569
578
 
570
- pub fn widget(props: JsProps) -> ReactElement {
579
+ pub fn widget(props: JsProps) -> Element {
571
580
  // EditableValueへのアクセス
572
581
  let name_attr: EditableValue = mendix.get_prop_required(props, "name")
573
582
  let display = editable_value.display_value(name_attr)
@@ -636,7 +645,7 @@ bindings.json # 外部Reactコンポーネントバイン
636
645
  package.json # npm依存関係(React、外部ライブラリなど)
637
646
  \`\`\`
638
647
 
639
- React/Mendix FFIおよびJS Interopバインディングは[glendix](https://hexdocs.pm/glendix/) Hexパッケージとして提供される。
648
+ Reactバインディングは[redraw](https://hexdocs.pm/redraw/)/[redraw_dom](https://hexdocs.pm/redraw_dom/)が、Mendix APIおよびJS Interopバインディングは[glendix](https://hexdocs.pm/glendix/)が提供する。
640
649
 
641
650
  ## 外部Reactコンポーネントの使用
642
651
 
@@ -672,17 +681,18 @@ gleam run -m glendix/install
672
681
 
673
682
  \`\`\`gleam
674
683
  import glendix/binding
675
- import glendix/react.{type ReactElement}
676
- import glendix/react/attribute.{type Attribute}
684
+ import glendix/interop
685
+ import redraw.{type Element}
686
+ import redraw/dom/attribute.{type Attribute}
677
687
 
678
688
  fn m() { binding.module("recharts") }
679
689
 
680
- pub fn pie_chart(attrs: List(Attribute), children: List(ReactElement)) -> ReactElement {
681
- react.component_el(binding.resolve(m(), "PieChart"), attrs, children)
690
+ pub fn pie_chart(attrs: List(Attribute), children: List(Element)) -> Element {
691
+ interop.component_el(binding.resolve(m(), "PieChart"), attrs, children)
682
692
  }
683
693
 
684
- pub fn tooltip(attrs: List(Attribute)) -> ReactElement {
685
- react.void_component_el(binding.resolve(m(), "Tooltip"), attrs)
694
+ pub fn tooltip(attrs: List(Attribute)) -> Element {
695
+ interop.void_component_el(binding.resolve(m(), "Tooltip"), attrs)
686
696
  }
687
697
  \`\`\`
688
698
 
@@ -739,18 +749,19 @@ gleam run -m glendix/install
739
749
 
740
750
  \`\`\`gleam
741
751
  // src/widgets/switch.gleam(自動生成)
742
- import glendix/mendix
743
- import glendix/react.{type JsProps, type ReactElement}
744
- import glendix/react/attribute
752
+ import glendix/mendix.{type JsProps}
753
+ import glendix/interop
754
+ import redraw.{type Element}
755
+ import redraw/dom/attribute
745
756
  import glendix/widget
746
757
 
747
758
  /// Switchウィジェットのレンダリング - propsからプロパティを読み取りウィジェットに渡す
748
- pub fn render(props: JsProps) -> ReactElement {
759
+ pub fn render(props: JsProps) -> Element {
749
760
  let boolean_attribute = mendix.get_prop_required(props, "booleanAttribute")
750
761
  let action = mendix.get_prop_required(props, "action")
751
762
 
752
763
  let comp = widget.component("Switch")
753
- react.component_el(
764
+ interop.component_el(
754
765
  comp,
755
766
  [
756
767
  attribute.attribute("booleanAttribute", boolean_attribute),
@@ -777,7 +788,8 @@ switch.render(props)
777
788
  ## 技術スタック
778
789
 
779
790
  - **Gleam** → JavaScriptコンパイル
780
- - **[glendix](https://hexdocs.pm/glendix/)** — React + Mendix API + JS Interop Gleamバインディング
791
+ - **[glendix](https://hexdocs.pm/glendix/)** — Mendix API + JS Interop Gleamバインディング
792
+ - **[redraw](https://hexdocs.pm/redraw/)** / **[redraw_dom](https://hexdocs.pm/redraw_dom/)** — React Gleamバインディング
781
793
  - **Mendix Pluggable Widget**(React 19)
782
794
  - **${pm}** — パッケージマネージャー
783
795
 
@@ -48,18 +48,19 @@ For example, placing \`Switch.mpk\` generates \`src/widgets/switch.gleam\`:
48
48
 
49
49
  \`\`\`gleam
50
50
  // src/widgets/switch.gleam (auto-generated)
51
- import glendix/mendix
52
- import glendix/react.{type JsProps, type ReactElement}
53
- import glendix/react/attribute
51
+ import glendix/interop
52
+ import glendix/mendix.{type JsProps}
54
53
  import glendix/widget
54
+ import redraw.{type Element}
55
+ import redraw/dom/attribute
55
56
 
56
57
  /// Render Switch widget - reads properties from props and passes them to the widget
57
- pub fn render(props: JsProps) -> ReactElement {
58
+ pub fn render(props: JsProps) -> Element {
58
59
  let boolean_attribute = mendix.get_prop_required(props, "booleanAttribute")
59
60
  let action = mendix.get_prop_required(props, "action")
60
61
 
61
62
  let comp = widget.component("Switch")
62
- react.component_el(
63
+ interop.component_el(
63
64
  comp,
64
65
  [
65
66
  attribute.attribute("booleanAttribute", boolean_attribute),
@@ -134,18 +135,19 @@ gleam run -m glendix/install
134
135
 
135
136
  \`\`\`gleam
136
137
  // src/widgets/switch.gleam (자동 생성)
137
- import glendix/mendix
138
- import glendix/react.{type JsProps, type ReactElement}
139
- import glendix/react/attribute
138
+ import glendix/interop
139
+ import glendix/mendix.{type JsProps}
140
140
  import glendix/widget
141
+ import redraw.{type Element}
142
+ import redraw/dom/attribute
141
143
 
142
144
  /// Switch 위젯 렌더링 - props에서 속성을 읽어 위젯에 전달
143
- pub fn render(props: JsProps) -> ReactElement {
145
+ pub fn render(props: JsProps) -> Element {
144
146
  let boolean_attribute = mendix.get_prop_required(props, "booleanAttribute")
145
147
  let action = mendix.get_prop_required(props, "action")
146
148
 
147
149
  let comp = widget.component("Switch")
148
- react.component_el(
150
+ interop.component_el(
149
151
  comp,
150
152
  [
151
153
  attribute.attribute("booleanAttribute", boolean_attribute),
@@ -220,18 +222,19 @@ gleam run -m glendix/install
220
222
 
221
223
  \`\`\`gleam
222
224
  // src/widgets/switch.gleam(自動生成)
223
- import glendix/mendix
224
- import glendix/react.{type JsProps, type ReactElement}
225
- import glendix/react/attribute
225
+ import glendix/interop
226
+ import glendix/mendix.{type JsProps}
226
227
  import glendix/widget
228
+ import redraw.{type Element}
229
+ import redraw/dom/attribute
227
230
 
228
231
  /// Switchウィジェットのレンダリング - propsからプロパティを読み取りウィジェットに渡す
229
- pub fn render(props: JsProps) -> ReactElement {
232
+ pub fn render(props: JsProps) -> Element {
230
233
  let boolean_attribute = mendix.get_prop_required(props, "booleanAttribute")
231
234
  let action = mendix.get_prop_required(props, "action")
232
235
 
233
236
  let comp = widget.component("Switch")
234
- react.component_el(
237
+ interop.component_el(
235
238
  comp,
236
239
  [
237
240
  attribute.attribute("booleanAttribute", boolean_attribute),