@sealcode/sealgen 0.19.29 → 0.19.31

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.
@@ -1,5 +1,4 @@
1
1
  export * from "./autocomplete.js";
2
- export * from "./big-radio-group.js";
3
2
  export * from "./checkbox-group.js";
4
3
  export * from "./checkbox.js";
5
4
  export { CheckboxedListInput } from "./checkboxed-list-input.js";
@@ -161,10 +161,7 @@ class StructuredArray extends FormFieldControl {
161
161
  ctx.body = this._render(
162
162
  ctx,
163
163
  form_id,
164
- await item.getDecodedBody(
165
- ctx.$context,
166
- {}
167
- )
164
+ await item.getDecodedBody(ctx.$context)
168
165
  );
169
166
  });
170
167
  }
@@ -1,5 +1,4 @@
1
1
  export * from "./autocomplete.js";
2
- export * from "./big-radio-group.js";
3
2
  export * from "./checkbox-group.js";
4
3
  export * from "./checkbox.js";
5
4
  import { CheckboxedListInput } from "./checkboxed-list-input.js";
@@ -20,8 +20,7 @@ class CollectionField extends FormField {
20
20
  const parsed_value = await this.sealiousField.decode(
21
21
  ctx.$context,
22
22
  encoded_value,
23
- null,
24
- this.sealiousField.typeName == "text" ? "original" : {}
23
+ null
25
24
  );
26
25
  return {
27
26
  parsable: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealcode/sealgen",
3
- "version": "0.19.29",
3
+ "version": "0.19.31",
4
4
  "description": "Module to automate adding routes and collections to a sealious application",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -93,7 +93,7 @@
93
93
  "peerDependencies": {
94
94
  "koa": "^2.13.0",
95
95
  "koa-responsive-image-router": "^0.2.24",
96
- "sealious": "^0.21.36",
96
+ "sealious": "^0.21.38",
97
97
  "stimulus": "^3.2.2"
98
98
  }
99
99
  }
@@ -223,10 +223,10 @@ export class StructuredArray<
223
223
  ctx.body = this._render(
224
224
  ctx,
225
225
  form_id,
226
- (await item.getDecodedBody(
227
- ctx.$context,
228
- {}
229
- )) as unknown as Record<string, FormDataValue>
226
+ (await item.getDecodedBody(ctx.$context)) as unknown as Record<
227
+ string,
228
+ FormDataValue
229
+ >
230
230
  );
231
231
  });
232
232
  }
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
3
  import { Context } from "koa";
4
4
  import {
5
- Field as SealiousField,
5
+ ExtractFieldDecoded,
6
6
  FieldTypes as SealiousFieldTypes,
7
7
  } from "sealious";
8
8
  import { CollectionField } from "../fields/collection-field.js";
@@ -10,9 +10,6 @@ import { DropdownOptions, FreeformDropdown } from "./dropdown.js";
10
10
  import { Collection, CollectionItem } from "sealious";
11
11
  import { FormField } from "../../index.js";
12
12
 
13
- export type ExtractFieldDecoded<F extends SealiousField<any, any, any>> =
14
- F extends SealiousField<infer T, unknown, unknown> ? T : never;
15
-
16
13
  export class SingleReferenceDropdown<
17
14
  TargetCollection extends Collection,
18
15
  SealiousField extends SealiousFieldTypes.SingleReference,
@@ -40,8 +40,7 @@ export class CollectionField<
40
40
  const parsed_value = (await this.sealiousField.decode(
41
41
  ctx.$context,
42
42
  encoded_value,
43
- null,
44
- this.sealiousField.typeName == "text" ? "original" : {}
43
+ null
45
44
  )) as ExtractFieldDecoded<F>;
46
45
  return {
47
46
  parsable: true,
package/src/get-fonts.ts CHANGED
@@ -98,7 +98,13 @@ export async function getFonts(_: Record<string, string | boolean> = {}) {
98
98
  } catch {
99
99
  console.info("No fonsta config present, using just google fonts");
100
100
  }
101
- await rmdir("public/tmp");
101
+ try {
102
+ await rmdir("public/tmp");
103
+ } catch {
104
+ console.info(
105
+ "Could not remove ./public/tmp. Maybe it wasn't there in the first place"
106
+ );
107
+ }
102
108
  console.info("Downloaded new fonts pack from Font Squirrel");
103
109
 
104
110
  console.info("Downloaded new fonts pack");
@@ -1,38 +0,0 @@
1
- import { tempstream } from "tempstream";
2
- import { FormFieldControl } from "./form-field-control.js";
3
- class BigRadioGroup extends FormFieldControl {
4
- constructor(field, options) {
5
- super([field]);
6
- this.field = field;
7
- this.options = options;
8
- }
9
- async render(fctx) {
10
- const { raw: current_value } = await this.field.getParsedValue(
11
- fctx.ctx,
12
- fctx.data.raw_values
13
- );
14
- return tempstream`<div class="bigradios">
15
- ${Object.entries(this.options).map(([key, { description }]) => {
16
- const id = `${this.field.name}-radio-${key}`;
17
- return tempstream`<input
18
- type="radio"
19
- name="${this.field.name}"
20
- value="${key}"
21
- id="${id}"
22
- style="display: none"
23
- ${fctx.form_id ? `form=${fctx.form_id}` : ""}
24
- ${this.field.required ? "required" : ""}
25
- ${key == current_value ? "checked" : ""}
26
- />
27
- <div class="bigradio">
28
- ${typeof description == "function" ? description(fctx) : description}
29
- <label class="bigradio__cta" for="${id}">Wybierz</label>
30
- </div>`;
31
- })}
32
- </div>`;
33
- }
34
- }
35
- export {
36
- BigRadioGroup
37
- };
38
- //# sourceMappingURL=big-radio-group.js.map