@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.
- package/@types/forms/controls/controls.d.ts +0 -1
- package/lib/forms/controls/array.js +1 -4
- package/lib/forms/controls/controls.js +0 -1
- package/lib/forms/fields/collection-field.js +1 -2
- package/package.json +2 -2
- package/src/forms/controls/array.ts +4 -4
- package/src/forms/controls/single-reference.ts +1 -4
- package/src/forms/fields/collection-field.ts +1 -2
- package/src/get-fonts.ts +7 -1
- package/lib/forms/controls/big-radio-group.js +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealcode/sealgen",
|
|
3
|
-
"version": "0.19.
|
|
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.
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|