@easyops-cn/a2ui-react 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{a2ui-react3.js → 0.8/A2UIRenderer.js} +5 -5
- package/dist/0.8/components/ComponentRenderer.js +76 -0
- package/dist/{a2ui-react16.js → 0.8/components/display/AudioPlayerComponent.js} +2 -2
- package/dist/{a2ui-react17.js → 0.8/components/display/DividerComponent.js} +1 -1
- package/dist/0.8/components/display/IconComponent.js +68 -0
- package/dist/{a2ui-react13.js → 0.8/components/display/ImageComponent.js} +2 -2
- package/dist/{a2ui-react12.js → 0.8/components/display/TextComponent.js} +2 -2
- package/dist/{a2ui-react15.js → 0.8/components/display/VideoComponent.js} +2 -2
- package/dist/{a2ui-react24.js → 0.8/components/interactive/ButtonComponent.js} +3 -3
- package/dist/{a2ui-react25.js → 0.8/components/interactive/CheckBoxComponent.js} +4 -4
- package/dist/0.8/components/interactive/DateTimeInputComponent.js +98 -0
- package/dist/{a2ui-react28.js → 0.8/components/interactive/MultipleChoiceComponent.js} +5 -5
- package/dist/{a2ui-react29.js → 0.8/components/interactive/SliderComponent.js} +3 -3
- package/dist/{a2ui-react26.js → 0.8/components/interactive/TextFieldComponent.js} +5 -5
- package/dist/{a2ui-react21.js → 0.8/components/layout/CardComponent.js} +2 -2
- package/dist/{a2ui-react19.js → 0.8/components/layout/ColumnComponent.js} +4 -4
- package/dist/{a2ui-react20.js → 0.8/components/layout/ListComponent.js} +4 -4
- package/dist/{a2ui-react23.js → 0.8/components/layout/ModalComponent.js} +2 -2
- package/dist/{a2ui-react18.js → 0.8/components/layout/RowComponent.js} +4 -4
- package/dist/{a2ui-react22.js → 0.8/components/layout/TabsComponent.js} +3 -3
- package/dist/{a2ui-react7.js → 0.8/contexts/A2UIProvider.js} +3 -3
- package/dist/{a2ui-react30.js → 0.8/contexts/ActionContext.js} +2 -2
- package/dist/{a2ui-react31.js → 0.8/contexts/DataModelContext.js} +1 -1
- package/dist/{a2ui-react10.js → 0.8/hooks/useA2UIMessageHandler.js} +3 -3
- package/dist/{a2ui-react11.js → 0.8/hooks/useComponent.js} +1 -1
- package/dist/0.8/hooks/useDataBinding.js +23 -0
- package/dist/{a2ui-react5.js → 0.8/hooks/useDispatchAction.js} +1 -1
- package/dist/0.8/index.js +11 -0
- package/dist/{a2ui-react32.js → 0.8/utils/dataBinding.js} +1 -1
- package/dist/index.js +4 -0
- package/package.json +1 -1
- package/dist/a2ui-react.js +0 -4
- package/dist/a2ui-react100.js +0 -24
- package/dist/a2ui-react101.js +0 -255
- package/dist/a2ui-react102.js +0 -163
- package/dist/a2ui-react103.js +0 -19
- package/dist/a2ui-react104.js +0 -251
- package/dist/a2ui-react105.js +0 -61
- package/dist/a2ui-react106.js +0 -35
- package/dist/a2ui-react107.js +0 -436
- package/dist/a2ui-react108.js +0 -16
- package/dist/a2ui-react109.js +0 -234
- package/dist/a2ui-react110.js +0 -6
- package/dist/a2ui-react111.js +0 -6
- package/dist/a2ui-react112.js +0 -6
- package/dist/a2ui-react113.js +0 -239
- package/dist/a2ui-react114.js +0 -845
- package/dist/a2ui-react115.js +0 -6
- package/dist/a2ui-react116.js +0 -10
- package/dist/a2ui-react117.js +0 -8
- package/dist/a2ui-react118.js +0 -8
- package/dist/a2ui-react119.js +0 -20
- package/dist/a2ui-react120.js +0 -8
- package/dist/a2ui-react121.js +0 -8
- package/dist/a2ui-react122.js +0 -9
- package/dist/a2ui-react123.js +0 -16
- package/dist/a2ui-react124.js +0 -18
- package/dist/a2ui-react125.js +0 -11
- package/dist/a2ui-react126.js +0 -9
- package/dist/a2ui-react127.js +0 -13
- package/dist/a2ui-react128.js +0 -17
- package/dist/a2ui-react129.js +0 -8
- package/dist/a2ui-react130.js +0 -17
- package/dist/a2ui-react131.js +0 -8
- package/dist/a2ui-react132.js +0 -10
- package/dist/a2ui-react133.js +0 -9
- package/dist/a2ui-react134.js +0 -7
- package/dist/a2ui-react135.js +0 -9
- package/dist/a2ui-react136.js +0 -548
- package/dist/a2ui-react137.js +0 -49
- package/dist/a2ui-react138.js +0 -20
- package/dist/a2ui-react139.js +0 -21
- package/dist/a2ui-react14.js +0 -114
- package/dist/a2ui-react140.js +0 -11
- package/dist/a2ui-react141.js +0 -9
- package/dist/a2ui-react142.js +0 -10
- package/dist/a2ui-react143.js +0 -8
- package/dist/a2ui-react144.js +0 -9
- package/dist/a2ui-react145.js +0 -12
- package/dist/a2ui-react146.js +0 -8
- package/dist/a2ui-react147.js +0 -11
- package/dist/a2ui-react148.js +0 -15
- package/dist/a2ui-react149.js +0 -8
- package/dist/a2ui-react150.js +0 -12
- package/dist/a2ui-react151.js +0 -10
- package/dist/a2ui-react152.js +0 -12
- package/dist/a2ui-react153.js +0 -16
- package/dist/a2ui-react154.js +0 -8
- package/dist/a2ui-react155.js +0 -8
- package/dist/a2ui-react156.js +0 -8
- package/dist/a2ui-react157.js +0 -7
- package/dist/a2ui-react158.js +0 -14
- package/dist/a2ui-react159.js +0 -13
- package/dist/a2ui-react160.js +0 -13
- package/dist/a2ui-react161.js +0 -14
- package/dist/a2ui-react162.js +0 -14
- package/dist/a2ui-react163.js +0 -35
- package/dist/a2ui-react164.js +0 -67
- package/dist/a2ui-react165.js +0 -11
- package/dist/a2ui-react166.js +0 -11
- package/dist/a2ui-react167.js +0 -10
- package/dist/a2ui-react168.js +0 -13
- package/dist/a2ui-react169.js +0 -10
- package/dist/a2ui-react170.js +0 -10
- package/dist/a2ui-react171.js +0 -9
- package/dist/a2ui-react172.js +0 -17
- package/dist/a2ui-react173.js +0 -21
- package/dist/a2ui-react174.js +0 -18
- package/dist/a2ui-react175.js +0 -35
- package/dist/a2ui-react176.js +0 -14
- package/dist/a2ui-react177.js +0 -7
- package/dist/a2ui-react178.js +0 -58
- package/dist/a2ui-react179.js +0 -25
- package/dist/a2ui-react180.js +0 -43
- package/dist/a2ui-react181.js +0 -63
- package/dist/a2ui-react182.js +0 -34
- package/dist/a2ui-react183.js +0 -15
- package/dist/a2ui-react184.js +0 -67
- package/dist/a2ui-react185.js +0 -67
- package/dist/a2ui-react186.js +0 -69
- package/dist/a2ui-react187.js +0 -69
- package/dist/a2ui-react188.js +0 -42
- package/dist/a2ui-react189.js +0 -43
- package/dist/a2ui-react190.js +0 -55
- package/dist/a2ui-react191.js +0 -45
- package/dist/a2ui-react192.js +0 -41
- package/dist/a2ui-react193.js +0 -72
- package/dist/a2ui-react194.js +0 -72
- package/dist/a2ui-react195.js +0 -97
- package/dist/a2ui-react196.js +0 -42
- package/dist/a2ui-react197.js +0 -42
- package/dist/a2ui-react198.js +0 -42
- package/dist/a2ui-react199.js +0 -27
- package/dist/a2ui-react2.js +0 -11
- package/dist/a2ui-react200.js +0 -26
- package/dist/a2ui-react201.js +0 -26
- package/dist/a2ui-react202.js +0 -27
- package/dist/a2ui-react203.js +0 -26
- package/dist/a2ui-react204.js +0 -26
- package/dist/a2ui-react205.js +0 -16
- package/dist/a2ui-react206.js +0 -41
- package/dist/a2ui-react207.js +0 -41
- package/dist/a2ui-react208.js +0 -16
- package/dist/a2ui-react209.js +0 -16
- package/dist/a2ui-react210.js +0 -32
- package/dist/a2ui-react211.js +0 -32
- package/dist/a2ui-react212.js +0 -6
- package/dist/a2ui-react213.js +0 -9
- package/dist/a2ui-react214.js +0 -50
- package/dist/a2ui-react215.js +0 -29
- package/dist/a2ui-react216.js +0 -68
- package/dist/a2ui-react217.js +0 -10
- package/dist/a2ui-react218.js +0 -127
- package/dist/a2ui-react219.js +0 -17
- package/dist/a2ui-react220.js +0 -136
- package/dist/a2ui-react221.js +0 -13
- package/dist/a2ui-react222.js +0 -219
- package/dist/a2ui-react223.js +0 -15
- package/dist/a2ui-react224.js +0 -36
- package/dist/a2ui-react225.js +0 -49
- package/dist/a2ui-react226.js +0 -10
- package/dist/a2ui-react227.js +0 -52
- package/dist/a2ui-react228.js +0 -6
- package/dist/a2ui-react229.js +0 -8
- package/dist/a2ui-react230.js +0 -30
- package/dist/a2ui-react231.js +0 -52
- package/dist/a2ui-react232.js +0 -11
- package/dist/a2ui-react233.js +0 -70
- package/dist/a2ui-react234.js +0 -49
- package/dist/a2ui-react235.js +0 -27
- package/dist/a2ui-react236.js +0 -49
- package/dist/a2ui-react237.js +0 -183
- package/dist/a2ui-react238.js +0 -70
- package/dist/a2ui-react239.js +0 -33
- package/dist/a2ui-react240.js +0 -11
- package/dist/a2ui-react241.js +0 -155
- package/dist/a2ui-react242.js +0 -110
- package/dist/a2ui-react243.js +0 -22
- package/dist/a2ui-react244.js +0 -100
- package/dist/a2ui-react245.js +0 -49
- package/dist/a2ui-react246.js +0 -14
- package/dist/a2ui-react247.js +0 -208
- package/dist/a2ui-react248.js +0 -24
- package/dist/a2ui-react249.js +0 -402
- package/dist/a2ui-react250.js +0 -49
- package/dist/a2ui-react251.js +0 -49
- package/dist/a2ui-react252.js +0 -54
- package/dist/a2ui-react253.js +0 -7
- package/dist/a2ui-react254.js +0 -7
- package/dist/a2ui-react255.js +0 -18
- package/dist/a2ui-react256.js +0 -8
- package/dist/a2ui-react257.js +0 -10
- package/dist/a2ui-react258.js +0 -19
- package/dist/a2ui-react259.js +0 -7
- package/dist/a2ui-react260.js +0 -7
- package/dist/a2ui-react261.js +0 -8
- package/dist/a2ui-react262.js +0 -8
- package/dist/a2ui-react263.js +0 -7
- package/dist/a2ui-react264.js +0 -7
- package/dist/a2ui-react265.js +0 -9
- package/dist/a2ui-react266.js +0 -27
- package/dist/a2ui-react267.js +0 -9
- package/dist/a2ui-react268.js +0 -7
- package/dist/a2ui-react269.js +0 -9
- package/dist/a2ui-react27.js +0 -100
- package/dist/a2ui-react270.js +0 -8
- package/dist/a2ui-react271.js +0 -7
- package/dist/a2ui-react272.js +0 -8
- package/dist/a2ui-react273.js +0 -7
- package/dist/a2ui-react274.js +0 -11
- package/dist/a2ui-react275.js +0 -8
- package/dist/a2ui-react276.js +0 -7
- package/dist/a2ui-react277.js +0 -7
- package/dist/a2ui-react278.js +0 -9
- package/dist/a2ui-react279.js +0 -148
- package/dist/a2ui-react280.js +0 -42
- package/dist/a2ui-react281.js +0 -7
- package/dist/a2ui-react282.js +0 -10
- package/dist/a2ui-react283.js +0 -16
- package/dist/a2ui-react284.js +0 -10
- package/dist/a2ui-react285.js +0 -34
- package/dist/a2ui-react286.js +0 -13
- package/dist/a2ui-react287.js +0 -13
- package/dist/a2ui-react288.js +0 -11
- package/dist/a2ui-react289.js +0 -16
- package/dist/a2ui-react290.js +0 -104
- package/dist/a2ui-react291.js +0 -22
- package/dist/a2ui-react292.js +0 -56
- package/dist/a2ui-react293.js +0 -75
- package/dist/a2ui-react294.js +0 -12
- package/dist/a2ui-react295.js +0 -23
- package/dist/a2ui-react296.js +0 -19
- package/dist/a2ui-react297.js +0 -26
- package/dist/a2ui-react298.js +0 -9
- package/dist/a2ui-react299.js +0 -8
- package/dist/a2ui-react300.js +0 -26
- package/dist/a2ui-react301.js +0 -37
- package/dist/a2ui-react302.js +0 -18
- package/dist/a2ui-react303.js +0 -9
- package/dist/a2ui-react304.js +0 -7
- package/dist/a2ui-react305.js +0 -7
- package/dist/a2ui-react306.js +0 -7
- package/dist/a2ui-react307.js +0 -7
- package/dist/a2ui-react308.js +0 -6
- package/dist/a2ui-react309.js +0 -9
- package/dist/a2ui-react310.js +0 -26
- package/dist/a2ui-react311.js +0 -10
- package/dist/a2ui-react312.js +0 -9
- package/dist/a2ui-react313.js +0 -8
- package/dist/a2ui-react314.js +0 -6
- package/dist/a2ui-react315.js +0 -6
- package/dist/a2ui-react316.js +0 -7
- package/dist/a2ui-react317.js +0 -6
- package/dist/a2ui-react318.js +0 -7
- package/dist/a2ui-react319.js +0 -6
- package/dist/a2ui-react320.js +0 -6
- package/dist/a2ui-react321.js +0 -6
- package/dist/a2ui-react322.js +0 -9
- package/dist/a2ui-react323.js +0 -18
- package/dist/a2ui-react324.js +0 -31
- package/dist/a2ui-react325.js +0 -15
- package/dist/a2ui-react326.js +0 -27
- package/dist/a2ui-react327.js +0 -31
- package/dist/a2ui-react328.js +0 -7
- package/dist/a2ui-react329.js +0 -19
- package/dist/a2ui-react330.js +0 -8
- package/dist/a2ui-react331.js +0 -8
- package/dist/a2ui-react332.js +0 -61
- package/dist/a2ui-react333.js +0 -69
- package/dist/a2ui-react334.js +0 -9
- package/dist/a2ui-react335.js +0 -7
- package/dist/a2ui-react336.js +0 -26
- package/dist/a2ui-react337.js +0 -19
- package/dist/a2ui-react338.js +0 -10
- package/dist/a2ui-react339.js +0 -13
- package/dist/a2ui-react34.js +0 -8
- package/dist/a2ui-react340.js +0 -13
- package/dist/a2ui-react341.js +0 -24
- package/dist/a2ui-react342.js +0 -13
- package/dist/a2ui-react343.js +0 -12
- package/dist/a2ui-react344.js +0 -12
- package/dist/a2ui-react345.js +0 -7
- package/dist/a2ui-react346.js +0 -8
- package/dist/a2ui-react347.js +0 -19
- package/dist/a2ui-react348.js +0 -12
- package/dist/a2ui-react349.js +0 -21
- package/dist/a2ui-react35.js +0 -16
- package/dist/a2ui-react350.js +0 -18
- package/dist/a2ui-react351.js +0 -15
- package/dist/a2ui-react352.js +0 -32
- package/dist/a2ui-react353.js +0 -15
- package/dist/a2ui-react354.js +0 -28
- package/dist/a2ui-react355.js +0 -8
- package/dist/a2ui-react356.js +0 -11
- package/dist/a2ui-react357.js +0 -22
- package/dist/a2ui-react358.js +0 -7
- package/dist/a2ui-react359.js +0 -5
- package/dist/a2ui-react36.js +0 -23
- package/dist/a2ui-react360.js +0 -26
- package/dist/a2ui-react361.js +0 -115
- package/dist/a2ui-react362.js +0 -18
- package/dist/a2ui-react363.js +0 -527
- package/dist/a2ui-react364.js +0 -130
- package/dist/a2ui-react365.js +0 -136
- package/dist/a2ui-react366.js +0 -7
- package/dist/a2ui-react367.js +0 -15
- package/dist/a2ui-react368.js +0 -67
- package/dist/a2ui-react369.js +0 -71
- package/dist/a2ui-react37.js +0 -15
- package/dist/a2ui-react370.js +0 -11
- package/dist/a2ui-react371.js +0 -16
- package/dist/a2ui-react372.js +0 -68
- package/dist/a2ui-react373.js +0 -6
- package/dist/a2ui-react374.js +0 -25
- package/dist/a2ui-react375.js +0 -15
- package/dist/a2ui-react376.js +0 -30
- package/dist/a2ui-react377.js +0 -7
- package/dist/a2ui-react378.js +0 -25
- package/dist/a2ui-react38.js +0 -10
- package/dist/a2ui-react39.js +0 -10
- package/dist/a2ui-react4.js +0 -76
- package/dist/a2ui-react40.js +0 -14
- package/dist/a2ui-react41.js +0 -14
- package/dist/a2ui-react42.js +0 -16
- package/dist/a2ui-react43.js +0 -12
- package/dist/a2ui-react44.js +0 -15
- package/dist/a2ui-react45.js +0 -15
- package/dist/a2ui-react46.js +0 -9
- package/dist/a2ui-react47.js +0 -11
- package/dist/a2ui-react48.js +0 -16
- package/dist/a2ui-react49.js +0 -10
- package/dist/a2ui-react50.js +0 -14
- package/dist/a2ui-react51.js +0 -9
- package/dist/a2ui-react52.js +0 -9
- package/dist/a2ui-react53.js +0 -15
- package/dist/a2ui-react54.js +0 -17
- package/dist/a2ui-react55.js +0 -10
- package/dist/a2ui-react56.js +0 -10
- package/dist/a2ui-react57.js +0 -10
- package/dist/a2ui-react58.js +0 -9
- package/dist/a2ui-react59.js +0 -9
- package/dist/a2ui-react6.js +0 -28
- package/dist/a2ui-react60.js +0 -9
- package/dist/a2ui-react61.js +0 -15
- package/dist/a2ui-react62.js +0 -10
- package/dist/a2ui-react63.js +0 -15
- package/dist/a2ui-react64.js +0 -10
- package/dist/a2ui-react65.js +0 -14
- package/dist/a2ui-react66.js +0 -22
- package/dist/a2ui-react67.js +0 -14
- package/dist/a2ui-react68.js +0 -10
- package/dist/a2ui-react69.js +0 -17
- package/dist/a2ui-react70.js +0 -15
- package/dist/a2ui-react71.js +0 -10
- package/dist/a2ui-react72.js +0 -12
- package/dist/a2ui-react73.js +0 -9
- package/dist/a2ui-react74.js +0 -6
- package/dist/a2ui-react75.js +0 -15
- package/dist/a2ui-react76.js +0 -11
- package/dist/a2ui-react77.js +0 -14
- package/dist/a2ui-react78.js +0 -9
- package/dist/a2ui-react79.js +0 -9
- package/dist/a2ui-react80.js +0 -9
- package/dist/a2ui-react81.js +0 -10
- package/dist/a2ui-react82.js +0 -26
- package/dist/a2ui-react83.js +0 -29
- package/dist/a2ui-react84.js +0 -67
- package/dist/a2ui-react85.js +0 -77
- package/dist/a2ui-react86.js +0 -53
- package/dist/a2ui-react87.js +0 -31
- package/dist/a2ui-react88.js +0 -22
- package/dist/a2ui-react89.js +0 -21
- package/dist/a2ui-react90.js +0 -18
- package/dist/a2ui-react91.js +0 -176
- package/dist/a2ui-react92.js +0 -38
- package/dist/a2ui-react93.js +0 -88
- package/dist/a2ui-react94.js +0 -9
- package/dist/a2ui-react95.js +0 -58
- package/dist/a2ui-react96.js +0 -146
- package/dist/a2ui-react97.js +0 -63
- package/dist/a2ui-react98.js +0 -17
- package/dist/a2ui-react99.js +0 -2765
- /package/dist/{a2ui-react8.js → 0.8/contexts/ComponentsMapContext.js} +0 -0
- /package/dist/{a2ui-react9.js → 0.8/contexts/SurfaceContext.js} +0 -0
- /package/dist/{a2ui-react33.js → 0.8/utils/pathUtils.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as p } from "react";
|
|
3
|
-
import { A2UIProvider as c } from "./
|
|
4
|
-
import { ComponentsMapProvider as a } from "./
|
|
5
|
-
import { useSurfaceContext as u } from "./
|
|
6
|
-
import { useA2UIMessageHandler as l } from "./
|
|
7
|
-
import { componentRegistry as d, ComponentRenderer as g } from "./
|
|
3
|
+
import { A2UIProvider as c } from "./contexts/A2UIProvider.js";
|
|
4
|
+
import { ComponentsMapProvider as a } from "./contexts/ComponentsMapContext.js";
|
|
5
|
+
import { useSurfaceContext as u } from "./contexts/SurfaceContext.js";
|
|
6
|
+
import { useA2UIMessageHandler as l } from "./hooks/useA2UIMessageHandler.js";
|
|
7
|
+
import { componentRegistry as d, ComponentRenderer as g } from "./components/ComponentRenderer.js";
|
|
8
8
|
function A({ messages: r }) {
|
|
9
9
|
const { processMessages: n, clear: o } = l(), { surfaces: t } = u();
|
|
10
10
|
p(() => {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { memo as f, useContext as l } from "react";
|
|
3
|
+
import { useComponent as s } from "../hooks/useComponent.js";
|
|
4
|
+
import { ComponentsMapContext as u } from "../contexts/ComponentsMapContext.js";
|
|
5
|
+
import { TextComponent as a } from "./display/TextComponent.js";
|
|
6
|
+
import { ImageComponent as c } from "./display/ImageComponent.js";
|
|
7
|
+
import { IconComponent as d } from "./display/IconComponent.js";
|
|
8
|
+
import { VideoComponent as x } from "./display/VideoComponent.js";
|
|
9
|
+
import { AudioPlayerComponent as T } from "./display/AudioPlayerComponent.js";
|
|
10
|
+
import { DividerComponent as h } from "./display/DividerComponent.js";
|
|
11
|
+
import { RowComponent as w } from "./layout/RowComponent.js";
|
|
12
|
+
import { ColumnComponent as g } from "./layout/ColumnComponent.js";
|
|
13
|
+
import { ListComponent as y } from "./layout/ListComponent.js";
|
|
14
|
+
import { CardComponent as A } from "./layout/CardComponent.js";
|
|
15
|
+
import { TabsComponent as M } from "./layout/TabsComponent.js";
|
|
16
|
+
import { ModalComponent as R } from "./layout/ModalComponent.js";
|
|
17
|
+
import { ButtonComponent as I } from "./interactive/ButtonComponent.js";
|
|
18
|
+
import { CheckBoxComponent as U } from "./interactive/CheckBoxComponent.js";
|
|
19
|
+
import { TextFieldComponent as B } from "./interactive/TextFieldComponent.js";
|
|
20
|
+
import { DateTimeInputComponent as D } from "./interactive/DateTimeInputComponent.js";
|
|
21
|
+
import { MultipleChoiceComponent as $ } from "./interactive/MultipleChoiceComponent.js";
|
|
22
|
+
import { SliderComponent as b } from "./interactive/SliderComponent.js";
|
|
23
|
+
const k = {
|
|
24
|
+
// Display components
|
|
25
|
+
Text: a,
|
|
26
|
+
Image: c,
|
|
27
|
+
Icon: d,
|
|
28
|
+
Video: x,
|
|
29
|
+
AudioPlayer: T,
|
|
30
|
+
Divider: h,
|
|
31
|
+
// Layout components
|
|
32
|
+
Row: w,
|
|
33
|
+
Column: g,
|
|
34
|
+
List: y,
|
|
35
|
+
Card: A,
|
|
36
|
+
Tabs: M,
|
|
37
|
+
Modal: R,
|
|
38
|
+
// Interactive components
|
|
39
|
+
Button: I,
|
|
40
|
+
CheckBox: U,
|
|
41
|
+
TextField: B,
|
|
42
|
+
DateTimeInput: D,
|
|
43
|
+
MultipleChoice: $,
|
|
44
|
+
Slider: b
|
|
45
|
+
}, j = f(function({
|
|
46
|
+
surfaceId: t,
|
|
47
|
+
componentId: o
|
|
48
|
+
}) {
|
|
49
|
+
const e = s(t, o), r = l(u);
|
|
50
|
+
if (!e)
|
|
51
|
+
return console.warn(
|
|
52
|
+
`A2UI: Component not found: ${o} on surface ${t}`
|
|
53
|
+
), null;
|
|
54
|
+
const p = Object.entries(e.component);
|
|
55
|
+
if (p.length === 0)
|
|
56
|
+
return console.warn(`A2UI: Component ${o} has no type definition`), null;
|
|
57
|
+
const [m, i] = p[0];
|
|
58
|
+
let n;
|
|
59
|
+
return r ? n = r.getComponent(m) : n = k[m], n ? (
|
|
60
|
+
// eslint-disable-next-line react-hooks/static-components
|
|
61
|
+
/* @__PURE__ */ C(
|
|
62
|
+
n,
|
|
63
|
+
{
|
|
64
|
+
surfaceId: t,
|
|
65
|
+
componentId: o,
|
|
66
|
+
weight: e.weight,
|
|
67
|
+
...i
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
) : (console.warn(`A2UI: Unknown component type: ${m}`), null);
|
|
71
|
+
});
|
|
72
|
+
j.displayName = "A2UI.ComponentRenderer";
|
|
73
|
+
export {
|
|
74
|
+
j as ComponentRenderer,
|
|
75
|
+
k as componentRegistry
|
|
76
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { memo as m } from "react";
|
|
3
|
-
import { useDataBinding as n } from "
|
|
4
|
-
import { cn as a } from "
|
|
3
|
+
import { useDataBinding as n } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { cn as a } from "@/lib/utils";
|
|
5
5
|
const u = m(function({
|
|
6
6
|
surfaceId: o,
|
|
7
7
|
url: i,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { memo as i } from "react";
|
|
3
|
+
import { useDataBinding as l } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { AlertTriangle as c, EyeOff as f, Eye as s, Upload as m, StarOff as p, StarHalf as d, Star as h, ShoppingCart as C, Share2 as u, Settings as w, Send as O, Search as g, RefreshCw as k, Printer as y, Image as H, Phone as o, User as I, CreditCard as S, Bell as U, BellOff as A, MoreHorizontal as M, MoreVertical as P, Menu as v, Mail as B, Unlock as D, Lock as F, MapPin as N, Info as T, Home as b, HelpCircle as x, Folder as z, HeartOff as E, Heart as L, AlertCircle as R, CalendarDays as V, Pencil as j, Download as X, Trash2 as $, X as q, Check as G, Camera as J, Calendar as K, Paperclip as Q, ArrowRight as W, ArrowLeft as Y, Plus as Z, UserCircle as _ } from "lucide-react";
|
|
5
|
+
import { cn as ee } from "@/lib/utils";
|
|
6
|
+
const re = {
|
|
7
|
+
accountCircle: _,
|
|
8
|
+
add: Z,
|
|
9
|
+
arrowBack: Y,
|
|
10
|
+
arrowForward: W,
|
|
11
|
+
attachFile: Q,
|
|
12
|
+
calendarToday: K,
|
|
13
|
+
call: o,
|
|
14
|
+
camera: J,
|
|
15
|
+
check: G,
|
|
16
|
+
close: q,
|
|
17
|
+
delete: $,
|
|
18
|
+
download: X,
|
|
19
|
+
edit: j,
|
|
20
|
+
event: V,
|
|
21
|
+
error: R,
|
|
22
|
+
favorite: L,
|
|
23
|
+
favoriteOff: E,
|
|
24
|
+
folder: z,
|
|
25
|
+
help: x,
|
|
26
|
+
home: b,
|
|
27
|
+
info: T,
|
|
28
|
+
locationOn: N,
|
|
29
|
+
lock: F,
|
|
30
|
+
lockOpen: D,
|
|
31
|
+
mail: B,
|
|
32
|
+
menu: v,
|
|
33
|
+
moreVert: P,
|
|
34
|
+
moreHoriz: M,
|
|
35
|
+
notificationsOff: A,
|
|
36
|
+
notifications: U,
|
|
37
|
+
payment: S,
|
|
38
|
+
person: I,
|
|
39
|
+
phone: o,
|
|
40
|
+
photo: H,
|
|
41
|
+
print: y,
|
|
42
|
+
refresh: k,
|
|
43
|
+
search: g,
|
|
44
|
+
send: O,
|
|
45
|
+
settings: w,
|
|
46
|
+
share: u,
|
|
47
|
+
shoppingCart: C,
|
|
48
|
+
star: h,
|
|
49
|
+
starHalf: d,
|
|
50
|
+
starOff: p,
|
|
51
|
+
upload: m,
|
|
52
|
+
visibility: s,
|
|
53
|
+
visibilityOff: f,
|
|
54
|
+
warning: c
|
|
55
|
+
}, oe = i(function({
|
|
56
|
+
surfaceId: a,
|
|
57
|
+
name: n
|
|
58
|
+
}) {
|
|
59
|
+
const e = l(a, n, "");
|
|
60
|
+
if (!e)
|
|
61
|
+
return null;
|
|
62
|
+
const r = re[e];
|
|
63
|
+
return r ? /* @__PURE__ */ t(r, { className: ee("w-5 h-5") }) : (console.warn(`A2UI: Unknown icon name: ${e}`), null);
|
|
64
|
+
});
|
|
65
|
+
oe.displayName = "A2UI.Icon";
|
|
66
|
+
export {
|
|
67
|
+
oe as IconComponent
|
|
68
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { memo as m } from "react";
|
|
3
|
-
import { useDataBinding as i } from "
|
|
4
|
-
import { cn as s } from "
|
|
3
|
+
import { useDataBinding as i } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { cn as s } from "@/lib/utils";
|
|
5
5
|
const t = {
|
|
6
6
|
contain: "object-contain",
|
|
7
7
|
cover: "object-cover",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { memo as x } from "react";
|
|
3
|
-
import { useDataBinding as l } from "
|
|
4
|
-
import { cn as r } from "
|
|
3
|
+
import { useDataBinding as l } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { cn as r } from "@/lib/utils";
|
|
5
5
|
const o = {
|
|
6
6
|
h1: "text-3xl font-bold tracking-tight",
|
|
7
7
|
h2: "text-2xl font-semibold tracking-tight",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as t, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { memo as i } from "react";
|
|
3
|
-
import { useDataBinding as s } from "
|
|
4
|
-
import { cn as m } from "
|
|
3
|
+
import { useDataBinding as s } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { cn as m } from "@/lib/utils";
|
|
5
5
|
const d = i(function({
|
|
6
6
|
surfaceId: r,
|
|
7
7
|
url: e
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { memo as p, useCallback as s } from "react";
|
|
3
|
-
import { useDispatchAction as c } from "
|
|
4
|
-
import { Button as u } from "
|
|
5
|
-
import { ComponentRenderer as a } from "
|
|
3
|
+
import { useDispatchAction as c } from "@/0.8/hooks/useDispatchAction";
|
|
4
|
+
import { Button as u } from "@/components/ui/button";
|
|
5
|
+
import { ComponentRenderer as a } from "../ComponentRenderer.js";
|
|
6
6
|
const f = p(function({
|
|
7
7
|
surfaceId: t,
|
|
8
8
|
componentId: n,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { memo as p, useCallback as C } from "react";
|
|
3
|
-
import { useDataBinding as d, useFormBinding as x } from "
|
|
4
|
-
import { Checkbox as k } from "
|
|
5
|
-
import { Label as f } from "
|
|
6
|
-
import { cn as b } from "
|
|
3
|
+
import { useDataBinding as d, useFormBinding as x } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { Checkbox as k } from "@/components/ui/checkbox";
|
|
5
|
+
import { Label as f } from "@/components/ui/label";
|
|
6
|
+
import { cn as b } from "@/lib/utils";
|
|
7
7
|
const g = p(function({
|
|
8
8
|
surfaceId: e,
|
|
9
9
|
componentId: m,
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsx as i, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { memo as V, useMemo as l, useCallback as M } from "react";
|
|
3
|
+
import { CalendarIcon as j } from "lucide-react";
|
|
4
|
+
import { parse as p, isValid as P, format as m } from "date-fns";
|
|
5
|
+
import { useFormBinding as B } from "@/0.8/hooks/useDataBinding";
|
|
6
|
+
import { cn as y } from "@/lib/utils";
|
|
7
|
+
import { Button as F } from "@/components/ui/button";
|
|
8
|
+
import { Calendar as S } from "@/components/ui/calendar";
|
|
9
|
+
import { Popover as k, PopoverTrigger as A, PopoverContent as L } from "@/components/ui/popover";
|
|
10
|
+
import { Input as g } from "@/components/ui/input";
|
|
11
|
+
const U = V(function({
|
|
12
|
+
surfaceId: v,
|
|
13
|
+
componentId: w,
|
|
14
|
+
value: x,
|
|
15
|
+
enableDate: o = !0,
|
|
16
|
+
enableTime: t = !1
|
|
17
|
+
}) {
|
|
18
|
+
const [n, e] = B(v, x, ""), r = l(() => {
|
|
19
|
+
if (!n) return;
|
|
20
|
+
let s;
|
|
21
|
+
return o && t ? s = p(n, "yyyy-MM-dd'T'HH:mm", /* @__PURE__ */ new Date()) : o ? s = p(n, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : t && (s = p(n, "HH:mm", /* @__PURE__ */ new Date())), s && P(s) ? s : void 0;
|
|
22
|
+
}, [n, o, t]), N = l(() => !r || !t ? "" : m(r, "HH:mm"), [r, t]), C = M(
|
|
23
|
+
(s) => {
|
|
24
|
+
if (!s) {
|
|
25
|
+
e("");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (o && t) {
|
|
29
|
+
const u = r ? m(r, "HH:mm") : "00:00", [d, c] = u.split(":").map(Number);
|
|
30
|
+
s.setHours(d, c), e(m(s, "yyyy-MM-dd'T'HH:mm"));
|
|
31
|
+
} else
|
|
32
|
+
e(m(s, "yyyy-MM-dd"));
|
|
33
|
+
},
|
|
34
|
+
[e, o, t, r]
|
|
35
|
+
), a = M(
|
|
36
|
+
(s) => {
|
|
37
|
+
const u = s.target.value;
|
|
38
|
+
if (!u) return;
|
|
39
|
+
const [d, c] = u.split(":").map(Number);
|
|
40
|
+
if (o && t) {
|
|
41
|
+
const h = r || /* @__PURE__ */ new Date();
|
|
42
|
+
h.setHours(d, c), e(m(h, "yyyy-MM-dd'T'HH:mm"));
|
|
43
|
+
} else t && !o && e(u);
|
|
44
|
+
},
|
|
45
|
+
[e, o, t, r]
|
|
46
|
+
), I = l(() => r ? o && t ? m(r, "yyyy-MM-dd HH:mm") : o ? m(r, "yyyy-MM-dd") : m(r, "HH:mm") : o && t ? "选择日期和时间" : o ? "选择日期" : "选择时间", [r, o, t]), H = `datetime-${w}`;
|
|
47
|
+
return t && !o ? /* @__PURE__ */ i("div", { className: y("flex flex-col gap-2"), children: /* @__PURE__ */ i(
|
|
48
|
+
g,
|
|
49
|
+
{
|
|
50
|
+
id: H,
|
|
51
|
+
type: "time",
|
|
52
|
+
value: n,
|
|
53
|
+
onChange: a,
|
|
54
|
+
className: "w-full"
|
|
55
|
+
}
|
|
56
|
+
) }) : /* @__PURE__ */ i("div", { className: y("flex flex-col gap-2"), children: /* @__PURE__ */ f(k, { children: [
|
|
57
|
+
/* @__PURE__ */ i(A, { asChild: !0, children: /* @__PURE__ */ f(
|
|
58
|
+
F,
|
|
59
|
+
{
|
|
60
|
+
id: H,
|
|
61
|
+
variant: "outline",
|
|
62
|
+
className: y(
|
|
63
|
+
"w-full justify-start text-left font-normal",
|
|
64
|
+
!r && "text-muted-foreground"
|
|
65
|
+
),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ i(j, { className: "mr-2 h-4 w-4" }),
|
|
68
|
+
I
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
) }),
|
|
72
|
+
/* @__PURE__ */ f(L, { className: "w-auto p-0", align: "start", children: [
|
|
73
|
+
/* @__PURE__ */ i(
|
|
74
|
+
S,
|
|
75
|
+
{
|
|
76
|
+
mode: "single",
|
|
77
|
+
selected: r,
|
|
78
|
+
onSelect: C,
|
|
79
|
+
captionLayout: "dropdown",
|
|
80
|
+
initialFocus: !0
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
t && /* @__PURE__ */ i("div", { className: "border-t p-3", children: /* @__PURE__ */ i(
|
|
84
|
+
g,
|
|
85
|
+
{
|
|
86
|
+
type: "time",
|
|
87
|
+
value: N,
|
|
88
|
+
onChange: a,
|
|
89
|
+
className: "w-full"
|
|
90
|
+
}
|
|
91
|
+
) })
|
|
92
|
+
] })
|
|
93
|
+
] }) });
|
|
94
|
+
});
|
|
95
|
+
U.displayName = "A2UI.DateTimeInput";
|
|
96
|
+
export {
|
|
97
|
+
U as DateTimeInputComponent
|
|
98
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r, jsxs as g, Fragment as M } from "react/jsx-runtime";
|
|
2
2
|
import { memo as N, useCallback as p } from "react";
|
|
3
|
-
import { useFormBinding as V, useDataBinding as S } from "
|
|
4
|
-
import { Select as F, SelectTrigger as $, SelectValue as j, SelectContent as B, SelectItem as D } from "
|
|
5
|
-
import { Checkbox as L } from "
|
|
6
|
-
import { Label as T } from "
|
|
7
|
-
import { cn as h } from "
|
|
3
|
+
import { useFormBinding as V, useDataBinding as S } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { Select as F, SelectTrigger as $, SelectValue as j, SelectContent as B, SelectItem as D } from "@/components/ui/select";
|
|
5
|
+
import { Checkbox as L } from "@/components/ui/checkbox";
|
|
6
|
+
import { Label as T } from "@/components/ui/label";
|
|
7
|
+
import { cn as h } from "@/lib/utils";
|
|
8
8
|
const A = N(function({
|
|
9
9
|
surfaceId: a,
|
|
10
10
|
componentId: o,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { memo as a, useCallback as c } from "react";
|
|
3
|
-
import { useFormBinding as p } from "
|
|
4
|
-
import { Slider as f } from "
|
|
5
|
-
import { cn as h } from "
|
|
3
|
+
import { useFormBinding as p } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { Slider as f } from "@/components/ui/slider";
|
|
5
|
+
import { cn as h } from "@/lib/utils";
|
|
6
6
|
const u = a(function({
|
|
7
7
|
surfaceId: m,
|
|
8
8
|
value: s,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { memo as T, useCallback as f } from "react";
|
|
3
|
-
import { useDataBinding as g, useFormBinding as h } from "
|
|
4
|
-
import { Input as b } from "
|
|
5
|
-
import { Textarea as C } from "
|
|
6
|
-
import { Label as F } from "
|
|
7
|
-
import { cn as v } from "
|
|
3
|
+
import { useDataBinding as g, useFormBinding as h } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { Input as b } from "@/components/ui/input";
|
|
5
|
+
import { Textarea as C } from "@/components/ui/textarea";
|
|
6
|
+
import { Label as F } from "@/components/ui/label";
|
|
7
|
+
import { cn as v } from "@/lib/utils";
|
|
8
8
|
const y = {
|
|
9
9
|
shortText: "text",
|
|
10
10
|
longText: "text",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { memo as m } from "react";
|
|
3
|
-
import { Card as n, CardContent as t } from "
|
|
4
|
-
import { ComponentRenderer as p } from "
|
|
3
|
+
import { Card as n, CardContent as t } from "@/components/ui/card";
|
|
4
|
+
import { ComponentRenderer as p } from "../ComponentRenderer.js";
|
|
5
5
|
const a = m(function({
|
|
6
6
|
surfaceId: e,
|
|
7
7
|
child: o
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { memo as u } from "react";
|
|
3
|
-
import { useDataModel as d } from "
|
|
4
|
-
import { cn as y } from "
|
|
5
|
-
import { getValueByPath as j } from "
|
|
6
|
-
import { ComponentRenderer as r } from "
|
|
3
|
+
import { useDataModel as d } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { cn as y } from "@/lib/utils";
|
|
5
|
+
import { getValueByPath as j } from "@/0.8/utils/pathUtils";
|
|
6
|
+
import { ComponentRenderer as r } from "../ComponentRenderer.js";
|
|
7
7
|
const v = {
|
|
8
8
|
start: "justify-start",
|
|
9
9
|
center: "justify-center",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { memo as d } from "react";
|
|
3
|
-
import { useDataModel as x } from "
|
|
4
|
-
import { cn as u } from "
|
|
5
|
-
import { getValueByPath as v } from "
|
|
6
|
-
import { ComponentRenderer as r } from "
|
|
3
|
+
import { useDataModel as x } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { cn as u } from "@/lib/utils";
|
|
5
|
+
import { getValueByPath as v } from "@/0.8/utils/pathUtils";
|
|
6
|
+
import { ComponentRenderer as r } from "../ComponentRenderer.js";
|
|
7
7
|
const L = {
|
|
8
8
|
start: "items-start",
|
|
9
9
|
center: "items-center",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { memo as l, useState as a } from "react";
|
|
3
|
-
import { Dialog as s, DialogTrigger as d, DialogContent as c } from "
|
|
4
|
-
import { ComponentRenderer as t } from "
|
|
3
|
+
import { Dialog as s, DialogTrigger as d, DialogContent as c } from "@/components/ui/dialog";
|
|
4
|
+
import { ComponentRenderer as t } from "../ComponentRenderer.js";
|
|
5
5
|
const f = l(function({
|
|
6
6
|
surfaceId: e,
|
|
7
7
|
entryPointChild: n,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { memo as l } from "react";
|
|
3
|
-
import { useDataModel as u } from "
|
|
4
|
-
import { cn as y } from "
|
|
5
|
-
import { getValueByPath as j } from "
|
|
6
|
-
import { ComponentRenderer as r } from "
|
|
3
|
+
import { useDataModel as u } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { cn as y } from "@/lib/utils";
|
|
5
|
+
import { getValueByPath as j } from "@/0.8/utils/pathUtils";
|
|
6
|
+
import { ComponentRenderer as r } from "../ComponentRenderer.js";
|
|
7
7
|
const v = {
|
|
8
8
|
start: "justify-start",
|
|
9
9
|
center: "justify-center",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as a, jsx as o, Fragment as c } from "react/jsx-runtime";
|
|
2
2
|
import { memo as d } from "react";
|
|
3
|
-
import { useDataBinding as m } from "
|
|
4
|
-
import { Tabs as p, TabsList as s, TabsTrigger as T, TabsContent as h } from "
|
|
5
|
-
import { ComponentRenderer as u } from "
|
|
3
|
+
import { useDataBinding as m } from "@/0.8/hooks/useDataBinding";
|
|
4
|
+
import { Tabs as p, TabsList as s, TabsTrigger as T, TabsContent as h } from "@/components/ui/tabs";
|
|
5
|
+
import { ComponentRenderer as u } from "../ComponentRenderer.js";
|
|
6
6
|
const f = d(function({
|
|
7
7
|
surfaceId: r,
|
|
8
8
|
tabItems: n
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { SurfaceProvider as e } from "./
|
|
3
|
-
import { DataModelProvider as t } from "./
|
|
4
|
-
import { ActionProvider as m } from "./
|
|
2
|
+
import { SurfaceProvider as e } from "./SurfaceContext.js";
|
|
3
|
+
import { DataModelProvider as t } from "./DataModelContext.js";
|
|
4
|
+
import { ActionProvider as m } from "./ActionContext.js";
|
|
5
5
|
function p({ onAction: o, children: i }) {
|
|
6
6
|
return /* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(m, { onAction: o, children: i }) }) });
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as x, useContext as C, useCallback as p, useMemo as f } from "react";
|
|
3
|
-
import { useDataModelContext as v } from "./
|
|
4
|
-
import { resolveActionContext as A } from "
|
|
3
|
+
import { useDataModelContext as v } from "./DataModelContext.js";
|
|
4
|
+
import { resolveActionContext as A } from "../utils/dataBinding.js";
|
|
5
5
|
const s = x(null);
|
|
6
6
|
function P({ onAction: t, children: c }) {
|
|
7
7
|
const { getDataModel: o } = v(), e = p(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as C } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as P, useContext as f, useState as V, useCallback as a, useMemo as v } from "react";
|
|
3
|
-
import { mergeAtPath as b, getValueByPath as y, setValueByPath as B } from "
|
|
3
|
+
import { mergeAtPath as b, getValueByPath as y, setValueByPath as B } from "../utils/pathUtils.js";
|
|
4
4
|
const g = P(
|
|
5
5
|
null
|
|
6
6
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback as c } from "react";
|
|
2
|
-
import { useSurfaceContext as I } from "
|
|
3
|
-
import { useDataModelContext as U } from "
|
|
4
|
-
import { contentsToObject as b } from "
|
|
2
|
+
import { useSurfaceContext as I } from "../contexts/SurfaceContext.js";
|
|
3
|
+
import { useDataModelContext as U } from "../contexts/DataModelContext.js";
|
|
4
|
+
import { contentsToObject as b } from "../utils/dataBinding.js";
|
|
5
5
|
function g() {
|
|
6
6
|
const { initSurface: n, updateSurface: d, deleteSurface: u, clearSurfaces: f } = I(), { updateDataModel: s, initDataModel: l, deleteDataModel: i, clearDataModels: p } = U(), o = c(
|
|
7
7
|
(t) => {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useMemo as r } from "react";
|
|
2
|
+
import { useDataModelContext as m } from "../contexts/DataModelContext.js";
|
|
3
|
+
import { resolveValue as l } from "../utils/dataBinding.js";
|
|
4
|
+
function s(n, t, o) {
|
|
5
|
+
const { getDataModel: e } = m();
|
|
6
|
+
return r(() => {
|
|
7
|
+
const a = e(n);
|
|
8
|
+
return l(t, a, o);
|
|
9
|
+
}, [e, n, t, o]);
|
|
10
|
+
}
|
|
11
|
+
function h(n, t, o) {
|
|
12
|
+
const { getDataModel: e, setDataValue: a } = m(), p = r(() => {
|
|
13
|
+
const i = e(n);
|
|
14
|
+
return l(t, i, o);
|
|
15
|
+
}, [e, n, t, o]), M = r(() => (i) => {
|
|
16
|
+
t && "path" in t && a(n, t.path, i);
|
|
17
|
+
}, [a, n, t]);
|
|
18
|
+
return [p, M];
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
s as useDataBinding,
|
|
22
|
+
h as useFormBinding
|
|
23
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { A2UIRenderer as o } from "./A2UIRenderer.js";
|
|
2
|
+
import { ComponentRenderer as t } from "./components/ComponentRenderer.js";
|
|
3
|
+
import { useDispatchAction as m } from "./hooks/useDispatchAction.js";
|
|
4
|
+
import { useDataBinding as d, useFormBinding as f } from "./hooks/useDataBinding.js";
|
|
5
|
+
export {
|
|
6
|
+
o as A2UIRenderer,
|
|
7
|
+
t as ComponentRenderer,
|
|
8
|
+
d as useDataBinding,
|
|
9
|
+
m as useDispatchAction,
|
|
10
|
+
f as useFormBinding
|
|
11
|
+
};
|
package/dist/index.js
ADDED
package/package.json
CHANGED
package/dist/a2ui-react.js
DELETED
package/dist/a2ui-react100.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as p from "react";
|
|
2
|
-
import { Primitive as v } from "./a2ui-react210.js";
|
|
3
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
4
|
-
var d = "Separator", a = "horizontal", l = ["horizontal", "vertical"], i = p.forwardRef((r, n) => {
|
|
5
|
-
const { decorative: e, orientation: t = a, ...s } = r, o = f(t) ? t : a, c = e ? { role: "none" } : { "aria-orientation": o === "vertical" ? o : void 0, role: "separator" };
|
|
6
|
-
return /* @__PURE__ */ m(
|
|
7
|
-
v.div,
|
|
8
|
-
{
|
|
9
|
-
"data-orientation": o,
|
|
10
|
-
...c,
|
|
11
|
-
...s,
|
|
12
|
-
ref: n
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
});
|
|
16
|
-
i.displayName = d;
|
|
17
|
-
function f(r) {
|
|
18
|
-
return l.includes(r);
|
|
19
|
-
}
|
|
20
|
-
var T = i;
|
|
21
|
-
export {
|
|
22
|
-
T as Root,
|
|
23
|
-
i as Separator
|
|
24
|
-
};
|