sveltekit-ui 1.1.17 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/dist/Components/Alert/index.svelte +88 -0
  2. package/dist/Components/Alert/index.svelte.js +101 -0
  3. package/dist/Components/ArrowToggle/index.svelte +62 -0
  4. package/dist/Components/Attachment/index.svelte +77 -0
  5. package/dist/Components/Attachment/index.svelte.js +119 -0
  6. package/dist/Components/Audio/index.svelte +193 -0
  7. package/dist/Components/Audio/index.svelte.js +463 -0
  8. package/dist/Components/AudioEditor/index.svelte +252 -0
  9. package/dist/Components/AudioEditor/index.svelte.js +977 -0
  10. package/dist/Components/AudioEditor/samples/alloy-voice-sample.mp3 +0 -0
  11. package/dist/Components/AudioEditor/samples/echo-voice-sample.mp3 +0 -0
  12. package/dist/Components/AudioEditor/samples/fable-voice-sample.mp3 +0 -0
  13. package/dist/Components/AudioEditor/samples/nova-voice-sample.mp3 +0 -0
  14. package/dist/Components/AudioEditor/samples/onyx-voice-sample.mp3 +0 -0
  15. package/dist/Components/AudioEditor/samples/shimmer-voice-sample.mp3 +0 -0
  16. package/dist/Components/AuthCodeInput/index.svelte +85 -0
  17. package/dist/Components/AuthCodeInput/index.svelte.js +95 -0
  18. package/dist/Components/Breadcrumbs/index.svelte +27 -0
  19. package/dist/Components/Breadcrumbs/index.svelte.js +88 -0
  20. package/dist/Components/Button/index.svelte +721 -0
  21. package/dist/Components/Button/index.svelte.js +375 -0
  22. package/dist/Components/Chart/Klines/index.svelte +87 -0
  23. package/dist/Components/Chart/index.svelte +226 -0
  24. package/dist/Components/Chart/index.svelte.js +1090 -0
  25. package/dist/Components/ChartInput/DisplayNav/Klines/index.svelte +150 -0
  26. package/dist/Components/ChartInput/DisplayNav/Lines/index.svelte +45 -0
  27. package/dist/Components/ChartInput/DisplayNav/index.svelte +297 -0
  28. package/dist/Components/ChartInput/EditPanel/index.svelte +155 -0
  29. package/dist/Components/ChartInput/index.svelte +21 -0
  30. package/dist/Components/ChartInput/index.svelte.js +671 -0
  31. package/dist/Components/Checkbox/index.svelte +411 -0
  32. package/dist/Components/Checkbox/index.svelte.js +178 -0
  33. package/dist/Components/Code/index.svelte +23 -0
  34. package/dist/Components/Code/index.svelte.js +33 -0
  35. package/dist/Components/Color/index.svelte +51 -0
  36. package/dist/Components/Color/index.svelte.js +31 -0
  37. package/dist/Components/ColorInput/ChromaPicker/index.svelte +50 -0
  38. package/dist/Components/ColorInput/ColorPalette/index.svelte +62 -0
  39. package/dist/Components/ColorInput/OpacityPicker/index.svelte +68 -0
  40. package/dist/Components/ColorInput/ShowcasePicker/index.svelte +136 -0
  41. package/dist/Components/ColorInput/index.svelte +70 -0
  42. package/dist/Components/ColorInput/index.svelte.js +386 -0
  43. package/dist/Components/ConditionsInput/index.svelte +46 -0
  44. package/dist/Components/ConditionsInput/index.svelte.js +201 -0
  45. package/dist/Components/Confetti/index.svelte +98 -0
  46. package/dist/Components/Confetti/index.svelte.js +94 -0
  47. package/dist/Components/Content/index.svelte +500 -0
  48. package/dist/Components/Content/index.svelte.js +910 -0
  49. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Audio/index.svelte +31 -0
  50. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Audio/index.svelte.js +258 -0
  51. package/dist/Components/ContentInput/AttributesInput/CustomConfig/AudioAdvanced/index.svelte +31 -0
  52. package/dist/Components/ContentInput/AttributesInput/CustomConfig/AudioAdvanced/index.svelte.js +258 -0
  53. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte +58 -0
  54. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +206 -0
  55. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Image/index.svelte +28 -0
  56. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Image/index.svelte.js +224 -0
  57. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte +44 -0
  58. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +272 -0
  59. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte +41 -0
  60. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +202 -0
  61. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte +19 -0
  62. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +117 -0
  63. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte +60 -0
  64. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +542 -0
  65. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Tag/index.svelte +47 -0
  66. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Tag/index.svelte.js +185 -0
  67. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte +35 -0
  68. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +222 -0
  69. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte +20 -0
  70. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +84 -0
  71. package/dist/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte +25 -0
  72. package/dist/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +91 -0
  73. package/dist/Components/ContentInput/AttributesInput/index.svelte +352 -0
  74. package/dist/Components/ContentInput/AttributesInput/index.svelte.js +1436 -0
  75. package/dist/Components/ContentInput/ContentPanelBuilder/AddElement/index.svelte +64 -0
  76. package/dist/Components/ContentInput/ContentPanelBuilder/AddElement/index.svelte.js +97 -0
  77. package/dist/Components/ContentInput/ContentPanelBuilder/ElementList/index.svelte +184 -0
  78. package/dist/Components/ContentInput/ContentPanelBuilder/index.svelte +41 -0
  79. package/dist/Components/ContentInput/index.svelte +78 -0
  80. package/dist/Components/ContentInput/index.svelte.js +1197 -0
  81. package/dist/Components/CronInput/index.svelte +78 -0
  82. package/dist/Components/CronInput/index.svelte.js +198 -0
  83. package/dist/Components/DataTypeInput/index.svelte +174 -0
  84. package/dist/Components/DataTypeInput/index.svelte.js +565 -0
  85. package/dist/Components/Dropdown/index.svelte +116 -0
  86. package/dist/Components/Dropdown/index.svelte.js +403 -0
  87. package/dist/Components/EmailAddress/index.svelte +22 -0
  88. package/dist/Components/EmailAddress/index.svelte.js +45 -0
  89. package/dist/Components/ErrorX/index.svelte +58 -0
  90. package/dist/Components/Eye/index.svelte +57 -0
  91. package/dist/Components/FileInput/index.svelte +146 -0
  92. package/dist/Components/FileInput/index.svelte.js +225 -0
  93. package/dist/Components/Hamburger/index.svelte +99 -0
  94. package/dist/Components/HorizScrollBox/index.svelte +145 -0
  95. package/dist/Components/Icon/index.svelte +412 -0
  96. package/dist/Components/Icon/index.svelte.js +116 -0
  97. package/dist/Components/IconInput/index.svelte +77 -0
  98. package/dist/Components/IconInput/index.svelte.js +259 -0
  99. package/dist/Components/Image/index.svelte +126 -0
  100. package/dist/Components/Image/index.svelte.js +116 -0
  101. package/dist/Components/ImageEditor/Image/CropBox/index.svelte +165 -0
  102. package/dist/Components/ImageEditor/Image/index.svelte +104 -0
  103. package/dist/Components/ImageEditor/Panels/AI/index.svelte +44 -0
  104. package/dist/Components/ImageEditor/Panels/Crop/index.svelte +96 -0
  105. package/dist/Components/ImageEditor/Panels/File/QualityPicker/index.svelte +124 -0
  106. package/dist/Components/ImageEditor/Panels/File/index.svelte +74 -0
  107. package/dist/Components/ImageEditor/Panels/Filters/index.svelte +46 -0
  108. package/dist/Components/ImageEditor/Panels/Resize/index.svelte +58 -0
  109. package/dist/Components/ImageEditor/index.svelte +93 -0
  110. package/dist/Components/ImageEditor/index.svelte.js +1961 -0
  111. package/dist/Components/ImageSlider/index.svelte +124 -0
  112. package/dist/Components/ImageSlider/index.svelte.js +99 -0
  113. package/dist/Components/InfoBox/index.svelte +89 -0
  114. package/dist/Components/Json/Nested/index.svelte +157 -0
  115. package/dist/Components/Json/index.svelte +60 -0
  116. package/dist/Components/Json/index.svelte.js +594 -0
  117. package/dist/Components/LabeledItem/index.svelte +102 -0
  118. package/dist/Components/Layout/NavBar/FullNav/index.svelte +52 -0
  119. package/dist/Components/Layout/NavBar/NavGuts/index.svelte +87 -0
  120. package/dist/Components/Layout/NavBar/index.svelte +72 -0
  121. package/dist/Components/Layout/index.svelte +149 -0
  122. package/dist/Components/Layout/index.svelte.js +360 -0
  123. package/dist/Components/Link/index.svelte +47 -0
  124. package/dist/Components/Link/index.svelte.js +136 -0
  125. package/dist/Components/LoadingSuccessDiv/index.svelte +51 -0
  126. package/dist/Components/LoadingWheel/index.svelte +38 -0
  127. package/dist/Components/Location/index.svelte +79 -0
  128. package/dist/Components/Location/index.svelte.js +288 -0
  129. package/dist/Components/LocationInput/index.svelte +197 -0
  130. package/dist/Components/LocationInput/index.svelte.js +965 -0
  131. package/dist/Components/Number/index.svelte +47 -0
  132. package/dist/Components/Number/index.svelte.js +151 -0
  133. package/dist/Components/PhoneCountryCode/index.svelte +7 -0
  134. package/dist/Components/PhoneCountryCode/index.svelte.js +260 -0
  135. package/dist/Components/PhoneNumber/index.svelte +22 -0
  136. package/dist/Components/PhoneNumber/index.svelte.js +41 -0
  137. package/dist/Components/Popover/index.svelte +396 -0
  138. package/dist/Components/Popover/index.svelte.js +319 -0
  139. package/dist/Components/Qr/index.svelte +85 -0
  140. package/dist/Components/Qr/index.svelte.js +301 -0
  141. package/dist/Components/QrInput/index.svelte +47 -0
  142. package/dist/Components/QrInput/index.svelte.js +218 -0
  143. package/dist/Components/Slider/index.svelte +239 -0
  144. package/dist/Components/Slider/index.svelte.js +469 -0
  145. package/dist/Components/Spacer/index.svelte +41 -0
  146. package/dist/Components/StoragePicker/DisplayFile/index.svelte +15 -0
  147. package/dist/Components/StoragePicker/index.svelte +187 -0
  148. package/dist/Components/StoragePicker/index.svelte.js +592 -0
  149. package/dist/Components/SuccessCheck/index.svelte +56 -0
  150. package/dist/Components/TableAdvanced/ColumnInput/index.svelte +117 -0
  151. package/dist/Components/TableAdvanced/ColumnInput/index.svelte.js +456 -0
  152. package/dist/Components/TableAdvanced/FilterInput/index.svelte +54 -0
  153. package/dist/Components/TableAdvanced/FilterInput/index.svelte.js +247 -0
  154. package/dist/Components/TableAdvanced/Pagination/index.svelte +43 -0
  155. package/dist/Components/TableAdvanced/Pagination/index.svelte.js +97 -0
  156. package/dist/Components/TableAdvanced/SortByInput/index.svelte +72 -0
  157. package/dist/Components/TableAdvanced/SortByInput/index.svelte.js +176 -0
  158. package/dist/Components/TableAdvanced/index.svelte +275 -0
  159. package/dist/Components/TableAdvanced/index.svelte.js +1565 -0
  160. package/dist/Components/Tag/index.svelte +45 -0
  161. package/dist/Components/Tag/index.svelte.js +76 -0
  162. package/dist/Components/TextArrayInput/index.svelte +108 -0
  163. package/dist/Components/TextArrayInput/index.svelte.js +239 -0
  164. package/dist/Components/TextInput/PasswordTooltip/index.svelte +89 -0
  165. package/dist/Components/TextInput/index.svelte +223 -0
  166. package/dist/Components/TextInput/index.svelte.js +447 -0
  167. package/dist/Components/Time/index.svelte +7 -0
  168. package/dist/Components/Time/index.svelte.js +38 -0
  169. package/dist/Components/TimeInput/NumberToggler/index.svelte +34 -0
  170. package/dist/Components/TimeInput/NumberToggler/index.svelte.js +79 -0
  171. package/dist/Components/TimeInput/index.js +702 -0
  172. package/dist/Components/TimeInput/index.svelte +211 -0
  173. package/dist/Components/TimeInput/index.svelte.js +638 -0
  174. package/dist/Components/Tooltip/index.svelte +143 -0
  175. package/dist/Components/TransparentBackground/index.svelte +153 -0
  176. package/dist/Components/TypingDots/index.svelte +84 -0
  177. package/dist/Components/VariablePathInput/index.svelte +63 -0
  178. package/dist/Components/VariablePathInput/index.svelte.js +273 -0
  179. package/dist/Components/VideoTBD/index.svelte +100 -0
  180. package/dist/Components/XFollow/index.svelte +42 -0
  181. package/dist/Components/XPost/index.svelte +52 -0
  182. package/dist/Components/XPost/index.svelte.js +64 -0
  183. package/dist/Components/YoutubeChannelButton/index.svelte +82 -0
  184. package/dist/Components/YoutubeVideo/index.svelte +73 -0
  185. package/dist/Components/YoutubeVideo/index.svelte.js +54 -0
  186. package/dist/actions/draggable.js +49 -0
  187. package/dist/actions/index.js +24 -0
  188. package/dist/actions/no_spaces.js +33 -0
  189. package/dist/actions/numbers_only.js +26 -0
  190. package/dist/actions/scroll_y.js +28 -0
  191. package/dist/actions/stop_scroll_propagation_y.js +42 -0
  192. package/dist/actions/swipe_handler.js +295 -0
  193. package/dist/client/astc_formatting/index.js +1128 -0
  194. package/dist/client/docs/index.js +7622 -0
  195. package/dist/client/index.js +735 -0
  196. package/dist/client/types/index.js +2812 -0
  197. package/dist/index.js +180 -0
  198. package/dist/style.css +682 -0
  199. package/package.json +1 -1
@@ -0,0 +1,1436 @@
1
+ import { create_popover_manager } from "../../Popover/index.svelte.js"
2
+ import { create_button_manager } from "../../Button/index.svelte.js"
3
+ import { create_dropdown_manager } from "../../Dropdown/index.svelte.js"
4
+ import { create_text_input_manager } from "../../TextInput/index.svelte.js"
5
+ import { create_time_input_manager } from "../../TimeInput/index.svelte.js"
6
+ import { create_color_input_manager } from "../../ColorInput/index.svelte.js"
7
+ import { create_cron_input_manager } from "../../CronInput/index.svelte.js"
8
+ import { create_slider_manager } from "../../Slider/index.svelte.js"
9
+ import { create_checkbox_manager } from "../../Checkbox/index.svelte.js"
10
+ import { create_icon_input_manager } from "../../IconInput/index.svelte.js"
11
+ import { create_location_input_manager } from "../../LocationInput/index.svelte.js"
12
+ import { create_slider_config_manager } from "./CustomConfig/Slider/index.svelte.js"
13
+ import { create_number_config_manager } from "./CustomConfig/Number/index.svelte.js"
14
+ import { create_text_input_config_manager } from "./CustomConfig/TextInput/index.svelte.js"
15
+ import { create_image_config_manager } from "./CustomConfig/Image/index.svelte.js"
16
+ import { create_audio_config_manager } from "./CustomConfig/Audio/index.svelte.js"
17
+ import { create_qr_config_manager } from "./CustomConfig/Qr/index.svelte.js"
18
+ import { create_table_advanced_config_manager } from "./CustomConfig/TableAdvanced/index.svelte.js"
19
+ import { create_dropdown_config_manager } from "./CustomConfig/Dropdown/index.svelte.js"
20
+ import { create_time_input_config_manager } from "./CustomConfig/TimeInput/index.svelte.js"
21
+ import { create_variable_path_input_manager } from "../../VariablePathInput/index.svelte.js"
22
+ import { create_defined_type_input_manager } from "./DefinedTypeInput/index.svelte.js"
23
+ import { node_types } from "../../../client/types/index.js"
24
+ import { create_unique_id, is_deep_equal, set_closurable } from "../../../client/index.js"
25
+ import { time_formats } from "../../TimeInput/index.js"
26
+
27
+ export function create_attributes_input_manager(config) {
28
+ const id = create_unique_id(null, 20)
29
+
30
+ let popover_manager = $state(null)
31
+ let content_type = $state(null)
32
+ let attributes_manager = $state(null)
33
+ let finish_button_manager = $state(null)
34
+ let selector_id = $state(null)
35
+ let val_original = $state(null)
36
+ let defined_data_type = $state(null)
37
+
38
+ let val = $derived(attributes_manager?.val)
39
+ let has_changed = $derived(!is_deep_equal(val, val_original))
40
+
41
+ const align_dropdown_options = [
42
+ { key: null, name: "Stretch" },
43
+ { key: "center", name: "Center" },
44
+ { key: "start", name: "Start" },
45
+ { key: "end", name: "End" },
46
+ { key: "space-between", name: "Space Between" },
47
+ { key: "space-around", name: "Space Around" },
48
+ { key: "space-evenly", name: "Space Evenly" },
49
+ ]
50
+
51
+ function set_focused_selector_id(input) {
52
+ if (typeof config?.set_focused_selector_id == "function") {
53
+ config?.set_focused_selector_id(input)
54
+ }
55
+ }
56
+
57
+ function init(config) {
58
+ val_original = set_closurable(config?.val, null)
59
+ content_type = config?.content_type
60
+ defined_data_type = config?.defined_data_type
61
+ popover_manager = create_popover_manager({
62
+ header: config?.header ?? "Edit Attributes",
63
+ type: "panel",
64
+ target_width: 600,
65
+ })
66
+ if (content_type && node_types && node_types.hasOwnProperty(content_type)) {
67
+ if (content_type == "number") {
68
+ attributes_manager = create_number_config_manager({
69
+ val: config?.val,
70
+ get_defined_options: config?.get_defined_options,
71
+ })
72
+ } else if (content_type == "qr") {
73
+ attributes_manager = create_qr_config_manager({
74
+ val: config?.val,
75
+ get_defined_options: config?.get_defined_options,
76
+ })
77
+ } else if (content_type == "variable_path_input") {
78
+ attributes_manager = create_variable_path_input_manager({
79
+ val: config?.val,
80
+ get_defined_options: config?.get_defined_options,
81
+ on_finish: () => attributes_manager.close_popover(),
82
+ })
83
+ } else if (content_type == "table_advanced") {
84
+ attributes_manager = create_table_advanced_config_manager({
85
+ val: config?.val,
86
+ get_defined_options: config?.get_defined_options,
87
+ })
88
+ } else if (content_type == "dropdown") {
89
+ attributes_manager = create_dropdown_config_manager({
90
+ val: config?.val,
91
+ get_defined_options: config?.get_defined_options,
92
+ })
93
+ } else if (content_type == "slider") {
94
+ attributes_manager = create_slider_config_manager({
95
+ val: config?.val,
96
+ get_defined_options: config?.get_defined_options,
97
+ })
98
+ } else if (content_type == "time_input") {
99
+ attributes_manager = create_time_input_config_manager({
100
+ val: config?.val,
101
+ get_defined_options: config?.get_defined_options,
102
+ })
103
+ } else if (content_type == "time") {
104
+ let val_format_dropdown_manager = $state(null)
105
+ let val_time_input_manager = $state(
106
+ create_time_input_manager({
107
+ format: () => val_format_dropdown_manager?.val,
108
+ is_popover: true,
109
+ is_nullable: true,
110
+ val: config?.val?.val,
111
+ })
112
+ )
113
+ let val_defined_type_input_manager = $state(
114
+ create_defined_type_input_manager({
115
+ get_defined_options: config?.get_defined_options,
116
+ label: "Val",
117
+ attribute_root_key: "val",
118
+ attribute_const_val: () => val_time_input_manager?.val,
119
+ attributes: config?.val,
120
+ })
121
+ )
122
+ val_format_dropdown_manager = create_dropdown_manager({
123
+ label: "Format",
124
+ is_button_compressed: true,
125
+ val: config?.val?.format ?? "time_full",
126
+ options: Object.entries(time_formats).map(([key, val]) => ({ key: key, name: val?.name })),
127
+ })
128
+ let display_format_dropdown_manager = $state(
129
+ create_dropdown_manager({
130
+ label: "Display Format",
131
+ is_button_compressed: true,
132
+ val: config?.val?.display_format ?? "calendar_date",
133
+ options: [
134
+ { key: "raw", name: "Raw" },
135
+ { key: "time_ago", name: "Time Ago" },
136
+ { key: "calendar_date", name: "Calendar Date" },
137
+ { key: "default", name: "Default" },
138
+ ],
139
+ })
140
+ )
141
+ let text_color_color_input_manager = $state(
142
+ create_color_input_manager({
143
+ is_nullable: true,
144
+ val: config?.val?.text_color,
145
+ })
146
+ )
147
+ attributes_manager = {
148
+ val_time_input_manager: val_time_input_manager,
149
+ val_defined_type_input_manager: val_defined_type_input_manager,
150
+ val_format_dropdown_manager: val_format_dropdown_manager,
151
+ display_format_dropdown_manager: display_format_dropdown_manager,
152
+ text_color_color_input_manager: text_color_color_input_manager,
153
+ get val() {
154
+ return {
155
+ ...val_defined_type_input_manager?.val,
156
+ format: val_format_dropdown_manager?.val,
157
+ display_format: display_format_dropdown_manager?.val,
158
+ text_color: text_color_color_input_manager?.val,
159
+ }
160
+ },
161
+ }
162
+ } else if (content_type == "section") {
163
+ let background_color_color_input_manager = $state(
164
+ create_color_input_manager({
165
+ is_nullable: true,
166
+ val: config?.val?.background_color,
167
+ })
168
+ )
169
+ let background_color_defined_type_input_manager = $state(
170
+ create_defined_type_input_manager({
171
+ get_defined_options: config?.get_defined_options,
172
+ label: "Background Color",
173
+ attribute_root_key: "background_color",
174
+ attribute_const_val: () => background_color_color_input_manager?.val,
175
+ attributes: config?.val?.background_color,
176
+ })
177
+ )
178
+ let border_color_color_input_manager = $state(
179
+ create_color_input_manager({
180
+ is_nullable: true,
181
+ val: config?.val?.border_color,
182
+ })
183
+ )
184
+ let border_color_defined_type_input_manager = $state(
185
+ create_defined_type_input_manager({
186
+ get_defined_options: config?.get_defined_options,
187
+ label: "Border Color",
188
+ attribute_root_key: "border_color",
189
+ attribute_const_val: () => border_color_color_input_manager?.val,
190
+ attributes: config?.val?.border_color,
191
+ })
192
+ )
193
+ let border_radius_slider_manager = $state(
194
+ create_slider_manager({
195
+ min: 0,
196
+ max: 5,
197
+ step: 0.1,
198
+ val: config?.val?.border_radius ?? 0.5,
199
+ })
200
+ )
201
+ let border_radius_defined_type_input_manager = $state(
202
+ create_defined_type_input_manager({
203
+ get_defined_options: config?.get_defined_options,
204
+ label: "Border Radius",
205
+ attribute_root_key: "border_radius",
206
+ attribute_const_val: () => border_radius_slider_manager?.val,
207
+ attributes: config?.val,
208
+ })
209
+ )
210
+ let padding_slider_manager = $state(
211
+ create_slider_manager({
212
+ min: 0,
213
+ max: 5,
214
+ step: 0.5,
215
+ val: config?.val?.padding ?? 0,
216
+ })
217
+ )
218
+ let padding_defined_type_input_manager = $state(
219
+ create_defined_type_input_manager({
220
+ get_defined_options: config?.get_defined_options,
221
+ label: "Padding",
222
+ attribute_root_key: "padding",
223
+ attribute_const_val: () => padding_slider_manager?.val,
224
+ attributes: config?.val,
225
+ })
226
+ )
227
+ attributes_manager = {
228
+ background_color_color_input_manager: background_color_color_input_manager,
229
+ background_color_defined_type_input_manager: background_color_defined_type_input_manager,
230
+ border_color_color_input_manager: border_color_color_input_manager,
231
+ border_color_defined_type_input_manager: border_color_defined_type_input_manager,
232
+ border_radius_slider_manager: border_radius_slider_manager,
233
+ border_radius_defined_type_input_manager: border_radius_defined_type_input_manager,
234
+ padding_slider_manager: padding_slider_manager,
235
+ padding_defined_type_input_manager: padding_defined_type_input_manager,
236
+ get val() {
237
+ return {
238
+ ...background_color_defined_type_input_manager?.val,
239
+ ...border_color_defined_type_input_manager?.val,
240
+ ...border_radius_defined_type_input_manager?.val,
241
+ ...padding_defined_type_input_manager?.val,
242
+ }
243
+ },
244
+ }
245
+ } else if (content_type == "figure") {
246
+ let caption_text_input_manager = $state(
247
+ create_text_input_manager({
248
+ is_nullable: true,
249
+ val: config?.val?.caption,
250
+ placeholder: "caption",
251
+ })
252
+ )
253
+ let caption_defined_type_input_manager = $state(
254
+ create_defined_type_input_manager({
255
+ get_defined_options: config?.get_defined_options,
256
+ label: "Caption",
257
+ attribute_root_key: "caption",
258
+ attribute_const_val: () => caption_text_input_manager?.val,
259
+ attributes: config?.val,
260
+ })
261
+ )
262
+ attributes_manager = {
263
+ caption_text_input_manager: caption_text_input_manager,
264
+ caption_defined_type_input_manager: caption_defined_type_input_manager,
265
+ get val() {
266
+ return {
267
+ ...caption_defined_type_input_manager?.val,
268
+ }
269
+ },
270
+ }
271
+ } else if (content_type == "div") {
272
+ let background_color_color_input_manager = $state(
273
+ create_color_input_manager({
274
+ is_nullable: true,
275
+ val: config?.val?.background_color,
276
+ })
277
+ )
278
+ let background_color_defined_type_input_manager = $state(
279
+ create_defined_type_input_manager({
280
+ get_defined_options: config?.get_defined_options,
281
+ label: "Background Color",
282
+ attribute_root_key: "background_color",
283
+ attribute_const_val: () => background_color_color_input_manager?.val,
284
+ attributes: config?.val,
285
+ })
286
+ )
287
+ let border_color_color_input_manager = $state(
288
+ create_color_input_manager({
289
+ is_nullable: true,
290
+ val: config?.val?.border_color,
291
+ })
292
+ )
293
+ let border_color_defined_type_input_manager = $state(
294
+ create_defined_type_input_manager({
295
+ get_defined_options: config?.get_defined_options,
296
+ label: "Border Color",
297
+ attribute_root_key: "border_color",
298
+ attribute_const_val: () => border_color_color_input_manager?.val,
299
+ attributes: config?.val,
300
+ })
301
+ )
302
+ let border_radius_slider_manager = $state(
303
+ create_slider_manager({
304
+ min: 0,
305
+ max: 5,
306
+ step: 0.1,
307
+ val: config?.val?.border_radius ?? 0.5,
308
+ })
309
+ )
310
+ let border_radius_defined_type_input_manager = $state(
311
+ create_defined_type_input_manager({
312
+ get_defined_options: config?.get_defined_options,
313
+ label: "Border Radius",
314
+ attribute_root_key: "border_radius",
315
+ attribute_const_val: () => border_radius_slider_manager?.val,
316
+ attributes: config?.val,
317
+ })
318
+ )
319
+ let padding_slider_manager = $state(
320
+ create_slider_manager({
321
+ min: 0,
322
+ max: 5,
323
+ step: 0.5,
324
+ val: config?.val?.padding ?? 0,
325
+ })
326
+ )
327
+ let padding_defined_type_input_manager = $state(
328
+ create_defined_type_input_manager({
329
+ get_defined_options: config?.get_defined_options,
330
+ label: "Padding",
331
+ attribute_root_key: "padding",
332
+ attribute_const_val: () => padding_slider_manager?.val,
333
+ attributes: config?.val,
334
+ })
335
+ )
336
+ let align_content_dropdown_manager = $state(
337
+ create_dropdown_manager({
338
+ options: align_dropdown_options,
339
+ is_button_compressed: true,
340
+ val: config?.val?.align_content ?? null,
341
+ })
342
+ )
343
+ let align_content_defined_type_input_manager = $state(
344
+ create_defined_type_input_manager({
345
+ get_defined_options: config?.get_defined_options,
346
+ label: "Align Content",
347
+ attribute_root_key: "align_content",
348
+ attribute_const_val: () => align_content_dropdown_manager?.val,
349
+ attributes: config?.val,
350
+ })
351
+ )
352
+ let justify_content_dropdown_manager = $state(
353
+ create_dropdown_manager({
354
+ options: align_dropdown_options,
355
+ is_button_compressed: true,
356
+ val: config?.val?.justify_content ?? null,
357
+ })
358
+ )
359
+ let justify_content_defined_type_input_manager = $state(
360
+ create_defined_type_input_manager({
361
+ get_defined_options: config?.get_defined_options,
362
+ label: "Justify Content",
363
+ attribute_root_key: "justify_content",
364
+ attribute_const_val: () => justify_content_dropdown_manager?.val,
365
+ attributes: config?.val,
366
+ })
367
+ )
368
+
369
+ let gap_slider_manager = $state(
370
+ create_slider_manager({
371
+ min: 0,
372
+ max: 5,
373
+ step: 0.1,
374
+ val: config?.val?.gap ?? 0,
375
+ })
376
+ )
377
+ let gap_defined_type_input_manager = $state(
378
+ create_defined_type_input_manager({
379
+ get_defined_options: config?.get_defined_options,
380
+ label: "Gap",
381
+ attribute_root_key: "gap",
382
+ attribute_const_val: () => gap_slider_manager?.val,
383
+ attributes: config?.val,
384
+ })
385
+ )
386
+ attributes_manager = {
387
+ background_color_color_input_manager: background_color_color_input_manager,
388
+ background_color_defined_type_input_manager: background_color_defined_type_input_manager,
389
+ border_color_color_input_manager: border_color_color_input_manager,
390
+ border_color_defined_type_input_manager: border_color_defined_type_input_manager,
391
+ border_radius_slider_manager: border_radius_slider_manager,
392
+ border_radius_defined_type_input_manager: border_radius_defined_type_input_manager,
393
+ padding_slider_manager: padding_slider_manager,
394
+ padding_defined_type_input_manager: padding_defined_type_input_manager,
395
+ align_content_dropdown_manager: align_content_dropdown_manager,
396
+ align_content_defined_type_input_manager: align_content_defined_type_input_manager,
397
+ justify_content_dropdown_manager: justify_content_dropdown_manager,
398
+ justify_content_defined_type_input_manager: justify_content_defined_type_input_manager,
399
+ gap_slider_manager: gap_slider_manager,
400
+ gap_defined_type_input_manager: gap_defined_type_input_manager,
401
+ get val() {
402
+ return {
403
+ ...background_color_defined_type_input_manager?.val,
404
+ ...border_color_defined_type_input_manager?.val,
405
+ ...border_radius_defined_type_input_manager?.val,
406
+ ...padding_defined_type_input_manager?.val,
407
+ ...align_content_defined_type_input_manager?.val,
408
+ ...justify_content_defined_type_input_manager?.val,
409
+ ...gap_defined_type_input_manager?.val,
410
+ }
411
+ },
412
+ }
413
+ } else if (content_type == "text_input") {
414
+ attributes_manager = create_text_input_config_manager({
415
+ get_defined_options: config?.get_defined_options,
416
+ val: config?.val,
417
+ })
418
+ } else if (content_type == "color_input") {
419
+ // attributes_manager = create_color_input_config_manager({
420
+ // val: config?.val,
421
+ // })
422
+ } else if (content_type == "color") {
423
+ let val_color_input_manager = $state(
424
+ create_color_input_manager({
425
+ is_nullable: true,
426
+ val: config?.val,
427
+ })
428
+ )
429
+ let val_defined_type_input_manager = $state(
430
+ create_defined_type_input_manager({
431
+ get_defined_options: config?.get_defined_options,
432
+ label: "Val",
433
+ attribute_root_key: "val",
434
+ attribute_const_val: () => val_color_input_manager?.val,
435
+ attributes: config?.val,
436
+ })
437
+ )
438
+ let is_show_details_checkbox_manager = $state(
439
+ create_checkbox_manager({
440
+ type: "toggle",
441
+ is_nullable: true,
442
+ val: config?.val?.is_show_details,
443
+ })
444
+ )
445
+ let is_show_details_defined_type_input_manager = $state(
446
+ create_defined_type_input_manager({
447
+ get_defined_options: config?.get_defined_options,
448
+ label: "Is Show Details",
449
+ attribute_root_key: "is_show_details",
450
+ attribute_const_val: () => is_show_details_checkbox_manager?.val,
451
+ attributes: config?.val,
452
+ })
453
+ )
454
+ let size_slider_manager = $state(
455
+ create_slider_manager({
456
+ min: 2,
457
+ max: 30,
458
+ step: 0.1,
459
+ val: config?.val?.size ?? 2,
460
+ })
461
+ )
462
+ let size_defined_type_input_manager = $state(
463
+ create_defined_type_input_manager({
464
+ get_defined_options: config?.get_defined_options,
465
+ label: "Size",
466
+ attribute_root_key: "size",
467
+ attribute_const_val: () => size_slider_manager?.val,
468
+ attributes: config?.val,
469
+ })
470
+ )
471
+ let border_radius_slider_manager = $state(
472
+ create_slider_manager({
473
+ min: 0,
474
+ max: 5,
475
+ step: 0.1,
476
+ val: config?.val?.border_radius ?? 0.5,
477
+ })
478
+ )
479
+ let border_radius_defined_type_input_manager = $state(
480
+ create_defined_type_input_manager({
481
+ get_defined_options: config?.get_defined_options,
482
+ label: "Border Radius",
483
+ attribute_root_key: "border_radius",
484
+ attribute_const_val: () => border_radius_slider_manager?.val,
485
+ attributes: config?.val,
486
+ })
487
+ )
488
+ attributes_manager = {
489
+ val_color_input_manager: val_color_input_manager,
490
+ val_defined_type_input_manager: val_defined_type_input_manager,
491
+ is_show_details_checkbox_manager: is_show_details_checkbox_manager,
492
+ is_show_details_defined_type_input_manager: is_show_details_defined_type_input_manager,
493
+ size_slider_manager: size_slider_manager,
494
+ size_defined_type_input_manager: size_defined_type_input_manager,
495
+ border_radius_slider_manager: border_radius_slider_manager,
496
+ border_radius_defined_type_input_manager: border_radius_defined_type_input_manager,
497
+ get val() {
498
+ return {
499
+ ...val_defined_type_input_manager?.val,
500
+ ...is_show_details_defined_type_input_manager?.val,
501
+ ...size_defined_type_input_manager?.val,
502
+ ...border_radius_defined_type_input_manager?.val,
503
+ }
504
+ },
505
+ }
506
+ } else if (content_type == "image") {
507
+ attributes_manager = create_image_config_manager({
508
+ storage: config?.storage,
509
+ storage_default_folder_path: config?.storage_default_folder_path,
510
+ storage_path: config?.storage_path,
511
+ val: config?.val,
512
+ get_defined_options: config?.get_defined_options,
513
+ })
514
+ } else if (content_type == "audio") {
515
+ attributes_manager = create_audio_config_manager({
516
+ storage: config?.storage,
517
+ storage_default_folder_path: config?.storage_default_folder_path,
518
+ storage_path: config?.storage_path,
519
+ val: config?.val,
520
+ get_defined_options: config?.get_defined_options,
521
+ })
522
+ } else if (
523
+ ["h1", "h2", "h3", "h4", "h5", "base_text", "em", "strong", "strong_em", "pre"].includes(content_type)
524
+ ) {
525
+ let content_text_input_manager = $state(
526
+ create_text_input_manager({
527
+ type: "text_area",
528
+ rows: 5,
529
+ is_nullable: true,
530
+ val: config?.val?.content,
531
+ placeholder: "content",
532
+ })
533
+ )
534
+ let content_defined_type_input_manager = $state(
535
+ create_defined_type_input_manager({
536
+ get_defined_options: config?.get_defined_options,
537
+ label: "Content",
538
+ attribute_root_key: "content",
539
+ attribute_const_val: () => content_text_input_manager?.val,
540
+ attributes: config?.val,
541
+ })
542
+ )
543
+ let text_color_color_input_manager = $state(
544
+ create_color_input_manager({
545
+ is_nullable: true,
546
+ val: config?.val?.text_color,
547
+ })
548
+ )
549
+ let text_color_defined_type_input_manager = $state(
550
+ create_defined_type_input_manager({
551
+ get_defined_options: config?.get_defined_options,
552
+ label: "Text Color",
553
+ attribute_root_key: "text_color",
554
+ attribute_const_val: () => text_color_color_input_manager?.val,
555
+ attributes: config?.val,
556
+ })
557
+ )
558
+ attributes_manager = {
559
+ content_defined_type_input_manager: content_defined_type_input_manager,
560
+ content_text_input_manager: content_text_input_manager,
561
+ text_color_defined_type_input_manager: text_color_defined_type_input_manager,
562
+ text_color_color_input_manager: text_color_color_input_manager,
563
+ get val() {
564
+ return {
565
+ ...content_defined_type_input_manager?.val,
566
+ ...text_color_defined_type_input_manager?.val,
567
+ }
568
+ },
569
+ }
570
+ } else if (content_type == "code_inline") {
571
+ let content_text_input_manager = $state(
572
+ create_text_input_manager({
573
+ type: "text_area",
574
+ rows: 5,
575
+ is_nullable: true,
576
+ val: config?.val?.content,
577
+ placeholder: "content",
578
+ })
579
+ )
580
+ let content_defined_type_input_manager = $state(
581
+ create_defined_type_input_manager({
582
+ get_defined_options: config?.get_defined_options,
583
+ label: "Content",
584
+ attribute_root_key: "content",
585
+ attribute_const_val: () => content_text_input_manager?.val,
586
+ attributes: config?.val,
587
+ })
588
+ )
589
+ let is_show_copy_button_checkbox_manager = $state(
590
+ create_checkbox_manager({
591
+ type: "toggle",
592
+ is_nullable: true,
593
+ val: config?.val?.is_show_copy_button,
594
+ })
595
+ )
596
+ let is_show_copy_button_defined_type_input_manager = $state(
597
+ create_defined_type_input_manager({
598
+ get_defined_options: config?.get_defined_options,
599
+ label: "Is Show Copy Button",
600
+ attribute_root_key: "is_show_copy_button",
601
+ attribute_const_val: () => is_show_copy_button_checkbox_manager?.val,
602
+ attributes: config?.val,
603
+ })
604
+ )
605
+ let text_color_color_input_manager = $state(
606
+ create_color_input_manager({
607
+ is_nullable: true,
608
+ val: config?.val?.text_color,
609
+ })
610
+ )
611
+ let text_color_defined_type_input_manager = $state(
612
+ create_defined_type_input_manager({
613
+ get_defined_options: config?.get_defined_options,
614
+ label: "Text Color",
615
+ attribute_root_key: "text_color",
616
+ attribute_const_val: () => text_color_color_input_manager?.val,
617
+ attributes: config?.val,
618
+ })
619
+ )
620
+ attributes_manager = {
621
+ content_defined_type_input_manager: content_defined_type_input_manager,
622
+ content_text_input_manager: content_text_input_manager,
623
+ is_show_copy_button_defined_type_input_manager: is_show_copy_button_defined_type_input_manager,
624
+ is_show_copy_button_checkbox_manager: is_show_copy_button_checkbox_manager,
625
+ text_color_defined_type_input_manager: text_color_defined_type_input_manager,
626
+ text_color_color_input_manager: text_color_color_input_manager,
627
+ get val() {
628
+ return {
629
+ ...content_defined_type_input_manager?.val,
630
+ ...is_show_copy_button_defined_type_input_manager?.val,
631
+ ...text_color_defined_type_input_manager?.val,
632
+ }
633
+ },
634
+ }
635
+ } else if (content_type == "x_post") {
636
+ let post_id_text_input_manager = $state(
637
+ create_text_input_manager({
638
+ is_nullable: true,
639
+ val: config?.val?.post_id,
640
+ placeholder: "post id",
641
+ })
642
+ )
643
+ let post_id_defined_type_input_manager = $state(
644
+ create_defined_type_input_manager({
645
+ get_defined_options: config?.get_defined_options,
646
+ label: "Post ID",
647
+ attribute_root_key: "post_id",
648
+ attribute_const_val: () => post_id_text_input_manager?.val,
649
+ attributes: config?.val,
650
+ })
651
+ )
652
+ let is_dark_theme_checkbox_manager = $state(
653
+ create_checkbox_manager({
654
+ type: "toggle",
655
+ val: config?.val?.is_dark_theme,
656
+ })
657
+ )
658
+ let is_dark_theme_defined_type_input_manager = $state(
659
+ create_defined_type_input_manager({
660
+ get_defined_options: config?.get_defined_options,
661
+ label: "Is Dark Theme",
662
+ attribute_root_key: "is_dark_theme",
663
+ attribute_const_val: () => is_dark_theme_checkbox_manager?.val,
664
+ attributes: config?.val,
665
+ })
666
+ )
667
+ attributes_manager = {
668
+ post_id_text_input_manager: post_id_text_input_manager,
669
+ post_id_defined_type_input_manager: post_id_defined_type_input_manager,
670
+ is_dark_theme_checkbox_manager: is_dark_theme_checkbox_manager,
671
+ is_dark_theme_defined_type_input_manager: is_dark_theme_defined_type_input_manager,
672
+ get val() {
673
+ return {
674
+ ...post_id_defined_type_input_manager?.val,
675
+ ...is_dark_theme_defined_type_input_manager?.val,
676
+ }
677
+ },
678
+ }
679
+ } else if (content_type == "youtube_video") {
680
+ let video_id_text_input_manager = $state(
681
+ create_text_input_manager({
682
+ is_nullable: true,
683
+ val: config?.val?.video_id,
684
+ placeholder: "video id",
685
+ })
686
+ )
687
+ let video_id_defined_type_input_manager = $state(
688
+ create_defined_type_input_manager({
689
+ get_defined_options: config?.get_defined_options,
690
+ label: "Video ID",
691
+ attribute_root_key: "video_id",
692
+ attribute_const_val: () => video_id_text_input_manager?.val,
693
+ attributes: config?.val,
694
+ })
695
+ )
696
+ let is_dark_theme_checkbox_manager = $state(
697
+ create_checkbox_manager({
698
+ type: "toggle",
699
+ val: config?.val?.is_dark_theme,
700
+ })
701
+ )
702
+ let is_dark_theme_defined_type_input_manager = $state(
703
+ create_defined_type_input_manager({
704
+ get_defined_options: config?.get_defined_options,
705
+ label: "Is Dark Theme",
706
+ attribute_root_key: "is_dark_theme",
707
+ attribute_const_val: () => is_dark_theme_checkbox_manager?.val,
708
+ attributes: config?.val,
709
+ })
710
+ )
711
+ attributes_manager = {
712
+ video_id_text_input_manager: video_id_text_input_manager,
713
+ video_id_defined_type_input_manager: video_id_defined_type_input_manager,
714
+ is_dark_theme_checkbox_manager: is_dark_theme_checkbox_manager,
715
+ is_dark_theme_defined_type_input_manager: is_dark_theme_defined_type_input_manager,
716
+ get val() {
717
+ return {
718
+ ...video_id_defined_type_input_manager?.val,
719
+ ...is_dark_theme_defined_type_input_manager?.val,
720
+ }
721
+ },
722
+ }
723
+ // } else if (["int_literal", "float_literal", "bigint_literal"].includes(content_type)) {
724
+ // let content_text_input_manager = $state(
725
+ // create_text_input_manager({
726
+ // type: "number",
727
+ // val: typeof val?.content == "undefined" ? att_val?.default : val?.content,
728
+ // placeholder: "content",
729
+ // })
730
+ // )
731
+ // attributes_manager = {
732
+ // content_text_input_manager: content_text_input_manager,
733
+ // val: () => val,
734
+ // }
735
+ } else if (content_type == "show_conditions") {
736
+ let is_run_serverside_checkbox_manager = $state(
737
+ create_checkbox_manager({
738
+ type: "toggle",
739
+ is_nullable: true,
740
+ val: config?.val?.is_run_serverside,
741
+ })
742
+ )
743
+ let is_run_serverside_defined_type_input_manager = $state(
744
+ create_defined_type_input_manager({
745
+ get_defined_options: config?.get_defined_options,
746
+ label: "Is Run Serverside",
747
+ attribute_root_key: "is_run_serverside",
748
+ attribute_const_val: () => is_run_serverside_checkbox_manager?.val,
749
+ attributes: config?.val,
750
+ })
751
+ )
752
+ attributes_manager = {
753
+ is_run_serverside_defined_type_input_manager: is_run_serverside_defined_type_input_manager,
754
+ is_run_serverside_checkbox_manager: is_run_serverside_checkbox_manager,
755
+ get val() {
756
+ return {
757
+ ...is_run_serverside_defined_type_input_manager?.val,
758
+ }
759
+ },
760
+ }
761
+ } else if (content_type == "show_conditions_item") {
762
+ let is_show_checkbox_manager = $state(
763
+ create_checkbox_manager({
764
+ type: "toggle",
765
+ is_nullable: true,
766
+ val: config?.val?.is_show,
767
+ })
768
+ )
769
+ let is_show_defined_type_input_manager = $state(
770
+ create_defined_type_input_manager({
771
+ get_defined_options: config?.get_defined_options,
772
+ label: "Is Show",
773
+ attribute_root_key: "is_show",
774
+ attribute_const_val: () => is_show_checkbox_manager?.val,
775
+ attributes: config?.val,
776
+ })
777
+ )
778
+ attributes_manager = {
779
+ is_show_defined_type_input_manager: is_show_defined_type_input_manager,
780
+ is_show_checkbox_manager: is_show_checkbox_manager,
781
+ get val() {
782
+ return {
783
+ ...is_show_defined_type_input_manager?.val,
784
+ }
785
+ },
786
+ }
787
+ } else if (content_type == "checkbox") {
788
+ // name, on_val, off_val, is_read_only
789
+ let val_checkbox_manager = $state(
790
+ create_checkbox_manager({
791
+ type: "toggle",
792
+ is_nullable: true,
793
+ val: config?.val,
794
+ })
795
+ )
796
+ let val_defined_type_input_manager = $state(
797
+ create_defined_type_input_manager({
798
+ get_defined_options: config?.get_defined_options,
799
+ label: "Val",
800
+ attribute_root_key: "val",
801
+ attribute_const_val: () => val_checkbox_manager?.val,
802
+ attributes: config?.val,
803
+ })
804
+ )
805
+ let type_dropdown_manager = $state(
806
+ create_dropdown_manager({
807
+ is_nullable: true,
808
+ val: config?.val?.type,
809
+ is_button_compressed: true,
810
+ options: [
811
+ { key: "checkbox", name: "Checkbox" },
812
+ { key: "toggle", name: "Toggle" },
813
+ ],
814
+ })
815
+ )
816
+ let type_defined_type_input_manager = $state(
817
+ create_defined_type_input_manager({
818
+ get_defined_options: config?.get_defined_options,
819
+ label: "Type",
820
+ attribute_root_key: "type",
821
+ attribute_const_val: () => type_dropdown_manager?.val,
822
+ attributes: config?.val,
823
+ })
824
+ )
825
+ let size_slider_manager = $state(
826
+ create_slider_manager({
827
+ is_nullable: true,
828
+ val: config?.val?.size,
829
+ min: 0.5,
830
+ max: 10,
831
+ step: 0.1,
832
+ })
833
+ )
834
+ let size_defined_type_input_manager = $state(
835
+ create_defined_type_input_manager({
836
+ get_defined_options: config?.get_defined_options,
837
+ label: "Size",
838
+ attribute_root_key: "size",
839
+ attribute_const_val: () => size_slider_manager?.val,
840
+ attributes: config?.val,
841
+ })
842
+ )
843
+ let color_input_manager = $state(
844
+ create_color_input_manager({
845
+ is_nullable: true,
846
+ val: config?.val?.color,
847
+ })
848
+ )
849
+ let color_defined_type_input_manager = $state(
850
+ create_defined_type_input_manager({
851
+ get_defined_options: config?.get_defined_options,
852
+ label: "Color",
853
+ attribute_root_key: "color",
854
+ attribute_const_val: () => color_input_manager?.val,
855
+ attributes: config?.val,
856
+ })
857
+ )
858
+ attributes_manager = {
859
+ val_defined_type_input_manager: val_defined_type_input_manager,
860
+ val_checkbox_manager: val_checkbox_manager,
861
+ type_dropdown_manager: type_dropdown_manager,
862
+ type_defined_type_input_manager: type_defined_type_input_manager,
863
+ size_slider_manager: size_slider_manager,
864
+ size_defined_type_input_manager: size_defined_type_input_manager,
865
+ color_defined_type_input_manager: color_defined_type_input_manager,
866
+ color_input_manager: color_input_manager,
867
+ get val() {
868
+ return {
869
+ ...val_defined_type_input_manager?.val,
870
+ ...type_defined_type_input_manager?.val,
871
+ ...size_defined_type_input_manager?.val,
872
+ ...color_defined_type_input_manager?.val,
873
+ }
874
+ },
875
+ }
876
+ } else if (content_type == "code") {
877
+ let content_text_input_manager = $state(
878
+ create_text_input_manager({
879
+ type: "text_area",
880
+ rows: 5,
881
+ is_nullable: true,
882
+ val: config?.val?.content,
883
+ placeholder: "content",
884
+ })
885
+ )
886
+ let content_defined_type_input_manager = $state(
887
+ create_defined_type_input_manager({
888
+ get_defined_options: config?.get_defined_options,
889
+ label: "Content",
890
+ attribute_root_key: "content",
891
+ attribute_const_val: () => content_text_input_manager?.val,
892
+ attributes: config?.val,
893
+ })
894
+ )
895
+ let language_text_input_manager = $state(
896
+ create_text_input_manager({
897
+ is_nullable: true,
898
+ val: config?.val?.language,
899
+ placeholder: "e.g. JSON",
900
+ })
901
+ )
902
+ let language_defined_type_input_manager = $state(
903
+ create_defined_type_input_manager({
904
+ get_defined_options: config?.get_defined_options,
905
+ label: "Language",
906
+ attribute_root_key: "language",
907
+ attribute_const_val: () => language_text_input_manager?.val,
908
+ attributes: config?.val,
909
+ })
910
+ )
911
+ attributes_manager = {
912
+ content_text_input_manager: content_text_input_manager,
913
+ content_defined_type_input_manager: content_defined_type_input_manager,
914
+ language_text_input_manager: language_text_input_manager,
915
+ language_defined_type_input_manager: language_defined_type_input_manager,
916
+ get val() {
917
+ return {
918
+ ...content_defined_type_input_manager?.val,
919
+ ...language_defined_type_input_manager?.val,
920
+ }
921
+ },
922
+ }
923
+ } else if (content_type == "json") {
924
+ let val_text_input_manager = $state(
925
+ create_text_input_manager({
926
+ type: "text_area",
927
+ rows: 5,
928
+ is_nullable: true,
929
+ val: config?.val?.val,
930
+ placeholder: "val",
931
+ })
932
+ )
933
+ let val_defined_type_input_manager = $state(
934
+ create_defined_type_input_manager({
935
+ get_defined_options: config?.get_defined_options,
936
+ label: "Val",
937
+ attribute_root_key: "val",
938
+ attribute_const_val: () => val_text_input_manager?.val,
939
+ attributes: config?.val,
940
+ })
941
+ )
942
+ let is_show_buttons_checkbox_manager = $state(
943
+ create_checkbox_manager({
944
+ type: "toggle",
945
+ label: "Is Show Buttons",
946
+ val: config?.val?.is_show_buttons,
947
+ })
948
+ )
949
+ let is_edit_mode_buttons_checkbox_manager = $state(
950
+ create_checkbox_manager({
951
+ type: "toggle",
952
+ label: "Is Edit Mode",
953
+ val: config?.val?.is_edit_mode,
954
+ })
955
+ )
956
+ let is_popover_checkbox_manager = $state(
957
+ create_checkbox_manager({
958
+ type: "toggle",
959
+ label: "Is Popover",
960
+ val: config?.val?.is_popover,
961
+ })
962
+ )
963
+ let is_inline_checkbox_manager = $state(
964
+ create_checkbox_manager({
965
+ type: "toggle",
966
+ label: "Is Inline",
967
+ val: config?.val?.is_inline,
968
+ })
969
+ )
970
+ attributes_manager = {
971
+ val_text_input_manager: val_text_input_manager,
972
+ val_defined_type_input_manager: val_defined_type_input_manager,
973
+ is_show_buttons_checkbox_manager: is_show_buttons_checkbox_manager,
974
+ is_edit_mode_buttons_checkbox_manager: is_edit_mode_buttons_checkbox_manager,
975
+ is_popover_checkbox_manager: is_popover_checkbox_manager,
976
+ is_inline_checkbox_manager: is_inline_checkbox_manager,
977
+ get val() {
978
+ return {
979
+ ...val_defined_type_input_manager?.val,
980
+ is_show_buttons: is_show_buttons_checkbox_manager?.val,
981
+ is_edit_mode: is_edit_mode_buttons_checkbox_manager?.val,
982
+ is_popover: is_popover_checkbox_manager?.val,
983
+ is_inline: is_inline_checkbox_manager?.val,
984
+ }
985
+ },
986
+ }
987
+ } else if (content_type == "location") {
988
+ let val_location_input_manager = $state(
989
+ create_location_input_manager({
990
+ val: config?.val?.val,
991
+ is_popover: false,
992
+ })
993
+ )
994
+ let val_defined_type_input_manager = $state(
995
+ create_defined_type_input_manager({
996
+ get_defined_options: config?.get_defined_options,
997
+ label: "Val",
998
+ attribute_root_key: "val",
999
+ attribute_const_val: () => val_location_input_manager?.val,
1000
+ attributes: config?.val,
1001
+ })
1002
+ )
1003
+ let is_popover_checkbox_manager = $state(
1004
+ create_checkbox_manager({
1005
+ type: "toggle",
1006
+ label: "Is Popover",
1007
+ val: config?.val?.is_popover,
1008
+ })
1009
+ )
1010
+ let is_inline_checkbox_manager = $state(
1011
+ create_checkbox_manager({
1012
+ type: "toggle",
1013
+ label: "Is Inline",
1014
+ val: config?.val?.is_inline,
1015
+ })
1016
+ )
1017
+ attributes_manager = {
1018
+ val_location_input_manager: val_location_input_manager,
1019
+ val_defined_type_input_manager: val_defined_type_input_manager,
1020
+ is_popover_checkbox_manager: is_popover_checkbox_manager,
1021
+ is_inline_checkbox_manager: is_inline_checkbox_manager,
1022
+ get val() {
1023
+ return {
1024
+ ...val_defined_type_input_manager?.val,
1025
+ is_popover: is_popover_checkbox_manager?.val,
1026
+ is_inline: is_inline_checkbox_manager?.val,
1027
+ }
1028
+ },
1029
+ }
1030
+ } else if (content_type == "link") {
1031
+ let href_text_input_manager = $state(
1032
+ create_text_input_manager({
1033
+ is_nullable: true,
1034
+ val: config?.val?.href,
1035
+ placeholder: "href",
1036
+ })
1037
+ )
1038
+ let href_defined_type_input_manager = $state(
1039
+ create_defined_type_input_manager({
1040
+ get_defined_options: config?.get_defined_options,
1041
+ label: "href",
1042
+ attribute_root_key: "href",
1043
+ attribute_const_val: () => href_text_input_manager?.val,
1044
+ attributes: config?.val,
1045
+ })
1046
+ )
1047
+ let display_text_text_input_manager = $state(
1048
+ create_text_input_manager({
1049
+ is_nullable: true,
1050
+ val: config?.val?.display_text,
1051
+ placeholder: "Some Link Text",
1052
+ })
1053
+ )
1054
+ let display_text_defined_type_input_manager = $state(
1055
+ create_defined_type_input_manager({
1056
+ get_defined_options: config?.get_defined_options,
1057
+ label: "Dispaly Text",
1058
+ attribute_root_key: "display_text",
1059
+ attribute_const_val: () => display_text_text_input_manager?.val,
1060
+ attributes: config?.val,
1061
+ })
1062
+ )
1063
+ let text_color_color_input_manager = $state(
1064
+ create_color_input_manager({
1065
+ is_nullable: true,
1066
+ val: config?.val?.text_color,
1067
+ })
1068
+ )
1069
+ let text_color_defined_type_input_manager = $state(
1070
+ create_defined_type_input_manager({
1071
+ get_defined_options: config?.get_defined_options,
1072
+ label: "Text Color",
1073
+ attribute_root_key: "text_color",
1074
+ attribute_const_val: () => text_color_color_input_manager?.val,
1075
+ attributes: config?.val,
1076
+ })
1077
+ )
1078
+ let is_show_preview_checkbox_manager = $state(
1079
+ create_checkbox_manager({
1080
+ type: "toggle",
1081
+ is_nullable: true,
1082
+ val: config?.val?.is_show_preview,
1083
+ })
1084
+ )
1085
+ let is_show_preview_defined_type_input_manager = $state(
1086
+ create_defined_type_input_manager({
1087
+ get_defined_options: config?.get_defined_options,
1088
+ label: "Is Show Preview",
1089
+ attribute_root_key: "is_show_preview",
1090
+ attribute_const_val: () => display_text_text_input_manager?.val,
1091
+ attributes: config?.val,
1092
+ })
1093
+ )
1094
+ attributes_manager = {
1095
+ href_text_input_manager: href_text_input_manager,
1096
+ href_defined_type_input_manager: href_defined_type_input_manager,
1097
+ display_text_text_input_manager: display_text_text_input_manager,
1098
+ display_text_defined_type_input_manager: display_text_defined_type_input_manager,
1099
+ text_color_color_input_manager: text_color_color_input_manager,
1100
+ text_color_defined_type_input_manager: text_color_defined_type_input_manager,
1101
+ is_show_preview_checkbox_manager: is_show_preview_checkbox_manager,
1102
+ is_show_preview_defined_type_input_manager: is_show_preview_defined_type_input_manager,
1103
+ get val() {
1104
+ return {
1105
+ ...href_defined_type_input_manager?.val,
1106
+ ...display_text_defined_type_input_manager?.val,
1107
+ ...text_color_defined_type_input_manager?.val,
1108
+ ...is_show_preview_defined_type_input_manager?.val,
1109
+ }
1110
+ },
1111
+ }
1112
+ } else if (content_type == "icon_input") {
1113
+ let val_icon_input_manager = $state(null)
1114
+ let is_icon_only_checkbox_manager = $state(
1115
+ create_checkbox_manager({
1116
+ type: "toggle",
1117
+ is_nullable: true,
1118
+ val: config?.val?.is_icon_only,
1119
+ on_change: (input) => val_icon_input_manager.set_is_icon_only(input),
1120
+ })
1121
+ )
1122
+ let is_icon_only_defined_type_input_manager = $state(
1123
+ create_defined_type_input_manager({
1124
+ get_defined_options: config?.get_defined_options,
1125
+ label: "Is Icon Only",
1126
+ attribute_root_key: "is_icon_only",
1127
+ attribute_const_val: () => is_icon_only_checkbox_manager?.val,
1128
+ attributes: config?.val,
1129
+ })
1130
+ )
1131
+ val_icon_input_manager = create_icon_input_manager({
1132
+ is_icon_only: is_icon_only_checkbox_manager?.val,
1133
+ is_nullable: true,
1134
+ val: config?.val?.val,
1135
+ })
1136
+ let val_defined_type_input_manager = $state(
1137
+ create_defined_type_input_manager({
1138
+ get_defined_options: config?.get_defined_options,
1139
+ label: "Val",
1140
+ attribute_root_key: "val",
1141
+ attribute_const_val: () => val_icon_input_manager?.val,
1142
+ attributes: config?.val,
1143
+ })
1144
+ )
1145
+ attributes_manager = {
1146
+ is_icon_only_checkbox_manager: is_icon_only_checkbox_manager,
1147
+ is_icon_only_defined_type_input_manager: is_icon_only_defined_type_input_manager,
1148
+ val_icon_input_manager: val_icon_input_manager,
1149
+ val_defined_type_input_manager: val_defined_type_input_manager,
1150
+ get val() {
1151
+ return {
1152
+ ...is_icon_only_defined_type_input_manager?.val,
1153
+ ...val_defined_type_input_manager?.val,
1154
+ }
1155
+ },
1156
+ }
1157
+ } else if (content_type == "icon") {
1158
+ let icon_id_icon_input_manager = $state(
1159
+ create_icon_input_manager({
1160
+ is_icon_only: true,
1161
+ val: config?.val?.icon_id,
1162
+ })
1163
+ )
1164
+ let icon_id_defined_type_input_manager = $state(
1165
+ create_defined_type_input_manager({
1166
+ get_defined_options: config?.get_defined_options,
1167
+ label: "Icon ID",
1168
+ attribute_root_key: "icon_id",
1169
+ attribute_const_val: () => icon_id_icon_input_manager?.val,
1170
+ attributes: config?.val,
1171
+ })
1172
+ )
1173
+ let icon_size_slider_manager = $state(
1174
+ create_slider_manager({
1175
+ is_nullable: true,
1176
+ min: 1,
1177
+ max: 30,
1178
+ step: 1,
1179
+ val: config?.val?.size,
1180
+ })
1181
+ )
1182
+ let icon_size_defined_type_input_manager = $state(
1183
+ create_defined_type_input_manager({
1184
+ get_defined_options: config?.get_defined_options,
1185
+ label: "Size",
1186
+ attribute_root_key: "size",
1187
+ attribute_const_val: () => icon_size_slider_manager?.val,
1188
+ attributes: config?.val,
1189
+ })
1190
+ )
1191
+ let icon_sw_slider_manager = $state(
1192
+ create_slider_manager({
1193
+ is_nullable: true,
1194
+ min: 1,
1195
+ max: 100,
1196
+ step: 1,
1197
+ val: config?.val?.sw,
1198
+ })
1199
+ )
1200
+ let icon_sw_defined_type_input_manager = $state(
1201
+ create_defined_type_input_manager({
1202
+ get_defined_options: config?.get_defined_options,
1203
+ label: "Stroke Width",
1204
+ attribute_root_key: "sw",
1205
+ attribute_const_val: () => icon_sw_slider_manager?.val,
1206
+ attributes: config?.val,
1207
+ })
1208
+ )
1209
+ let icon_deg_slider_manager = $state(
1210
+ create_slider_manager({
1211
+ is_nullable: true,
1212
+ min: 0,
1213
+ max: 360,
1214
+ step: 1,
1215
+ val: config?.val?.deg,
1216
+ })
1217
+ )
1218
+ let icon_deg_defined_type_input_manager = $state(
1219
+ create_defined_type_input_manager({
1220
+ get_defined_options: config?.get_defined_options,
1221
+ label: "Degrees Turned",
1222
+ attribute_root_key: "deg",
1223
+ attribute_const_val: () => icon_deg_slider_manager?.val,
1224
+ attributes: config?.val,
1225
+ })
1226
+ )
1227
+ let icon_color_color_input_manager = $state(
1228
+ create_color_input_manager({
1229
+ is_nullable: true,
1230
+ val: config?.val?.color,
1231
+ })
1232
+ )
1233
+ let icon_color_defined_type_input_manager = $state(
1234
+ create_defined_type_input_manager({
1235
+ get_defined_options: config?.get_defined_options,
1236
+ label: "Icon Color",
1237
+ attribute_root_key: "color",
1238
+ attribute_const_val: () => icon_color_color_input_manager?.val,
1239
+ attributes: config?.val,
1240
+ })
1241
+ )
1242
+ // color_alt,fill
1243
+ attributes_manager = {
1244
+ icon_id_icon_input_manager: icon_id_icon_input_manager,
1245
+ icon_id_defined_type_input_manager: icon_id_defined_type_input_manager,
1246
+ icon_size_slider_manager: icon_size_slider_manager,
1247
+ icon_size_defined_type_input_manager: icon_size_defined_type_input_manager,
1248
+ icon_sw_slider_manager: icon_sw_slider_manager,
1249
+ icon_sw_defined_type_input_manager: icon_sw_defined_type_input_manager,
1250
+ icon_deg_slider_manager: icon_deg_slider_manager,
1251
+ icon_deg_defined_type_input_manager: icon_deg_defined_type_input_manager,
1252
+ icon_color_color_input_manager: icon_color_color_input_manager,
1253
+ icon_color_defined_type_input_manager: icon_color_defined_type_input_manager,
1254
+ get val() {
1255
+ return {
1256
+ ...icon_id_defined_type_input_manager?.val,
1257
+ ...icon_size_defined_type_input_manager?.val,
1258
+ ...icon_sw_defined_type_input_manager?.val,
1259
+ ...icon_deg_defined_type_input_manager?.val,
1260
+ ...icon_color_defined_type_input_manager?.val,
1261
+ }
1262
+ },
1263
+ }
1264
+ } else if (content_type == "cron_input") {
1265
+ let val_cron_input_manager = $state(
1266
+ create_cron_input_manager({
1267
+ is_nullable: true,
1268
+ val: config?.val?.val,
1269
+ })
1270
+ )
1271
+ let val_defined_type_input_manager = $state(
1272
+ create_defined_type_input_manager({
1273
+ get_defined_options: config?.get_defined_options,
1274
+ label: "Val",
1275
+ attribute_root_key: "val",
1276
+ attribute_const_val: () => val_cron_input_manager?.val,
1277
+ attributes: config?.val,
1278
+ })
1279
+ )
1280
+ attributes_manager = {
1281
+ val_cron_input_manager: val_cron_input_manager,
1282
+ val_defined_type_input_manager: val_defined_type_input_manager,
1283
+ get val() {
1284
+ return {
1285
+ ...val_defined_type_input_manager?.val,
1286
+ }
1287
+ },
1288
+ }
1289
+ } else if (content_type == "cron") {
1290
+ let val_cron_input_manager = $state(
1291
+ create_cron_input_manager({
1292
+ is_nullable: true,
1293
+ val: config?.val?.val,
1294
+ })
1295
+ )
1296
+ let val_defined_type_input_manager = $state(
1297
+ create_defined_type_input_manager({
1298
+ get_defined_options: config?.get_defined_options,
1299
+ label: "Val",
1300
+ attribute_root_key: "val",
1301
+ attribute_const_val: () => val_cron_input_manager?.val,
1302
+ attributes: config?.val,
1303
+ })
1304
+ )
1305
+ attributes_manager = {
1306
+ val_cron_input_manager: val_cron_input_manager,
1307
+ val_defined_type_input_manager: val_defined_type_input_manager,
1308
+ get val() {
1309
+ return {
1310
+ ...val_defined_type_input_manager?.val,
1311
+ }
1312
+ },
1313
+ }
1314
+ } else if (content_type == "loop") {
1315
+ let iter_identifier_text_input_manager = $state(
1316
+ create_text_input_manager({
1317
+ label: "Iter Identifier",
1318
+ val: config?.val?.iter_identifier,
1319
+ placeholder: "some_key",
1320
+ })
1321
+ )
1322
+ let val_input_manager = $state(
1323
+ create_variable_path_input_manager({
1324
+ val: config?.val?.val_from_variable_path,
1325
+ get_defined_options: config?.get_defined_options,
1326
+ on_finish: () => val_input_manager.close_popover(),
1327
+ })
1328
+ )
1329
+ let join_text_text_input_manager = $state(
1330
+ create_text_input_manager({
1331
+ is_nullable: true,
1332
+ val: config?.val?.join_text,
1333
+ placeholder: "Join Text",
1334
+ })
1335
+ )
1336
+ let join_text_defined_type_input_manager = $state(
1337
+ create_defined_type_input_manager({
1338
+ defined_data_type: {
1339
+ ...defined_data_type,
1340
+ properties: {
1341
+ ...defined_data_type?.properties,
1342
+ [iter_identifier_text_input_manager?.val]: { type: "int_literal" },
1343
+ },
1344
+ },
1345
+ label: "Join Text",
1346
+ attribute_root_key: "join_text",
1347
+ attribute_const_val: () => join_text_text_input_manager?.val,
1348
+ attributes: config?.val,
1349
+ })
1350
+ )
1351
+ attributes_manager = {
1352
+ val_input_manager: val_input_manager,
1353
+ iter_identifier_text_input_manager: iter_identifier_text_input_manager,
1354
+ join_text_text_input_manager: join_text_text_input_manager,
1355
+ join_text_defined_type_input_manager: join_text_defined_type_input_manager,
1356
+ get val() {
1357
+ return {
1358
+ iter_identifier: iter_identifier_text_input_manager?.val,
1359
+ val_from_variable_path: val_input_manager?.val,
1360
+ ...join_text_defined_type_input_manager?.val,
1361
+ }
1362
+ },
1363
+ }
1364
+ } else if (content_type == "slot") {
1365
+ let val_text_input_manager = $state(
1366
+ create_text_input_manager({
1367
+ val: config?.val?.val,
1368
+ })
1369
+ )
1370
+ let val_defined_type_input_manager = $state(
1371
+ create_defined_type_input_manager({
1372
+ get_defined_options: config?.get_defined_options,
1373
+ label: "Val",
1374
+ attribute_root_key: "val",
1375
+ attribute_const_val: () => val_text_input_manager?.val,
1376
+ attributes: config?.val,
1377
+ })
1378
+ )
1379
+ attributes_manager = {
1380
+ val_text_input_manager: val_text_input_manager,
1381
+ val_defined_type_input_manager: val_defined_type_input_manager,
1382
+ get val() {
1383
+ return {
1384
+ ...val_defined_type_input_manager?.val,
1385
+ }
1386
+ },
1387
+ }
1388
+ }
1389
+ }
1390
+ finish_button_manager = create_button_manager({
1391
+ text: "Finish",
1392
+ c: 1,
1393
+ l: 2,
1394
+ mt: 1,
1395
+ // is_disabled: () => !has_changed, idk not updating on a change tbd
1396
+ on_click: () => {
1397
+ if (typeof config?.on_finish == "function") {
1398
+ config?.on_finish(attributes_manager?.val)
1399
+ }
1400
+ },
1401
+ })
1402
+ selector_id = config?.selector_id ?? null
1403
+ }
1404
+
1405
+ init(config)
1406
+
1407
+ return {
1408
+ id,
1409
+ get val() {
1410
+ return val
1411
+ },
1412
+ get val_original() {
1413
+ return val_original
1414
+ },
1415
+ get selector_id() {
1416
+ return selector_id
1417
+ },
1418
+ get content_type() {
1419
+ return content_type
1420
+ },
1421
+ get has_changed() {
1422
+ return has_changed
1423
+ },
1424
+ get popover_manager() {
1425
+ return popover_manager
1426
+ },
1427
+ get attributes_manager() {
1428
+ return attributes_manager
1429
+ },
1430
+ get finish_button_manager() {
1431
+ return finish_button_manager
1432
+ },
1433
+ init,
1434
+ set_focused_selector_id,
1435
+ }
1436
+ }