@sealcode/sealgen 0.14.4 → 0.14.5

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.
@@ -66,12 +66,17 @@ export abstract class StatefulPage<
66
66
  this.wrapInForm(
67
67
  state,
68
68
  await original_render(ctx, state, inputs)
69
- )
69
+ ),
70
+ state
70
71
  );
71
72
  };
72
73
  }
73
74
 
74
- abstract wrapInLayout(ctx: BaseContext, content: Templatable): Templatable;
75
+ abstract wrapInLayout(
76
+ ctx: BaseContext,
77
+ content: Templatable,
78
+ state: State
79
+ ): Templatable;
75
80
 
76
81
  wrapInForm(state: State, content: Templatable): Templatable {
77
82
  return tempstream/* HTML */ `<form action="./" method="POST">
@@ -218,7 +223,7 @@ export abstract class StatefulPage<
218
223
  options
219
224
  );
220
225
  } else if (target.indexOf(item) === -1) {
221
- destination.push(item);
226
+ destination[index] = item;
222
227
  }
223
228
  });
224
229
  return destination;
@@ -0,0 +1,18 @@
1
+ import { toKebabCase, toPascalCase } from "js-convert-case";
2
+
3
+ export function jddComponentTemplate(controller_name: string) {
4
+ return `import { Controller } from "stimulus";
5
+
6
+ export default class ${toPascalCase(controller_name)} extends Controller {
7
+
8
+ connect() {
9
+ console.warn(
10
+ "Remove ${toKebabCase(
11
+ controller_name
12
+ )}.stimulus.ts file if your JDD component doesn't need any browser-side logic"
13
+ );
14
+ }
15
+ }
16
+
17
+ `;
18
+ }