@lostgradient/cinder 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/components.json +82 -4
- package/dist/components/access-gate/index.js +381 -239
- package/dist/components/chat/builders.d.ts +17 -8
- package/dist/components/chat/conversation-model.d.ts +1 -1
- package/dist/components/chat/index.d.ts +1 -1
- package/dist/components/chat/index.js +300 -17
- package/dist/components/chat/utilities/conversation.d.ts +6 -6
- package/dist/components/chat-conversation-header/index.js +19 -6
- package/dist/components/chat-conversation-list/index.js +19 -6
- package/dist/components/connection-indicator/connection-indicator.css +136 -0
- package/dist/components/connection-indicator/connection-indicator.css.d.ts +1 -0
- package/dist/components/connection-indicator/connection-indicator.schema.d.ts +3 -0
- package/dist/components/connection-indicator/connection-indicator.schema.js +89 -0
- package/dist/components/connection-indicator/connection-indicator.svelte.d.ts +21 -0
- package/dist/components/connection-indicator/connection-indicator.types.d.ts +46 -0
- package/dist/components/connection-indicator/connection-indicator.variables.d.ts +2 -0
- package/dist/components/connection-indicator/connection-indicator.variables.js +61 -0
- package/dist/components/connection-indicator/index.d.ts +5 -0
- package/dist/components/connection-indicator/index.js +409 -0
- package/dist/components/container/container.schema.js +4 -4
- package/dist/components/invocation-rule-builder/index.d.ts +1 -1
- package/dist/components/invocation-rule-builder/index.js +305 -150
- package/dist/components/invocation-rule-builder/invocation-rule-builder.css +28 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.js +89 -5
- package/dist/components/invocation-rule-builder/invocation-rule-builder.svelte.d.ts +2 -1
- package/dist/components/invocation-rule-builder/invocation-rule-builder.types.d.ts +114 -16
- package/dist/components/run-step-timeline/index.d.ts +1 -1
- package/dist/components/run-step-timeline/index.js +992 -559
- package/dist/components/run-step-timeline/run-step-branch-disclosure.svelte.d.ts +17 -0
- package/dist/components/run-step-timeline/run-step-timeline.css +124 -0
- package/dist/components/run-step-timeline/run-step-timeline.schema.js +873 -350
- package/dist/components/run-step-timeline/run-step-timeline.svelte.d.ts +1 -15
- package/dist/components/run-step-timeline/run-step-timeline.types.d.ts +182 -5
- package/dist/components/run-step-timeline/run-step-timeline.utilities.d.ts +52 -0
- package/dist/components/schedule-builder/index.d.ts +5 -0
- package/dist/components/schedule-builder/index.js +3176 -0
- package/dist/components/schedule-builder/schedule-builder.css +121 -0
- package/dist/components/schedule-builder/schedule-builder.css.d.ts +1 -0
- package/dist/components/schedule-builder/schedule-builder.schema.d.ts +3 -0
- package/dist/components/schedule-builder/schedule-builder.schema.js +141 -0
- package/dist/components/schedule-builder/schedule-builder.svelte.d.ts +22 -0
- package/dist/components/schedule-builder/schedule-builder.types.d.ts +130 -0
- package/dist/components/schedule-builder/schedule-builder.utilities.d.ts +78 -0
- package/dist/components/schedule-builder/schedule-builder.variables.d.ts +2 -0
- package/dist/components/schedule-builder/schedule-builder.variables.js +61 -0
- package/dist/components/tag-input/index.js +22 -4
- package/dist/components/tag-input/tag-input.schema.js +5 -1
- package/dist/components/tag-input/tag-input.types.d.ts +4 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +22704 -20574
- package/dist/server/components/access-gate/index.js +2 -1
- package/dist/server/components/chat/index.js +4 -4
- package/dist/server/components/chat-conversation-header/index.js +5 -5
- package/dist/server/components/chat-conversation-list/index.js +3 -3
- package/dist/server/components/connection-indicator/index.js +16 -0
- package/dist/server/components/data-table/index.js +3 -3
- package/dist/server/components/diff-viewer/index.js +4 -3
- package/dist/server/components/invocation-rule-builder/index.js +1 -1
- package/dist/server/components/json-schema-editor/index.js +4 -3
- package/dist/server/components/review-editor/index.js +4 -3
- package/dist/server/components/run-step-timeline/index.js +1 -1
- package/dist/server/components/schedule-builder/index.js +30 -0
- package/dist/server/components/side-navigation/index.js +2 -2
- package/dist/server/components/table/index.js +3 -3
- package/dist/server/components/tag-input/index.js +1 -1
- package/dist/server/components/time-field/index.js +5 -3
- package/dist/server/index.js +100 -87
- package/dist/server/index.server-0sx92swg.js +9 -0
- package/dist/server/{index.server-mzzb7dnm.js → index.server-2bbwajb2.js} +1 -1
- package/dist/server/{index.server-q7w4jw89.js → index.server-2s5h1d05.js} +2 -2
- package/dist/server/{index.server-dg83ke3k.js → index.server-2zdbz3rj.js} +1 -1
- package/dist/server/{index.server-0jhra85x.js → index.server-3w72dxz7.js} +4 -4
- package/dist/server/{index.server-qh9qzd5t.js → index.server-4x4hgvqe.js} +283 -13
- package/dist/server/{index.server-c6pe4kaf.js → index.server-5gzyqv78.js} +1 -1
- package/dist/server/{index.server-mqt1ngqw.js → index.server-6hnfzc7f.js} +19 -6
- package/dist/server/index.server-be9bpqeh.js +93 -0
- package/dist/server/{index.server-f3z7tpxr.js → index.server-c42b462p.js} +2 -4
- package/dist/server/{index.server-7vyzen5x.js → index.server-c5qv3p61.js} +171 -63
- package/dist/server/index.server-cch0eed5.js +144 -0
- package/dist/server/index.server-gmh5ar16.js +2 -0
- package/dist/server/{index.server-0atyznp7.js → index.server-h89zk5ev.js} +7 -7
- package/dist/server/{index.server-jxg42jpz.js → index.server-jdcq5zza.js} +7 -7
- package/dist/server/{index.server-2dga5yzr.js → index.server-jfrssta6.js} +1 -1
- package/dist/server/{index.server-fy068yne.js → index.server-jj76374p.js} +1 -1
- package/dist/server/index.server-qbkxz7r2.js +750 -0
- package/dist/server/{index.server-marjz8ps.js → index.server-tcay903b.js} +3 -2
- package/dist/server/index.server-z38bxms8.js +734 -0
- package/dist/server/{index.server-yz4k36cw.js → index.server-z7hxtqs1.js} +1 -1
- package/package.json +66 -3
- package/src/components/chat/builders.ts +445 -14
- package/src/components/chat/conversation-model.ts +1 -0
- package/src/components/chat/index.ts +1 -0
- package/src/components/chat/utilities/conversation.ts +33 -15
- package/src/components/connection-indicator/connection-indicator.css +136 -0
- package/src/components/connection-indicator/connection-indicator.examples.json +31 -0
- package/src/components/connection-indicator/connection-indicator.schema.json +29 -0
- package/src/components/connection-indicator/connection-indicator.schema.ts +36 -0
- package/src/components/connection-indicator/connection-indicator.svelte +63 -0
- package/src/components/connection-indicator/connection-indicator.types.ts +58 -0
- package/src/components/connection-indicator/connection-indicator.variables.json +1 -0
- package/src/components/connection-indicator/connection-indicator.variables.ts +3 -0
- package/src/components/connection-indicator/index.ts +10 -0
- package/src/components/container/container.schema.json +3 -3
- package/src/components/container/container.schema.ts +3 -3
- package/src/components/invocation-rule-builder/index.ts +4 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.css +28 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.examples.json +6 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.json +76 -3
- package/src/components/invocation-rule-builder/invocation-rule-builder.schema.ts +83 -3
- package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +326 -113
- package/src/components/invocation-rule-builder/invocation-rule-builder.types.ts +157 -43
- package/src/components/run-step-timeline/index.ts +8 -0
- package/src/components/run-step-timeline/run-step-branch-disclosure.svelte +16 -0
- package/src/components/run-step-timeline/run-step-timeline.css +124 -0
- package/src/components/run-step-timeline/run-step-timeline.examples.json +18 -0
- package/src/components/run-step-timeline/run-step-timeline.schema.json +872 -349
- package/src/components/run-step-timeline/run-step-timeline.schema.ts +931 -349
- package/src/components/run-step-timeline/run-step-timeline.svelte +387 -268
- package/src/components/run-step-timeline/run-step-timeline.types.ts +192 -5
- package/src/components/run-step-timeline/run-step-timeline.utilities.ts +242 -0
- package/src/components/schedule-builder/index.ts +14 -0
- package/src/components/schedule-builder/schedule-builder.css +121 -0
- package/src/components/schedule-builder/schedule-builder.examples.json +31 -0
- package/src/components/schedule-builder/schedule-builder.schema.json +78 -0
- package/src/components/schedule-builder/schedule-builder.schema.ts +86 -0
- package/src/components/schedule-builder/schedule-builder.svelte +629 -0
- package/src/components/schedule-builder/schedule-builder.types.ts +137 -0
- package/src/components/schedule-builder/schedule-builder.utilities.ts +344 -0
- package/src/components/schedule-builder/schedule-builder.variables.json +1 -0
- package/src/components/schedule-builder/schedule-builder.variables.ts +3 -0
- package/src/components/tag-input/tag-input.schema.json +4 -0
- package/src/components/tag-input/tag-input.schema.ts +4 -0
- package/src/components/tag-input/tag-input.svelte +20 -3
- package/src/components/tag-input/tag-input.types.ts +4 -0
- package/src/index.ts +23 -0
- package/src/styles/components.css +2 -0
- package/dist/server/index.server-qk1h0n02.js +0 -393
|
@@ -74,6 +74,7 @@ var rest_excludes = new Set([
|
|
|
74
74
|
"fieldOptions",
|
|
75
75
|
"operatorOptions",
|
|
76
76
|
"actionOptions",
|
|
77
|
+
"mode",
|
|
77
78
|
"readonly",
|
|
78
79
|
"addRuleLabel",
|
|
79
80
|
"addConditionLabel",
|
|
@@ -91,22 +92,87 @@ var root_4 = $.from_html(`<p class="cinder-invocation-rule-builder__empty">No co
|
|
|
91
92
|
var root_5 = $.from_html(`<div class="cinder-invocation-rule-builder__summary-row"> </div>`);
|
|
92
93
|
var root_6 = $.from_html(`<div class="cinder-invocation-rule-builder__summary"><!></div>`);
|
|
93
94
|
var root_7 = $.from_html(`<option> </option>`);
|
|
94
|
-
var root_8 = $.from_html(`<
|
|
95
|
-
var root_9 = $.from_html(`<
|
|
96
|
-
var root_10 = $.from_html(`<
|
|
97
|
-
var root_11 = $.from_html(`<
|
|
98
|
-
var root_12 = $.from_html(`<div class="cinder-invocation-rule-
|
|
99
|
-
var root_13 = $.from_html(`<div class="cinder-invocation-rule-
|
|
100
|
-
var root_14 = $.from_html(`<
|
|
101
|
-
var root_15 = $.from_html(`<
|
|
102
|
-
var root_16 = $.from_html(`<
|
|
103
|
-
var root_17 = $.from_html(`<
|
|
95
|
+
var root_8 = $.from_html(`<input type="number" class="cinder-invocation-rule-builder__condition-value" placeholder="Value to compare"/>`);
|
|
96
|
+
var root_9 = $.from_html(`<input type="checkbox" class="cinder-invocation-rule-builder__condition-value-checkbox"/>`);
|
|
97
|
+
var root_10 = $.from_html(`<select class="cinder-invocation-rule-builder__condition-select cinder-invocation-rule-builder__condition-value-select"></select>`);
|
|
98
|
+
var root_11 = $.from_html(`<input type="text" class="cinder-invocation-rule-builder__condition-value" placeholder="Value to compare"/>`);
|
|
99
|
+
var root_12 = $.from_html(`<div class="cinder-invocation-rule-builder__condition" role="listitem"><select class="cinder-invocation-rule-builder__condition-select"></select> <select class="cinder-invocation-rule-builder__condition-select"></select> <!> <button type="button" class="cinder-invocation-rule-builder__icon-btn" data-irb-condition-remove=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="2" fill="none"></path></svg></button></div>`);
|
|
100
|
+
var root_13 = $.from_html(`<div class="cinder-invocation-rule-builder__conditions" role="list"></div> <button type="button" class="cinder-invocation-rule-builder__add-btn" data-irb-add-condition=""> </button>`, 1);
|
|
101
|
+
var root_14 = $.from_html(`<p class="cinder-invocation-rule-builder__validation" role="status">Add at least one action for this rule.</p>`);
|
|
102
|
+
var root_15 = $.from_html(`<p class="cinder-invocation-rule-builder__empty">No actions configured.</p>`);
|
|
103
|
+
var root_16 = $.from_html(`<div class="cinder-invocation-rule-builder__action" role="listitem"><select class="cinder-invocation-rule-builder__action-select"></select> <button type="button" class="cinder-invocation-rule-builder__icon-btn" data-irb-action-remove=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="2" fill="none"></path></svg></button></div>`);
|
|
104
|
+
var root_17 = $.from_html(`<div class="cinder-invocation-rule-builder__actions" role="list"></div> <button type="button" class="cinder-invocation-rule-builder__add-btn" data-irb-add-action=""> </button>`, 1);
|
|
105
|
+
var root_18 = $.from_html(`<div><span class="cinder-invocation-rule-builder__section-heading">Actions</span> <!> <!></div>`);
|
|
106
|
+
var root_19 = $.from_html(`<div class="cinder-invocation-rule-builder__rule"><div class="cinder-invocation-rule-builder__rule-header"><!> <!></div> <div><span class="cinder-invocation-rule-builder__section-heading">Conditions</span> <!> <!></div> <!></div>`);
|
|
107
|
+
var root_20 = $.from_html(`<button type="button" class="cinder-invocation-rule-builder__add-btn cinder-invocation-rule-builder__add-rule-btn" data-irb-add-rule=""> </button>`);
|
|
108
|
+
var root_21 = $.from_html(`<p class="cinder-invocation-rule-builder__empty">No rules configured.</p>`);
|
|
109
|
+
var root_22 = $.from_html(`<section><!> <!> <!></section> <div role="status" aria-live="polite" aria-atomic="true" class="cinder-invocation-rule-builder__announcer"> </div>`, 1);
|
|
104
110
|
function Invocation_rule_builder($$anchor, $$props) {
|
|
105
111
|
const baseId = $.props_id();
|
|
106
112
|
$.push($$props, true);
|
|
107
|
-
|
|
113
|
+
const CONDITIONS_ONLY_OPERATOR_OPTIONS = [
|
|
114
|
+
{ value: "eq", label: "equals" },
|
|
115
|
+
{ value: "gt", label: "greater than" },
|
|
116
|
+
{ value: "lt", label: "less than" },
|
|
117
|
+
{ value: "gte", label: "greater than or equal" },
|
|
118
|
+
{ value: "lte", label: "less than or equal" }
|
|
119
|
+
];
|
|
120
|
+
let mode = $.prop($$props, "mode", 3, "full"), readonly = $.prop($$props, "readonly", 3, false), addRuleLabel = $.prop($$props, "addRuleLabel", 3, "Add rule"), addConditionLabel = $.prop($$props, "addConditionLabel", 3, "Add condition"), addActionLabel = $.prop($$props, "addActionLabel", 3, "Add action"), rest = $.rest_props($$props, rest_excludes);
|
|
108
121
|
const sectionAriaLabel = $.derived(() => $$props["aria-labelledby"] ? undefined : $$props["aria-label"] ?? $$props.label ?? "Invocation rules");
|
|
109
122
|
const effectiveReadonly = $.derived(() => readonly() || $$props.onchange === undefined);
|
|
123
|
+
const conditionsOnly = $.derived(() => mode() === "conditions");
|
|
124
|
+
const resolvedOperatorOptions = $.derived(() => $.get(conditionsOnly) ? CONDITIONS_ONLY_OPERATOR_OPTIONS : $$props.operatorOptions ?? []);
|
|
125
|
+
const resolvedActionOptions = $.derived(() => $$props.actionOptions ?? []);
|
|
126
|
+
function fieldValueType(fieldValue) {
|
|
127
|
+
return $$props.fieldOptions.find((option) => option.value === fieldValue)?.type ?? "string";
|
|
128
|
+
}
|
|
129
|
+
function fieldEnumOptions(fieldValue) {
|
|
130
|
+
return $$props.fieldOptions.find((option) => option.value === fieldValue)?.options ?? [];
|
|
131
|
+
}
|
|
132
|
+
function defaultConditionValue(fieldValue) {
|
|
133
|
+
const type = fieldValueType(fieldValue);
|
|
134
|
+
switch (type) {
|
|
135
|
+
case "boolean":
|
|
136
|
+
return "false";
|
|
137
|
+
case "enum":
|
|
138
|
+
return fieldEnumOptions(fieldValue)[0]?.value ?? "";
|
|
139
|
+
case "number":
|
|
140
|
+
case "string":
|
|
141
|
+
return "";
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const NUMBER_LIKE_VALUE_PATTERN = /^([+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d*)?|[+-]?\.?)$/i;
|
|
145
|
+
function isValueValidForFieldType(value, type, fieldValue) {
|
|
146
|
+
switch (type) {
|
|
147
|
+
case "boolean":
|
|
148
|
+
return value === "true" || value === "false";
|
|
149
|
+
case "enum":
|
|
150
|
+
return fieldEnumOptions(fieldValue).some((option) => option.value === value);
|
|
151
|
+
case "number":
|
|
152
|
+
return value === "" || value.trim() !== "" && NUMBER_LIKE_VALUE_PATTERN.test(value.trim());
|
|
153
|
+
case "string":
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function isConditionsOnlyOperator(operator) {
|
|
158
|
+
return CONDITIONS_ONLY_OPERATOR_OPTIONS.some((option) => option.value === operator);
|
|
159
|
+
}
|
|
160
|
+
function displayOperator(operator) {
|
|
161
|
+
return $.get(conditionsOnly) && !isConditionsOnlyOperator(operator) ? "eq" : operator;
|
|
162
|
+
}
|
|
163
|
+
function emitChange(nextRules, change) {
|
|
164
|
+
const rulesToEmit = $.get(conditionsOnly) ? nextRules.map((rule) => ({
|
|
165
|
+
...rule,
|
|
166
|
+
actions: [],
|
|
167
|
+
conditions: rule.conditions.map((condition) => {
|
|
168
|
+
const operator = isConditionsOnlyOperator(condition.operator) ? condition.operator : "eq";
|
|
169
|
+
const type = fieldValueType(condition.field);
|
|
170
|
+
const value = isValueValidForFieldType(condition.value, type, condition.field) ? condition.value : defaultConditionValue(condition.field);
|
|
171
|
+
return operator === condition.operator && value === condition.value ? condition : { ...condition, operator, value };
|
|
172
|
+
})
|
|
173
|
+
})) : nextRules;
|
|
174
|
+
$$props.onchange?.(rulesToEmit, change);
|
|
175
|
+
}
|
|
110
176
|
let announcement = $.state("");
|
|
111
177
|
let ruleLabelDrafts = $.state($.proxy({}));
|
|
112
178
|
function announce(message) {
|
|
@@ -133,13 +199,13 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
133
199
|
}
|
|
134
200
|
];
|
|
135
201
|
const change = { type: "add-rule", ruleId };
|
|
136
|
-
|
|
202
|
+
emitChange(nextRules, change);
|
|
137
203
|
announce("Rule added.");
|
|
138
204
|
}
|
|
139
205
|
function handleRemoveRule(ruleId, ruleLabel, ruleIndex) {
|
|
140
206
|
const nextRules = $$props.rules.filter((rule) => rule.id !== ruleId);
|
|
141
207
|
const change = { type: "remove-rule", ruleId };
|
|
142
|
-
|
|
208
|
+
emitChange(nextRules, change);
|
|
143
209
|
announce(`${ruleLabel} removed.`);
|
|
144
210
|
tick().then(() => {
|
|
145
211
|
const targetIndex = ruleIndex > 0 ? ruleIndex - 1 : 0;
|
|
@@ -156,7 +222,7 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
156
222
|
const [moved] = nextRules.splice(fromIndex, 1);
|
|
157
223
|
nextRules.splice(toIndex, 0, moved);
|
|
158
224
|
const change = { type: "move-rule", ruleId, fromIndex, toIndex };
|
|
159
|
-
|
|
225
|
+
emitChange(nextRules, change);
|
|
160
226
|
announce(`${moved.label} moved to position ${toIndex + 1} of ${nextRules.length}.`);
|
|
161
227
|
}
|
|
162
228
|
function handleRenameRule(ruleId, label) {
|
|
@@ -168,7 +234,7 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
168
234
|
return;
|
|
169
235
|
const nextRules = updateRules(ruleId, (rule) => ({ ...rule, label: nextLabel }));
|
|
170
236
|
const change = { type: "rename-rule", ruleId };
|
|
171
|
-
|
|
237
|
+
emitChange(nextRules, change);
|
|
172
238
|
}
|
|
173
239
|
function ruleLabelDraft(rule) {
|
|
174
240
|
const draft = $.get(ruleLabelDrafts)[rule.id];
|
|
@@ -177,7 +243,8 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
177
243
|
function handleAddCondition(ruleId) {
|
|
178
244
|
const conditionId = generateId();
|
|
179
245
|
const firstField = $$props.fieldOptions[0]?.value ?? "";
|
|
180
|
-
const firstOperator =
|
|
246
|
+
const firstOperator = $.get(resolvedOperatorOptions)[0]?.value ?? "";
|
|
247
|
+
const initialValue = $.get(conditionsOnly) ? defaultConditionValue(firstField) : "";
|
|
181
248
|
const nextRules = updateRules(ruleId, (rule) => ({
|
|
182
249
|
...rule,
|
|
183
250
|
conditions: [
|
|
@@ -186,12 +253,12 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
186
253
|
id: conditionId,
|
|
187
254
|
field: firstField,
|
|
188
255
|
operator: firstOperator,
|
|
189
|
-
value:
|
|
256
|
+
value: initialValue
|
|
190
257
|
}
|
|
191
258
|
]
|
|
192
259
|
}));
|
|
193
260
|
const change = { type: "add-condition", ruleId, conditionId };
|
|
194
|
-
|
|
261
|
+
emitChange(nextRules, change);
|
|
195
262
|
announce("Condition added.");
|
|
196
263
|
}
|
|
197
264
|
function handleRemoveCondition(ruleId, conditionId, conditionIndex, ruleIndex) {
|
|
@@ -200,7 +267,7 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
200
267
|
conditions: rule.conditions.filter((condition) => condition.id !== conditionId)
|
|
201
268
|
}));
|
|
202
269
|
const change = { type: "remove-condition", ruleId, conditionId };
|
|
203
|
-
|
|
270
|
+
emitChange(nextRules, change);
|
|
204
271
|
announce("Condition removed.");
|
|
205
272
|
tick().then(() => {
|
|
206
273
|
const ruleEl = document.querySelector(`[data-irb-region="${baseId}"] [data-irb-rule="${ruleIndex}"]`);
|
|
@@ -213,20 +280,29 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
213
280
|
function handleUpdateCondition(ruleId, conditionId, field, value) {
|
|
214
281
|
const nextRules = updateRules(ruleId, (rule) => ({
|
|
215
282
|
...rule,
|
|
216
|
-
conditions: rule.conditions.map((condition) =>
|
|
283
|
+
conditions: rule.conditions.map((condition) => {
|
|
284
|
+
if (condition.id !== conditionId)
|
|
285
|
+
return condition;
|
|
286
|
+
if (field === "field" && $.get(conditionsOnly)) {
|
|
287
|
+
const nextType = fieldValueType(value);
|
|
288
|
+
const nextValue = isValueValidForFieldType(condition.value, nextType, value) ? condition.value : defaultConditionValue(value);
|
|
289
|
+
return { ...condition, field: value, value: nextValue };
|
|
290
|
+
}
|
|
291
|
+
return { ...condition, [field]: value };
|
|
292
|
+
})
|
|
217
293
|
}));
|
|
218
294
|
const change = { type: "update-condition", ruleId, conditionId, field };
|
|
219
|
-
|
|
295
|
+
emitChange(nextRules, change);
|
|
220
296
|
}
|
|
221
297
|
function handleAddAction(ruleId) {
|
|
222
298
|
const actionId = generateId();
|
|
223
|
-
const firstTarget =
|
|
299
|
+
const firstTarget = $.get(resolvedActionOptions)[0]?.value ?? "";
|
|
224
300
|
const nextRules = updateRules(ruleId, (rule) => ({
|
|
225
301
|
...rule,
|
|
226
302
|
actions: [...rule.actions, { id: actionId, target: firstTarget }]
|
|
227
303
|
}));
|
|
228
304
|
const change = { type: "add-action", ruleId, actionId };
|
|
229
|
-
|
|
305
|
+
emitChange(nextRules, change);
|
|
230
306
|
announce("Action added.");
|
|
231
307
|
}
|
|
232
308
|
function handleRemoveAction(ruleId, actionId, actionIndex, ruleIndex) {
|
|
@@ -235,7 +311,7 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
235
311
|
actions: rule.actions.filter((action) => action.id !== actionId)
|
|
236
312
|
}));
|
|
237
313
|
const change = { type: "remove-action", ruleId, actionId };
|
|
238
|
-
|
|
314
|
+
emitChange(nextRules, change);
|
|
239
315
|
announce("Action removed.");
|
|
240
316
|
tick().then(() => {
|
|
241
317
|
const ruleEl = document.querySelector(`[data-irb-region="${baseId}"] [data-irb-rule="${ruleIndex}"]`);
|
|
@@ -251,16 +327,17 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
251
327
|
actions: rule.actions.map((action) => action.id === actionId ? { ...action, target } : action)
|
|
252
328
|
}));
|
|
253
329
|
const change = { type: "update-action", ruleId, actionId };
|
|
254
|
-
|
|
330
|
+
emitChange(nextRules, change);
|
|
255
331
|
}
|
|
256
332
|
function fieldLabel(value) {
|
|
257
333
|
return $$props.fieldOptions.find((option) => option.value === value)?.label ?? value;
|
|
258
334
|
}
|
|
259
335
|
function operatorLabel(value) {
|
|
260
|
-
|
|
336
|
+
const displayValue = displayOperator(value);
|
|
337
|
+
return $.get(resolvedOperatorOptions).find((option) => option.value === displayValue)?.label ?? displayValue;
|
|
261
338
|
}
|
|
262
339
|
function actionTargetLabel(value) {
|
|
263
|
-
return
|
|
340
|
+
return $.get(resolvedActionOptions).find((option) => option.value === value)?.label ?? value;
|
|
264
341
|
}
|
|
265
342
|
function conditionSummary(condition) {
|
|
266
343
|
return `${fieldLabel(condition.field)} ${operatorLabel(condition.operator)} "${condition.value}"`;
|
|
@@ -268,7 +345,7 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
268
345
|
function actionSummary(action) {
|
|
269
346
|
return `Invoke ${actionTargetLabel(action.target)}`;
|
|
270
347
|
}
|
|
271
|
-
var fragment =
|
|
348
|
+
var fragment = root_22();
|
|
272
349
|
var section = $.first_child(fragment);
|
|
273
350
|
$.attribute_effect(section, ($0) => ({
|
|
274
351
|
...rest,
|
|
@@ -281,7 +358,7 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
281
358
|
]);
|
|
282
359
|
var node = $.child(section);
|
|
283
360
|
$.each(node, 19, () => $$props.rules, (rule) => rule.id, ($$anchor2, rule, ruleIndex) => {
|
|
284
|
-
var div =
|
|
361
|
+
var div = root_19();
|
|
285
362
|
var div_1 = $.child(div);
|
|
286
363
|
var node_1 = $.child(div_1);
|
|
287
364
|
{
|
|
@@ -393,11 +470,11 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
393
470
|
$.template_effect(() => $.set_attribute(div_4, "aria-label", `Conditions for ${$.get(rule).label}`));
|
|
394
471
|
$.append($$anchor3, div_4);
|
|
395
472
|
};
|
|
396
|
-
var
|
|
397
|
-
var fragment_2 =
|
|
473
|
+
var alternate_3 = ($$anchor3) => {
|
|
474
|
+
var fragment_2 = root_13();
|
|
398
475
|
var div_6 = $.first_child(fragment_2);
|
|
399
476
|
$.each(div_6, 23, () => $.get(rule).conditions, (condition) => condition.id, ($$anchor4, condition, conditionIndex) => {
|
|
400
|
-
var div_7 =
|
|
477
|
+
var div_7 = root_12();
|
|
401
478
|
var select = $.child(div_7);
|
|
402
479
|
$.each(select, 21, () => $$props.fieldOptions, (option) => option.value, ($$anchor5, option) => {
|
|
403
480
|
var option_1 = root_7();
|
|
@@ -416,7 +493,7 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
416
493
|
var select_value;
|
|
417
494
|
$.init_select(select);
|
|
418
495
|
var select_1 = $.sibling(select, 2);
|
|
419
|
-
$.each(select_1, 21, () =>
|
|
496
|
+
$.each(select_1, 21, () => $.get(resolvedOperatorOptions), (option) => option.value, ($$anchor5, option) => {
|
|
420
497
|
var option_2 = root_7();
|
|
421
498
|
var text_3 = $.child(option_2, true);
|
|
422
499
|
$.reset(option_2);
|
|
@@ -432,37 +509,105 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
432
509
|
$.reset(select_1);
|
|
433
510
|
var select_1_value;
|
|
434
511
|
$.init_select(select_1);
|
|
435
|
-
var
|
|
436
|
-
|
|
437
|
-
|
|
512
|
+
var node_7 = $.sibling(select_1, 2);
|
|
513
|
+
{
|
|
514
|
+
var consequent_5 = ($$anchor5) => {
|
|
515
|
+
var input_1 = root_8();
|
|
516
|
+
$.remove_input_defaults(input_1);
|
|
517
|
+
$.template_effect(() => {
|
|
518
|
+
$.set_attribute(input_1, "aria-label", `Value for condition ${$.get(conditionIndex) + 1} of ${$.get(rule).label}`);
|
|
519
|
+
$.set_value(input_1, $.get(condition).value);
|
|
520
|
+
});
|
|
521
|
+
$.delegated("input", input_1, (event2) => handleUpdateCondition($.get(rule).id, $.get(condition).id, "value", event2.target.value));
|
|
522
|
+
$.append($$anchor5, input_1);
|
|
523
|
+
};
|
|
524
|
+
var d = $.derived(() => $.get(conditionsOnly) && fieldValueType($.get(condition).field) === "number");
|
|
525
|
+
var consequent_6 = ($$anchor5) => {
|
|
526
|
+
var input_2 = root_9();
|
|
527
|
+
$.remove_input_defaults(input_2);
|
|
528
|
+
$.template_effect(() => {
|
|
529
|
+
$.set_attribute(input_2, "aria-label", `Value for condition ${$.get(conditionIndex) + 1} of ${$.get(rule).label}`);
|
|
530
|
+
$.set_checked(input_2, $.get(condition).value === "true");
|
|
531
|
+
});
|
|
532
|
+
$.delegated("change", input_2, (event2) => handleUpdateCondition($.get(rule).id, $.get(condition).id, "value", String(event2.target.checked)));
|
|
533
|
+
$.append($$anchor5, input_2);
|
|
534
|
+
};
|
|
535
|
+
var d_1 = $.derived(() => $.get(conditionsOnly) && fieldValueType($.get(condition).field) === "boolean");
|
|
536
|
+
var consequent_7 = ($$anchor5) => {
|
|
537
|
+
var select_2 = root_10();
|
|
538
|
+
$.each(select_2, 21, () => fieldEnumOptions($.get(condition).field), (option) => option.value, ($$anchor6, option) => {
|
|
539
|
+
var option_3 = root_7();
|
|
540
|
+
var text_4 = $.child(option_3, true);
|
|
541
|
+
$.reset(option_3);
|
|
542
|
+
var option_3_value = {};
|
|
543
|
+
$.template_effect(() => {
|
|
544
|
+
$.set_text(text_4, $.get(option).label);
|
|
545
|
+
if (option_3_value !== (option_3_value = $.get(option).value)) {
|
|
546
|
+
option_3.value = (option_3.__value = $.get(option).value) ?? "";
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
$.append($$anchor6, option_3);
|
|
550
|
+
});
|
|
551
|
+
$.reset(select_2);
|
|
552
|
+
var select_2_value;
|
|
553
|
+
$.init_select(select_2);
|
|
554
|
+
$.template_effect(() => {
|
|
555
|
+
$.set_attribute(select_2, "aria-label", `Value for condition ${$.get(conditionIndex) + 1} of ${$.get(rule).label}`);
|
|
556
|
+
if (select_2_value !== (select_2_value = $.get(condition).value)) {
|
|
557
|
+
select_2.value = (select_2.__value = $.get(condition).value) ?? "", $.select_option(select_2, $.get(condition).value);
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
$.delegated("change", select_2, (event2) => handleUpdateCondition($.get(rule).id, $.get(condition).id, "value", event2.target.value));
|
|
561
|
+
$.append($$anchor5, select_2);
|
|
562
|
+
};
|
|
563
|
+
var d_2 = $.derived(() => $.get(conditionsOnly) && fieldValueType($.get(condition).field) === "enum");
|
|
564
|
+
var alternate_2 = ($$anchor5) => {
|
|
565
|
+
var input_3 = root_11();
|
|
566
|
+
$.remove_input_defaults(input_3);
|
|
567
|
+
$.template_effect(() => {
|
|
568
|
+
$.set_attribute(input_3, "aria-label", `Value for condition ${$.get(conditionIndex) + 1} of ${$.get(rule).label}`);
|
|
569
|
+
$.set_value(input_3, $.get(condition).value);
|
|
570
|
+
});
|
|
571
|
+
$.delegated("input", input_3, (event2) => handleUpdateCondition($.get(rule).id, $.get(condition).id, "value", event2.target.value));
|
|
572
|
+
$.append($$anchor5, input_3);
|
|
573
|
+
};
|
|
574
|
+
$.if(node_7, ($$render) => {
|
|
575
|
+
if ($.get(d))
|
|
576
|
+
$$render(consequent_5);
|
|
577
|
+
else if ($.get(d_1))
|
|
578
|
+
$$render(consequent_6, 1);
|
|
579
|
+
else if ($.get(d_2))
|
|
580
|
+
$$render(consequent_7, 2);
|
|
581
|
+
else
|
|
582
|
+
$$render(alternate_2, -1);
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
var button_3 = $.sibling(node_7, 2);
|
|
438
586
|
$.reset(div_7);
|
|
439
|
-
$.template_effect(() => {
|
|
587
|
+
$.template_effect(($0) => {
|
|
440
588
|
$.set_attribute(select, "aria-label", `Field for condition ${$.get(conditionIndex) + 1} of ${$.get(rule).label}`);
|
|
441
589
|
if (select_value !== (select_value = $.get(condition).field)) {
|
|
442
590
|
select.value = (select.__value = $.get(condition).field) ?? "", $.select_option(select, $.get(condition).field);
|
|
443
591
|
}
|
|
444
592
|
$.set_attribute(select_1, "aria-label", `Operator for condition ${$.get(conditionIndex) + 1} of ${$.get(rule).label}`);
|
|
445
|
-
if (select_1_value !== (select_1_value =
|
|
446
|
-
select_1.value = (select_1.__value =
|
|
593
|
+
if (select_1_value !== (select_1_value = $0)) {
|
|
594
|
+
select_1.value = (select_1.__value = $0) ?? "", $.select_option(select_1, $0);
|
|
447
595
|
}
|
|
448
|
-
$.set_attribute(input_1, "aria-label", `Value for condition ${$.get(conditionIndex) + 1} of ${$.get(rule).label}`);
|
|
449
|
-
$.set_value(input_1, $.get(condition).value);
|
|
450
596
|
$.set_attribute(button_3, "aria-label", `Remove condition ${$.get(conditionIndex) + 1} of ${$.get(rule).label}`);
|
|
451
|
-
});
|
|
597
|
+
}, [() => displayOperator($.get(condition).operator)]);
|
|
452
598
|
$.delegated("change", select, (event2) => handleUpdateCondition($.get(rule).id, $.get(condition).id, "field", event2.target.value));
|
|
453
599
|
$.delegated("change", select_1, (event2) => handleUpdateCondition($.get(rule).id, $.get(condition).id, "operator", event2.target.value));
|
|
454
|
-
$.delegated("input", input_1, (event2) => handleUpdateCondition($.get(rule).id, $.get(condition).id, "value", event2.target.value));
|
|
455
600
|
$.delegated("click", button_3, () => handleRemoveCondition($.get(rule).id, $.get(condition).id, $.get(conditionIndex), $.get(ruleIndex)));
|
|
456
601
|
$.append($$anchor4, div_7);
|
|
457
602
|
});
|
|
458
603
|
$.reset(div_6);
|
|
459
604
|
var button_4 = $.sibling(div_6, 2);
|
|
460
|
-
var
|
|
605
|
+
var text_5 = $.child(button_4);
|
|
461
606
|
$.reset(button_4);
|
|
462
607
|
$.template_effect(() => {
|
|
463
608
|
$.set_attribute(div_6, "aria-labelledby", `${baseId}-rule-${$.get(ruleIndex)}-conditions-label`);
|
|
464
609
|
$.set_attribute(button_4, "aria-label", `${addConditionLabel()} to ${$.get(rule).label}`);
|
|
465
|
-
$.set_text(
|
|
610
|
+
$.set_text(text_5, `+ ${addConditionLabel() ?? ""}`);
|
|
466
611
|
});
|
|
467
612
|
$.delegated("click", button_4, () => handleAddCondition($.get(rule).id));
|
|
468
613
|
$.append($$anchor3, fragment_2);
|
|
@@ -471,150 +616,160 @@ function Invocation_rule_builder($$anchor, $$props) {
|
|
|
471
616
|
if ($.get(effectiveReadonly))
|
|
472
617
|
$$render(consequent_4);
|
|
473
618
|
else
|
|
474
|
-
$$render(
|
|
619
|
+
$$render(alternate_3, -1);
|
|
475
620
|
});
|
|
476
621
|
}
|
|
477
622
|
$.reset(div_3);
|
|
478
|
-
var
|
|
479
|
-
var span_1 = $.child(div_8);
|
|
480
|
-
var node_7 = $.sibling(span_1, 2);
|
|
623
|
+
var node_8 = $.sibling(div_3, 2);
|
|
481
624
|
{
|
|
482
|
-
var
|
|
483
|
-
var
|
|
484
|
-
$.
|
|
485
|
-
|
|
486
|
-
$.if(node_7, ($$render) => {
|
|
487
|
-
if (!$.get(effectiveReadonly) && $.get(rule).actions.length === 0)
|
|
488
|
-
$$render(consequent_5);
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
var node_8 = $.sibling(node_7, 2);
|
|
492
|
-
{
|
|
493
|
-
var consequent_7 = ($$anchor3) => {
|
|
494
|
-
var div_9 = root_6();
|
|
495
|
-
var node_9 = $.child(div_9);
|
|
625
|
+
var consequent_11 = ($$anchor3) => {
|
|
626
|
+
var div_8 = root_18();
|
|
627
|
+
var span_1 = $.child(div_8);
|
|
628
|
+
var node_9 = $.sibling(span_1, 2);
|
|
496
629
|
{
|
|
497
|
-
var
|
|
498
|
-
var
|
|
499
|
-
$.append($$anchor4,
|
|
500
|
-
};
|
|
501
|
-
var alternate_3 = ($$anchor4) => {
|
|
502
|
-
var fragment_3 = $.comment();
|
|
503
|
-
var node_10 = $.first_child(fragment_3);
|
|
504
|
-
$.each(node_10, 17, () => $.get(rule).actions, (action) => action.id, ($$anchor5, action) => {
|
|
505
|
-
var div_10 = root_5();
|
|
506
|
-
var text_5 = $.child(div_10, true);
|
|
507
|
-
$.reset(div_10);
|
|
508
|
-
$.template_effect(($0) => $.set_text(text_5, $0), [() => actionSummary($.get(action))]);
|
|
509
|
-
$.append($$anchor5, div_10);
|
|
510
|
-
});
|
|
511
|
-
$.append($$anchor4, fragment_3);
|
|
630
|
+
var consequent_8 = ($$anchor4) => {
|
|
631
|
+
var p_2 = root_14();
|
|
632
|
+
$.append($$anchor4, p_2);
|
|
512
633
|
};
|
|
513
634
|
$.if(node_9, ($$render) => {
|
|
514
|
-
if ($.get(rule).actions.length === 0)
|
|
515
|
-
$$render(
|
|
516
|
-
else
|
|
517
|
-
$$render(alternate_3, -1);
|
|
635
|
+
if (!$.get(effectiveReadonly) && $.get(rule).actions.length === 0)
|
|
636
|
+
$$render(consequent_8);
|
|
518
637
|
});
|
|
519
638
|
}
|
|
520
|
-
$.
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
639
|
+
var node_10 = $.sibling(node_9, 2);
|
|
640
|
+
{
|
|
641
|
+
var consequent_10 = ($$anchor4) => {
|
|
642
|
+
var div_9 = root_6();
|
|
643
|
+
var node_11 = $.child(div_9);
|
|
644
|
+
{
|
|
645
|
+
var consequent_9 = ($$anchor5) => {
|
|
646
|
+
var p_3 = root_15();
|
|
647
|
+
$.append($$anchor5, p_3);
|
|
648
|
+
};
|
|
649
|
+
var alternate_4 = ($$anchor5) => {
|
|
650
|
+
var fragment_3 = $.comment();
|
|
651
|
+
var node_12 = $.first_child(fragment_3);
|
|
652
|
+
$.each(node_12, 17, () => $.get(rule).actions, (action) => action.id, ($$anchor6, action) => {
|
|
653
|
+
var div_10 = root_5();
|
|
654
|
+
var text_6 = $.child(div_10, true);
|
|
655
|
+
$.reset(div_10);
|
|
656
|
+
$.template_effect(($0) => $.set_text(text_6, $0), [() => actionSummary($.get(action))]);
|
|
657
|
+
$.append($$anchor6, div_10);
|
|
658
|
+
});
|
|
659
|
+
$.append($$anchor5, fragment_3);
|
|
660
|
+
};
|
|
661
|
+
$.if(node_11, ($$render) => {
|
|
662
|
+
if ($.get(rule).actions.length === 0)
|
|
663
|
+
$$render(consequent_9);
|
|
664
|
+
else
|
|
665
|
+
$$render(alternate_4, -1);
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
$.reset(div_9);
|
|
669
|
+
$.template_effect(() => $.set_attribute(div_9, "aria-label", `Actions for ${$.get(rule).label}`));
|
|
670
|
+
$.append($$anchor4, div_9);
|
|
671
|
+
};
|
|
672
|
+
var alternate_5 = ($$anchor4) => {
|
|
673
|
+
var fragment_4 = root_17();
|
|
674
|
+
var div_11 = $.first_child(fragment_4);
|
|
675
|
+
$.each(div_11, 23, () => $.get(rule).actions, (action) => action.id, ($$anchor5, action, actionIndex) => {
|
|
676
|
+
var div_12 = root_16();
|
|
677
|
+
var select_3 = $.child(div_12);
|
|
678
|
+
$.each(select_3, 21, () => $.get(resolvedActionOptions), (option) => option.value, ($$anchor6, option) => {
|
|
679
|
+
var option_4 = root_7();
|
|
680
|
+
var text_7 = $.child(option_4, true);
|
|
681
|
+
$.reset(option_4);
|
|
682
|
+
var option_4_value = {};
|
|
683
|
+
$.template_effect(() => {
|
|
684
|
+
$.set_text(text_7, $.get(option).label);
|
|
685
|
+
if (option_4_value !== (option_4_value = $.get(option).value)) {
|
|
686
|
+
option_4.value = (option_4.__value = $.get(option).value) ?? "";
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
$.append($$anchor6, option_4);
|
|
690
|
+
});
|
|
691
|
+
$.reset(select_3);
|
|
692
|
+
var select_3_value;
|
|
693
|
+
$.init_select(select_3);
|
|
694
|
+
var button_5 = $.sibling(select_3, 2);
|
|
695
|
+
$.reset(div_12);
|
|
696
|
+
$.template_effect(() => {
|
|
697
|
+
$.set_attribute(select_3, "aria-label", `Action ${$.get(actionIndex) + 1} target for ${$.get(rule).label}`);
|
|
698
|
+
if (select_3_value !== (select_3_value = $.get(action).target)) {
|
|
699
|
+
select_3.value = (select_3.__value = $.get(action).target) ?? "", $.select_option(select_3, $.get(action).target);
|
|
700
|
+
}
|
|
701
|
+
$.set_attribute(button_5, "aria-label", `Remove action ${$.get(actionIndex) + 1} of ${$.get(rule).label}`);
|
|
702
|
+
});
|
|
703
|
+
$.delegated("change", select_3, (event2) => handleUpdateAction($.get(rule).id, $.get(action).id, event2.target.value));
|
|
704
|
+
$.delegated("click", button_5, () => handleRemoveAction($.get(rule).id, $.get(action).id, $.get(actionIndex), $.get(ruleIndex)));
|
|
705
|
+
$.append($$anchor5, div_12);
|
|
706
|
+
});
|
|
707
|
+
$.reset(div_11);
|
|
708
|
+
var button_6 = $.sibling(div_11, 2);
|
|
709
|
+
var text_8 = $.child(button_6);
|
|
710
|
+
$.reset(button_6);
|
|
535
711
|
$.template_effect(() => {
|
|
536
|
-
$.
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
712
|
+
$.set_attribute(div_11, "aria-labelledby", `${baseId}-rule-${$.get(ruleIndex)}-actions-label`);
|
|
713
|
+
$.set_attribute(button_6, "aria-label", `${addActionLabel()} to ${$.get(rule).label}`);
|
|
714
|
+
$.set_text(text_8, `+ ${addActionLabel() ?? ""}`);
|
|
540
715
|
});
|
|
541
|
-
$.
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
$.set_attribute(select_2, "aria-label", `Action ${$.get(actionIndex) + 1} target for ${$.get(rule).label}`);
|
|
550
|
-
if (select_2_value !== (select_2_value = $.get(action).target)) {
|
|
551
|
-
select_2.value = (select_2.__value = $.get(action).target) ?? "", $.select_option(select_2, $.get(action).target);
|
|
552
|
-
}
|
|
553
|
-
$.set_attribute(button_5, "aria-label", `Remove action ${$.get(actionIndex) + 1} of ${$.get(rule).label}`);
|
|
716
|
+
$.delegated("click", button_6, () => handleAddAction($.get(rule).id));
|
|
717
|
+
$.append($$anchor4, fragment_4);
|
|
718
|
+
};
|
|
719
|
+
$.if(node_10, ($$render) => {
|
|
720
|
+
if ($.get(effectiveReadonly))
|
|
721
|
+
$$render(consequent_10);
|
|
722
|
+
else
|
|
723
|
+
$$render(alternate_5, -1);
|
|
554
724
|
});
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
$.reset(div_11);
|
|
560
|
-
var button_6 = $.sibling(div_11, 2);
|
|
561
|
-
var text_7 = $.child(button_6);
|
|
562
|
-
$.reset(button_6);
|
|
563
|
-
$.template_effect(() => {
|
|
564
|
-
$.set_attribute(div_11, "aria-labelledby", `${baseId}-rule-${$.get(ruleIndex)}-actions-label`);
|
|
565
|
-
$.set_attribute(button_6, "aria-label", `${addActionLabel()} to ${$.get(rule).label}`);
|
|
566
|
-
$.set_text(text_7, `+ ${addActionLabel() ?? ""}`);
|
|
567
|
-
});
|
|
568
|
-
$.delegated("click", button_6, () => handleAddAction($.get(rule).id));
|
|
569
|
-
$.append($$anchor3, fragment_4);
|
|
725
|
+
}
|
|
726
|
+
$.reset(div_8);
|
|
727
|
+
$.template_effect(() => $.set_attribute(span_1, "id", `${baseId}-rule-${$.get(ruleIndex)}-actions-label`));
|
|
728
|
+
$.append($$anchor3, div_8);
|
|
570
729
|
};
|
|
571
730
|
$.if(node_8, ($$render) => {
|
|
572
|
-
if (
|
|
573
|
-
$$render(
|
|
574
|
-
else
|
|
575
|
-
$$render(alternate_4, -1);
|
|
731
|
+
if (mode() === "full")
|
|
732
|
+
$$render(consequent_11);
|
|
576
733
|
});
|
|
577
734
|
}
|
|
578
|
-
$.reset(div_8);
|
|
579
735
|
$.reset(div);
|
|
580
736
|
$.template_effect(() => {
|
|
581
737
|
$.set_attribute(div, "data-irb-rule", $.get(ruleIndex));
|
|
582
738
|
$.set_attribute(span, "id", `${baseId}-rule-${$.get(ruleIndex)}-conditions-label`);
|
|
583
|
-
$.set_attribute(span_1, "id", `${baseId}-rule-${$.get(ruleIndex)}-actions-label`);
|
|
584
739
|
});
|
|
585
740
|
$.append($$anchor2, div);
|
|
586
741
|
});
|
|
587
|
-
var
|
|
742
|
+
var node_13 = $.sibling(node, 2);
|
|
588
743
|
{
|
|
589
|
-
var
|
|
590
|
-
var button_7 =
|
|
591
|
-
var
|
|
744
|
+
var consequent_12 = ($$anchor2) => {
|
|
745
|
+
var button_7 = root_20();
|
|
746
|
+
var text_9 = $.child(button_7);
|
|
592
747
|
$.reset(button_7);
|
|
593
|
-
$.template_effect(() => $.set_text(
|
|
748
|
+
$.template_effect(() => $.set_text(text_9, `+ ${addRuleLabel() ?? ""}`));
|
|
594
749
|
$.delegated("click", button_7, handleAddRule);
|
|
595
750
|
$.append($$anchor2, button_7);
|
|
596
751
|
};
|
|
597
|
-
$.if(
|
|
752
|
+
$.if(node_13, ($$render) => {
|
|
598
753
|
if (!$.get(effectiveReadonly))
|
|
599
|
-
$$render(
|
|
754
|
+
$$render(consequent_12);
|
|
600
755
|
});
|
|
601
756
|
}
|
|
602
|
-
var
|
|
757
|
+
var node_14 = $.sibling(node_13, 2);
|
|
603
758
|
{
|
|
604
|
-
var
|
|
605
|
-
var p_4 =
|
|
759
|
+
var consequent_13 = ($$anchor2) => {
|
|
760
|
+
var p_4 = root_21();
|
|
606
761
|
$.append($$anchor2, p_4);
|
|
607
762
|
};
|
|
608
|
-
$.if(
|
|
763
|
+
$.if(node_14, ($$render) => {
|
|
609
764
|
if ($$props.rules.length === 0 && $.get(effectiveReadonly))
|
|
610
|
-
$$render(
|
|
765
|
+
$$render(consequent_13);
|
|
611
766
|
});
|
|
612
767
|
}
|
|
613
768
|
$.reset(section);
|
|
614
769
|
var div_13 = $.sibling(section, 2);
|
|
615
|
-
var
|
|
770
|
+
var text_10 = $.child(div_13, true);
|
|
616
771
|
$.reset(div_13);
|
|
617
|
-
$.template_effect(() => $.set_text(
|
|
772
|
+
$.template_effect(() => $.set_text(text_10, $.get(announcement)));
|
|
618
773
|
$.append($$anchor, fragment);
|
|
619
774
|
$.pop();
|
|
620
775
|
}
|
|
@@ -627,4 +782,4 @@ export {
|
|
|
627
782
|
Invocation_rule_builder as InvocationRuleBuilder
|
|
628
783
|
};
|
|
629
784
|
|
|
630
|
-
//# debugId=
|
|
785
|
+
//# debugId=68559E88502D32A764756E2164756E21
|