@@ -241,7 +241,10 @@ exports[`Alpine.js > jsx > Javascript Test > Basic Outputs 1`] = `
241
241
`;
242
242
243
243
exports[`Alpine.js > jsx > Javascript Test > Basic Outputs Meta 1`] = `
244
- " <div x-data =\\"myBasicOutputsComponent()\\"></div>
244
+ " /** useMetadata: {\\"outputs\\":[\\"onMessage\\",\\"onEvent\\"],\\"baz\\":\\"metadata inside
245
+ component\\"} */
246
+
247
+ <div x-data =\\"myBasicOutputsComponent()\\"></div>
245
248
<script>
246
249
document.addEventListener(\\"alpine:init\\", () => {
247
250
Alpine .data (\\" myBasicOutputsComponent\\ " , () => ({
@@ -1630,7 +1633,9 @@ exports[`Alpine.js > jsx > Javascript Test > basicForwardRef 1`] = `
1630
1633
` ;
1631
1634
1632
1635
exports [` Alpine.js > jsx > Javascript Test > basicForwardRefMetadata 1` ] = `
1633
- "<style >
1636
+ "/** useMetadata: { \\" forwardRef\\ " :\\" inputRef\\ " } */
1637
+
1638
+ <style >
1634
1639
.input {
1635
1640
color : red ;
1636
1641
}
@@ -1784,6 +1789,20 @@ exports[`Alpine.js > jsx > Javascript Test > classState 1`] = `
1784
1789
"
1785
1790
` ;
1786
1791
1792
+ exports [` Alpine.js > jsx > Javascript Test > complexMeta 1` ] = `
1793
+ "/** useMetadata:
1794
+ { \\" x\\ " :\\" y\\ " ,\\" asdf\\ " :{\\" stringValue\\ " :\\" d\\ " ,\\" booleanValue\\ " :true ,\\" numberValue\\ " :1 ,\\" innerObject\\ " :{\\" stringValue\\ " :\\" inner\\ " ,\\" numberValue\\ " :2 ,\\" booleanValue\\ " :false },\\" spreadStringValue\\ " :\\" f\\ " }}
1795
+ */
1796
+
1797
+ <div x-data =\\"complexMetaRaw()\\"></div>
1798
+ <script>
1799
+ document.addEventListener(\\"alpine:init\\", () => {
1800
+ Alpine .data (\\" complexMetaRaw\\ " , () => ({}));
1801
+ } );
1802
+ </script>
1803
+ "
1804
+ `;
1805
+
1787
1806
exports[`Alpine.js > jsx > Javascript Test > componentWithContext 1`] = `
1788
1807
" <div x-data =\\"componentWithContext()\\">
1789
1808
<div><span x-html =\\"foo.value\\"></span></div>
@@ -1922,6 +1941,35 @@ exports[`Alpine.js > jsx > Javascript Test > expressionState 1`] = `
1922
1941
"
1923
1942
`;
1924
1943
1944
+ exports[`Alpine.js > jsx > Javascript Test > figmaMeta 1`] = `
1945
+ " /** useMetadata:
1946
+ {\\"figma\\":{\\"name\\":\\"def-button-beta-outlined\\",\\"url\\":\\"https://www.figma.com/xxx\\",\\"props\\":{\\"iconSmall\\":{\\"type\\":\\"instance\\",\\"key\\":\\"📍
1947
+ Icon Small\\"},\\"iconMedium\\":{\\"type\\":\\"instance\\",\\"key\\":\\"📍 Icon
1948
+ Medium\\"},\\"label\\":{\\"type\\":\\"string\\",\\"key\\":\\"✏️
1949
+ Label\\"},\\"icon\\":{\\"type\\":\\"boolean\\",\\"key\\":\\"👁️
1950
+ Icon\\",\\"value\\":{\\"false\\":false,\\"true\\":\\"placeholder\\"}},\\"interactiveState\\":{\\"type\\":\\"enum\\",\\"key\\":\\"Interactive
1951
+ State\\",\\"value\\":{\\"(Def)
1952
+ Enabled\\":false,\\"Hovered\\":false,\\"Pressed\\":false,\\"Focused\\":false,\\"Disabled\\":\\"true\\"}},\\"size\\":{\\"type\\":\\"enum\\",\\"key\\":\\"Size\\",\\"value\\":{\\"(Def)
1953
+ Medium\\":false,\\"Small\\":\\"small\\"}},\\"width\\":{\\"type\\":\\"enum\\",\\"key\\":\\"Width\\",\\"value\\":{\\"(Def)
1954
+ Auto Width\\":false,\\"Full Width\\":\\"full\\"}}}}} */
1955
+
1956
+ <button
1957
+ x-data =\\"figmaButton()\\"
1958
+ x-bind:data-icon=\\"icon\\"
1959
+ x-bind:data-disabled=\\"interactiveState\\"
1960
+ x-bind:data-width=\\"width\\"
1961
+ x-bind:data-size=\\"size\\"
1962
+ >
1963
+ <span x-html =\\"label\\"></span>
1964
+ </button>
1965
+ <script>
1966
+ document.addEventListener(\\"alpine:init\\", () => {
1967
+ Alpine .data (\\" figmaButton\\ " , () => ({}));
1968
+ } );
1969
+ </script>
1970
+ "
1971
+ `;
1972
+
1925
1973
exports[`Alpine.js > jsx > Javascript Test > getterState 1`] = `
1926
1974
" <div x-data =\\"button()\\">
1927
1975
<p><span x-html =\\"foo2\\"></span></p>
@@ -3319,7 +3367,10 @@ exports[`Alpine.js > jsx > Typescript Test > Basic Outputs 1`] = `
3319
3367
`;
3320
3368
3321
3369
exports[`Alpine.js > jsx > Typescript Test > Basic Outputs Meta 1`] = `
3322
- " <div x-data =\\"myBasicOutputsComponent()\\"></div>
3370
+ " /** useMetadata: {\\"outputs\\":[\\"onMessage\\",\\"onEvent\\"],\\"baz\\":\\"metadata inside
3371
+ component\\"} */
3372
+
3373
+ <div x-data =\\"myBasicOutputsComponent()\\"></div>
3323
3374
<script>
3324
3375
document.addEventListener(\\"alpine:init\\", () => {
3325
3376
Alpine .data (\\" myBasicOutputsComponent\\ " , () => ({
@@ -4697,7 +4748,9 @@ exports[`Alpine.js > jsx > Typescript Test > basicForwardRef 1`] = `
4697
4748
` ;
4698
4749
4699
4750
exports [` Alpine.js > jsx > Typescript Test > basicForwardRefMetadata 1` ] = `
4700
- "<style >
4751
+ "/** useMetadata: { \\" forwardRef\\ " :\\" inputRef\\ " } */
4752
+
4753
+ <style >
4701
4754
.input {
4702
4755
color : red ;
4703
4756
}
@@ -4851,6 +4904,20 @@ exports[`Alpine.js > jsx > Typescript Test > classState 1`] = `
4851
4904
"
4852
4905
` ;
4853
4906
4907
+ exports [` Alpine.js > jsx > Typescript Test > complexMeta 1` ] = `
4908
+ "/** useMetadata:
4909
+ { \\" x\\ " :\\" y\\ " ,\\" asdf\\ " :{\\" stringValue\\ " :\\" d\\ " ,\\" booleanValue\\ " :true ,\\" numberValue\\ " :1 ,\\" innerObject\\ " :{\\" stringValue\\ " :\\" inner\\ " ,\\" numberValue\\ " :2 ,\\" booleanValue\\ " :false },\\" spreadStringValue\\ " :\\" f\\ " }}
4910
+ */
4911
+
4912
+ <div x-data =\\"complexMetaRaw()\\"></div>
4913
+ <script>
4914
+ document.addEventListener(\\"alpine:init\\", () => {
4915
+ Alpine .data (\\" complexMetaRaw\\ " , () => ({}));
4916
+ } );
4917
+ </script>
4918
+ "
4919
+ `;
4920
+
4854
4921
exports[`Alpine.js > jsx > Typescript Test > componentWithContext 1`] = `
4855
4922
" <div x-data =\\"componentWithContext()\\">
4856
4923
<div><span x-html =\\"foo.value\\"></span></div>
@@ -4989,6 +5056,35 @@ exports[`Alpine.js > jsx > Typescript Test > expressionState 1`] = `
4989
5056
"
4990
5057
`;
4991
5058
5059
+ exports[`Alpine.js > jsx > Typescript Test > figmaMeta 1`] = `
5060
+ " /** useMetadata:
5061
+ {\\"figma\\":{\\"name\\":\\"def-button-beta-outlined\\",\\"url\\":\\"https://www.figma.com/xxx\\",\\"props\\":{\\"iconSmall\\":{\\"type\\":\\"instance\\",\\"key\\":\\"📍
5062
+ Icon Small\\"},\\"iconMedium\\":{\\"type\\":\\"instance\\",\\"key\\":\\"📍 Icon
5063
+ Medium\\"},\\"label\\":{\\"type\\":\\"string\\",\\"key\\":\\"✏️
5064
+ Label\\"},\\"icon\\":{\\"type\\":\\"boolean\\",\\"key\\":\\"👁️
5065
+ Icon\\",\\"value\\":{\\"false\\":false,\\"true\\":\\"placeholder\\"}},\\"interactiveState\\":{\\"type\\":\\"enum\\",\\"key\\":\\"Interactive
5066
+ State\\",\\"value\\":{\\"(Def)
5067
+ Enabled\\":false,\\"Hovered\\":false,\\"Pressed\\":false,\\"Focused\\":false,\\"Disabled\\":\\"true\\"}},\\"size\\":{\\"type\\":\\"enum\\",\\"key\\":\\"Size\\",\\"value\\":{\\"(Def)
5068
+ Medium\\":false,\\"Small\\":\\"small\\"}},\\"width\\":{\\"type\\":\\"enum\\",\\"key\\":\\"Width\\",\\"value\\":{\\"(Def)
5069
+ Auto Width\\":false,\\"Full Width\\":\\"full\\"}}}}} */
5070
+
5071
+ <button
5072
+ x-data =\\"figmaButton()\\"
5073
+ x-bind:data-icon=\\"icon\\"
5074
+ x-bind:data-disabled=\\"interactiveState\\"
5075
+ x-bind:data-width=\\"width\\"
5076
+ x-bind:data-size=\\"size\\"
5077
+ >
5078
+ <span x-html =\\"label\\"></span>
5079
+ </button>
5080
+ <script>
5081
+ document.addEventListener(\\"alpine:init\\", () => {
5082
+ Alpine .data (\\" figmaButton\\ " , () => ({}));
5083
+ } );
5084
+ </script>
5085
+ "
5086
+ `;
5087
+
4992
5088
exports[`Alpine.js > jsx > Typescript Test > getterState 1`] = `
4993
5089
" <div x-data =\\"button()\\">
4994
5090
<p><span x-html =\\"foo2\\"></span></p>
0 commit comments