@keycloakify/svelte 0.1.6 → 0.1.8

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.
@@ -104,7 +104,7 @@ function readThisNpmPackageVersion() {
104
104
  /***/ }),
105
105
 
106
106
  /***/ 479:
107
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
107
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
108
108
 
109
109
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
110
110
  /* harmony export */ JS: () => (/* binding */ runPrettier),
@@ -125,6 +125,7 @@ function readThisNpmPackageVersion() {
125
125
  /* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(886);
126
126
  /* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(399);
127
127
  /* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(704);
128
+ /* module decorator */ module = __webpack_require__.hmd(module);
128
129
 
129
130
 
130
131
 
@@ -161,7 +162,17 @@ async function getPrettier() {
161
162
  // So we do a sketchy eval to bypass ncc.
162
163
  // We make sure to only do that when linking, otherwise we import properly.
163
164
  if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_8__/* .readThisNpmPackageVersion */ .M)().startsWith('0.0.0')) {
164
- eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__/* .symToStr */ .I)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'))}")`);
165
+ const prettierDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'));
166
+ const isCJS = true && module.exports;
167
+ if (isCJS) {
168
+ eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__/* .symToStr */ .I)({ prettier })} = require("${prettierDirPath}")`);
169
+ }
170
+ else {
171
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
172
+ prettier = await new Promise((_resolve) => {
173
+ eval(`import("file:///${(0,path__WEBPACK_IMPORTED_MODULE_3__.join)(prettierDirPath, 'index.mjs').replace(/\\/g, '/')}").then(prettier => _resolve(prettier))`);
174
+ });
175
+ }
165
176
  (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!(0,tsafe_is__WEBPACK_IMPORTED_MODULE_5__.is)(prettier));
166
177
  break import_prettier;
167
178
  }
@@ -175,10 +186,7 @@ async function getPrettier() {
175
186
  const data = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.readFile(configFilePath);
176
187
  return crypto__WEBPACK_IMPORTED_MODULE_1__.createHash('sha256').update(data).digest('hex');
177
188
  })();
178
- const prettierAndConfig = {
179
- prettier,
180
- configHash,
181
- };
189
+ const prettierAndConfig = { prettier, configHash };
182
190
  getPrettier.cache = prettierAndConfig;
183
191
  return prettierAndConfig;
184
192
  }
@@ -187,9 +195,7 @@ async function runPrettier(params) {
187
195
  let formattedSourceCode;
188
196
  try {
189
197
  const { prettier } = await getPrettier();
190
- const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
191
- resolveConfig: true,
192
- });
198
+ const { ignored, inferredParser } = await prettier.getFileInfo(filePath, { resolveConfig: true });
193
199
  if (ignored) {
194
200
  return sourceCode;
195
201
  }
@@ -796,7 +796,7 @@ function readThisNpmPackageVersion() {
796
796
  /***/ }),
797
797
 
798
798
  /***/ 479:
799
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
799
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
800
800
 
801
801
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
802
802
  /* harmony export */ JS: () => (/* binding */ runPrettier),
@@ -817,6 +817,7 @@ function readThisNpmPackageVersion() {
817
817
  /* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(886);
818
818
  /* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(399);
819
819
  /* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(704);
820
+ /* module decorator */ module = __webpack_require__.hmd(module);
820
821
 
821
822
 
822
823
 
@@ -853,7 +854,17 @@ async function getPrettier() {
853
854
  // So we do a sketchy eval to bypass ncc.
854
855
  // We make sure to only do that when linking, otherwise we import properly.
855
856
  if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_8__/* .readThisNpmPackageVersion */ .M)().startsWith('0.0.0')) {
856
- eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__/* .symToStr */ .I)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'))}")`);
857
+ const prettierDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'));
858
+ const isCJS = true && module.exports;
859
+ if (isCJS) {
860
+ eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__/* .symToStr */ .I)({ prettier })} = require("${prettierDirPath}")`);
861
+ }
862
+ else {
863
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
864
+ prettier = await new Promise((_resolve) => {
865
+ eval(`import("file:///${(0,path__WEBPACK_IMPORTED_MODULE_3__.join)(prettierDirPath, 'index.mjs').replace(/\\/g, '/')}").then(prettier => _resolve(prettier))`);
866
+ });
867
+ }
857
868
  (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!(0,tsafe_is__WEBPACK_IMPORTED_MODULE_5__.is)(prettier));
858
869
  break import_prettier;
859
870
  }
@@ -867,10 +878,7 @@ async function getPrettier() {
867
878
  const data = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.readFile(configFilePath);
868
879
  return crypto__WEBPACK_IMPORTED_MODULE_1__.createHash('sha256').update(data).digest('hex');
869
880
  })();
870
- const prettierAndConfig = {
871
- prettier,
872
- configHash,
873
- };
881
+ const prettierAndConfig = { prettier, configHash };
874
882
  getPrettier.cache = prettierAndConfig;
875
883
  return prettierAndConfig;
876
884
  }
@@ -879,9 +887,7 @@ async function runPrettier(params) {
879
887
  let formattedSourceCode;
880
888
  try {
881
889
  const { prettier } = await getPrettier();
882
- const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
883
- resolveConfig: true,
884
- });
890
+ const { ignored, inferredParser } = await prettier.getFileInfo(filePath, { resolveConfig: true });
885
891
  if (ignored) {
886
892
  return sourceCode;
887
893
  }
@@ -1018,15 +1018,15 @@ const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z
1018
1018
  const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
1019
1019
  const dateRegex = new RegExp(`^${dateRegexSource}$`);
1020
1020
  function timeRegexSource(args) {
1021
- // let regex = `\\d{2}:\\d{2}:\\d{2}`;
1022
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
1021
+ let secondsRegexSource = `[0-5]\\d`;
1023
1022
  if (args.precision) {
1024
- regex = `${regex}\\.\\d{${args.precision}}`;
1023
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
1025
1024
  }
1026
1025
  else if (args.precision == null) {
1027
- regex = `${regex}(\\.\\d+)?`;
1026
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
1028
1027
  }
1029
- return regex;
1028
+ const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
1029
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
1030
1030
  }
1031
1031
  function timeRegex(args) {
1032
1032
  return new RegExp(`^${timeRegexSource(args)}$`);
@@ -245,7 +245,7 @@ function readThisNpmPackageVersion() {
245
245
  /***/ }),
246
246
 
247
247
  /***/ 479:
248
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
248
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
249
249
 
250
250
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
251
251
  /* harmony export */ JS: () => (/* binding */ runPrettier),
@@ -266,6 +266,7 @@ function readThisNpmPackageVersion() {
266
266
  /* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(886);
267
267
  /* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(399);
268
268
  /* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(704);
269
+ /* module decorator */ module = __webpack_require__.hmd(module);
269
270
 
270
271
 
271
272
 
@@ -302,7 +303,17 @@ async function getPrettier() {
302
303
  // So we do a sketchy eval to bypass ncc.
303
304
  // We make sure to only do that when linking, otherwise we import properly.
304
305
  if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_8__/* .readThisNpmPackageVersion */ .M)().startsWith('0.0.0')) {
305
- eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__/* .symToStr */ .I)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'))}")`);
306
+ const prettierDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'));
307
+ const isCJS = true && module.exports;
308
+ if (isCJS) {
309
+ eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__/* .symToStr */ .I)({ prettier })} = require("${prettierDirPath}")`);
310
+ }
311
+ else {
312
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
313
+ prettier = await new Promise((_resolve) => {
314
+ eval(`import("file:///${(0,path__WEBPACK_IMPORTED_MODULE_3__.join)(prettierDirPath, 'index.mjs').replace(/\\/g, '/')}").then(prettier => _resolve(prettier))`);
315
+ });
316
+ }
306
317
  (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!(0,tsafe_is__WEBPACK_IMPORTED_MODULE_5__.is)(prettier));
307
318
  break import_prettier;
308
319
  }
@@ -316,10 +327,7 @@ async function getPrettier() {
316
327
  const data = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.readFile(configFilePath);
317
328
  return crypto__WEBPACK_IMPORTED_MODULE_1__.createHash('sha256').update(data).digest('hex');
318
329
  })();
319
- const prettierAndConfig = {
320
- prettier,
321
- configHash,
322
- };
330
+ const prettierAndConfig = { prettier, configHash };
323
331
  getPrettier.cache = prettierAndConfig;
324
332
  return prettierAndConfig;
325
333
  }
@@ -328,9 +336,7 @@ async function runPrettier(params) {
328
336
  let formattedSourceCode;
329
337
  try {
330
338
  const { prettier } = await getPrettier();
331
- const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
332
- resolveConfig: true,
333
- });
339
+ const { ignored, inferredParser } = await prettier.getFileInfo(filePath, { resolveConfig: true });
334
340
  if (ignored) {
335
341
  return sourceCode;
336
342
  }
@@ -877,7 +877,7 @@ function readThisNpmPackageVersion() {
877
877
  /***/ }),
878
878
 
879
879
  /***/ 479:
880
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
880
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
881
881
 
882
882
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
883
883
  /* harmony export */ JS: () => (/* binding */ runPrettier),
@@ -898,6 +898,7 @@ function readThisNpmPackageVersion() {
898
898
  /* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(886);
899
899
  /* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(399);
900
900
  /* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(704);
901
+ /* module decorator */ module = __webpack_require__.hmd(module);
901
902
 
902
903
 
903
904
 
@@ -934,7 +935,17 @@ async function getPrettier() {
934
935
  // So we do a sketchy eval to bypass ncc.
935
936
  // We make sure to only do that when linking, otherwise we import properly.
936
937
  if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_8__/* .readThisNpmPackageVersion */ .M)().startsWith('0.0.0')) {
937
- eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__/* .symToStr */ .I)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'))}")`);
938
+ const prettierDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'));
939
+ const isCJS = true && module.exports;
940
+ if (isCJS) {
941
+ eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_9__/* .symToStr */ .I)({ prettier })} = require("${prettierDirPath}")`);
942
+ }
943
+ else {
944
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
945
+ prettier = await new Promise((_resolve) => {
946
+ eval(`import("file:///${(0,path__WEBPACK_IMPORTED_MODULE_3__.join)(prettierDirPath, 'index.mjs').replace(/\\/g, '/')}").then(prettier => _resolve(prettier))`);
947
+ });
948
+ }
938
949
  (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!(0,tsafe_is__WEBPACK_IMPORTED_MODULE_5__.is)(prettier));
939
950
  break import_prettier;
940
951
  }
@@ -948,10 +959,7 @@ async function getPrettier() {
948
959
  const data = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.readFile(configFilePath);
949
960
  return crypto__WEBPACK_IMPORTED_MODULE_1__.createHash('sha256').update(data).digest('hex');
950
961
  })();
951
- const prettierAndConfig = {
952
- prettier,
953
- configHash,
954
- };
962
+ const prettierAndConfig = { prettier, configHash };
955
963
  getPrettier.cache = prettierAndConfig;
956
964
  return prettierAndConfig;
957
965
  }
@@ -960,9 +968,7 @@ async function runPrettier(params) {
960
968
  let formattedSourceCode;
961
969
  try {
962
970
  const { prettier } = await getPrettier();
963
- const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
964
- resolveConfig: true,
965
- });
971
+ const { ignored, inferredParser } = await prettier.getFileInfo(filePath, { resolveConfig: true });
966
972
  if (ignored) {
967
973
  return sourceCode;
968
974
  }
@@ -2299,6 +2299,21 @@ function is(value) {
2299
2299
  /******/ };
2300
2300
  /******/ })();
2301
2301
  /******/
2302
+ /******/ /* webpack/runtime/harmony module decorator */
2303
+ /******/ (() => {
2304
+ /******/ __nccwpck_require__.hmd = (module) => {
2305
+ /******/ module = Object.create(module);
2306
+ /******/ if (!module.children) module.children = [];
2307
+ /******/ Object.defineProperty(module, 'exports', {
2308
+ /******/ enumerable: true,
2309
+ /******/ set: () => {
2310
+ /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
2311
+ /******/ }
2312
+ /******/ });
2313
+ /******/ return module;
2314
+ /******/ };
2315
+ /******/ })();
2316
+ /******/
2302
2317
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
2303
2318
  /******/ (() => {
2304
2319
  /******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
@@ -11,7 +11,13 @@
11
11
  const inputType = attribute.annotations.inputType ?? '';
12
12
  </script>
13
13
 
14
- {#if inputType === 'textarea'}
14
+ {#if inputType === 'hidden'}
15
+ <input
16
+ type="hidden"
17
+ name={attribute.name}
18
+ value={valueOrValues}
19
+ />
20
+ {:else if inputType === 'textarea'}
15
21
  <TextareaTag
16
22
  {...props}
17
23
  {displayableErrors}
@@ -61,7 +61,10 @@
61
61
  {/if}
62
62
  <div
63
63
  class={kcClsx('kcFormGroupClass')}
64
- style:display={attribute.name === 'password-confirm' && !doMakeUserConfirmPassword ? 'none' : undefined}
64
+ style:display={attribute.annotations.inputType === 'hidden' ||
65
+ (attribute.name === 'password-confirm' && !doMakeUserConfirmPassword)
66
+ ? 'none'
67
+ : undefined}
65
68
  >
66
69
  <div class={kcClsx('kcLabelWrapperClass')}>
67
70
  <label
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keycloakify/svelte",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Svelte Components for Keycloakify",
5
5
  "keywords": [
6
6
  "keycloak",
@@ -436,34 +436,34 @@
436
436
  "svelte": "^5.0.0"
437
437
  },
438
438
  "devDependencies": {
439
- "@sveltejs/adapter-auto": "^4.0.0",
440
- "@sveltejs/kit": "^2.19.0",
441
- "@sveltejs/package": "^2.3.10",
439
+ "@sveltejs/adapter-auto": "^6.0.1",
440
+ "@sveltejs/kit": "^2.21.0",
441
+ "@sveltejs/package": "^2.3.11",
442
442
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
443
443
  "@types/eslint": "^9.6.1",
444
- "@types/node": "^22.13.10",
444
+ "@types/node": "^22.15.18",
445
445
  "@vercel/ncc": "^0.38.3",
446
446
  "conventional-changelog-cli": "^5.0.0",
447
447
  "cz-conventional-changelog": "^3.3.0",
448
448
  "cli-select": "^1.1.2",
449
- "eslint": "9.22.0",
450
- "eslint-config-prettier": "^10.1.1",
451
- "eslint-plugin-prettier": "^5.2.3",
452
- "eslint-plugin-svelte": "^3.1.0",
449
+ "eslint": "9.26.0",
450
+ "eslint-config-prettier": "^10.1.5",
451
+ "eslint-plugin-prettier": "^5.4.0",
452
+ "eslint-plugin-svelte": "^3.7.0",
453
453
  "eslint-plugin-unused-imports": "^4.1.4",
454
- "globals": "^16.0.0",
455
- "keycloakify": "^11.8.17",
456
- "npm-check-updates": "^17.1.15",
454
+ "globals": "^16.1.0",
455
+ "keycloakify": "^11.8.27",
456
+ "npm-check-updates": "^18.0.1",
457
457
  "prettier": "^3.5.3",
458
- "prettier-plugin-svelte": "^3.3.3",
458
+ "prettier-plugin-svelte": "^3.4.0",
459
459
  "publint": "0.2.12",
460
- "svelte": "^5.22.6",
461
- "svelte-check": "^4.1.5",
462
- "tsx": "^4.19.3",
463
- "typescript": "~5.8.2",
464
- "typescript-eslint": "^8.26.0",
465
- "vite": "^6.2.1",
466
- "zod": "^3.24.2"
460
+ "svelte": "^5.30.1",
461
+ "svelte-check": "^4.2.1",
462
+ "tsx": "^4.19.4",
463
+ "typescript": "~5.8.3",
464
+ "typescript-eslint": "^8.32.1",
465
+ "vite": "^6.3.5",
466
+ "zod": "^3.24.4"
467
467
  },
468
468
  "bin": {
469
469
  "_keycloakify-custom-handler": "keycloakify-svelte/bin/index.js"
@@ -29,10 +29,7 @@ export async function getIsPrettierAvailable(): Promise<boolean> {
29
29
  return isPrettierAvailable;
30
30
  }
31
31
 
32
- type PrettierAndConfigHash = {
33
- prettier: typeof import('prettier');
34
- configHash: string;
35
- };
32
+ type PrettierAndConfigHash = { prettier: typeof import('prettier'); configHash: string };
36
33
 
37
34
  getPrettier.cache = id<PrettierAndConfigHash | undefined>(undefined);
38
35
 
@@ -51,9 +48,20 @@ export async function getPrettier(): Promise<PrettierAndConfigHash> {
51
48
  // So we do a sketchy eval to bypass ncc.
52
49
  // We make sure to only do that when linking, otherwise we import properly.
53
50
  if (readThisNpmPackageVersion().startsWith('0.0.0')) {
54
- eval(
55
- `${symToStr({ prettier })} = require("${pathResolve(pathJoin(getNodeModulesBinDirPath(), '..', 'prettier'))}")`,
56
- );
51
+ const prettierDirPath = pathResolve(pathJoin(getNodeModulesBinDirPath(), '..', 'prettier'));
52
+
53
+ const isCJS = typeof module !== 'undefined' && module.exports;
54
+
55
+ if (isCJS) {
56
+ eval(`${symToStr({ prettier })} = require("${prettierDirPath}")`);
57
+ } else {
58
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
59
+ prettier = await new Promise((_resolve) => {
60
+ eval(
61
+ `import("file:///${pathJoin(prettierDirPath, 'index.mjs').replace(/\\/g, '/')}").then(prettier => _resolve(prettier))`,
62
+ );
63
+ });
64
+ }
57
65
 
58
66
  assert(!is<undefined>(prettier));
59
67
 
@@ -75,10 +83,7 @@ export async function getPrettier(): Promise<PrettierAndConfigHash> {
75
83
  return crypto.createHash('sha256').update(data).digest('hex');
76
84
  })();
77
85
 
78
- const prettierAndConfig: PrettierAndConfigHash = {
79
- prettier,
80
- configHash,
81
- };
86
+ const prettierAndConfig: PrettierAndConfigHash = { prettier, configHash };
82
87
 
83
88
  getPrettier.cache = prettierAndConfig;
84
89
 
@@ -93,9 +98,7 @@ export async function runPrettier(params: { sourceCode: string; filePath: string
93
98
  try {
94
99
  const { prettier } = await getPrettier();
95
100
 
96
- const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
97
- resolveConfig: true,
98
- });
101
+ const { ignored, inferredParser } = await prettier.getFileInfo(filePath, { resolveConfig: true });
99
102
 
100
103
  if (ignored) {
101
104
  return sourceCode;
@@ -11,7 +11,13 @@
11
11
  const inputType = attribute.annotations.inputType ?? '';
12
12
  </script>
13
13
 
14
- {#if inputType === 'textarea'}
14
+ {#if inputType === 'hidden'}
15
+ <input
16
+ type="hidden"
17
+ name={attribute.name}
18
+ value={valueOrValues}
19
+ />
20
+ {:else if inputType === 'textarea'}
15
21
  <TextareaTag
16
22
  {...props}
17
23
  {displayableErrors}
@@ -61,7 +61,10 @@
61
61
  {/if}
62
62
  <div
63
63
  class={kcClsx('kcFormGroupClass')}
64
- style:display={attribute.name === 'password-confirm' && !doMakeUserConfirmPassword ? 'none' : undefined}
64
+ style:display={attribute.annotations.inputType === 'hidden' ||
65
+ (attribute.name === 'password-confirm' && !doMakeUserConfirmPassword)
66
+ ? 'none'
67
+ : undefined}
65
68
  >
66
69
  <div class={kcClsx('kcLabelWrapperClass')}>
67
70
  <label