@clipbus/plugin-sdk 0.8.4 → 0.8.5

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.
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @clipbus/plugin-sdk/preview
3
+ *
4
+ * Framework-neutral development-time preview harness.
5
+ * Provides a minimal bidirectional fake host for iterating on plugin UIs
6
+ * without a real macOS host process.
7
+ *
8
+ * Usage:
9
+ * ```ts
10
+ * import { createPreviewWorkbench } from '@clipbus/plugin-sdk/preview';
11
+ *
12
+ * createPreviewWorkbench(document.getElementById('app')!, {
13
+ * scenarios,
14
+ * mount(slotEl, { scenario }) {
15
+ * const app = createApp(MyPlugin);
16
+ * app.mount(slotEl);
17
+ * return () => app.unmount();
18
+ * },
19
+ * });
20
+ * ```
21
+ */
22
+ import type { PreviewWorkbenchOptions } from './types.js';
23
+ export type { PreviewViewport, PreviewScenario, PreviewWorkbenchOptions } from './types.js';
24
+ export type { WirePayloads } from './wire.js';
25
+ export type { PreviewThemePreset } from './theme.js';
26
+ export { computeWirePayloads, injectWire, applyThemeCssVars, THEME_CSS_VAR_NAMES } from './wire.js';
27
+ export { installFakeHost } from './fakeHost.js';
28
+ export type { FakeHostHooks } from './fakeHost.js';
29
+ export { defaultDarkTheme, defaultLightTheme } from './theme.js';
30
+ export { previewThemePresets, DEFAULT_THEME_KEY, getThemePreset, } from './theme.js';
31
+ export { groupScenariosByMode, resolveViewportWidth, clampWidth } from './chrome.js';
32
+ export { PLUGIN_CALL_HANDLER_NAME, WINDOW_SET_HEIGHT_METHOD, } from '../generated/wireConstants.generated.js';
33
+ /**
34
+ * Mount a preview workbench into `root`.
35
+ *
36
+ * Orchestration order:
37
+ * 1. Inject workbench styles.
38
+ * 2. Install fake host (hooks → log panel + viewport height).
39
+ * 3. Render chrome (selectors, viewport, card shell, button strip, log panel).
40
+ * 4. On each scenario activation:
41
+ * a. computeWirePayloads(scenario, presetKey) → injectWire (host→plugin bootstrap).
42
+ * b. Call opts.mount(slotEl, { scenario }) → get cleanup fn.
43
+ * 5. On theme change: re-inject wire (no remount) so theme subscribers restyle.
44
+ * 6. On scenario switch: cleanup previous → repeat step 4.
45
+ */
46
+ export declare function createPreviewWorkbench(root: HTMLElement, opts: PreviewWorkbenchOptions): void;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @clipbus/plugin-sdk/preview
3
+ *
4
+ * Framework-neutral development-time preview harness.
5
+ * Provides a minimal bidirectional fake host for iterating on plugin UIs
6
+ * without a real macOS host process.
7
+ *
8
+ * Usage:
9
+ * ```ts
10
+ * import { createPreviewWorkbench } from '@clipbus/plugin-sdk/preview';
11
+ *
12
+ * createPreviewWorkbench(document.getElementById('app')!, {
13
+ * scenarios,
14
+ * mount(slotEl, { scenario }) {
15
+ * const app = createApp(MyPlugin);
16
+ * app.mount(slotEl);
17
+ * return () => app.unmount();
18
+ * },
19
+ * });
20
+ * ```
21
+ */
22
+ import type { PreviewWorkbenchOptions } from './types.js';
23
+ export type { PreviewViewport, PreviewScenario, PreviewWorkbenchOptions } from './types.js';
24
+ export type { WirePayloads } from './wire.js';
25
+ export type { PreviewThemePreset } from './theme.js';
26
+ export { computeWirePayloads, injectWire, applyThemeCssVars, THEME_CSS_VAR_NAMES } from './wire.js';
27
+ export { installFakeHost } from './fakeHost.js';
28
+ export type { FakeHostHooks } from './fakeHost.js';
29
+ export { defaultDarkTheme, defaultLightTheme } from './theme.js';
30
+ export { previewThemePresets, DEFAULT_THEME_KEY, getThemePreset, } from './theme.js';
31
+ export { groupScenariosByMode, resolveViewportWidth, clampWidth } from './chrome.js';
32
+ export { PLUGIN_CALL_HANDLER_NAME, WINDOW_SET_HEIGHT_METHOD, } from '../generated/wireConstants.generated.js';
33
+ /**
34
+ * Mount a preview workbench into `root`.
35
+ *
36
+ * Orchestration order:
37
+ * 1. Inject workbench styles.
38
+ * 2. Install fake host (hooks → log panel + viewport height).
39
+ * 3. Render chrome (selectors, viewport, card shell, button strip, log panel).
40
+ * 4. On each scenario activation:
41
+ * a. computeWirePayloads(scenario, presetKey) → injectWire (host→plugin bootstrap).
42
+ * b. Call opts.mount(slotEl, { scenario }) → get cleanup fn.
43
+ * 5. On theme change: re-inject wire (no remount) so theme subscribers restyle.
44
+ * 6. On scenario switch: cleanup previous → repeat step 4.
45
+ */
46
+ export declare function createPreviewWorkbench(root: HTMLElement, opts: PreviewWorkbenchOptions): void;