design-canvas-plugin-style-kit 0.1.0 → 0.1.1

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/README.md ADDED
@@ -0,0 +1,140 @@
1
+ # Style Kit — Design Canvas Plugin
2
+
3
+ **Token-aware design tuning for Fluent UI applications.** Explore token scales, override values live, save variations, prompt Copilot for adjustments, and ship changes via GitHub Issues or PRs.
4
+
5
+ ## Features
6
+
7
+ - **Token Detection** — Automatically identifies the token framework in use (Fluent UI, Material Design, Spectrum, Chakra UI, or custom tokens) and maps element styles to their corresponding design tokens.
8
+ - **Live Override Engine** — Adjust spacing, typography, colors, border radius, shadows, stroke widths, and motion tokens in real time. Changes are applied instantly via CSS custom property overrides.
9
+ - **Scope Control** — Toggle between Global (all elements) and Element-scoped overrides. Pick any element on the canvas to inspect and tune its specific token usage.
10
+ - **Variations** — Save named sets of overrides as variations. Switch between Base and saved variations to compare different design directions.
11
+ - **Copilot Integration** — Natural language prompt bar for AI-powered style adjustments (e.g., *"make it more compact"* or *"darker background"*). Copilot suggests token changes based on your description.
12
+ - **Search & Filter** — Browse all available tokens with search and category filter pills (Spacing, Typography, Colors, Shape, Motion).
13
+ - **Handoff & Export** — Copy CSS overrides, theme partials, or generate a full fix prompt for Copilot. Create GitHub Issues with context screenshots and assign Copilot for automated fixes.
14
+ - **Light/Dark Mode** — Full dark mode support with a dedicated token system (`--sk-*` custom properties) that adapts to the host application's theme.
15
+ - **Accessibility** — ARIA attributes, keyboard navigation, screen reader labels, and semantic roles throughout the panel UI.
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install design-canvas-plugin-style-kit
21
+ ```
22
+
23
+ ### Peer Dependencies
24
+
25
+ - `@design-canvas/toolbox` >= 0.1.0
26
+
27
+ ## Usage
28
+
29
+ Register the plugin with your Design Canvas instance:
30
+
31
+ ```ts
32
+ import plugin from 'design-canvas-plugin-style-kit';
33
+
34
+ // In your Design Canvas setup:
35
+ canvas.registerPlugin(plugin);
36
+ ```
37
+
38
+ The plugin exposes the standard Design Canvas plugin interface:
39
+
40
+ ```ts
41
+ plugin.meta // { id, name, icon, description, panel }
42
+ plugin.activate(ctx) // Mount the panel, start detection
43
+ plugin.deactivate() // Clean up listeners and DOM
44
+ plugin.getAPI() // { getOverrides, serializeOverrides, applyOverride, clearAll }
45
+ plugin.getHandoffContext() // { overrides, css, themePartial }
46
+ ```
47
+
48
+ ## Keyboard Shortcut
49
+
50
+ | Shortcut | Action |
51
+ |----------|--------|
52
+ | `Ctrl+Shift+K` | Toggle Style Kit panel |
53
+
54
+ ## Development
55
+
56
+ ```bash
57
+ # Install dependencies
58
+ npm install
59
+
60
+ # Start dev harness (Vite + HMR)
61
+ npm run dev:ui
62
+
63
+ # Build for production
64
+ npm run build
65
+
66
+ # Watch mode (library output)
67
+ npm run dev
68
+
69
+ # Validate plugin structure
70
+ npm run validate
71
+
72
+ # Full verification (structure + types + patterns)
73
+ npm run verify
74
+ ```
75
+
76
+ ### Dev Harness
77
+
78
+ The `dev/` folder contains a standalone test harness that simulates the Design Canvas panel shell. It provides:
79
+
80
+ - Light/dark theme toggle
81
+ - Sample DOM elements for token detection testing
82
+ - Panel open/close simulation
83
+ - Full HMR via Vite
84
+
85
+ Open `http://localhost:5174` after running `npm run dev:ui`.
86
+
87
+ ## Architecture
88
+
89
+ ```
90
+ src/
91
+ ├── index.ts # Plugin entry — meta, activate/deactivate, API
92
+ ├── panel.ts # Panel DOM renderer (imperative, no framework)
93
+ ├── panel-styles.ts # All CSS as a template literal with --sk-* tokens
94
+ ├── token-registry.ts # Static token scale definitions + framework detection
95
+ ├── token-detector.ts # Maps element computed styles → token matches
96
+ ├── override-engine.ts # Applies/tracks CSS custom property overrides
97
+ └── variations.ts # Persistence layer for named override sets
98
+ ```
99
+
100
+ ### Token System
101
+
102
+ The panel uses its own `--sk-*` CSS custom property system for theming:
103
+
104
+ | Token | Purpose |
105
+ |-------|---------|
106
+ | `--sk-bg` | Panel background |
107
+ | `--sk-bg-subtle` | Section backgrounds |
108
+ | `--sk-bg-accent` | Interactive accents |
109
+ | `--sk-fg` | Primary text |
110
+ | `--sk-fg-secondary` | Secondary text |
111
+ | `--sk-border` | Borders |
112
+ | `--sk-success` | Success states |
113
+ | `--sk-pulse-color` | Animation highlight |
114
+
115
+ Light and dark values are defined on `.sk` and `.sk.sk--dark` respectively.
116
+
117
+ ## API
118
+
119
+ ### `getOverrides(): TokenOverride[]`
120
+
121
+ Returns the current list of active token overrides.
122
+
123
+ ### `serializeOverrides(): { overrides, css, themePartial }`
124
+
125
+ Serializes all active overrides into exportable formats:
126
+ - `overrides` — Structured array with token names, old/new values, scope
127
+ - `css` — Ready-to-paste CSS custom property declarations
128
+ - `themePartial` — Framework-specific theme object partial
129
+
130
+ ### `applyOverride(tokenName, value, scope): void`
131
+
132
+ Programmatically apply a token override.
133
+
134
+ ### `clearAll(): void`
135
+
136
+ Remove all active overrides and reset to base values.
137
+
138
+ ## License
139
+
140
+ MIT
@@ -0,0 +1,455 @@
1
+ // src/token-registry.ts
2
+ var SPACING_H_SCALE = [
3
+ ["None", "0"],
4
+ ["XXS", "2px"],
5
+ ["XS", "4px"],
6
+ ["SNudge", "6px"],
7
+ ["S", "8px"],
8
+ ["MNudge", "10px"],
9
+ ["M", "12px"],
10
+ ["L", "16px"],
11
+ ["XL", "20px"],
12
+ ["XXL", "24px"],
13
+ ["XXXL", "32px"]
14
+ ];
15
+ var SPACING_V_SCALE = SPACING_H_SCALE;
16
+ var FONT_SIZE_SCALE = [
17
+ ["Base100", "10px"],
18
+ ["Base200", "12px"],
19
+ ["Base300", "14px"],
20
+ ["Base400", "16px"],
21
+ ["Base500", "20px"],
22
+ ["Base600", "24px"],
23
+ ["Hero700", "28px"],
24
+ ["Hero800", "32px"],
25
+ ["Hero900", "40px"],
26
+ ["Hero1000", "68px"]
27
+ ];
28
+ var LINE_HEIGHT_SCALE = [
29
+ ["Base100", "14px"],
30
+ ["Base200", "16px"],
31
+ ["Base300", "20px"],
32
+ ["Base400", "22px"],
33
+ ["Base500", "28px"],
34
+ ["Base600", "32px"],
35
+ ["Hero700", "36px"],
36
+ ["Hero800", "40px"],
37
+ ["Hero900", "52px"],
38
+ ["Hero1000", "92px"]
39
+ ];
40
+ var FONT_WEIGHT_SCALE = [
41
+ ["Regular", "400"],
42
+ ["Medium", "500"],
43
+ ["Semibold", "600"],
44
+ ["Bold", "700"]
45
+ ];
46
+ var BORDER_RADIUS_SCALE = [
47
+ ["None", "0"],
48
+ ["Small", "2px"],
49
+ ["Medium", "4px"],
50
+ ["Large", "6px"],
51
+ ["XLarge", "8px"],
52
+ ["2XLarge", "12px"],
53
+ ["3XLarge", "16px"],
54
+ ["4XLarge", "24px"],
55
+ ["5XLarge", "32px"],
56
+ ["6XLarge", "40px"],
57
+ ["Circular", "10000px"]
58
+ ];
59
+ var STROKE_WIDTH_SCALE = [
60
+ ["Thin", "1px"],
61
+ ["Thick", "2px"],
62
+ ["Thicker", "3px"],
63
+ ["Thickest", "4px"]
64
+ ];
65
+ var SHADOW_SCALE = [
66
+ "shadow2",
67
+ "shadow4",
68
+ "shadow8",
69
+ "shadow16",
70
+ "shadow28",
71
+ "shadow64",
72
+ "shadow2Brand",
73
+ "shadow4Brand",
74
+ "shadow8Brand",
75
+ "shadow16Brand",
76
+ "shadow28Brand",
77
+ "shadow64Brand"
78
+ ];
79
+ var DURATION_SCALE = [
80
+ ["UltraFast", "50ms"],
81
+ ["Faster", "100ms"],
82
+ ["Fast", "150ms"],
83
+ ["Normal", "200ms"],
84
+ ["Gentle", "250ms"],
85
+ ["Slow", "300ms"],
86
+ ["Slower", "400ms"],
87
+ ["UltraSlow", "500ms"]
88
+ ];
89
+ var CURVE_SCALE = [
90
+ ["AccelerateMax", "cubic-bezier(1,0,1,1)"],
91
+ ["AccelerateMid", "cubic-bezier(0.7,0,1,0.5)"],
92
+ ["AccelerateMin", "cubic-bezier(0.8,0,1,1)"],
93
+ ["DecelerateMax", "cubic-bezier(0,0,0,1)"],
94
+ ["DecelerateMid", "cubic-bezier(0.1,0.9,0.2,1)"],
95
+ ["DecelerateMin", "cubic-bezier(0.33,0,0.1,1)"],
96
+ ["EasyEaseMax", "cubic-bezier(0.8,0,0.1,1)"],
97
+ ["EasyEase", "cubic-bezier(0.33,0,0.67,1)"],
98
+ ["Linear", "cubic-bezier(0,0,1,1)"]
99
+ ];
100
+ var FONT_FAMILY_NAMES = [
101
+ "fontFamilyBase",
102
+ "fontFamilyMonospace",
103
+ "fontFamilyNumeric"
104
+ ];
105
+ var NEUTRAL_BG = [
106
+ "colorNeutralBackground1",
107
+ "colorNeutralBackground2",
108
+ "colorNeutralBackground3",
109
+ "colorNeutralBackground4",
110
+ "colorNeutralBackground5",
111
+ "colorNeutralBackground6",
112
+ "colorNeutralBackgroundInverted",
113
+ "colorNeutralBackgroundStatic",
114
+ "colorSubtleBackground",
115
+ "colorTransparentBackground"
116
+ ];
117
+ var NEUTRAL_FG = [
118
+ "colorNeutralForeground1",
119
+ "colorNeutralForeground2",
120
+ "colorNeutralForeground3",
121
+ "colorNeutralForeground4",
122
+ "colorNeutralForegroundDisabled"
123
+ ];
124
+ var BRAND_BG = [
125
+ "colorBrandBackground",
126
+ "colorBrandBackground2",
127
+ "colorBrandBackgroundInverted",
128
+ "colorBrandBackgroundStatic"
129
+ ];
130
+ var BRAND_FG = [
131
+ "colorBrandForegroundLink",
132
+ "colorBrandForeground1",
133
+ "colorBrandForeground2",
134
+ "colorBrandForegroundInverted"
135
+ ];
136
+ var NEUTRAL_STROKE = [
137
+ "colorNeutralStroke1",
138
+ "colorNeutralStroke2",
139
+ "colorNeutralStroke3",
140
+ "colorNeutralStrokeSubtle",
141
+ "colorNeutralStrokeDisabled",
142
+ "colorNeutralStrokeAccessible"
143
+ ];
144
+ var BRAND_STROKE = [
145
+ "colorBrandStroke1",
146
+ "colorBrandStroke2",
147
+ "colorCompoundBrandStroke"
148
+ ];
149
+ function resolveVar(cssVar) {
150
+ const provider = document.querySelector(".fui-FluentProvider") ?? document.documentElement;
151
+ return getComputedStyle(provider).getPropertyValue(cssVar).trim();
152
+ }
153
+ function buildScale(category, label, prefix, entries) {
154
+ return {
155
+ category,
156
+ label,
157
+ entries: entries.map(([suffix, fallback]) => {
158
+ const name = `${prefix}${suffix}`;
159
+ const cssVar = `--${name}`;
160
+ const value = resolveVar(cssVar) || fallback;
161
+ return { name, cssVar, value, label: suffix };
162
+ })
163
+ };
164
+ }
165
+ function buildColorScale(category, label, names) {
166
+ return {
167
+ category,
168
+ label,
169
+ entries: names.map((name) => {
170
+ const cssVar = `--${name}`;
171
+ const value = resolveVar(cssVar) || "#000";
172
+ const short = name.replace("colorNeutral", "").replace("colorBrand", "").replace("colorCompound", "").replace("colorSubtle", "Subtle").replace("colorTransparent", "Transparent");
173
+ return { name, cssVar, value, label: short };
174
+ })
175
+ };
176
+ }
177
+ function buildShadowScale() {
178
+ return {
179
+ category: "shadow",
180
+ label: "Shadow",
181
+ entries: SHADOW_SCALE.map((name) => {
182
+ const cssVar = `--${name}`;
183
+ const value = resolveVar(cssVar) || "0 0 0 rgba(0,0,0,0)";
184
+ const short = name.replace("shadow", "").replace("Brand", " Brand") || name;
185
+ return { name, cssVar, value, label: short };
186
+ })
187
+ };
188
+ }
189
+ function buildFontFamilyScale() {
190
+ return {
191
+ category: "fontFamily",
192
+ label: "Font Family",
193
+ entries: FONT_FAMILY_NAMES.map((name) => {
194
+ const cssVar = `--${name}`;
195
+ const value = resolveVar(cssVar) || "";
196
+ const short = name.replace("fontFamily", "");
197
+ return { name, cssVar, value, label: short };
198
+ })
199
+ };
200
+ }
201
+ function buildRegistry() {
202
+ return [
203
+ buildScale("spacingH", "Horizontal Spacing", "spacingHorizontal", SPACING_H_SCALE),
204
+ buildScale("spacingV", "Vertical Spacing", "spacingVertical", SPACING_V_SCALE),
205
+ buildScale("fontSize", "Font Size", "fontSize", FONT_SIZE_SCALE),
206
+ buildScale("lineHeight", "Line Height", "lineHeight", LINE_HEIGHT_SCALE),
207
+ buildScale("fontWeight", "Font Weight", "fontWeight", FONT_WEIGHT_SCALE),
208
+ buildScale("borderRadius", "Border Radius", "borderRadius", BORDER_RADIUS_SCALE),
209
+ buildScale("strokeWidth", "Stroke Width", "strokeWidth", STROKE_WIDTH_SCALE),
210
+ buildShadowScale(),
211
+ buildFontFamilyScale(),
212
+ buildScale("duration", "Duration", "duration", DURATION_SCALE),
213
+ buildScale("curve", "Timing Curve", "curve", CURVE_SCALE),
214
+ buildColorScale("colorNeutralBg", "Neutral Background", NEUTRAL_BG),
215
+ buildColorScale("colorNeutralFg", "Neutral Foreground", NEUTRAL_FG),
216
+ buildColorScale("colorBrandBg", "Brand Background", BRAND_BG),
217
+ buildColorScale("colorBrandFg", "Brand Foreground", BRAND_FG),
218
+ buildColorScale("colorNeutralStroke", "Neutral Stroke", NEUTRAL_STROKE),
219
+ buildColorScale("colorBrandStroke", "Brand Stroke", BRAND_STROKE)
220
+ ];
221
+ }
222
+ function findToken(registry, tokenName) {
223
+ for (const scale of registry) {
224
+ const idx = scale.entries.findIndex((e) => e.name === tokenName);
225
+ if (idx !== -1) return { scale, index: idx };
226
+ }
227
+ return null;
228
+ }
229
+ function getResolvedValue(cssVar) {
230
+ return resolveVar(cssVar);
231
+ }
232
+ function serializeForPrompt(registry) {
233
+ return registry.map(
234
+ (s) => `${s.label}: ${s.entries.map((e) => `${e.label}=${e.value}`).join(", ")}`
235
+ ).join("\n");
236
+ }
237
+
238
+ // src/override-engine.ts
239
+ var STYLE_ID = "dc-style-kit-overrides";
240
+ var activeOverrides = /* @__PURE__ */ new Map();
241
+ var activeStaticOverrides = /* @__PURE__ */ new Map();
242
+ var listeners = [];
243
+ function getOrCreateStyleEl() {
244
+ let el = document.getElementById(STYLE_ID);
245
+ if (!el) {
246
+ el = document.createElement("style");
247
+ el.id = STYLE_ID;
248
+ el.setAttribute("data-design-canvas", "style-kit");
249
+ document.body.appendChild(el);
250
+ }
251
+ return el;
252
+ }
253
+ function overrideKey(o) {
254
+ const scopeKey = o.scope.type === "global" ? "_global_" : o.scope.selector;
255
+ return `${scopeKey}::${o.tokenName}`;
256
+ }
257
+ function staticKey(o) {
258
+ const scopeKey = o.scope.type === "global" ? "_global_" : o.scope.selector;
259
+ return `${scopeKey}::static::${o.property}`;
260
+ }
261
+ var TOKEN_TO_CSS_PROPERTY = {
262
+ fontSize: "font-size",
263
+ fontWeight: "font-weight",
264
+ lineHeight: "line-height",
265
+ fontFamily: "font-family",
266
+ spacingHorizontal: "padding-inline",
267
+ spacingVertical: "padding-block",
268
+ borderRadius: "border-radius",
269
+ strokeWidth: "border-width",
270
+ colorNeutralBackground: "background-color",
271
+ colorBrandBackground: "background-color",
272
+ colorSubtleBackground: "background-color",
273
+ colorTransparentBackground: "background-color",
274
+ colorNeutralForeground: "color",
275
+ colorBrandForeground: "color",
276
+ colorNeutralStroke: "border-color",
277
+ colorBrandStroke: "border-color",
278
+ colorPaletteRedBackground: "background-color",
279
+ colorPaletteRedForeground: "color",
280
+ colorPaletteRedBorder: "border-color",
281
+ colorPaletteGreenBackground: "background-color",
282
+ colorPaletteGreenForeground: "color",
283
+ colorPaletteGreenBorder: "border-color",
284
+ colorPaletteYellowBackground: "background-color",
285
+ colorPaletteYellowForeground: "color",
286
+ colorPaletteBlueForeground: "color",
287
+ colorPaletteBlueBackground: "background-color",
288
+ colorPaletteBlueBorder: "border-color",
289
+ shadow: "box-shadow"
290
+ };
291
+ function cssPropertyForToken(tokenName) {
292
+ for (const [prefix, prop] of Object.entries(TOKEN_TO_CSS_PROPERTY)) {
293
+ if (tokenName.startsWith(prefix)) return prop;
294
+ }
295
+ return null;
296
+ }
297
+ function renderCSS() {
298
+ const el = getOrCreateStyleEl();
299
+ const byScope = /* @__PURE__ */ new Map();
300
+ for (const o of activeOverrides.values()) {
301
+ const key = o.scope.type === "global" ? "_global_" : o.scope.selector;
302
+ if (!byScope.has(key)) byScope.set(key, { tokens: [], statics: [] });
303
+ byScope.get(key).tokens.push(o);
304
+ }
305
+ for (const o of activeStaticOverrides.values()) {
306
+ const key = o.scope.type === "global" ? "_global_" : o.scope.selector;
307
+ if (!byScope.has(key)) byScope.set(key, { tokens: [], statics: [] });
308
+ byScope.get(key).statics.push(o);
309
+ }
310
+ let css = "/* Style Kit overrides \u2014 auto-generated */\n";
311
+ for (const [scopeKey, { tokens, statics }] of byScope) {
312
+ const isGlobal = scopeKey === "_global_";
313
+ const selector = isGlobal ? ".fui-FluentProvider" : scopeKey;
314
+ const tokenProps = tokens.map((o) => ` ${o.cssVar}: ${o.newValue};`).join("\n");
315
+ const concreteProps = isGlobal ? "" : tokens.map((o) => {
316
+ const prop = cssPropertyForToken(o.tokenName);
317
+ return prop ? ` ${prop}: ${o.newValue} !important;` : "";
318
+ }).filter(Boolean).join("\n");
319
+ const staticProps = statics.map((o) => ` ${o.property}: ${o.newValue} !important;`).join("\n");
320
+ const allProps = [tokenProps, concreteProps, staticProps].filter(Boolean).join("\n");
321
+ css += `${selector} {
322
+ ${allProps}
323
+ }
324
+ `;
325
+ }
326
+ el.textContent = css;
327
+ notify();
328
+ }
329
+ function notify() {
330
+ const list = Array.from(activeOverrides.values());
331
+ for (const fn of listeners) fn(list);
332
+ }
333
+ function applyOverride(override) {
334
+ const key = overrideKey(override);
335
+ activeOverrides.set(key, override);
336
+ renderCSS();
337
+ }
338
+ function removeOverride(tokenName, scope) {
339
+ const key = overrideKey({ tokenName, scope });
340
+ activeOverrides.delete(key);
341
+ renderCSS();
342
+ }
343
+ function getOverrides() {
344
+ return Array.from(activeOverrides.values());
345
+ }
346
+ function getOverrideForToken(tokenName, scope) {
347
+ return activeOverrides.get(overrideKey({ tokenName, scope }));
348
+ }
349
+ function clearAll() {
350
+ activeOverrides.clear();
351
+ activeStaticOverrides.clear();
352
+ renderCSS();
353
+ }
354
+ function bulkApply(overrides) {
355
+ for (const o of overrides) {
356
+ activeOverrides.set(overrideKey(o), o);
357
+ }
358
+ renderCSS();
359
+ }
360
+ function bulkReplace(overrides) {
361
+ activeOverrides.clear();
362
+ for (const o of overrides) {
363
+ activeOverrides.set(overrideKey(o), o);
364
+ }
365
+ renderCSS();
366
+ }
367
+ function onOverridesChanged(fn) {
368
+ listeners.push(fn);
369
+ return () => {
370
+ listeners = listeners.filter((l) => l !== fn);
371
+ };
372
+ }
373
+ function applyStaticOverride(override) {
374
+ const key = staticKey(override);
375
+ activeStaticOverrides.set(key, override);
376
+ renderCSS();
377
+ }
378
+ function removeStaticOverride(property, scope) {
379
+ const key = staticKey({ property, scope });
380
+ activeStaticOverrides.delete(key);
381
+ renderCSS();
382
+ }
383
+ function getStaticOverrideForProperty(property, scope) {
384
+ return activeStaticOverrides.get(staticKey({ property, scope }));
385
+ }
386
+ function getStaticOverridesList() {
387
+ return Array.from(activeStaticOverrides.values());
388
+ }
389
+ function serializeOverrides() {
390
+ const list = getOverrides();
391
+ const staticList = getStaticOverridesList();
392
+ const registry = buildRegistry();
393
+ const tokenEntries = list.map((o) => {
394
+ const entry = {
395
+ token: o.tokenName,
396
+ from: o.originalValue,
397
+ to: o.newValue,
398
+ scope: o.scope.type === "global" ? "Global" : o.scope.label
399
+ };
400
+ const match = findToken(registry, o.tokenName);
401
+ if (match) {
402
+ const swapTarget = match.scale.entries.find(
403
+ (e) => e.value === o.newValue && e.name !== o.tokenName
404
+ );
405
+ if (swapTarget) {
406
+ entry.swapTo = swapTarget.name;
407
+ }
408
+ }
409
+ return entry;
410
+ });
411
+ const staticEntries = staticList.map((o) => ({
412
+ token: `[static] ${o.property}`,
413
+ from: o.originalValue,
414
+ to: o.newValue,
415
+ scope: o.scope.type === "global" ? "Global" : o.scope.label
416
+ }));
417
+ const overrides = [...tokenEntries, ...staticEntries];
418
+ const css = getOrCreateStyleEl().textContent ?? "";
419
+ const globalOverrides = list.filter((o) => o.scope.type === "global");
420
+ const themeLines = globalOverrides.map(
421
+ (o) => ` ${o.tokenName}: '${o.newValue}',`
422
+ );
423
+ const themePartial = `const themeOverrides = {
424
+ ${themeLines.join("\n")}
425
+ };`;
426
+ return { overrides, css, themePartial };
427
+ }
428
+ function destroy() {
429
+ activeOverrides.clear();
430
+ activeStaticOverrides.clear();
431
+ listeners = [];
432
+ const el = document.getElementById(STYLE_ID);
433
+ el?.remove();
434
+ }
435
+
436
+ export {
437
+ buildRegistry,
438
+ findToken,
439
+ getResolvedValue,
440
+ serializeForPrompt,
441
+ applyOverride,
442
+ removeOverride,
443
+ getOverrides,
444
+ getOverrideForToken,
445
+ clearAll,
446
+ bulkApply,
447
+ bulkReplace,
448
+ onOverridesChanged,
449
+ applyStaticOverride,
450
+ removeStaticOverride,
451
+ getStaticOverrideForProperty,
452
+ getStaticOverridesList,
453
+ serializeOverrides,
454
+ destroy
455
+ };
package/dist/index.d.ts CHANGED
@@ -1,30 +1,5 @@
1
- declare const plugin: {
2
- meta: {
3
- id: string;
4
- name: string;
5
- icon: string;
6
- description: string;
7
- version: string;
8
- panel: {
9
- defaultWidth: number;
10
- defaultHeight: number;
11
- minWidth: number;
12
- minHeight: number;
13
- };
14
- };
15
- activate(ctx: any): void;
16
- deactivate(): void;
17
- getHandoffContext(): {
18
- overrides: Array<{
19
- token: string;
20
- from: string;
21
- to: string;
22
- scope: string;
23
- swapTo?: string;
24
- }>;
25
- css: string;
26
- themePartial: string;
27
- };
28
- };
1
+ import { PluginDefinition } from './types.js';
2
+
3
+ declare const plugin: PluginDefinition;
29
4
 
30
5
  export { plugin as default };