@adonis-agora/agent 0.74.1 → 0.76.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.
- package/CHANGELOG.md +42 -0
- package/README.md +16 -0
- package/dist/src/channels/handler.d.ts.map +1 -1
- package/dist/src/channels/handler.js +10 -0
- package/dist/src/channels/handler.js.map +1 -1
- package/dist/src/channels/texts.d.ts +2 -0
- package/dist/src/channels/texts.d.ts.map +1 -1
- package/dist/src/channels/texts.js.map +1 -1
- package/dist/src/genui/catalog.d.ts.map +1 -1
- package/dist/src/genui/catalog.js +3 -1
- package/dist/src/genui/catalog.js.map +1 -1
- package/dist/src/genui/channels.d.ts +32 -5
- package/dist/src/genui/channels.d.ts.map +1 -1
- package/dist/src/genui/channels.js +20 -9
- package/dist/src/genui/channels.js.map +1 -1
- package/dist/src/genui/index.d.ts.map +1 -1
- package/dist/src/genui/index.js +7 -7
- package/dist/src/genui/index.js.map +1 -1
- package/dist/src/genui/kit/bundle.d.ts +12 -0
- package/dist/src/genui/kit/bundle.d.ts.map +1 -1
- package/dist/src/genui/kit/bundle.js +124 -133
- package/dist/src/genui/kit/bundle.js.map +1 -1
- package/dist/src/genui/kit/discover.d.ts +8 -5
- package/dist/src/genui/kit/discover.d.ts.map +1 -1
- package/dist/src/genui/kit/discover.js +45 -18
- package/dist/src/genui/kit/discover.js.map +1 -1
- package/dist/src/genui/kit/docs.d.ts +3 -1
- package/dist/src/genui/kit/docs.d.ts.map +1 -1
- package/dist/src/genui/kit/docs.js +22 -5
- package/dist/src/genui/kit/docs.js.map +1 -1
- package/dist/src/genui/kit/files.d.ts +22 -10
- package/dist/src/genui/kit/files.d.ts.map +1 -1
- package/dist/src/genui/kit/files.js +117 -19
- package/dist/src/genui/kit/files.js.map +1 -1
- package/dist/src/genui/kit/index.d.ts +5 -3
- package/dist/src/genui/kit/index.d.ts.map +1 -1
- package/dist/src/genui/kit/index.js +4 -2
- package/dist/src/genui/kit/index.js.map +1 -1
- package/dist/src/genui/kit/plugin.d.ts +17 -9
- package/dist/src/genui/kit/plugin.d.ts.map +1 -1
- package/dist/src/genui/kit/plugin.js +196 -129
- package/dist/src/genui/kit/plugin.js.map +1 -1
- package/dist/src/genui/kit/styles.d.ts +83 -0
- package/dist/src/genui/kit/styles.d.ts.map +1 -0
- package/dist/src/genui/kit/styles.js +406 -0
- package/dist/src/genui/kit/styles.js.map +1 -0
- package/dist/src/genui/kit/vite-build.d.ts +33 -0
- package/dist/src/genui/kit/vite-build.d.ts.map +1 -0
- package/dist/src/genui/kit/vite-build.js +195 -0
- package/dist/src/genui/kit/vite-build.js.map +1 -0
- package/dist/src/genui/kit/write.d.ts +20 -8
- package/dist/src/genui/kit/write.d.ts.map +1 -1
- package/dist/src/genui/kit/write.js +54 -16
- package/dist/src/genui/kit/write.js.map +1 -1
- package/dist/src/genui/public.d.ts +5 -4
- package/dist/src/genui/public.d.ts.map +1 -1
- package/dist/src/genui/public.js +4 -3
- package/dist/src/genui/public.js.map +1 -1
- package/dist/src/genui/sandbox-jsx-frame-generated.d.ts +2 -0
- package/dist/src/genui/sandbox-jsx-frame-generated.d.ts.map +1 -0
- package/dist/src/genui/sandbox-jsx-frame-generated.js +4 -0
- package/dist/src/genui/sandbox-jsx-frame-generated.js.map +1 -0
- package/dist/src/genui/sandbox-kit.d.ts +50 -17
- package/dist/src/genui/sandbox-kit.d.ts.map +1 -1
- package/dist/src/genui/sandbox-kit.js +20 -10
- package/dist/src/genui/sandbox-kit.js.map +1 -1
- package/dist/src/genui/sandbox-styles.d.ts +113 -0
- package/dist/src/genui/sandbox-styles.d.ts.map +1 -0
- package/dist/src/genui/sandbox-styles.js +487 -0
- package/dist/src/genui/sandbox-styles.js.map +1 -0
- package/dist/src/genui/sandbox-theme.d.ts +13 -9
- package/dist/src/genui/sandbox-theme.d.ts.map +1 -1
- package/dist/src/genui/sandbox-theme.js +52 -60
- package/dist/src/genui/sandbox-theme.js.map +1 -1
- package/dist/src/genui/sandbox.d.ts +21 -15
- package/dist/src/genui/sandbox.d.ts.map +1 -1
- package/dist/src/genui/sandbox.js +66 -17
- package/dist/src/genui/sandbox.js.map +1 -1
- package/dist/src/genui/tools.d.ts +20 -0
- package/dist/src/genui/tools.d.ts.map +1 -1
- package/dist/src/genui/tools.js +19 -4
- package/dist/src/genui/tools.js.map +1 -1
- package/dist/src/hooks/genui_kit.d.ts +6 -2
- package/dist/src/hooks/genui_kit.d.ts.map +1 -1
- package/dist/src/hooks/genui_kit.js +21 -9
- package/dist/src/hooks/genui_kit.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/negotiated-tool-ui.d.ts.map +1 -1
- package/dist/src/negotiated-tool-ui.js +4 -0
- package/dist/src/negotiated-tool-ui.js.map +1 -1
- package/dist/src/react/core/genui/sandbox-assets.d.ts +4 -1
- package/dist/src/react/core/genui/sandbox-assets.d.ts.map +1 -1
- package/dist/src/react/core/genui/sandbox-assets.js +17 -5
- package/dist/src/react/core/genui/sandbox-assets.js.map +1 -1
- package/dist/src/react/core/genui/sandbox.d.ts +1 -1
- package/dist/src/react/core/genui/sandbox.d.ts.map +1 -1
- package/dist/src/react/core/genui/sandbox.js +20 -4
- package/dist/src/react/core/genui/sandbox.js.map +1 -1
- package/dist/src/react-native/genui/index.d.ts +20 -0
- package/dist/src/react-native/genui/index.d.ts.map +1 -0
- package/dist/src/react-native/genui/index.js +18 -0
- package/dist/src/react-native/genui/index.js.map +1 -0
- package/dist/src/react-native/genui/provider.d.ts +19 -0
- package/dist/src/react-native/genui/provider.d.ts.map +1 -0
- package/dist/src/react-native/genui/provider.js +23 -0
- package/dist/src/react-native/genui/provider.js.map +1 -0
- package/dist/src/react-native/genui/sandbox-assets.d.ts +57 -0
- package/dist/src/react-native/genui/sandbox-assets.d.ts.map +1 -0
- package/dist/src/react-native/genui/sandbox-assets.js +153 -0
- package/dist/src/react-native/genui/sandbox-assets.js.map +1 -0
- package/dist/src/react-native/genui/sandbox-host.d.ts +119 -0
- package/dist/src/react-native/genui/sandbox-host.d.ts.map +1 -0
- package/dist/src/react-native/genui/sandbox-host.js +188 -0
- package/dist/src/react-native/genui/sandbox-host.js.map +1 -0
- package/dist/src/react-native/genui/sandbox.d.ts +86 -0
- package/dist/src/react-native/genui/sandbox.d.ts.map +1 -0
- package/dist/src/react-native/genui/sandbox.js +376 -0
- package/dist/src/react-native/genui/sandbox.js.map +1 -0
- package/dist/src/vite/index.d.ts +10 -7
- package/dist/src/vite/index.d.ts.map +1 -1
- package/dist/src/vite/index.js +10 -7
- package/dist/src/vite/index.js.map +1 -1
- package/package.json +28 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* draws the model's JSX in the frame. The Node half (docs generation, the bundle, the Vite plugin,
|
|
5
5
|
* discovery) is `genui/kit`.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { SANDBOX_JSX_FRAME_SOURCE } from './sandbox-jsx-frame-generated.js';
|
|
8
8
|
/** What the opt-in assets weigh, inlined into every sandbox frame that uses them. */
|
|
9
9
|
export const SANDBOX_ASSET_SIZES = {
|
|
10
10
|
/** `@tailwindcss/browser` v4 (minified, as inlined; ≈75 KB gzipped over the wire, once). */
|
|
@@ -32,17 +32,25 @@ export function kitDocsToModelText(docs) {
|
|
|
32
32
|
}
|
|
33
33
|
return lines.join('\n');
|
|
34
34
|
}
|
|
35
|
-
/** The rules for writing the sandbox as JSX
|
|
36
|
-
export function kitJsxInstructions() {
|
|
35
|
+
/** The rules for writing the sandbox as JSX. */
|
|
36
|
+
export function kitJsxInstructions(options = {}) {
|
|
37
|
+
const components = options.components !== false;
|
|
37
38
|
return [
|
|
38
39
|
'Write the view as JSX in `jsx` (instead of `html`/`jsFunctions`): plain JavaScript + JSX, no TypeScript, no imports — define `function App()` and return the UI; it is rendered for you.',
|
|
39
|
-
|
|
40
|
+
components
|
|
41
|
+
? 'React hooks (useState, useEffect, useMemo, useRef, useCallback, useReducer) and every kit component are in scope by name. Use kit components for controls and surfaces, plain elements for the rest.'
|
|
42
|
+
: 'React hooks (useState, useEffect, useMemo, useRef, useCallback, useReducer) are in scope by name; use plain elements.',
|
|
43
|
+
...(options.wrapper === true
|
|
44
|
+
? [
|
|
45
|
+
"App is rendered inside the app's own providers (its theme, its baseline styles): do not add a theme provider or global resets of your own.",
|
|
46
|
+
]
|
|
47
|
+
: []),
|
|
40
48
|
'Keep state in App; call agent.send({ text, ...values }) from a click handler to hand values back.',
|
|
41
49
|
].join(' ');
|
|
42
50
|
}
|
|
43
|
-
/** The
|
|
44
|
-
export function
|
|
45
|
-
return '
|
|
51
|
+
/** The rule for a kit with styles but no components: the model writes HTML with those styles. */
|
|
52
|
+
export function kitHtmlInstructions() {
|
|
53
|
+
return 'There is no component kit here: write html (and jsFunctions/jsExpressions), never jsx.';
|
|
46
54
|
}
|
|
47
55
|
/**
|
|
48
56
|
* The script that draws the model's JSX in the frame: it holds the transpiler, compiles what the
|
|
@@ -56,8 +64,10 @@ export function sandboxJsxRuntime(options) {
|
|
|
56
64
|
const t = JSON.stringify(options.token);
|
|
57
65
|
const type = JSON.stringify(options.jsxMessage);
|
|
58
66
|
const initial = options.initial === undefined ? 'null' : JSON.stringify(options.initial);
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
// The transpiler ships prebuilt as a string (never `fn.toString()` of bundled code, which a
|
|
68
|
+
// consumer's minifier rewrites): see scripts/build-frame-runtime.mjs.
|
|
69
|
+
return `(function(){${SANDBOX_JSX_FRAME_SOURCE};var transpileJsx=__genuiJsx.transpileJsx,prepareSandboxJsx=__genuiJsx.prepareSandboxJsx;
|
|
70
|
+
var T=${t},TYPE=${type},R=window.React,D=window.ReactDOM,K=window.Kit||{},W=typeof window.KitWrapper==='function'||(window.KitWrapper&&typeof window.KitWrapper==='object')?window.KitWrapper:null;
|
|
61
71
|
if(window.__GENUI_KIT_CSS__){var ks=document.createElement('style');ks.textContent=window.__GENUI_KIT_CSS__;document.head.appendChild(ks)}
|
|
62
72
|
var kitNames=Object.keys(K).filter(function(k){return /^[A-Z][\\w$]*$/.test(k)});
|
|
63
73
|
var hookNames=['useState','useEffect','useMemo','useRef','useCallback','useReducer','useId','useLayoutEffect','Fragment'].filter(function(k){return R&&R[k]!==undefined});
|
|
@@ -81,7 +91,7 @@ document.head.appendChild(s);s.remove();window.__agoraQuiet=false;
|
|
|
81
91
|
if(!window.__genuiOk||typeof window.__genuiApp!=='function'){return false}
|
|
82
92
|
lastCode=code;var App=window.__genuiApp;
|
|
83
93
|
if(!root)root=D.createRoot(document.getElementById('agora-sandbox-root'));
|
|
84
|
-
|
|
94
|
+
var view=R.createElement(Boundary,{key:++seq,app:App,keep:lastGood,final:final},R.createElement(App));\nroot.render(W?R.createElement(W,null,view):view);
|
|
85
95
|
return true}
|
|
86
96
|
window.addEventListener('message',function(e){if(e.source!==window.parent)return;var d=e.data;if(!d||d.token!==T||d.type!==TYPE)return;draw(String(d.code||''),d.final===true)});
|
|
87
97
|
var init=${initial};if(init){draw(init.code,init.final)}})();`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-kit.js","sourceRoot":"","sources":["../../../src/genui/sandbox-kit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sandbox-kit.js","sourceRoot":"","sources":["../../../src/genui/sandbox-kit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAwE5E,qFAAqF;AACrF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,4FAA4F;IAC5F,QAAQ,EAAE,SAAS;IACnB,2EAA2E;IAC3E,GAAG,EAAE,2BAA2B;CACxB,CAAC;AAEX,iGAAiG;AACjG,SAAS,QAAQ,CAAC,IAAuB;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IA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CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,kBAAkB,CAChC,OAAO,GAAgD,EAAE;IAEzD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,KAAK,KAAK,CAAC;IAChD,OAAO;QACL,0LAA0L;QAC1L,UAAU;YACR,CAAC,CAAC,sMAAsM;YACxM,CAAC,CAAC,uHAAuH;QAC3H,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI;YAC1B,CAAC,CAAC;gBACE,4IAA4I;aAC7I;YACH,CAAC,CAAC,EAAE,CAAC;QACP,mGAAmG;KACpG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,mBAAmB;IACjC,OAAO,wFAAwF,CAAC;AAClG,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAKjC;IACC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACzF,4FAA4F;IAC5F,sEAAsE;IACtE,OAAO,eAAe,wBAAwB;QACxC,CAAC,SAAS,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2BX,OAAO,4CAA4C,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/** A stylesheet's class names as the model reads them. */
|
|
2
|
+
export interface CssVocabulary {
|
|
3
|
+
/** Families of classes, the most used first: `{ name: 'btn', classes: ['btn', 'btn-{primary,secondary}'] }`. */
|
|
4
|
+
groups: {
|
|
5
|
+
name: string;
|
|
6
|
+
classes: string[];
|
|
7
|
+
}[];
|
|
8
|
+
/** How many distinct class names the stylesheet defines. */
|
|
9
|
+
total: number;
|
|
10
|
+
/** How many of them `groups` lists (the rest were over the cap). */
|
|
11
|
+
listed: number;
|
|
12
|
+
/** Custom properties declared on its root (`:root`, `html`, `[data-theme]`, `.dark`…). */
|
|
13
|
+
vars: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface CssVocabularyOptions {
|
|
16
|
+
/** Most class names listed. Default 600. */
|
|
17
|
+
maxClasses?: number;
|
|
18
|
+
/** Most class names listed per family (`btn`, `col`…), so utilities do not crowd out components. Default 30. */
|
|
19
|
+
maxPerFamily?: number;
|
|
20
|
+
/** Most custom properties listed. Default 80. */
|
|
21
|
+
maxVars?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* What a stylesheet gives the model to write with: its class names, grouped into families
|
|
25
|
+
* (`btn`, `card`, `form`…) and compressed (`btn-{primary,secondary,danger}`), the most used first —
|
|
26
|
+
* a class counts once per selector it appears in, and twice more where it stands alone (`.btn {`,
|
|
27
|
+
* a component's root) — plus the custom properties on its root. Generated CSS-modules names are
|
|
28
|
+
* left out (nobody can write them).
|
|
29
|
+
*/
|
|
30
|
+
export declare function extractCssVocabulary(css: string, options?: CssVocabularyOptions): CssVocabulary;
|
|
31
|
+
/**
|
|
32
|
+
* Class names sharing everything but their last `-segment`, written once: `btn-primary`,
|
|
33
|
+
* `btn-secondary` → `btn-{primary,secondary}`. Order kept (the first member's place).
|
|
34
|
+
*/
|
|
35
|
+
export declare function compressClassNames(names: readonly string[]): string[];
|
|
36
|
+
/** The vocabulary as the model reads it (inside the sandbox description). */
|
|
37
|
+
export declare function vocabularyToModelText(vocabulary: CssVocabulary, options?: {
|
|
38
|
+
jsx?: boolean;
|
|
39
|
+
}): string;
|
|
40
|
+
/** Whether a stylesheet's source uses Tailwind, and which major version it reads as. */
|
|
41
|
+
export declare function tailwindVersionOf(source: string): 3 | 4 | null;
|
|
42
|
+
/**
|
|
43
|
+
* The Tailwind directives of an app stylesheet the frame's Tailwind runtime gets too: its
|
|
44
|
+
* `@custom-variant`s, `@utility`s, `@variant`s and `@theme` blocks (`@keyframes` inside them
|
|
45
|
+
* included) — not its `@import`s, `@source`s, `@plugin`s or base styles (those reach the frame
|
|
46
|
+
* compiled).
|
|
47
|
+
*/
|
|
48
|
+
export declare function tailwindDirectivesFromCss(css: string): string;
|
|
49
|
+
/** What the app's Tailwind setup gives the model: theme names, its own utilities and variants. */
|
|
50
|
+
export interface TailwindTokens {
|
|
51
|
+
/** `bg-<name>`, `text-<name>`… (`--color-<name>`). */
|
|
52
|
+
colors: string[];
|
|
53
|
+
/** `rounded-<name>` (`--radius-<name>`). */
|
|
54
|
+
radius: string[];
|
|
55
|
+
/** `font-<name>` (`--font-<name>`). */
|
|
56
|
+
fonts: string[];
|
|
57
|
+
/** `shadow-<name>`. */
|
|
58
|
+
shadows: string[];
|
|
59
|
+
/** `text-<name>` sizes (`--text-<name>`). */
|
|
60
|
+
text: string[];
|
|
61
|
+
/** `animate-<name>`. */
|
|
62
|
+
animations: string[];
|
|
63
|
+
/** `@utility` names (`figure`, `tab-*`). */
|
|
64
|
+
utilities: string[];
|
|
65
|
+
/** `@custom-variant` names (`dark`, `data-open`). */
|
|
66
|
+
variants: string[];
|
|
67
|
+
}
|
|
68
|
+
/** The tokens a Tailwind stylesheet's directives declare (see {@link tailwindDirectivesFromCss}). */
|
|
69
|
+
export declare function tailwindTokensFromCss(css: string): TailwindTokens;
|
|
70
|
+
/** What the model is told about Tailwind in the frame. `colors` may add the host theme's names. */
|
|
71
|
+
export declare function tailwindToModelText(tokens: TailwindTokens, options?: {
|
|
72
|
+
version?: 3 | 4;
|
|
73
|
+
colors?: readonly string[];
|
|
74
|
+
}): string;
|
|
75
|
+
/**
|
|
76
|
+
* A Tailwind v3 config's theme as the v4 directives the frame's runtime reads: colors →
|
|
77
|
+
* `--color-*` (nested shades flattened, `DEFAULT` dropped, `<alpha-value>` → 1), `borderRadius` →
|
|
78
|
+
* `--radius-*`, `fontFamily` → `--font-*`, `fontSize` → `--text-*`, `boxShadow` → `--shadow-*`,
|
|
79
|
+
* `screens` → `--breakpoint-*`, `keyframes`/`animation` → `@keyframes` + `--animate-*` — the
|
|
80
|
+
* `theme` and its `extend` together, function values skipped. `darkMode: 'class'` / `'selector'` /
|
|
81
|
+
* `['class', '<selector>']` becomes a `dark` variant.
|
|
82
|
+
*/
|
|
83
|
+
export declare function tailwindV3ConfigToCss(config: unknown): string;
|
|
84
|
+
/** What a `url()` resolves to: its bytes (base64) and type — or why it cannot be inlined. */
|
|
85
|
+
export type CssUrlResolution = {
|
|
86
|
+
data: string;
|
|
87
|
+
mime: string;
|
|
88
|
+
bytes: number;
|
|
89
|
+
} | {
|
|
90
|
+
dropped: string;
|
|
91
|
+
} | null;
|
|
92
|
+
export interface InlineCssUrlsOptions {
|
|
93
|
+
/** The bytes behind a url that is not already `data:` (`null`: unknown, dropped). */
|
|
94
|
+
resolve(url: string): CssUrlResolution;
|
|
95
|
+
/** Largest file inlined, in bytes. Default 128 KB. */
|
|
96
|
+
limit?: number;
|
|
97
|
+
/** Most bytes inlined in all, `data:` URIs already in the CSS included. Default 1 MB. */
|
|
98
|
+
budget?: number;
|
|
99
|
+
/** Told about every url dropped, and why. */
|
|
100
|
+
warn?(message: string): void;
|
|
101
|
+
}
|
|
102
|
+
export declare const INLINE_ASSET_DEFAULTS: {
|
|
103
|
+
readonly limit: number;
|
|
104
|
+
readonly budget: number;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Every `url()` of a stylesheet made network-less: `data:` URIs kept (within the budget), files
|
|
108
|
+
* inlined as `data:` URIs when `resolve` finds them and they fit `limit` and `budget`, everything
|
|
109
|
+
* else — remote urls, files too big, files not found — replaced by an empty `data:,` (the browser
|
|
110
|
+
* falls back: the next font in the stack, no background image), each with a warning.
|
|
111
|
+
*/
|
|
112
|
+
export declare function inlineCssUrls(css: string, options: InlineCssUrlsOptions): string;
|
|
113
|
+
//# sourceMappingURL=sandbox-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-styles.d.ts","sourceRoot":"","sources":["../../../src/genui/sandbox-styles.ts"],"names":[],"mappings":"AAwEA,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,gHAAgH;IAChH,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC9C,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gHAAgH;IAChH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAgBD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,oBAAyB,GACjC,aAAa,CAyCf;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAyBrE;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,aAAa,EACzB,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9B,MAAM,CAaR;AAMD,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAQ9D;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MA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