@lostgradient/cinder 0.11.0 → 0.12.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 +10 -0
- package/components.json +1 -1
- package/dist/components/code-block/code-block.css +15 -9
- package/dist/components/code-block/code-block.variables.js +8 -2
- package/dist/components/confirm-dialog/confirm-dialog.css +2 -0
- package/dist/components/confirm-dialog/confirm-dialog.schema.js +10 -1
- package/dist/components/confirm-dialog/confirm-dialog.types.d.ts +7 -0
- package/dist/components/confirm-dialog/index.js +478 -106
- package/dist/components/faceted-filter-bar/faceted-filter-bar.schema.js +5 -1
- package/dist/components/faceted-filter-bar/faceted-filter-bar.types.d.ts +2 -0
- package/dist/components/faceted-filter-bar/index.js +40 -31
- package/dist/components/navigation-bar/index.js +11 -17
- package/dist/components/run-step-timeline/index.js +65 -6
- package/dist/components/run-step-timeline/run-step-timeline.utilities.d.ts +9 -1
- package/dist/index.js +352 -246
- package/dist/server/components/color-field/index.js +2 -2
- package/dist/server/components/confirm-dialog/index.js +7 -2
- package/dist/server/components/faceted-filter-bar/index.js +1 -1
- package/dist/server/components/navigation-bar/index.js +1 -1
- package/dist/server/components/run-step-timeline/index.js +1 -1
- package/dist/server/index.js +7 -7
- package/dist/server/{index.server-5tf22d6e.js → index.server-4wx0qven.js} +3 -3
- package/dist/server/{index.server-894t97kv.js → index.server-7yvpb6z7.js} +4 -4
- package/dist/server/{index.server-btgb3d56.js → index.server-d5a5ccz7.js} +18 -12
- package/dist/server/{index.server-z38bxms8.js → index.server-g5jgq3jp.js} +65 -6
- package/dist/server/{index.server-39ne5cd1.js → index.server-pxq277t5.js} +32 -1
- package/package.json +22 -95
- package/src/components/code-block/code-block.css +15 -9
- package/src/components/code-block/code-block.variables.json +7 -1
- package/src/components/code-block/code-block.variables.ts +7 -1
- package/src/components/confirm-dialog/confirm-dialog.css +2 -0
- package/src/components/confirm-dialog/confirm-dialog.schema.json +8 -0
- package/src/components/confirm-dialog/confirm-dialog.schema.ts +10 -0
- package/src/components/confirm-dialog/confirm-dialog.svelte +31 -3
- package/src/components/confirm-dialog/confirm-dialog.types.ts +7 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.schema.json +4 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.schema.ts +4 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.svelte +13 -11
- package/src/components/faceted-filter-bar/faceted-filter-bar.types.ts +2 -0
- package/src/components/navigation-bar/navigation-bar.svelte +2 -2
- package/src/components/run-step-timeline/run-step-timeline.svelte +4 -4
- package/src/components/run-step-timeline/run-step-timeline.utilities.ts +68 -0
|
@@ -64,6 +64,10 @@ var schema = {
|
|
|
64
64
|
type: "string",
|
|
65
65
|
description: "Current text search query. When provided, the search field is controlled."
|
|
66
66
|
},
|
|
67
|
+
showSearch: {
|
|
68
|
+
type: "boolean",
|
|
69
|
+
description: "Whether to render the leading search field. Defaults to `true`."
|
|
70
|
+
},
|
|
67
71
|
searchPlaceholder: {
|
|
68
72
|
type: "string",
|
|
69
73
|
description: "Placeholder text shown in the leading search field."
|
|
@@ -124,4 +128,4 @@ export {
|
|
|
124
128
|
faceted_filter_bar_schema_default as default
|
|
125
129
|
};
|
|
126
130
|
|
|
127
|
-
//# debugId=
|
|
131
|
+
//# debugId=5E8BF6E34E58E39164756E2164756E21
|
|
@@ -66,6 +66,8 @@ export type FacetedFilterBarProps = Omit<HTMLAttributes<HTMLDivElement>, 'class'
|
|
|
66
66
|
'aria-label'?: string;
|
|
67
67
|
/** Current text search query. When provided, the search field is controlled. */
|
|
68
68
|
searchQuery?: string;
|
|
69
|
+
/** Whether to render the leading search field. Defaults to `true`. */
|
|
70
|
+
showSearch?: boolean;
|
|
69
71
|
/** Placeholder text shown in the leading search field. */
|
|
70
72
|
searchPlaceholder?: string;
|
|
71
73
|
/** Accessible label for the search input. Defaults to 'Search'. */
|
|
@@ -862,6 +862,7 @@ var rest_excludes4 = new Set([
|
|
|
862
862
|
"$$legacy",
|
|
863
863
|
"aria-label",
|
|
864
864
|
"searchQuery",
|
|
865
|
+
"showSearch",
|
|
865
866
|
"searchPlaceholder",
|
|
866
867
|
"searchAriaLabel",
|
|
867
868
|
"facets",
|
|
@@ -881,7 +882,7 @@ var root_42 = $8.from_html(`<div><div class="cinder-faceted-filter-bar__controls
|
|
|
881
882
|
function Faceted_filter_bar($$anchor, $$props) {
|
|
882
883
|
const generatedId = $8.props_id();
|
|
883
884
|
$8.push($$props, true);
|
|
884
|
-
let ariaLabel = $8.prop($$props, "aria-label", 3, "Filters"), searchPlaceholder = $8.prop($$props, "searchPlaceholder", 3, "Search…"), searchAriaLabel = $8.prop($$props, "searchAriaLabel", 3, "Search"), facets = $8.prop($$props, "facets", 19, () => []), appliedFilters = $8.prop($$props, "appliedFilters", 19, () => []), disabled = $8.prop($$props, "disabled", 3, false), rest = $8.rest_props($$props, rest_excludes4);
|
|
885
|
+
let ariaLabel = $8.prop($$props, "aria-label", 3, "Filters"), showSearch = $8.prop($$props, "showSearch", 3, true), searchPlaceholder = $8.prop($$props, "searchPlaceholder", 3, "Search…"), searchAriaLabel = $8.prop($$props, "searchAriaLabel", 3, "Search"), facets = $8.prop($$props, "facets", 19, () => []), appliedFilters = $8.prop($$props, "appliedFilters", 19, () => []), disabled = $8.prop($$props, "disabled", 3, false), rest = $8.rest_props($$props, rest_excludes4);
|
|
885
886
|
const searchId = $8.derived(() => `${generatedId}-search`);
|
|
886
887
|
let rootElement = $8.state(undefined);
|
|
887
888
|
let internalSearchQuery = $8.state("");
|
|
@@ -896,7 +897,7 @@ function Faceted_filter_bar($$anchor, $$props) {
|
|
|
896
897
|
return value;
|
|
897
898
|
return facet.options.find((option) => option.value === value)?.label ?? value;
|
|
898
899
|
}
|
|
899
|
-
const hasAppliedFilters = $8.derived(() => appliedFilters().length > 0 || $8.get(currentSearchQuery).length > 0);
|
|
900
|
+
const hasAppliedFilters = $8.derived(() => appliedFilters().length > 0 || showSearch() && $8.get(currentSearchQuery).length > 0);
|
|
900
901
|
const totalActiveCount = $8.derived(() => appliedFilters().length);
|
|
901
902
|
const summaryMessage = $8.derived(() => {
|
|
902
903
|
if ($8.get(totalActiveCount) === 0)
|
|
@@ -940,31 +941,39 @@ function Faceted_filter_bar($$anchor, $$props) {
|
|
|
940
941
|
}), [() => classNames("cinder-faceted-filter-bar", $$props.class)]);
|
|
941
942
|
var div_1 = $8.child(div);
|
|
942
943
|
var node = $8.child(div_1);
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
944
|
+
{
|
|
945
|
+
var consequent = ($$anchor2) => {
|
|
946
|
+
Search_field($$anchor2, {
|
|
947
|
+
get id() {
|
|
948
|
+
return $8.get(searchId);
|
|
949
|
+
},
|
|
950
|
+
class: "cinder-faceted-filter-bar__search",
|
|
951
|
+
get value() {
|
|
952
|
+
return $8.get(currentSearchQuery);
|
|
953
|
+
},
|
|
954
|
+
get placeholder() {
|
|
955
|
+
return searchPlaceholder();
|
|
956
|
+
},
|
|
957
|
+
get "aria-label"() {
|
|
958
|
+
return searchAriaLabel();
|
|
959
|
+
},
|
|
960
|
+
get disabled() {
|
|
961
|
+
return disabled();
|
|
962
|
+
},
|
|
963
|
+
oninput: handleSearchInput
|
|
964
|
+
});
|
|
965
|
+
};
|
|
966
|
+
$8.if(node, ($$render) => {
|
|
967
|
+
if (showSearch())
|
|
968
|
+
$$render(consequent);
|
|
969
|
+
});
|
|
970
|
+
}
|
|
962
971
|
var node_1 = $8.sibling(node, 2);
|
|
963
972
|
$8.each(node_1, 17, facets, (facet) => facet.key, ($$anchor2, facet) => {
|
|
964
|
-
var
|
|
965
|
-
var node_2 = $8.first_child(
|
|
973
|
+
var fragment_1 = $8.comment();
|
|
974
|
+
var node_2 = $8.first_child(fragment_1);
|
|
966
975
|
{
|
|
967
|
-
var
|
|
976
|
+
var consequent_1 = ($$anchor3) => {
|
|
968
977
|
const selectFacet = $8.derived(() => $8.get(facet));
|
|
969
978
|
var div_2 = root_14();
|
|
970
979
|
var label = $8.child(div_2);
|
|
@@ -1012,7 +1021,7 @@ function Faceted_filter_bar($$anchor, $$props) {
|
|
|
1012
1021
|
});
|
|
1013
1022
|
$8.append($$anchor3, div_2);
|
|
1014
1023
|
};
|
|
1015
|
-
var
|
|
1024
|
+
var consequent_2 = ($$anchor3) => {
|
|
1016
1025
|
var div_3 = root_23();
|
|
1017
1026
|
var node_4 = $8.child(div_3);
|
|
1018
1027
|
{
|
|
@@ -1029,17 +1038,17 @@ function Faceted_filter_bar($$anchor, $$props) {
|
|
|
1029
1038
|
};
|
|
1030
1039
|
$8.if(node_2, ($$render) => {
|
|
1031
1040
|
if ($8.get(facet).type === "select")
|
|
1032
|
-
$$render(
|
|
1041
|
+
$$render(consequent_1);
|
|
1033
1042
|
else if ($8.get(facet).type === "custom")
|
|
1034
|
-
$$render(
|
|
1043
|
+
$$render(consequent_2, 1);
|
|
1035
1044
|
});
|
|
1036
1045
|
}
|
|
1037
|
-
$8.append($$anchor2,
|
|
1046
|
+
$8.append($$anchor2, fragment_1);
|
|
1038
1047
|
});
|
|
1039
1048
|
$8.reset(div_1);
|
|
1040
1049
|
var node_5 = $8.sibling(div_1, 2);
|
|
1041
1050
|
{
|
|
1042
|
-
var
|
|
1051
|
+
var consequent_3 = ($$anchor2) => {
|
|
1043
1052
|
var div_4 = root_33();
|
|
1044
1053
|
var node_6 = $8.child(div_4);
|
|
1045
1054
|
$8.each(node_6, 17, appliedFilters, (filter) => filter.key, ($$anchor3, filter) => {
|
|
@@ -1084,7 +1093,7 @@ function Faceted_filter_bar($$anchor, $$props) {
|
|
|
1084
1093
|
};
|
|
1085
1094
|
$8.if(node_5, ($$render) => {
|
|
1086
1095
|
if ($8.get(hasAppliedFilters))
|
|
1087
|
-
$$render(
|
|
1096
|
+
$$render(consequent_3);
|
|
1088
1097
|
});
|
|
1089
1098
|
}
|
|
1090
1099
|
var node_8 = $8.sibling(node_5, 2);
|
|
@@ -1108,4 +1117,4 @@ export {
|
|
|
1108
1117
|
Faceted_filter_bar as FacetedFilterBar
|
|
1109
1118
|
};
|
|
1110
1119
|
|
|
1111
|
-
//# debugId=
|
|
1120
|
+
//# debugId=87F490947F95C08764756E2164756E21
|
|
@@ -275,14 +275,11 @@ function Navigation_bar($$anchor, $$props) {
|
|
|
275
275
|
var consequent = ($$anchor2) => {
|
|
276
276
|
var div = root();
|
|
277
277
|
var node_1 = $.child(div);
|
|
278
|
-
{
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}));
|
|
284
|
-
$.snippet(node_1, () => $$props.menuToggle, () => $.get($0));
|
|
285
|
-
}
|
|
278
|
+
$.snippet(node_1, () => $$props.menuToggle, () => ({
|
|
279
|
+
"aria-expanded": mobileMenuOpen() ? "true" : "false",
|
|
280
|
+
"aria-controls": regionId,
|
|
281
|
+
onclick: handleToggle
|
|
282
|
+
}));
|
|
286
283
|
$.reset(div);
|
|
287
284
|
$.append($$anchor2, div);
|
|
288
285
|
};
|
|
@@ -310,14 +307,11 @@ function Navigation_bar($$anchor, $$props) {
|
|
|
310
307
|
var consequent_2 = ($$anchor2) => {
|
|
311
308
|
var div_2 = root();
|
|
312
309
|
var node_5 = $.child(div_2);
|
|
313
|
-
{
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}));
|
|
319
|
-
$.snippet(node_5, () => $$props.menuToggle, () => $.get($0));
|
|
320
|
-
}
|
|
310
|
+
$.snippet(node_5, () => $$props.menuToggle, () => ({
|
|
311
|
+
"aria-expanded": mobileMenuOpen() ? "true" : "false",
|
|
312
|
+
"aria-controls": regionId,
|
|
313
|
+
onclick: handleToggle
|
|
314
|
+
}));
|
|
321
315
|
$.reset(div_2);
|
|
322
316
|
$.append($$anchor2, div_2);
|
|
323
317
|
};
|
|
@@ -367,4 +361,4 @@ export {
|
|
|
367
361
|
Navigation_bar as NavigationBar
|
|
368
362
|
};
|
|
369
363
|
|
|
370
|
-
//# debugId=
|
|
364
|
+
//# debugId=1BB3A9EE76EE8C6964756E2164756E21
|
|
@@ -670,6 +670,65 @@ function Status_dot($$anchor, $$props) {
|
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
// src/components/run-step-timeline/run-step-timeline.utilities.ts
|
|
673
|
+
function relocateCompensationSteps(steps) {
|
|
674
|
+
return relocateSiblingItems(steps, (step) => step);
|
|
675
|
+
}
|
|
676
|
+
function relocateSiblingItems(items, getStep) {
|
|
677
|
+
if (!items.some((item) => getStep(item)?.compensates !== undefined))
|
|
678
|
+
return items;
|
|
679
|
+
const stepById = new Map;
|
|
680
|
+
for (const item of items) {
|
|
681
|
+
const step = getStep(item);
|
|
682
|
+
if (step !== undefined) {
|
|
683
|
+
stepById.set(step.id, step);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
const canRelocate = (step) => {
|
|
687
|
+
const visited = new Set([step.id]);
|
|
688
|
+
let targetId = step.compensates;
|
|
689
|
+
while (targetId !== undefined) {
|
|
690
|
+
const target = stepById.get(targetId);
|
|
691
|
+
if (target === undefined || visited.has(targetId))
|
|
692
|
+
return false;
|
|
693
|
+
visited.add(targetId);
|
|
694
|
+
targetId = target.compensates;
|
|
695
|
+
}
|
|
696
|
+
return true;
|
|
697
|
+
};
|
|
698
|
+
const relocatable = new Set;
|
|
699
|
+
const compensationsByTarget = new Map;
|
|
700
|
+
for (const item of items) {
|
|
701
|
+
const step = getStep(item);
|
|
702
|
+
if (step === undefined || step.compensates === undefined || !canRelocate(step))
|
|
703
|
+
continue;
|
|
704
|
+
relocatable.add(step);
|
|
705
|
+
const compensations = compensationsByTarget.get(step.compensates) ?? [];
|
|
706
|
+
compensations.push(item);
|
|
707
|
+
compensationsByTarget.set(step.compensates, compensations);
|
|
708
|
+
}
|
|
709
|
+
const result = [];
|
|
710
|
+
const appendWithCompensations = (item) => {
|
|
711
|
+
result.push(item);
|
|
712
|
+
const step = getStep(item);
|
|
713
|
+
if (step === undefined)
|
|
714
|
+
return;
|
|
715
|
+
for (const compensation of compensationsByTarget.get(step.id) ?? []) {
|
|
716
|
+
appendWithCompensations(compensation);
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
for (const item of items) {
|
|
720
|
+
const step = getStep(item);
|
|
721
|
+
if (step === undefined || !relocatable.has(step))
|
|
722
|
+
appendWithCompensations(item);
|
|
723
|
+
}
|
|
724
|
+
return result;
|
|
725
|
+
}
|
|
726
|
+
function relocateCompensationEntries(entries) {
|
|
727
|
+
return relocateSiblingItems(entries, (entry) => isBranchGroup(entry) ? undefined : entry);
|
|
728
|
+
}
|
|
729
|
+
function isBranchGroup(entry) {
|
|
730
|
+
return "kind" in entry && entry.kind === "branch";
|
|
731
|
+
}
|
|
673
732
|
function statusDotStatus(status) {
|
|
674
733
|
switch (status) {
|
|
675
734
|
case "succeeded":
|
|
@@ -1254,8 +1313,8 @@ function Run_step_timeline($$anchor, $$props) {
|
|
|
1254
1313
|
const MAX_NESTED_STEP_DEPTH = 3;
|
|
1255
1314
|
let rest = $8.rest_props($$props, rest_excludes5);
|
|
1256
1315
|
const resolvedAriaLabel = $8.derived(() => $$props["aria-labelledby"] === undefined && $$props["aria-label"] === undefined ? $$props.label : $$props["aria-label"]);
|
|
1257
|
-
const renderedEntries = $8.derived(() => flattenEntries($$props.steps));
|
|
1258
|
-
function
|
|
1316
|
+
const renderedEntries = $8.derived(() => flattenEntries(relocateCompensationEntries($$props.steps)));
|
|
1317
|
+
function isBranchGroup2(entry) {
|
|
1259
1318
|
return "kind" in entry && entry.kind === "branch";
|
|
1260
1319
|
}
|
|
1261
1320
|
function flattenEntries(entries) {
|
|
@@ -1268,7 +1327,7 @@ function Run_step_timeline($$anchor, $$props) {
|
|
|
1268
1327
|
stepRun = [];
|
|
1269
1328
|
};
|
|
1270
1329
|
for (const entry of entries) {
|
|
1271
|
-
if (
|
|
1330
|
+
if (isBranchGroup2(entry)) {
|
|
1272
1331
|
flushRun();
|
|
1273
1332
|
result.push({
|
|
1274
1333
|
kind: "branch",
|
|
@@ -1330,7 +1389,7 @@ function Run_step_timeline($$anchor, $$props) {
|
|
|
1330
1389
|
}
|
|
1331
1390
|
function flattenSteps(list, pathPrefix) {
|
|
1332
1391
|
const rows = [];
|
|
1333
|
-
appendRunStepRows(rows, list, 0, pathPrefix);
|
|
1392
|
+
appendRunStepRows(rows, relocateCompensationSteps(list), 0, pathPrefix);
|
|
1334
1393
|
const currentRowIndex = deepestCurrentStepIndex(rows);
|
|
1335
1394
|
const labelByPathKey = new Map;
|
|
1336
1395
|
for (const row of rows) {
|
|
@@ -1368,7 +1427,7 @@ function Run_step_timeline($$anchor, $$props) {
|
|
|
1368
1427
|
rows.push({ kind: "step", step, depth, pathKey });
|
|
1369
1428
|
if (step.children && step.children.length > 0) {
|
|
1370
1429
|
if (depth < MAX_NESTED_STEP_DEPTH) {
|
|
1371
|
-
appendRunStepRows(rows, step.children, depth + 1, pathKey);
|
|
1430
|
+
appendRunStepRows(rows, relocateCompensationSteps(step.children), depth + 1, pathKey);
|
|
1372
1431
|
} else {
|
|
1373
1432
|
const hiddenSummary = summarizeNestedRunSteps(step.children);
|
|
1374
1433
|
rows.push({
|
|
@@ -1611,4 +1670,4 @@ export {
|
|
|
1611
1670
|
Run_step_timeline as RunStepTimeline
|
|
1612
1671
|
};
|
|
1613
1672
|
|
|
1614
|
-
//# debugId=
|
|
1673
|
+
//# debugId=77801BC78A33372764756E2164756E21
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import type { StatusDotStatus } from '../status-dot/status-dot.types.ts';
|
|
2
|
-
import type { RunStep, RunStepBranchGroup, RunStepBranchLane, RunStepBranchLaneOutcome, RunStepStatus } from './run-step-timeline.types.ts';
|
|
2
|
+
import type { RunStep, RunStepBranchGroup, RunStepBranchLane, RunStepBranchLaneOutcome, RunStepStatus, RunStepTimelineEntry } from './run-step-timeline.types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Relocate resolved compensation steps immediately after the subtree of the
|
|
5
|
+
* sibling they reverse. Unresolved, self-referential, and cyclic links retain
|
|
6
|
+
* consumer order. Multiple compensations retain their relative input order.
|
|
7
|
+
*/
|
|
8
|
+
export declare function relocateCompensationSteps(steps: RunStep[]): RunStep[];
|
|
9
|
+
/** Relocate top-level compensations while preserving branch rows as rail entries. */
|
|
10
|
+
export declare function relocateCompensationEntries(entries: RunStepTimelineEntry[]): RunStepTimelineEntry[];
|
|
3
11
|
/** Badge variants used for the per-step status chip. */
|
|
4
12
|
export type RunStepBadgeVariant = 'neutral' | 'success' | 'warning' | 'danger' | 'info' | 'accent';
|
|
5
13
|
/** Map a generic {@link RunStepStatus} onto a StatusDot status token. */
|