@tduniec/plugin-template-designer 0.3.6 → 0.4.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +39 -37
  2. package/README.md +8 -115
  3. package/dist/alpha.esm.js +1 -1
  4. package/dist/alpha.esm.js.map +1 -1
  5. package/dist/components/TemplateDesigner/TemplateDesigner.esm.js +14 -12
  6. package/dist/components/TemplateDesigner/TemplateDesigner.esm.js.map +1 -1
  7. package/dist/index.d.ts +10 -4
  8. package/dist/index.esm.js +3 -1
  9. package/dist/index.esm.js.map +1 -1
  10. package/dist/package.json.esm.js +53 -92
  11. package/dist/package.json.esm.js.map +1 -1
  12. package/dist/plugin.esm.js +1 -2
  13. package/dist/plugin.esm.js.map +1 -1
  14. package/package.json +46 -77
  15. package/LICENSE +0 -201
  16. package/dist/api/mockScaffolderActions.esm.js +0 -85
  17. package/dist/api/mockScaffolderActions.esm.js.map +0 -1
  18. package/dist/api/scaffolderActions.esm.js +0 -57
  19. package/dist/api/scaffolderActions.esm.js.map +0 -1
  20. package/dist/components/DesignerFlow/DesignerFlow.esm.js +0 -431
  21. package/dist/components/DesignerFlow/DesignerFlow.esm.js.map +0 -1
  22. package/dist/components/DesignerFlow/flowConfig.esm.js +0 -21
  23. package/dist/components/DesignerFlow/flowConfig.esm.js.map +0 -1
  24. package/dist/components/DesignerFlow/handlers.esm.js +0 -322
  25. package/dist/components/DesignerFlow/handlers.esm.js.map +0 -1
  26. package/dist/components/DesignerFlow/model.esm.js +0 -185
  27. package/dist/components/DesignerFlow/model.esm.js.map +0 -1
  28. package/dist/components/DesignerFlow/nodeLayout.esm.js +0 -138
  29. package/dist/components/DesignerFlow/nodeLayout.esm.js.map +0 -1
  30. package/dist/components/DesignerFlow/parameterTransforms.esm.js +0 -184
  31. package/dist/components/DesignerFlow/parameterTransforms.esm.js.map +0 -1
  32. package/dist/components/Nodes/ActionNode.esm.js +0 -602
  33. package/dist/components/Nodes/ActionNode.esm.js.map +0 -1
  34. package/dist/components/Nodes/OutputNode.esm.js +0 -370
  35. package/dist/components/Nodes/OutputNode.esm.js.map +0 -1
  36. package/dist/components/Nodes/ParameterInputNode.esm.js +0 -310
  37. package/dist/components/Nodes/ParameterInputNode.esm.js.map +0 -1
  38. package/dist/components/Nodes/ParameterTitlesNode.esm.js +0 -251
  39. package/dist/components/Nodes/ParameterTitlesNode.esm.js.map +0 -1
  40. package/dist/components/Nodes/ParametersNode.esm.js +0 -144
  41. package/dist/components/Nodes/ParametersNode.esm.js.map +0 -1
  42. package/dist/components/Nodes/action/schema.esm.js +0 -144
  43. package/dist/components/Nodes/action/schema.esm.js.map +0 -1
  44. package/dist/components/Nodes/action/useActionInputs.esm.js +0 -84
  45. package/dist/components/Nodes/action/useActionInputs.esm.js.map +0 -1
  46. package/dist/components/Nodes/common/AutoWidthPopper.esm.js +0 -22
  47. package/dist/components/Nodes/common/AutoWidthPopper.esm.js.map +0 -1
  48. package/dist/components/Nodes/common/nodeInteraction.esm.js +0 -9
  49. package/dist/components/Nodes/common/nodeInteraction.esm.js.map +0 -1
  50. package/dist/components/Nodes/output/useOutputController.esm.js +0 -191
  51. package/dist/components/Nodes/output/useOutputController.esm.js.map +0 -1
  52. package/dist/components/Nodes/parameters/useParameterSections.esm.js +0 -162
  53. package/dist/components/Nodes/parameters/useParameterSections.esm.js.map +0 -1
  54. package/dist/components/Nodes/types.esm.js +0 -8
  55. package/dist/components/Nodes/types.esm.js.map +0 -1
  56. package/dist/components/TemplateDesigner/components/FieldEditorDialog.esm.js +0 -55
  57. package/dist/components/TemplateDesigner/components/FieldEditorDialog.esm.js.map +0 -1
  58. package/dist/components/TemplateDesigner/components/TemplateLanding.esm.js +0 -157
  59. package/dist/components/TemplateDesigner/components/TemplateLanding.esm.js.map +0 -1
  60. package/dist/components/TemplateDesigner/components/TemplateWorkspace.esm.js +0 -302
  61. package/dist/components/TemplateDesigner/components/TemplateWorkspace.esm.js.map +0 -1
  62. package/dist/components/TemplateDesigner/components/codemirrorTheme.esm.js +0 -30
  63. package/dist/components/TemplateDesigner/components/codemirrorTheme.esm.js.map +0 -1
  64. package/dist/components/TemplateDesigner/useFieldEditor.esm.js +0 -95
  65. package/dist/components/TemplateDesigner/useFieldEditor.esm.js.map +0 -1
  66. package/dist/components/TemplateDesigner/useTemplateState.esm.js +0 -627
  67. package/dist/components/TemplateDesigner/useTemplateState.esm.js.map +0 -1
  68. package/dist/components/TemplateDesigner/utils.esm.js +0 -46
  69. package/dist/components/TemplateDesigner/utils.esm.js.map +0 -1
  70. package/dist/components/TemplateDesignerIcon.esm.js +0 -33
  71. package/dist/components/TemplateDesignerIcon.esm.js.map +0 -1
  72. package/dist/utils/createSequentialEdges.esm.js +0 -15
  73. package/dist/utils/createSequentialEdges.esm.js.map +0 -1
  74. package/dist/utils/sampleTemplate.esm.js +0 -40
  75. package/dist/utils/sampleTemplate.esm.js.map +0 -1
  76. package/dist/utils/yamlJsonConversion.esm.js +0 -47
  77. package/dist/utils/yamlJsonConversion.esm.js.map +0 -1
@@ -1,138 +0,0 @@
1
- import { NODE_VERTICAL_SPACING } from '../Nodes/types.esm.js';
2
-
3
- const DEFAULT_NODE_HEIGHT = 320;
4
- const MIN_VERTICAL_GAP = 48;
5
- const parseNumericHeight = (value) => {
6
- if (typeof value === "number" && Number.isFinite(value) && value > 0) {
7
- return value;
8
- }
9
- if (typeof value === "string") {
10
- const parsed = Number.parseFloat(value);
11
- if (!Number.isNaN(parsed) && parsed > 0) {
12
- return parsed;
13
- }
14
- }
15
- return null;
16
- };
17
- const estimateParametersNodeHeight = (node) => {
18
- if (node.type !== "parametersNode") {
19
- return null;
20
- }
21
- const data = node.data;
22
- if (!data) {
23
- return null;
24
- }
25
- const sections = data.sections ?? [];
26
- const PARAMETER_SHELL_HEIGHT = 300;
27
- const PARAMETER_CARD_BASE = 220;
28
- const SECTION_BASE = 180;
29
- const FIELD_HEIGHT = 86;
30
- if (!sections.length) {
31
- return PARAMETER_SHELL_HEIGHT + PARAMETER_CARD_BASE + SECTION_BASE;
32
- }
33
- const sectionsHeight = sections.reduce((total, section) => {
34
- const fieldCount = section.fields?.length ?? 0;
35
- return total + SECTION_BASE + Math.max(fieldCount, 1) * FIELD_HEIGHT;
36
- }, 0);
37
- return PARAMETER_SHELL_HEIGHT + PARAMETER_CARD_BASE + sectionsHeight;
38
- };
39
- const estimateActionNodeHeight = (node) => {
40
- if (node.type !== "actionNode") {
41
- return null;
42
- }
43
- const data = node.data;
44
- if (!data) {
45
- return null;
46
- }
47
- const base = NODE_VERTICAL_SPACING.actionNode ;
48
- const rowHeight = 84;
49
- const inputCount = Object.keys(data.step?.input ?? {}).length;
50
- const displayedRows = Math.max(inputCount, 1);
51
- const extraRows = Math.max(displayedRows - 1, 0);
52
- return base + extraRows * rowHeight;
53
- };
54
- const BUILTIN_OUTPUT_KEYS = /* @__PURE__ */ new Set(["links", "text"]);
55
- const estimateOutputNodeHeight = (node) => {
56
- if (node.type !== "outputNode") {
57
- return null;
58
- }
59
- const data = node.data;
60
- if (!data) {
61
- return null;
62
- }
63
- const base = 240;
64
- const linkHeight = 68;
65
- const textHeight = 68;
66
- const customHeight = 56;
67
- const links = Array.isArray(data.output?.links) ? data.output.links : [];
68
- const textEntries = Array.isArray(data.output?.text) ? data.output.text : [];
69
- const customEntries = data.output && typeof data.output === "object" ? Object.entries(data.output).filter(
70
- ([key]) => !BUILTIN_OUTPUT_KEYS.has(key)
71
- ) : [];
72
- return base + links.length * linkHeight + textEntries.length * textHeight + customEntries.length * customHeight;
73
- };
74
- const getEstimatedHeightForNode = (node) => {
75
- const type = node.type;
76
- if (!type) {
77
- return null;
78
- }
79
- const estimators = {
80
- parametersNode: estimateParametersNodeHeight,
81
- actionNode: estimateActionNodeHeight,
82
- outputNode: estimateOutputNodeHeight
83
- };
84
- const estimated = estimators[type]?.(node);
85
- if (typeof estimated === "number" && estimated > 0) {
86
- return estimated;
87
- }
88
- const fallback = NODE_VERTICAL_SPACING[type];
89
- return typeof fallback === "number" && fallback > 0 ? fallback : null;
90
- };
91
- const getNodeHeight = (node) => {
92
- const measured = parseNumericHeight(node.measured?.height);
93
- if (measured) {
94
- return measured;
95
- }
96
- const explicitHeight = parseNumericHeight(node.height);
97
- if (explicitHeight) {
98
- return explicitHeight;
99
- }
100
- const styleHeight = parseNumericHeight(node.style?.height);
101
- if (styleHeight) {
102
- return styleHeight;
103
- }
104
- const estimatedHeight = getEstimatedHeightForNode(node);
105
- if (estimatedHeight) {
106
- return estimatedHeight;
107
- }
108
- return DEFAULT_NODE_HEIGHT;
109
- };
110
- const getSpacingBufferForNode = (node) => {
111
- const type = node.type;
112
- if (!type) {
113
- return MIN_VERTICAL_GAP;
114
- }
115
- const buffer = NODE_VERTICAL_SPACING[type] ?? MIN_VERTICAL_GAP;
116
- return buffer > MIN_VERTICAL_GAP ? buffer : MIN_VERTICAL_GAP;
117
- };
118
- const alignNodes = (nodes, fixedXPosition, verticalSpacing) => {
119
- let currentY = 0;
120
- return nodes.map((node) => {
121
- const alignedNode = {
122
- ...node,
123
- position: {
124
- x: fixedXPosition,
125
- y: currentY
126
- }
127
- };
128
- const nodeHeight = getNodeHeight(node);
129
- const spacingBuffer = getSpacingBufferForNode(node);
130
- const minDistance = nodeHeight + spacingBuffer;
131
- const distanceToNext = Math.max(minDistance, verticalSpacing);
132
- currentY += distanceToNext;
133
- return alignedNode;
134
- });
135
- };
136
-
137
- export { alignNodes };
138
- //# sourceMappingURL=nodeLayout.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodeLayout.esm.js","sources":["../../../src/components/DesignerFlow/nodeLayout.ts"],"sourcesContent":["import type { Node } from \"@xyflow/react\";\nimport type {\n ActionNodeData,\n DesignerNodeType,\n OutputNodeData,\n ParametersNodeData,\n} from \"../Nodes/types\";\nimport { NODE_VERTICAL_SPACING } from \"../Nodes/types\";\n\n// Shared helpers for computing consistent node alignment/spacing in the flow.\n\nconst DEFAULT_NODE_HEIGHT = 320;\nconst MIN_VERTICAL_GAP = 48;\n\nconst parseNumericHeight = (value: unknown): number | null => {\n if (typeof value === \"number\" && Number.isFinite(value) && value > 0) {\n return value;\n }\n if (typeof value === \"string\") {\n const parsed = Number.parseFloat(value);\n if (!Number.isNaN(parsed) && parsed > 0) {\n return parsed;\n }\n }\n return null;\n};\n\nconst estimateParametersNodeHeight = (node: Node): number | null => {\n if (node.type !== \"parametersNode\") {\n return null;\n }\n const data = node.data as ParametersNodeData | undefined;\n if (!data) {\n return null;\n }\n\n const sections = data.sections ?? [];\n const PARAMETER_SHELL_HEIGHT = 300;\n const PARAMETER_CARD_BASE = 220;\n const SECTION_BASE = 180;\n const FIELD_HEIGHT = 86;\n\n if (!sections.length) {\n return PARAMETER_SHELL_HEIGHT + PARAMETER_CARD_BASE + SECTION_BASE;\n }\n\n const sectionsHeight = sections.reduce((total, section) => {\n const fieldCount = section.fields?.length ?? 0;\n return total + SECTION_BASE + Math.max(fieldCount, 1) * FIELD_HEIGHT;\n }, 0);\n\n return PARAMETER_SHELL_HEIGHT + PARAMETER_CARD_BASE + sectionsHeight;\n};\n\nconst estimateActionNodeHeight = (node: Node): number | null => {\n if (node.type !== \"actionNode\") {\n return null;\n }\n const data = node.data as ActionNodeData | undefined;\n if (!data) {\n return null;\n }\n const base =\n NODE_VERTICAL_SPACING.actionNode && NODE_VERTICAL_SPACING.actionNode > 0\n ? NODE_VERTICAL_SPACING.actionNode\n : MIN_VERTICAL_GAP;\n const rowHeight = 84;\n const inputCount = Object.keys(data.step?.input ?? {}).length;\n const displayedRows = Math.max(inputCount, 1);\n const extraRows = Math.max(displayedRows - 1, 0);\n return base + extraRows * rowHeight;\n};\n\nconst BUILTIN_OUTPUT_KEYS = new Set([\"links\", \"text\"]);\n\nconst estimateOutputNodeHeight = (node: Node): number | null => {\n if (node.type !== \"outputNode\") {\n return null;\n }\n const data = node.data as OutputNodeData | undefined;\n if (!data) {\n return null;\n }\n const base = 240;\n const linkHeight = 68;\n const textHeight = 68;\n const customHeight = 56;\n\n const links = Array.isArray(data.output?.links) ? data.output.links : [];\n const textEntries = Array.isArray(data.output?.text) ? data.output.text : [];\n const customEntries =\n data.output && typeof data.output === \"object\"\n ? Object.entries(data.output).filter(\n ([key]) => !BUILTIN_OUTPUT_KEYS.has(key)\n )\n : [];\n\n return (\n base +\n links.length * linkHeight +\n textEntries.length * textHeight +\n customEntries.length * customHeight\n );\n};\n\nconst getEstimatedHeightForNode = (node: Node): number | null => {\n const type = node.type as DesignerNodeType | undefined;\n if (!type) {\n return null;\n }\n\n const estimators: Partial<\n Record<DesignerNodeType, (node: Node) => number | null>\n > = {\n parametersNode: estimateParametersNodeHeight,\n actionNode: estimateActionNodeHeight,\n outputNode: estimateOutputNodeHeight,\n };\n\n const estimated = estimators[type]?.(node);\n if (typeof estimated === \"number\" && estimated > 0) {\n return estimated;\n }\n\n const fallback = NODE_VERTICAL_SPACING[type];\n return typeof fallback === \"number\" && fallback > 0 ? fallback : null;\n};\n\nconst getNodeHeight = (node: Node): number => {\n const measured = parseNumericHeight(node.measured?.height);\n if (measured) {\n return measured;\n }\n const explicitHeight = parseNumericHeight(node.height);\n if (explicitHeight) {\n return explicitHeight;\n }\n const styleHeight = parseNumericHeight(node.style?.height);\n if (styleHeight) {\n return styleHeight;\n }\n const estimatedHeight = getEstimatedHeightForNode(node);\n if (estimatedHeight) {\n return estimatedHeight;\n }\n return DEFAULT_NODE_HEIGHT;\n};\n\nconst getSpacingBufferForNode = (node: Node): number => {\n const type = node.type as DesignerNodeType | undefined;\n if (!type) {\n return MIN_VERTICAL_GAP;\n }\n const buffer = NODE_VERTICAL_SPACING[type] ?? MIN_VERTICAL_GAP;\n return buffer > MIN_VERTICAL_GAP ? buffer : MIN_VERTICAL_GAP;\n};\n\nexport const alignNodes = (\n nodes: Node[],\n fixedXPosition: number,\n verticalSpacing: number\n) => {\n let currentY = 0;\n\n return nodes.map((node) => {\n const alignedNode: Node = {\n ...node,\n position: {\n x: fixedXPosition,\n y: currentY,\n },\n };\n\n const nodeHeight = getNodeHeight(node);\n const spacingBuffer = getSpacingBufferForNode(node);\n const minDistance = nodeHeight + spacingBuffer;\n const distanceToNext = Math.max(minDistance, verticalSpacing);\n currentY += distanceToNext;\n\n return alignedNode;\n });\n};\n"],"names":[],"mappings":";;AAWA,MAAM,mBAAA,GAAsB,GAAA;AAC5B,MAAM,gBAAA,GAAmB,EAAA;AAEzB,MAAM,kBAAA,GAAqB,CAAC,KAAA,KAAkC;AAC5D,EAAA,IAAI,OAAO,UAAU,QAAA,IAAY,MAAA,CAAO,SAAS,KAAK,CAAA,IAAK,QAAQ,CAAA,EAAG;AACpE,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,IAAA,MAAM,MAAA,GAAS,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA;AACtC,IAAA,IAAI,CAAC,MAAA,CAAO,KAAA,CAAM,MAAM,CAAA,IAAK,SAAS,CAAA,EAAG;AACvC,MAAA,OAAO,MAAA;AAAA,IACT;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT,CAAA;AAEA,MAAM,4BAAA,GAA+B,CAAC,IAAA,KAA8B;AAClE,EAAA,IAAI,IAAA,CAAK,SAAS,gBAAA,EAAkB;AAClC,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,MAAM,OAAO,IAAA,CAAK,IAAA;AAClB,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,QAAA,IAAY,EAAC;AACnC,EAAA,MAAM,sBAAA,GAAyB,GAAA;AAC/B,EAAA,MAAM,mBAAA,GAAsB,GAAA;AAC5B,EAAA,MAAM,YAAA,GAAe,GAAA;AACrB,EAAA,MAAM,YAAA,GAAe,EAAA;AAErB,EAAA,IAAI,CAAC,SAAS,MAAA,EAAQ;AACpB,IAAA,OAAO,yBAAyB,m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B,KAAA,EACA,cAAA,EACA,eAAA,KACG;AACH,EAAA,IAAI,QAAA,GAAW,CAAA;AAEf,EAAA,OAAO,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,KAAS;AACzB,IAAA,MAAM,WAAA,GAAoB;AAAA,MACxB,GAAG,IAAA;AAAA,MACH,QAAA,EAAU;AAAA,QACR,CAAA,EAAG,cAAA;AAAA,QACH,CAAA,EAAG;AAAA;AACL,KACF;AAEA,IAAA,MAAM,UAAA,GAAa,cAAc,IAAI,CAAA;AACrC,IAAA,MAAM,aAAA,GAAgB,wBAAwB,IAAI,CAAA;AAClD,IAAA,MAAM,cAAc,UAAA,GAAa,aAAA;AACjC,IAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,GAAA,CAAI,WAAA,EAAa,eAAe,CAAA;AAC5D,IAAA,QAAA,IAAY,cAAA;AAEZ,IAAA,OAAO,WAAA;AAAA,EACT,CAAC,CAAA;AACH;;;;"}
@@ -1,184 +0,0 @@
1
- const asString = (value) => typeof value === "string" ? value : void 0;
2
- const asStringArray = (value) => Array.isArray(value) && value.every((item) => typeof item === "string") ? value : void 0;
3
- const asSchemaRecord = (value) => {
4
- if (!value || typeof value !== "object" || Array.isArray(value)) {
5
- return void 0;
6
- }
7
- return value;
8
- };
9
- const cloneSchema = (schema) => {
10
- if (!schema) {
11
- return void 0;
12
- }
13
- return JSON.parse(JSON.stringify(schema));
14
- };
15
- const buildDefaultSchema = (fieldName) => ({
16
- title: fieldName || "Field",
17
- type: "string"
18
- });
19
- const buildFieldsForSection = (sectionId, sectionTitle, properties, requiredList) => {
20
- if (!properties) {
21
- return [];
22
- }
23
- return Object.entries(properties).map(([fieldName, schema], fieldIndex) => {
24
- const isRequired = Array.isArray(requiredList) && requiredList.includes(fieldName);
25
- const safeSchema = cloneSchema(schema) ?? buildDefaultSchema(fieldName);
26
- return {
27
- id: `${sectionId}-field-${fieldIndex}`,
28
- fieldName,
29
- sectionId,
30
- sectionTitle,
31
- required: Boolean(isRequired),
32
- schema: safeSchema
33
- };
34
- });
35
- };
36
- const sanitizeField = (field, fallbackSectionId, index) => {
37
- const fieldId = field.id ?? `${fallbackSectionId}-field-${index}`;
38
- return {
39
- ...field,
40
- id: fieldId,
41
- sectionId: field.sectionId ?? fallbackSectionId,
42
- schema: cloneSchema(field.schema) ?? buildDefaultSchema(field.fieldName)
43
- };
44
- };
45
- const rebuildSectionMeta = (section, index) => {
46
- const fallbackId = section.id ?? `section-${index}`;
47
- const sanitizedFields = (section.fields ?? []).map(
48
- (field, fieldIndex) => sanitizeField(field, fallbackId, fieldIndex)
49
- );
50
- const properties = sanitizedFields.reduce((acc, field) => {
51
- if (!field.fieldName) {
52
- return acc;
53
- }
54
- acc[field.fieldName] = cloneSchema(field.schema) ?? buildDefaultSchema(field.fieldName);
55
- return acc;
56
- }, {});
57
- const required = sanitizedFields.filter((field) => field.required && field.fieldName).map((field) => field.fieldName);
58
- const propagatedFields = sanitizedFields.map((field) => ({
59
- ...field,
60
- sectionTitle: section.title ?? field.sectionTitle
61
- }));
62
- return {
63
- ...section,
64
- id: fallbackId,
65
- fields: propagatedFields,
66
- properties,
67
- required
68
- };
69
- };
70
- const sanitizeSections = (sections) => (sections ?? []).map((section, index) => rebuildSectionMeta(section, index));
71
- const sectionsToParametersValue = (sections) => {
72
- const sanitizedSections = sanitizeSections(sections);
73
- if (!sanitizedSections.length) {
74
- return void 0;
75
- }
76
- const templates = sanitizedSections.map((section) => {
77
- const properties = section.properties ?? {};
78
- if (!Object.keys(properties).length) {
79
- return null;
80
- }
81
- const template = {
82
- title: section.title,
83
- description: section.description,
84
- required: section.required && section.required.length ? [...section.required] : void 0,
85
- properties: JSON.parse(JSON.stringify(properties))
86
- };
87
- return template;
88
- }).filter((entry) => entry !== null);
89
- if (!templates.length) {
90
- return void 0;
91
- }
92
- return templates.length === 1 ? [templates[0]] : templates;
93
- };
94
- const normalizeParametersToSections = (parameters) => {
95
- if (parameters === void 0 || parameters === null) {
96
- return [];
97
- }
98
- const entries = Array.isArray(parameters) ? parameters : [parameters];
99
- const sections = [];
100
- entries.forEach((entry, index) => {
101
- if (!entry || typeof entry !== "object") {
102
- return;
103
- }
104
- const record = entry;
105
- const steps = Array.isArray(record.steps) ? record.steps : [];
106
- if (steps.length > 0) {
107
- steps.forEach((step, stepIndex) => {
108
- if (!step || typeof step !== "object") {
109
- return;
110
- }
111
- const schema2 = step.schema;
112
- if (!schema2 || typeof schema2 !== "object") {
113
- return;
114
- }
115
- const sectionSchema = schema2;
116
- const stepRecord = step;
117
- const sectionTitle = asString(stepRecord.title) ?? asString(sectionSchema.title) ?? `Step ${stepIndex + 1}`;
118
- const sectionDescription = asString(stepRecord.description) ?? asString(sectionSchema.description);
119
- const sectionProperties2 = asSchemaRecord(sectionSchema.properties) ?? {};
120
- const required = asStringArray(sectionSchema.required) ?? [];
121
- const sectionId2 = `section-${index}-step-${stepIndex}`;
122
- sections.push({
123
- id: sectionId2,
124
- title: sectionTitle,
125
- description: sectionDescription,
126
- properties: sectionProperties2,
127
- required,
128
- fields: buildFieldsForSection(
129
- sectionId2,
130
- sectionTitle,
131
- sectionProperties2,
132
- required
133
- )
134
- });
135
- });
136
- return;
137
- }
138
- const schema = record;
139
- const schemaTitle = asString(schema.title);
140
- const schemaDescription = asString(schema.description);
141
- const sectionProperties = asSchemaRecord(schema.properties);
142
- if (sectionProperties && Object.keys(sectionProperties).length > 0) {
143
- const required = asStringArray(schema.required) ?? [];
144
- const sectionId2 = `section-${index}`;
145
- sections.push({
146
- id: sectionId2,
147
- title: schemaTitle ?? `Section ${index + 1}`,
148
- description: schemaDescription,
149
- properties: sectionProperties,
150
- required,
151
- fields: buildFieldsForSection(
152
- sectionId2,
153
- schemaTitle,
154
- sectionProperties,
155
- required
156
- )
157
- });
158
- return;
159
- }
160
- const parameterSchema = entry;
161
- const fallbackKey = schemaTitle ?? `field-${index + 1}`;
162
- const sectionId = `section-${index}`;
163
- const fallbackProperties = {
164
- [fallbackKey]: parameterSchema
165
- };
166
- sections.push({
167
- id: sectionId,
168
- title: schemaTitle ?? `Section ${index + 1}`,
169
- description: schemaDescription,
170
- properties: fallbackProperties,
171
- required: [],
172
- fields: buildFieldsForSection(
173
- sectionId,
174
- schemaTitle,
175
- fallbackProperties,
176
- []
177
- )
178
- });
179
- });
180
- return sections;
181
- };
182
-
183
- export { normalizeParametersToSections, sanitizeSections, sectionsToParametersValue };
184
- //# sourceMappingURL=parameterTransforms.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parameterTransforms.esm.js","sources":["../../../src/components/DesignerFlow/parameterTransforms.ts"],"sourcesContent":["import type {\n TemplateParameterSchema,\n TemplateParametersV1beta3,\n} from \"@backstage/plugin-scaffolder-common\";\nimport type {\n ParameterFieldDisplay,\n ParameterSectionDisplay,\n TemplateParametersValue,\n} from \"../Nodes/types\";\n\ntype ParameterPropertySchema = Record<string, unknown>;\n\nconst asString = (value: unknown): string | undefined =>\n typeof value === \"string\" ? value : undefined;\n\nconst asStringArray = (value: unknown): string[] | undefined =>\n Array.isArray(value) && value.every((item) => typeof item === \"string\")\n ? (value as string[])\n : undefined;\n\nconst asSchemaRecord = (\n value: unknown\n): Record<string, ParameterPropertySchema> | undefined => {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return undefined;\n }\n return value as Record<string, ParameterPropertySchema>;\n};\n\nconst cloneSchema = (\n schema?: ParameterPropertySchema\n): ParameterPropertySchema | undefined => {\n if (!schema) {\n return undefined;\n }\n return JSON.parse(JSON.stringify(schema)) as ParameterPropertySchema;\n};\n\nconst buildDefaultSchema = (fieldName: string): ParameterPropertySchema => ({\n title: fieldName || \"Field\",\n type: \"string\",\n});\n\nconst buildFieldsForSection = (\n sectionId: string,\n sectionTitle: string | undefined,\n properties?: Record<string, ParameterPropertySchema>,\n requiredList?: string[]\n): ParameterFieldDisplay[] => {\n if (!properties) {\n return [];\n }\n\n return Object.entries(properties).map(([fieldName, schema], fieldIndex) => {\n const isRequired =\n Array.isArray(requiredList) && requiredList.includes(fieldName);\n const safeSchema = cloneSchema(schema) ?? buildDefaultSchema(fieldName);\n return {\n id: `${sectionId}-field-${fieldIndex}`,\n fieldName,\n sectionId,\n sectionTitle,\n required: Boolean(isRequired),\n schema: safeSchema,\n };\n });\n};\n\nconst sanitizeField = (\n field: ParameterFieldDisplay,\n fallbackSectionId: string,\n index: number\n): ParameterFieldDisplay => {\n const fieldId = field.id ?? `${fallbackSectionId}-field-${index}`;\n return {\n ...field,\n id: fieldId,\n sectionId: field.sectionId ?? fallbackSectionId,\n schema: cloneSchema(field.schema) ?? buildDefaultSchema(field.fieldName),\n };\n};\n\nconst rebuildSectionMeta = (\n section: ParameterSectionDisplay,\n index: number\n): ParameterSectionDisplay => {\n const fallbackId = section.id ?? `section-${index}`;\n const sanitizedFields = (section.fields ?? []).map((field, fieldIndex) =>\n sanitizeField(field, fallbackId, fieldIndex)\n );\n\n const properties = sanitizedFields.reduce<\n Record<string, ParameterPropertySchema>\n >((acc, field) => {\n if (!field.fieldName) {\n return acc;\n }\n acc[field.fieldName] =\n cloneSchema(field.schema) ?? buildDefaultSchema(field.fieldName);\n return acc;\n }, {});\n\n const required = sanitizedFields\n .filter((field) => field.required && field.fieldName)\n .map((field) => field.fieldName);\n\n const propagatedFields = sanitizedFields.map((field) => ({\n ...field,\n sectionTitle: section.title ?? field.sectionTitle,\n }));\n\n return {\n ...section,\n id: fallbackId,\n fields: propagatedFields,\n properties,\n required,\n };\n};\n\nexport const sanitizeSections = (\n sections: ParameterSectionDisplay[] | undefined\n): ParameterSectionDisplay[] =>\n (sections ?? []).map((section, index) => rebuildSectionMeta(section, index));\n\nexport const sectionsToParametersValue = (\n sections: ParameterSectionDisplay[]\n): TemplateParametersValue => {\n const sanitizedSections = sanitizeSections(sections);\n if (!sanitizedSections.length) {\n return undefined;\n }\n\n const templates = sanitizedSections\n .map((section) => {\n const properties = section.properties ?? {};\n if (!Object.keys(properties).length) {\n return null;\n }\n const template: TemplateParametersV1beta3 = {\n title: section.title,\n description: section.description,\n required:\n section.required && section.required.length\n ? [...section.required]\n : undefined,\n properties: JSON.parse(JSON.stringify(properties)),\n };\n return template;\n })\n .filter((entry): entry is TemplateParametersV1beta3 => entry !== null);\n\n if (!templates.length) {\n return undefined;\n }\n\n return templates.length === 1 ? [templates[0]] : templates;\n};\n\nexport const normalizeParametersToSections = (\n parameters: TemplateParametersValue\n): ParameterSectionDisplay[] => {\n if (parameters === undefined || parameters === null) {\n return [];\n }\n\n const entries = Array.isArray(parameters) ? parameters : [parameters];\n const sections: ParameterSectionDisplay[] = [];\n\n entries.forEach((entry, index) => {\n if (!entry || typeof entry !== \"object\") {\n return;\n }\n\n const record = entry as Record<string, any>;\n const steps = Array.isArray(record.steps) ? record.steps : [];\n if (steps.length > 0) {\n steps.forEach((step, stepIndex) => {\n if (!step || typeof step !== \"object\") {\n return;\n }\n const schema = (step as Record<string, any>).schema;\n if (!schema || typeof schema !== \"object\") {\n return;\n }\n const sectionSchema = schema as TemplateParametersV1beta3;\n const stepRecord = step as Record<string, any>;\n const sectionTitle =\n asString(stepRecord.title) ??\n asString(sectionSchema.title) ??\n `Step ${stepIndex + 1}`;\n const sectionDescription =\n asString(stepRecord.description) ??\n asString(sectionSchema.description);\n const sectionProperties =\n asSchemaRecord(sectionSchema.properties) ?? {};\n const required = asStringArray(sectionSchema.required) ?? [];\n const sectionId = `section-${index}-step-${stepIndex}`;\n sections.push({\n id: sectionId,\n title: sectionTitle,\n description: sectionDescription,\n properties: sectionProperties,\n required,\n fields: buildFieldsForSection(\n sectionId,\n sectionTitle,\n sectionProperties,\n required\n ),\n });\n });\n return;\n }\n\n const schema = record as TemplateParametersV1beta3;\n const schemaTitle = asString(schema.title);\n const schemaDescription = asString(schema.description);\n const sectionProperties = asSchemaRecord(schema.properties);\n\n if (sectionProperties && Object.keys(sectionProperties).length > 0) {\n const required = asStringArray(schema.required) ?? [];\n const sectionId = `section-${index}`;\n sections.push({\n id: sectionId,\n title: schemaTitle ?? `Section ${index + 1}`,\n description: schemaDescription,\n properties: sectionProperties,\n required,\n fields: buildFieldsForSection(\n sectionId,\n schemaTitle,\n sectionProperties,\n required\n ),\n });\n return;\n }\n\n const parameterSchema = entry as TemplateParameterSchema;\n const fallbackKey = schemaTitle ?? `field-${index + 1}`;\n const sectionId = `section-${index}`;\n const fallbackProperties: Record<string, ParameterPropertySchema> = {\n [fallbackKey]: parameterSchema as ParameterPropertySchema,\n };\n\n sections.push({\n id: sectionId,\n title: schemaTitle ?? `Section ${index + 1}`,\n description: schemaDescription,\n properties: fallbackProperties,\n required: [],\n fields: buildFieldsForSection(\n sectionId,\n schemaTitle,\n fallbackProperties,\n []\n ),\n });\n });\n\n return sections;\n};\n"],"names":["schema","sectionProperties","sectionId"],"mappings":"AAYA,MAAM,WAAW,CAAC,KAAA,KAChB,OAAO,KAAA,KAAU,WAAW,KAAA,GAAQ,MAAA;AAEtC,MAAM,aAAA,GAAgB,CAAC,KAAA,KACrB,KAAA,CAAM,QAAQ,KAAK,CAAA,IAAK,KAAA,CAAM,KAAA,CAAM,CAAC,IAAA,KAAS,OAAO,IAAA,KAAS,QAAQ,IACjE,KAAA,GACD,MAAA;AAEN,MAAM,cAAA,GAAiB,CACrB,KAAA,KACwD;AACxD,EAAA,IAAI,CAAC,SAAS,OAAO,KAAA,KAAU,YAAY,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AAC/D,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,KAAA;AACT,CAAA;AAEA,MAAM,WAAA,GAAc,CAClB,MAAA,KACwC;AACxC,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,SAAA,CAAU,MAAM,CAAC,CAAA;AAC1C,CAAA;AAEA,MAAM,kBAAA,GAAqB,CAAC,SAAA,MAAgD;AAAA,EAC1E,OAAO,SAAA,IAAa,OAAA;AAAA,EACpB,I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