lumiverse-spindle-types 0.5.14 → 0.5.16
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/package.json +1 -1
- package/src/dom.ts +8 -0
- package/src/permissions.ts +5 -1
package/package.json
CHANGED
package/src/dom.ts
CHANGED
|
@@ -259,6 +259,14 @@ export interface SpindleSandboxFrameOptions {
|
|
|
259
259
|
minHeight?: number;
|
|
260
260
|
/** Maximum host iframe height in CSS pixels. Default: `4000`. */
|
|
261
261
|
maxHeight?: number;
|
|
262
|
+
/**
|
|
263
|
+
* Opt this frame into CSP 'unsafe-eval' so the iframe can use eval / new
|
|
264
|
+
* Function (e.g. frameworks that compile templates at runtime). Requires the
|
|
265
|
+
* extension to hold the privileged `unsafe_eval` permission, otherwise the
|
|
266
|
+
* host ignores this and the frame's CSP stays default (unsafe-inline only).
|
|
267
|
+
* Default: false.
|
|
268
|
+
*/
|
|
269
|
+
allowEval?: boolean;
|
|
262
270
|
}
|
|
263
271
|
|
|
264
272
|
export interface SpindleSandboxFrameHandle {
|
package/src/permissions.ts
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
* - "web_search" — execute searches via the user's configured web search
|
|
23
23
|
* provider (e.g. SearXNG) and read the safe view of their
|
|
24
24
|
* web search settings (never the API key).
|
|
25
|
+
* - "unsafe_eval" — opt a sandboxed widget frame into CSP 'unsafe-eval'
|
|
26
|
+
* (eval / new Function) for runtime-compiling frameworks.
|
|
25
27
|
*/
|
|
26
28
|
export type SpindlePermission =
|
|
27
29
|
| "generation"
|
|
@@ -48,7 +50,8 @@ export type SpindlePermission =
|
|
|
48
50
|
| "images"
|
|
49
51
|
| "generation_parameters"
|
|
50
52
|
| "macro_interceptor"
|
|
51
|
-
| "web_search"
|
|
53
|
+
| "web_search"
|
|
54
|
+
| "unsafe_eval";
|
|
52
55
|
|
|
53
56
|
export const ALL_PERMISSIONS: readonly SpindlePermission[] = [
|
|
54
57
|
"generation",
|
|
@@ -76,6 +79,7 @@ export const ALL_PERMISSIONS: readonly SpindlePermission[] = [
|
|
|
76
79
|
"generation_parameters",
|
|
77
80
|
"macro_interceptor",
|
|
78
81
|
"web_search",
|
|
82
|
+
"unsafe_eval",
|
|
79
83
|
] as const;
|
|
80
84
|
|
|
81
85
|
export function isValidPermission(p: string): p is SpindlePermission {
|