@clipbus/plugin-sdk 0.8.4 → 0.8.6

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,51 @@
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 { classifyWireSections, parsePayloadJson } from './inputPanel.js';
33
+ export type { WireSection } from './inputPanel.js';
34
+ export { PLUGIN_CALL_HANDLER_NAME, WINDOW_SET_HEIGHT_METHOD, } from '../generated/wireConstants.generated.js';
35
+ /**
36
+ * Mount a preview workbench into `root`.
37
+ *
38
+ * Orchestration order:
39
+ * 1. Inject workbench styles.
40
+ * 2. Install fake host (hooks → OUT log + viewport height).
41
+ * 3. Render chrome (header/controls, workspace hero, dock with IN/OUT cards).
42
+ * 4. On each scenario activation:
43
+ * a. computeWirePayloads(scenario, presetKey) → injectWire (host→plugin bootstrap).
44
+ * b. applyThemeCssVars(slotEl, ...) — mirror --clipbus-* vars to plugin slot.
45
+ * c. renderWireInput(inputContainer, payloads) — populate IN Wire Input panel.
46
+ * d. Call opts.mount(slotEl, { scenario }) → get cleanup fn.
47
+ * 5. On theme change: re-inject wire (no remount) + re-render Wire Input so
48
+ * the theme section reflects the new preset.
49
+ * 6. On scenario switch: cleanup previous → repeat step 4.
50
+ */
51
+ export declare function createPreviewWorkbench(root: HTMLElement, opts: PreviewWorkbenchOptions): void;
@@ -0,0 +1,51 @@
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 { classifyWireSections, parsePayloadJson } from './inputPanel.js';
33
+ export type { WireSection } from './inputPanel.js';
34
+ export { PLUGIN_CALL_HANDLER_NAME, WINDOW_SET_HEIGHT_METHOD, } from '../generated/wireConstants.generated.js';
35
+ /**
36
+ * Mount a preview workbench into `root`.
37
+ *
38
+ * Orchestration order:
39
+ * 1. Inject workbench styles.
40
+ * 2. Install fake host (hooks → OUT log + viewport height).
41
+ * 3. Render chrome (header/controls, workspace hero, dock with IN/OUT cards).
42
+ * 4. On each scenario activation:
43
+ * a. computeWirePayloads(scenario, presetKey) → injectWire (host→plugin bootstrap).
44
+ * b. applyThemeCssVars(slotEl, ...) — mirror --clipbus-* vars to plugin slot.
45
+ * c. renderWireInput(inputContainer, payloads) — populate IN Wire Input panel.
46
+ * d. Call opts.mount(slotEl, { scenario }) → get cleanup fn.
47
+ * 5. On theme change: re-inject wire (no remount) + re-render Wire Input so
48
+ * the theme section reflects the new preset.
49
+ * 6. On scenario switch: cleanup previous → repeat step 4.
50
+ */
51
+ export declare function createPreviewWorkbench(root: HTMLElement, opts: PreviewWorkbenchOptions): void;