sveltekit-ui 1.0.11 → 1.0.13
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/Components/Content/index.svelte +12 -12
- package/dist/Components/Content/index.svelte.js +73 -61
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +1 -5
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +1 -2
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +1 -3
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +2 -4
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +28 -32
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +1 -3
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +1 -3
- package/dist/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +3 -13
- package/dist/Components/ContentInput/AttributesInput/index.svelte +1 -0
- package/dist/Components/ContentInput/AttributesInput/index.svelte.js +89 -120
- package/dist/Components/ContentInput/index.svelte.js +38 -62
- package/dist/Components/DataTypeInput/index.svelte.js +0 -3
- package/dist/Components/IconInput/index.svelte +1 -1
- package/dist/Components/TableAdvanced/ColumnInput/index.svelte.js +16 -64
- package/dist/Components/TableAdvanced/SortByInput/index.svelte.js +2 -1
- package/dist/Components/TableAdvanced/index.svelte.js +124 -98
- package/dist/Components/TextInput/index.svelte.js +12 -0
- package/dist/Components/VariablePathInput/index.svelte +47 -93
- package/dist/Components/VariablePathInput/index.svelte.js +205 -191
- package/dist/client/astc_formatting/index.js +15 -58
- package/dist/client/docs/index.js +4 -23
- package/dist/client/index.js +86 -90
- package/dist/client/types/index.js +2 -0
- package/dist/index.js +2 -0
- package/package.json +4 -4
- package/src/lib/Components/Content/index.svelte +12 -12
- package/src/lib/Components/Content/index.svelte.js +73 -61
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +1 -5
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +1 -2
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +1 -3
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +2 -4
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +28 -32
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +1 -3
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +1 -3
- package/src/lib/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +3 -13
- package/src/lib/Components/ContentInput/AttributesInput/index.svelte +1 -0
- package/src/lib/Components/ContentInput/AttributesInput/index.svelte.js +89 -120
- package/src/lib/Components/ContentInput/index.svelte.js +38 -62
- package/src/lib/Components/DataTypeInput/index.svelte.js +0 -3
- package/src/lib/Components/IconInput/index.svelte +1 -1
- package/src/lib/Components/TableAdvanced/ColumnInput/index.svelte.js +16 -64
- package/src/lib/Components/TableAdvanced/SortByInput/index.svelte.js +2 -1
- package/src/lib/Components/TableAdvanced/index.svelte.js +124 -98
- package/src/lib/Components/TextInput/index.svelte.js +12 -0
- package/src/lib/Components/VariablePathInput/index.svelte +47 -93
- package/src/lib/Components/VariablePathInput/index.svelte.js +205 -191
- package/src/lib/client/astc_formatting/index.js +15 -58
- package/src/lib/client/docs/index.js +4 -23
- package/src/lib/client/index.js +86 -90
- package/src/lib/client/types/index.js +2 -0
- package/src/lib/index.js +2 -0
- package/src/routes/[component]/Showcase/Content/index.svelte +49 -83
- package/src/routes/[component]/Showcase/ContentInput/index.svelte +11 -13
- package/src/routes/[component]/Showcase/TableAdvanced/index.svelte +108 -418
|
@@ -1,199 +1,232 @@
|
|
|
1
1
|
import { create_popover_manager } from "../Popover/index.svelte.js"
|
|
2
2
|
import { create_button_manager } from "../Button/index.svelte.js"
|
|
3
3
|
import { create_text_input_manager } from "../TextInput/index.svelte.js"
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { deep_copy, set_closurable, get_data_type_at_path } from "../../client/index.js"
|
|
4
|
+
import { create_dropdown_manager } from "../Dropdown/index.svelte.js"
|
|
5
|
+
import { set_closurable, get_data_type_at_path } from "../../client/index.js"
|
|
7
6
|
|
|
8
7
|
export function create_variable_path_input_manager(config) {
|
|
9
|
-
let val = $state(null)
|
|
10
|
-
let is_popover = $state(true)
|
|
11
8
|
let popover_manager = $state(null)
|
|
12
|
-
let
|
|
13
|
-
let
|
|
14
|
-
let set_null_button_manager = $state(null)
|
|
15
|
-
let set_root_path_button_manager = $state(null)
|
|
16
|
-
let is_dynamic_path_item_checkbox_manager = $state(null)
|
|
17
|
-
let next_path_variable_path_input_manager = $state(null)
|
|
9
|
+
let open_edit_button_manager = $state(null)
|
|
10
|
+
let add_path_item_button_manager = $state(null)
|
|
18
11
|
let finish_button_manager = $state(null)
|
|
19
|
-
let
|
|
20
|
-
let
|
|
21
|
-
let
|
|
12
|
+
let defined_options = $state(null)
|
|
13
|
+
let def_dropdown_manager = $state(null)
|
|
14
|
+
let levels_nested = $state(null)
|
|
15
|
+
let path_prepped = $state(null)
|
|
16
|
+
let val = $derived(
|
|
17
|
+
def_dropdown_manager?.val
|
|
18
|
+
? [def_dropdown_manager?.val, ...(Array.isArray(path_prepped) ? path_prepped.map((h) => h?.val) : [])]
|
|
19
|
+
: []
|
|
20
|
+
)
|
|
21
|
+
let val_text = $derived(val_to_text(val))
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
on_click: () => {
|
|
47
|
-
val = val.slice(0, i)
|
|
48
|
-
set_val_prepped()
|
|
49
|
-
set_next_path_options()
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
23
|
+
function prep_path(input) {
|
|
24
|
+
console.log("prep_path", input)
|
|
25
|
+
let path_prepped_loc = $state([])
|
|
26
|
+
if (Array.isArray(input)) {
|
|
27
|
+
let variable_data_type_at_path = Array.isArray(defined_options)
|
|
28
|
+
? defined_options.find((h) => h?.key === def_dropdown_manager?.val)?.data_type
|
|
29
|
+
: null
|
|
30
|
+
for (let i = 1; i < input.length; i++) {
|
|
31
|
+
let type_dropdown_manager = create_dropdown_manager({
|
|
32
|
+
placeholder: "Select Type",
|
|
33
|
+
is_button_compressed: true,
|
|
34
|
+
options: [
|
|
35
|
+
{ key: "number", name: "Number" },
|
|
36
|
+
{ key: "string", name: "String" },
|
|
37
|
+
{ key: "variable", name: "Variable" },
|
|
38
|
+
],
|
|
39
|
+
val: Array.isArray(input?.[i])
|
|
40
|
+
? "variable"
|
|
41
|
+
: Number.isInteger(input?.[i])
|
|
42
|
+
? "number"
|
|
43
|
+
: typeof input?.[i] == "string"
|
|
44
|
+
? "string"
|
|
45
|
+
: null,
|
|
52
46
|
})
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
val_prepped = val_prepped_loc
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function add_path_item(input) {
|
|
59
|
-
if (!Array.isArray(val)) {
|
|
60
|
-
val = [input]
|
|
61
|
-
} else {
|
|
62
|
-
val = [...val, input]
|
|
63
|
-
}
|
|
64
|
-
is_dynamic_path_item_checkbox_manager.set_val(false)
|
|
65
|
-
next_path_variable_path_input_manager?.init()
|
|
66
|
-
set_next_path_options()
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function set_next_path_options() {
|
|
70
|
-
let next_path_options_loc = null
|
|
71
|
-
if (data_type_at_path?.type == "loop") {
|
|
72
|
-
let number_input_manager = create_text_input_manager({
|
|
73
|
-
type: "number",
|
|
74
|
-
val: 0,
|
|
75
|
-
mt: 0.5,
|
|
76
|
-
mb: 0.5,
|
|
77
|
-
})
|
|
78
|
-
next_path_options_loc = {
|
|
79
|
-
type: "loop",
|
|
80
|
-
number_input_manager: number_input_manager,
|
|
81
|
-
add_path_item_button_manager: create_button_manager({
|
|
47
|
+
let remove_path_item_button_manager = create_button_manager({
|
|
82
48
|
type: "outlined",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
on_click: () =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
for (let [key, property] of Object.entries(data_type_at_path?.properties)) {
|
|
91
|
-
let option_button_manager = create_button_manager({
|
|
49
|
+
is_uniform: true,
|
|
50
|
+
support_icon: "x",
|
|
51
|
+
on_click: () => {
|
|
52
|
+
prep_path(Array.isArray(val) ? val.filter((_, idx) => idx !== i) : null)
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
let insert_path_item_before_button_manager = create_button_manager({
|
|
92
56
|
type: "outlined",
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
on_click: () =>
|
|
57
|
+
is_uniform: true,
|
|
58
|
+
support_icon: "plus",
|
|
59
|
+
on_click: () =>
|
|
60
|
+
prep_path([
|
|
61
|
+
...(Array.isArray(val) ? val.slice(0, i) : []),
|
|
62
|
+
null,
|
|
63
|
+
...(Array.isArray(val) ? val.slice(i) : []),
|
|
64
|
+
]),
|
|
96
65
|
})
|
|
97
|
-
|
|
98
|
-
|
|
66
|
+
let const_string_value_text_input_manager = create_text_input_manager({
|
|
67
|
+
label: "Property",
|
|
68
|
+
placeholder: "some_property",
|
|
69
|
+
type: "text",
|
|
70
|
+
val: type_dropdown_manager?.val == "string" ? input?.[i] : null,
|
|
71
|
+
})
|
|
72
|
+
let const_number_value_text_input_manager = create_text_input_manager({
|
|
73
|
+
label: "Index",
|
|
74
|
+
placeholder: "0",
|
|
75
|
+
type: "number",
|
|
76
|
+
val: type_dropdown_manager?.val == "number" ? input?.[i] : null,
|
|
77
|
+
})
|
|
78
|
+
let variable_path_input_manager = create_variable_path_input_manager({
|
|
79
|
+
val: input?.[i],
|
|
80
|
+
levels_nested: levels_nested + 1,
|
|
81
|
+
get_defined_options: config?.get_defined_options,
|
|
82
|
+
on_finish: () => {
|
|
83
|
+
variable_path_input_manager.close_popover()
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
let key_options = []
|
|
87
|
+
if (variable_data_type_at_path?.type == "object_literal") {
|
|
88
|
+
for (let [key, property] of Object.entries(variable_data_type_at_path?.properties)) {
|
|
89
|
+
let select_button_manager = create_button_manager({
|
|
90
|
+
type: "outlined",
|
|
91
|
+
is_compressed: true,
|
|
92
|
+
text: `${key}: (${property?.type})`,
|
|
93
|
+
selected_type: () => (const_string_value_text_input_manager?.val == key ? "half_selected" : null),
|
|
94
|
+
on_click: () => {
|
|
95
|
+
type_dropdown_manager.set_val("string")
|
|
96
|
+
const_string_value_text_input_manager.set_val(key)
|
|
97
|
+
},
|
|
98
|
+
})
|
|
99
|
+
key_options.push({
|
|
100
|
+
select_button_manager: select_button_manager,
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
console.log("key_options", key_options)
|
|
105
|
+
let val = $derived(
|
|
106
|
+
type_dropdown_manager?.val == "string"
|
|
107
|
+
? const_string_value_text_input_manager?.val
|
|
108
|
+
: type_dropdown_manager?.val == "number"
|
|
109
|
+
? const_number_value_text_input_manager?.val
|
|
110
|
+
: type_dropdown_manager?.val == "variable"
|
|
111
|
+
? variable_path_input_manager?.val
|
|
112
|
+
: null
|
|
113
|
+
)
|
|
114
|
+
let variable_data_type_at_next_path = $derived(
|
|
115
|
+
type_dropdown_manager?.val == "string"
|
|
116
|
+
? variable_data_type_at_path?.properties?.[const_string_value_text_input_manager?.val]
|
|
117
|
+
: type_dropdown_manager?.val == "number"
|
|
118
|
+
? variable_data_type_at_path?.items
|
|
119
|
+
: type_dropdown_manager?.val == "variable"
|
|
120
|
+
? variable_path_input_manager?.variable_data_type_at_path
|
|
121
|
+
: null
|
|
122
|
+
)
|
|
123
|
+
path_prepped_loc.push({
|
|
124
|
+
get type_dropdown_manager() {
|
|
125
|
+
return type_dropdown_manager
|
|
126
|
+
},
|
|
127
|
+
get remove_path_item_button_manager() {
|
|
128
|
+
return remove_path_item_button_manager
|
|
129
|
+
},
|
|
130
|
+
get insert_path_item_before_button_manager() {
|
|
131
|
+
return insert_path_item_before_button_manager
|
|
132
|
+
},
|
|
133
|
+
get const_string_value_text_input_manager() {
|
|
134
|
+
return const_string_value_text_input_manager
|
|
135
|
+
},
|
|
136
|
+
get const_number_value_text_input_manager() {
|
|
137
|
+
return const_number_value_text_input_manager
|
|
138
|
+
},
|
|
139
|
+
get variable_path_input_manager() {
|
|
140
|
+
return variable_path_input_manager
|
|
141
|
+
},
|
|
142
|
+
get key_options() {
|
|
143
|
+
return key_options
|
|
144
|
+
},
|
|
145
|
+
get variable_data_type_at_next_path() {
|
|
146
|
+
return variable_data_type_at_next_path
|
|
147
|
+
},
|
|
148
|
+
get val() {
|
|
149
|
+
return val
|
|
150
|
+
},
|
|
99
151
|
})
|
|
100
|
-
}
|
|
101
|
-
next_path_options_loc = {
|
|
102
|
-
type: "object_literal",
|
|
103
|
-
options: options_loc,
|
|
104
152
|
}
|
|
105
153
|
}
|
|
106
|
-
|
|
107
|
-
set_val_prepped()
|
|
154
|
+
path_prepped = path_prepped_loc
|
|
108
155
|
}
|
|
109
156
|
|
|
110
|
-
function
|
|
157
|
+
function close_popover() {
|
|
111
158
|
popover_manager.close()
|
|
112
|
-
if (typeof config?.on_finish == "function") {
|
|
113
|
-
config?.on_finish(val)
|
|
114
|
-
}
|
|
115
159
|
}
|
|
116
160
|
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
161
|
+
function val_to_text(input) {
|
|
162
|
+
let text_items = []
|
|
163
|
+
if (Array.isArray(input) && input.length > 0) {
|
|
164
|
+
for (let item of input) {
|
|
165
|
+
if (Array.isArray(item)) {
|
|
166
|
+
text_items.push(val_to_text(item))
|
|
167
|
+
} else {
|
|
168
|
+
text_items.push(item)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return `[${text_items.join(", ")}]`
|
|
121
173
|
}
|
|
122
174
|
|
|
123
|
-
function init(
|
|
124
|
-
|
|
175
|
+
function init(input) {
|
|
176
|
+
levels_nested = input?.levels_nested ?? 0
|
|
125
177
|
popover_manager = create_popover_manager({
|
|
126
|
-
min_width:
|
|
127
|
-
target_width:
|
|
128
|
-
min_height:
|
|
129
|
-
target_height:
|
|
178
|
+
min_width: 280,
|
|
179
|
+
target_width: 450,
|
|
180
|
+
min_height: 400,
|
|
181
|
+
target_height: 240,
|
|
130
182
|
type: "center",
|
|
131
|
-
header: "
|
|
132
|
-
|
|
183
|
+
header: "Defined Target Selector",
|
|
184
|
+
on_open: () => {
|
|
185
|
+
if (typeof config?.on_dropdown_opened == "function") {
|
|
186
|
+
config?.on_dropdown_opened()
|
|
187
|
+
}
|
|
188
|
+
},
|
|
133
189
|
})
|
|
134
|
-
|
|
190
|
+
open_edit_button_manager = create_button_manager({
|
|
135
191
|
type: "outlined",
|
|
192
|
+
h: 10,
|
|
193
|
+
l: 3,
|
|
194
|
+
c: 1,
|
|
136
195
|
is_compressed: true,
|
|
137
|
-
text: "Select
|
|
196
|
+
text: () => (Array.isArray(val) && val.length > 0 ? val_to_text(val) : "Select Defined Identifier"),
|
|
138
197
|
popover_target: () => `popover_${popover_manager?.id}`,
|
|
139
198
|
})
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
type: "outlined",
|
|
152
|
-
is_compressed: true,
|
|
153
|
-
text: "Set Null",
|
|
154
|
-
on_click: () => {
|
|
155
|
-
val = null
|
|
156
|
-
set_val_prepped()
|
|
157
|
-
set_next_path_options()
|
|
199
|
+
def_dropdown_manager = create_dropdown_manager({
|
|
200
|
+
label: "Defined Variable",
|
|
201
|
+
is_button_compressed: true,
|
|
202
|
+
val: input?.val?.[0],
|
|
203
|
+
on_dropdown_opened: () => {
|
|
204
|
+
console.log("open_def", typeof config?.get_defined_options)
|
|
205
|
+
if (typeof config?.get_defined_options == "function") {
|
|
206
|
+
defined_options = config?.get_defined_options()
|
|
207
|
+
console.log("get_defined_options", defined_options)
|
|
208
|
+
def_dropdown_manager.set_options(defined_options)
|
|
209
|
+
}
|
|
158
210
|
},
|
|
211
|
+
mb: 1,
|
|
159
212
|
})
|
|
160
|
-
|
|
213
|
+
add_path_item_button_manager = create_button_manager({
|
|
161
214
|
type: "outlined",
|
|
215
|
+
support_icon: "plus",
|
|
216
|
+
text: "Add Path Item",
|
|
162
217
|
is_compressed: true,
|
|
163
|
-
|
|
164
|
-
on_click: () =>
|
|
165
|
-
val = []
|
|
166
|
-
set_val_prepped()
|
|
167
|
-
set_next_path_options()
|
|
168
|
-
},
|
|
169
|
-
})
|
|
170
|
-
is_dynamic_path_item_checkbox_manager = create_checkbox_manager({
|
|
171
|
-
type: "toggle",
|
|
172
|
-
label: "Is Dynamic Path Item",
|
|
173
|
-
val: false,
|
|
174
|
-
on_change: (input) => {
|
|
175
|
-
if (input) {
|
|
176
|
-
next_path_variable_path_input_manager = create_variable_path_input_manager({
|
|
177
|
-
is_popover: false,
|
|
178
|
-
is_allow_dynamic_path_item: false,
|
|
179
|
-
variables_data_type: () => variables_data_type,
|
|
180
|
-
on_finish: (input) => add_path_item(input),
|
|
181
|
-
})
|
|
182
|
-
}
|
|
183
|
-
},
|
|
218
|
+
mb: 1,
|
|
219
|
+
on_click: () => prep_path([...(Array.isArray(val) ? val : []), null]),
|
|
184
220
|
})
|
|
185
221
|
finish_button_manager = create_button_manager({
|
|
186
222
|
text: "Finish",
|
|
187
|
-
on_click: () =>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
size: 1.2,
|
|
193
|
-
color: "var(--g11-t)",
|
|
223
|
+
on_click: () => {
|
|
224
|
+
if (typeof config?.on_finish == "function") {
|
|
225
|
+
config?.on_finish(val)
|
|
226
|
+
}
|
|
227
|
+
},
|
|
194
228
|
})
|
|
195
|
-
|
|
196
|
-
set_next_path_options()
|
|
229
|
+
prep_path(input?.val)
|
|
197
230
|
}
|
|
198
231
|
|
|
199
232
|
init(config)
|
|
@@ -202,49 +235,30 @@ export function create_variable_path_input_manager(config) {
|
|
|
202
235
|
get val() {
|
|
203
236
|
return val
|
|
204
237
|
},
|
|
205
|
-
get
|
|
206
|
-
return
|
|
207
|
-
},
|
|
208
|
-
get is_popover() {
|
|
209
|
-
return is_popover
|
|
238
|
+
get val_text() {
|
|
239
|
+
return val_text
|
|
210
240
|
},
|
|
211
|
-
get
|
|
212
|
-
return
|
|
241
|
+
get levels_nested() {
|
|
242
|
+
return levels_nested
|
|
213
243
|
},
|
|
214
244
|
get popover_manager() {
|
|
215
245
|
return popover_manager
|
|
216
246
|
},
|
|
217
|
-
get
|
|
218
|
-
return
|
|
247
|
+
get open_edit_button_manager() {
|
|
248
|
+
return open_edit_button_manager
|
|
219
249
|
},
|
|
220
|
-
get
|
|
221
|
-
return
|
|
250
|
+
get def_dropdown_manager() {
|
|
251
|
+
return def_dropdown_manager
|
|
222
252
|
},
|
|
223
|
-
get
|
|
224
|
-
return
|
|
253
|
+
get add_path_item_button_manager() {
|
|
254
|
+
return add_path_item_button_manager
|
|
225
255
|
},
|
|
226
|
-
get
|
|
227
|
-
return
|
|
228
|
-
},
|
|
229
|
-
get set_root_path_button_manager() {
|
|
230
|
-
return set_root_path_button_manager
|
|
231
|
-
},
|
|
232
|
-
get is_allow_dynamic_path_item() {
|
|
233
|
-
return is_allow_dynamic_path_item
|
|
234
|
-
},
|
|
235
|
-
get is_dynamic_path_item_checkbox_manager() {
|
|
236
|
-
return is_dynamic_path_item_checkbox_manager
|
|
237
|
-
},
|
|
238
|
-
get next_path_variable_path_input_manager() {
|
|
239
|
-
return next_path_variable_path_input_manager
|
|
256
|
+
get path_prepped() {
|
|
257
|
+
return path_prepped
|
|
240
258
|
},
|
|
241
259
|
get finish_button_manager() {
|
|
242
260
|
return finish_button_manager
|
|
243
261
|
},
|
|
244
|
-
|
|
245
|
-
return arrow_icon_manager
|
|
246
|
-
},
|
|
247
|
-
set_val,
|
|
248
|
-
init,
|
|
262
|
+
close_popover,
|
|
249
263
|
}
|
|
250
264
|
}
|
|
@@ -331,11 +331,11 @@ export function astc_to_markdown(astc) {
|
|
|
331
331
|
return astc_element_to_markdown(astc)
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
export function get_variable_from_path(path, variables,
|
|
334
|
+
export function get_variable_from_path(path, variables, defs) {
|
|
335
335
|
if (Array.isArray(path)) {
|
|
336
336
|
let combined_variables_loc = deep_copy({
|
|
337
337
|
variables: variables,
|
|
338
|
-
|
|
338
|
+
defs: defs,
|
|
339
339
|
})
|
|
340
340
|
for (let path_item of path) {
|
|
341
341
|
if (Array.isArray(path_item)) {
|
|
@@ -350,13 +350,13 @@ export function get_variable_from_path(path, variables, loops) {
|
|
|
350
350
|
return null
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
export function clean_variable_path(path, variables,
|
|
354
|
-
// eg. ['variables','dddd',['
|
|
353
|
+
export function clean_variable_path(path, variables, defs) {
|
|
354
|
+
// eg. ['variables','dddd',['defs',0]] to ['variables','dddd',3]
|
|
355
355
|
if (Array.isArray(path)) {
|
|
356
356
|
let cleaned_path = []
|
|
357
357
|
for (let path_item of path) {
|
|
358
358
|
if (Array.isArray(path_item)) {
|
|
359
|
-
let sub_val_from_path = get_variable_from_path(path_item, variables,
|
|
359
|
+
let sub_val_from_path = get_variable_from_path(path_item, variables, defs)
|
|
360
360
|
cleaned_path.push(sub_val_from_path)
|
|
361
361
|
} else {
|
|
362
362
|
cleaned_path.push(path_item)
|
|
@@ -367,14 +367,14 @@ export function clean_variable_path(path, variables, loops) {
|
|
|
367
367
|
return null
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
export function clean_attributes_from_variable_path(attributes, variables,
|
|
370
|
+
export function clean_attributes_from_variable_path(attributes, variables, defs) {
|
|
371
371
|
let cleaned_attributes = attributes
|
|
372
372
|
if (Object.keys(attributes || {}).length) {
|
|
373
373
|
for (let [att_key, att_val] of Object.entries(attributes)) {
|
|
374
374
|
if (att_key.endsWith("_from_variable_path") && att_val != null) {
|
|
375
|
-
const clean_path = clean_variable_path(att_val, variables,
|
|
375
|
+
const clean_path = clean_variable_path(att_val, variables, defs)
|
|
376
376
|
const att_key_to_set = att_key.split("_from_variable_path")?.[0]
|
|
377
|
-
cleaned_attributes[att_key_to_set] = get_variable_from_path(clean_path, variables,
|
|
377
|
+
cleaned_attributes[att_key_to_set] = get_variable_from_path(clean_path, variables, defs)
|
|
378
378
|
delete cleaned_attributes[att_key]
|
|
379
379
|
}
|
|
380
380
|
}
|
|
@@ -382,18 +382,18 @@ export function clean_attributes_from_variable_path(attributes, variables, loops
|
|
|
382
382
|
return cleaned_attributes
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
export function astc_to_static_attributes(astc, variables,
|
|
385
|
+
export function astc_to_static_attributes(astc, variables, defs) {
|
|
386
386
|
if ([undefined, null].includes(astc)) {
|
|
387
387
|
return null
|
|
388
388
|
}
|
|
389
389
|
let astc_loc = deep_copy(astc)
|
|
390
390
|
if (Object.keys(astc_loc?.attributes || {}).length > 0) {
|
|
391
|
-
astc_loc.attributes = clean_attributes_from_variable_path(astc_loc?.attributes, variables,
|
|
391
|
+
astc_loc.attributes = clean_attributes_from_variable_path(astc_loc?.attributes, variables, defs)
|
|
392
392
|
}
|
|
393
393
|
if (Array.isArray(astc_loc?.children)) {
|
|
394
394
|
let cleaned_children = []
|
|
395
395
|
for (let child of astc_loc.children) {
|
|
396
|
-
cleaned_children.push(astc_to_static_attributes(child, variables,
|
|
396
|
+
cleaned_children.push(astc_to_static_attributes(child, variables, defs))
|
|
397
397
|
}
|
|
398
398
|
astc_loc.children = cleaned_children
|
|
399
399
|
}
|
|
@@ -601,25 +601,6 @@ export function astc_to_email_html(astc, options, slots_html_and_text_body) {
|
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
-
function increase_loops_on_path(path) {
|
|
605
|
-
let cleaned_path = null
|
|
606
|
-
if (Array.isArray(path)) {
|
|
607
|
-
cleaned_path = []
|
|
608
|
-
for (let path_item of path) {
|
|
609
|
-
if (Array.isArray(path_item)) {
|
|
610
|
-
if (path_item?.[0] == "loops" && typeof path_item?.[1] == "number") {
|
|
611
|
-
cleaned_path.push(["loops", path_item?.[1] + 1])
|
|
612
|
-
} else {
|
|
613
|
-
cleaned_path.push(increase_loops_on_path(path_item))
|
|
614
|
-
}
|
|
615
|
-
} else {
|
|
616
|
-
cleaned_path.push(path_item)
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
return cleaned_path
|
|
621
|
-
}
|
|
622
|
-
|
|
623
604
|
export function variables_data_type_remaining_to_astc(
|
|
624
605
|
variables_data_type_remaining,
|
|
625
606
|
preferred_content_use = "display",
|
|
@@ -795,15 +776,9 @@ export function variables_data_type_remaining_to_astc(
|
|
|
795
776
|
})
|
|
796
777
|
} else if (variables_data_type_remaining?.type == "array_uniform_literal") {
|
|
797
778
|
if (preferred_content_use == "input") {
|
|
798
|
-
let leading_variable_path_children = increase_loops_on_path(leading_variable_path)
|
|
799
|
-
leading_variable_path_children = [
|
|
800
|
-
...(Array.isArray(leading_variable_path_children) ? leading_variable_path_children : []),
|
|
801
|
-
["loops", 0],
|
|
802
|
-
]
|
|
803
779
|
const child_astc = variables_data_type_remaining_to_astc(
|
|
804
780
|
variables_data_type_remaining?.items,
|
|
805
|
-
preferred_content_use
|
|
806
|
-
leading_variable_path_children
|
|
781
|
+
preferred_content_use
|
|
807
782
|
)
|
|
808
783
|
return astc_element("array_uniform_input", [child_astc], {
|
|
809
784
|
val_from_variable_path: leading_variable_path,
|
|
@@ -813,15 +788,9 @@ export function variables_data_type_remaining_to_astc(
|
|
|
813
788
|
// if (preferred_content_type == "object") {
|
|
814
789
|
// // maybe infer as table
|
|
815
790
|
// }
|
|
816
|
-
let leading_variable_path_children = increase_loops_on_path(leading_variable_path)
|
|
817
|
-
leading_variable_path_children = [
|
|
818
|
-
...(Array.isArray(leading_variable_path_children) ? leading_variable_path_children : []),
|
|
819
|
-
["loops", 0],
|
|
820
|
-
]
|
|
821
791
|
const child_astc = variables_data_type_remaining_to_astc(
|
|
822
792
|
variables_data_type_remaining?.items,
|
|
823
|
-
preferred_content_use
|
|
824
|
-
leading_variable_path_children
|
|
793
|
+
preferred_content_use
|
|
825
794
|
)
|
|
826
795
|
return astc_element("loop", [child_astc], {
|
|
827
796
|
val_from_variable_path: leading_variable_path,
|
|
@@ -840,30 +809,18 @@ export function variables_data_type_remaining_to_astc(
|
|
|
840
809
|
// return astc_element("list", children)
|
|
841
810
|
} else if (variables_data_type_remaining?.type == "object_uniform_literal") {
|
|
842
811
|
if (preferred_content_use == "input") {
|
|
843
|
-
let leading_variable_path_children = increase_loops_on_path(leading_variable_path)
|
|
844
|
-
leading_variable_path_children = [
|
|
845
|
-
...(Array.isArray(leading_variable_path_children) ? leading_variable_path_children : []),
|
|
846
|
-
["loops", 0],
|
|
847
|
-
]
|
|
848
812
|
const child_astc = variables_data_type_remaining_to_astc(
|
|
849
813
|
variables_data_type_remaining?.items,
|
|
850
|
-
preferred_content_use
|
|
851
|
-
leading_variable_path_children
|
|
814
|
+
preferred_content_use
|
|
852
815
|
)
|
|
853
816
|
return astc_element("object_uniform_input", [child_astc], {
|
|
854
817
|
val_from_variable_path: leading_variable_path,
|
|
855
818
|
...(variables_data_type_remaining?.attributes ?? {}),
|
|
856
819
|
})
|
|
857
820
|
}
|
|
858
|
-
let leading_variable_path_children = increase_loops_on_path(leading_variable_path)
|
|
859
|
-
leading_variable_path_children = [
|
|
860
|
-
...(Array.isArray(leading_variable_path_children) ? leading_variable_path_children : []),
|
|
861
|
-
["loops", 0],
|
|
862
|
-
]
|
|
863
821
|
const child_astc = variables_data_type_remaining_to_astc(
|
|
864
822
|
variables_data_type_remaining?.items,
|
|
865
|
-
preferred_content_use
|
|
866
|
-
leading_variable_path_children
|
|
823
|
+
preferred_content_use
|
|
867
824
|
)
|
|
868
825
|
return astc_element("object_uniform", [child_astc], {
|
|
869
826
|
val_from_variable_path: leading_variable_path,
|
|
@@ -2111,11 +2111,6 @@ export const definitions = {
|
|
|
2111
2111
|
default: null,
|
|
2112
2112
|
description: "external data object used by show_conditions or variable-based attributes",
|
|
2113
2113
|
},
|
|
2114
|
-
loops: {
|
|
2115
|
-
type: "any",
|
|
2116
|
-
default: null,
|
|
2117
|
-
description: "tracks current iteration indexes when rendering loop nodes",
|
|
2118
|
-
},
|
|
2119
2114
|
mapkit_js_token: {
|
|
2120
2115
|
type: "string",
|
|
2121
2116
|
default: null,
|
|
@@ -2176,13 +2171,9 @@ export const definitions = {
|
|
|
2176
2171
|
type: "object",
|
|
2177
2172
|
description: "the processed content node with type, manager, and possible children",
|
|
2178
2173
|
},
|
|
2179
|
-
|
|
2174
|
+
definition_stack: {
|
|
2180
2175
|
type: "any",
|
|
2181
|
-
description: "the variables reference passed in config, potentially used by show_conditions
|
|
2182
|
-
},
|
|
2183
|
-
loops: {
|
|
2184
|
-
type: "any",
|
|
2185
|
-
description: "the current loop indexes used within array or object loops",
|
|
2176
|
+
description: "the definition_stack variables reference passed in config, potentially used by show_conditions",
|
|
2186
2177
|
},
|
|
2187
2178
|
},
|
|
2188
2179
|
},
|
|
@@ -2212,20 +2203,10 @@ export const definitions = {
|
|
|
2212
2203
|
default: null,
|
|
2213
2204
|
description: "callback invoked for certain child content manager events",
|
|
2214
2205
|
},
|
|
2215
|
-
|
|
2216
|
-
type: "any",
|
|
2217
|
-
default: null,
|
|
2218
|
-
description: "external variables object for show_conditions or other variable-based usage",
|
|
2219
|
-
},
|
|
2220
|
-
loops: {
|
|
2221
|
-
type: "any",
|
|
2222
|
-
default: null,
|
|
2223
|
-
description: "loop iteration indexes used within array or object loops",
|
|
2224
|
-
},
|
|
2225
|
-
variables_data_type: {
|
|
2206
|
+
definition_stack: {
|
|
2226
2207
|
type: "any",
|
|
2227
2208
|
default: null,
|
|
2228
|
-
description: "
|
|
2209
|
+
description: "external definition_stack variables object for show_conditions or other variable-based usage",
|
|
2229
2210
|
},
|
|
2230
2211
|
mapkit_js_token: {
|
|
2231
2212
|
type: "string",
|