windmill-components 1.28.3 → 1.28.4

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.
@@ -50,14 +50,16 @@ $: {
50
50
  evalValueToRaw();
51
51
  validateInput(pattern, value);
52
52
  }
53
- if (defaultValue) {
54
- let stringified = JSON.stringify(defaultValue, null, 4);
55
- if (stringified.length > 50) {
56
- minRows = 3;
57
- }
58
- if (type != 'string') {
59
- minRows = Math.max(minRows, Math.min(stringified.split(/\r\n|\r|\n/).length + 1, maxRows));
60
- }
53
+ }
54
+ $: {
55
+ defaultValue && recomputeRowSize(JSON.stringify(defaultValue, null, 4));
56
+ }
57
+ function recomputeRowSize(str) {
58
+ if (str.length > 50) {
59
+ minRows = 3;
60
+ }
61
+ if (type != 'string') {
62
+ minRows = Math.max(minRows, Math.min(str.split(/\r\n|\r|\n/).length + 1, maxRows));
61
63
  }
62
64
  }
63
65
  export function evalValueToRaw() {
@@ -240,6 +242,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
240
242
  <textarea
241
243
  {disabled}
242
244
  style="min-height: {minHeight}; max-height: {maxHeight}"
245
+ on:input={async () => recomputeRowSize(rawValue ?? '')}
243
246
  class="col-span-10 {valid
244
247
  ? ''
245
248
  : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
@@ -290,7 +293,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
290
293
  : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
291
294
  placeholder={defaultValue ?? ''}
292
295
  bind:value
293
- on:input={() => dispatch('input', { rawValue: value, isRaw: false })}
296
+ on:input={async () => {
297
+ recomputeRowSize(value)
298
+ dispatch('input', { rawValue: value, isRaw: false })
299
+ }}
294
300
  />
295
301
  {/if}
296
302
  {#if !required && inputCat != 'resource-object'}
@@ -94,6 +94,7 @@ function toAny(x) {
94
94
  </div>
95
95
  <div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4 w-full">
96
96
  <div class="w-full">
97
+ <span class="text-black">{mod?.summary ?? ''}</span>
97
98
  <p class="text-sm text-gray-500">
98
99
  {#if mod?.value?.type == 'script'}
99
100
  Script at path <a
@@ -123,18 +123,14 @@ export async function loadSchemaFromModule(module) {
123
123
  schema: emptySchema()
124
124
  };
125
125
  }
126
+ const returnStatementRegex = new RegExp(/\$\{(.*)\}/);
126
127
  export function isCodeInjection(expr) {
127
128
  if (!expr) {
128
129
  return false;
129
130
  }
130
131
  const lines = expr.split('\n');
131
132
  const [returnStatement] = lines.reverse();
132
- const returnStatementRegex = new RegExp(/\$\{(.*)\}/);
133
- if (returnStatementRegex.test(returnStatement)) {
134
- const [_, argName] = returnStatement.split(returnStatementRegex);
135
- return Boolean(argName);
136
- }
137
- return false;
133
+ return returnStatementRegex.test(returnStatement);
138
134
  }
139
135
  export function getDefaultExpr(i, key = 'myfield', previousExpr) {
140
136
  const expr = previousExpr ?? `previous_result.${key}`;
@@ -1,6 +1,6 @@
1
1
  export const OpenAPI = {
2
2
  BASE: '/api',
3
- VERSION: '1.27.2',
3
+ VERSION: '1.28.1',
4
4
  WITH_CREDENTIALS: false,
5
5
  CREDENTIALS: 'include',
6
6
  TOKEN: undefined,
@@ -5,4 +5,5 @@ export declare type FlowModule = {
5
5
  value: FlowModuleValue;
6
6
  stop_after_if_expr?: string;
7
7
  skip_if_stopped?: boolean;
8
+ summary?: string;
8
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.28.3",
3
+ "version": "1.28.4",
4
4
  "devDependencies": {
5
5
  "@playwright/test": "^1.24.2",
6
6
  "@sveltejs/adapter-static": "^1.0.0-next.37",