@thunderid/vue 0.12.0 → 0.13.0

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.
@@ -3327,13 +3327,17 @@ const STYLES = [
3327
3327
  *
3328
3328
  * @param vendor - Vendor/brand namespace used to derive the dedupe `<style>` element id
3329
3329
  * (e.g. `${vendor}-vue-styles`). Defaults to `VendorConstants.VENDOR_PREFIX`.
3330
+ * @param nonce - CSP nonce applied to the injected `<style>` element via a `nonce` attribute,
3331
+ * so consuming apps can enforce a strict `style-src` Content-Security-Policy (i.e. without
3332
+ * `'unsafe-inline'`) for this runtime-injected stylesheet.
3330
3333
  */
3331
- function injectStyles(vendor) {
3334
+ function injectStyles(vendor, nonce) {
3332
3335
  if (typeof document === "undefined") return;
3333
3336
  const styleId = `${(0, __thunderid_browser.getVendorPrefix)(vendor)}-vue-styles`;
3334
3337
  if (document.getElementById(styleId)) return;
3335
3338
  const style = document.createElement("style");
3336
3339
  style.id = styleId;
3340
+ if (nonce) style.setAttribute("nonce", nonce);
3337
3341
  style.textContent = STYLES;
3338
3342
  document.head.appendChild(style);
3339
3343
  }
@@ -3367,7 +3371,7 @@ function injectStyles(vendor) {
3367
3371
  * ```
3368
3372
  */
3369
3373
  const ThunderIDPlugin = { install(app, options) {
3370
- injectStyles(options?.vendor);
3374
+ injectStyles(options?.vendor, options?.cspNonce);
3371
3375
  if (options?.mode === "delegated") return;
3372
3376
  app.component("ThunderIDProvider", ThunderIDProvider_default);
3373
3377
  } };
package/dist/index.js CHANGED
@@ -3301,13 +3301,17 @@ const STYLES = [
3301
3301
  *
3302
3302
  * @param vendor - Vendor/brand namespace used to derive the dedupe `<style>` element id
3303
3303
  * (e.g. `${vendor}-vue-styles`). Defaults to `VendorConstants.VENDOR_PREFIX`.
3304
+ * @param nonce - CSP nonce applied to the injected `<style>` element via a `nonce` attribute,
3305
+ * so consuming apps can enforce a strict `style-src` Content-Security-Policy (i.e. without
3306
+ * `'unsafe-inline'`) for this runtime-injected stylesheet.
3304
3307
  */
3305
- function injectStyles(vendor) {
3308
+ function injectStyles(vendor, nonce) {
3306
3309
  if (typeof document === "undefined") return;
3307
3310
  const styleId = `${getVendorPrefix(vendor)}-vue-styles`;
3308
3311
  if (document.getElementById(styleId)) return;
3309
3312
  const style = document.createElement("style");
3310
3313
  style.id = styleId;
3314
+ if (nonce) style.setAttribute("nonce", nonce);
3311
3315
  style.textContent = STYLES;
3312
3316
  document.head.appendChild(style);
3313
3317
  }
@@ -3341,7 +3345,7 @@ function injectStyles(vendor) {
3341
3345
  * ```
3342
3346
  */
3343
3347
  const ThunderIDPlugin = { install(app, options) {
3344
- injectStyles(options?.vendor);
3348
+ injectStyles(options?.vendor, options?.cspNonce);
3345
3349
  if (options?.mode === "delegated") return;
3346
3350
  app.component("ThunderIDProvider", ThunderIDProvider_default);
3347
3351
  } };
@@ -28,6 +28,11 @@ export interface ThunderIDPluginOptions {
28
28
  * Should match the `vendor` passed to `<ThunderIDProvider>`. Defaults to `VendorConstants.VENDOR_PREFIX`.
29
29
  */
30
30
  vendor?: string;
31
+ /**
32
+ * CSP nonce applied to the SDK's runtime-injected `<style>` tag, for apps that enforce
33
+ * a strict `style-src` Content-Security-Policy directive (i.e. without `'unsafe-inline'`).
34
+ */
35
+ cspNonce?: string;
31
36
  }
32
37
  /**
33
38
  * Vue plugin for ThunderID authentication.
@@ -1 +1 @@
1
- {"version":3,"file":"ThunderIDPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/ThunderIDPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAM,MAAM,EAAC,MAAM,KAAK,CAAC;AAIrC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAE/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,eAAe,EAAE,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAYtD,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ThunderIDPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/ThunderIDPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAM,MAAM,EAAC,MAAM,KAAK,CAAC;AAIrC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAE/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,eAAe,EAAE,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAYtD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -4,7 +4,10 @@
4
4
  *
5
5
  * @param vendor - Vendor/brand namespace used to derive the dedupe `<style>` element id
6
6
  * (e.g. `${vendor}-vue-styles`). Defaults to `VendorConstants.VENDOR_PREFIX`.
7
+ * @param nonce - CSP nonce applied to the injected `<style>` element via a `nonce` attribute,
8
+ * so consuming apps can enforce a strict `style-src` Content-Security-Policy (i.e. without
9
+ * `'unsafe-inline'`) for this runtime-injected stylesheet.
7
10
  */
8
- export declare function injectStyles(vendor?: string): void;
11
+ export declare function injectStyles(vendor?: string, nonce?: string): void;
9
12
  export default injectStyles;
10
13
  //# sourceMappingURL=injectStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"injectStyles.d.ts","sourceRoot":"","sources":["../../src/styles/injectStyles.ts"],"names":[],"mappings":"AA4EA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAWlD;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"injectStyles.d.ts","sourceRoot":"","sources":["../../src/styles/injectStyles.ts"],"names":[],"mappings":"AA4EA;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAclE;AAED,eAAe,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thunderid/vue",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Vue SDK for ThunderID",
5
5
  "keywords": [
6
6
  "thunderid",
@@ -37,6 +37,7 @@
37
37
  "@thunderid/eslint-plugin": "0.0.2",
38
38
  "@thunderid/prettier-config": "0.0.2",
39
39
  "@types/node": "24.7.2",
40
+ "@vitest/browser-playwright": "4.1.8",
40
41
  "@vue/test-utils": "2.4.6",
41
42
  "eslint": "9.39.4",
42
43
  "prettier": "3.6.2",
@@ -58,7 +59,7 @@
58
59
  "dependencies": {
59
60
  "dompurify": "3.4.11",
60
61
  "tslib": "2.8.1",
61
- "@thunderid/browser": "^0.12.0"
62
+ "@thunderid/browser": "^0.13.0"
62
63
  },
63
64
  "publishConfig": {
64
65
  "access": "public"