@histoire/plugin-kit 0.0.0-stage → 1.0.0-beta.2
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/LICENSE +21 -0
- package/README.md +182 -2
- package/dist/builtins.d.ts +13 -0
- package/dist/builtins.d.ts.map +1 -0
- package/dist/builtins.js +7 -0
- package/dist/define.d.ts +19 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +43 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +14 -0
- package/dist/frame.d.ts +6 -0
- package/dist/frame.d.ts.map +1 -0
- package/dist/frame.js +3 -0
- package/dist/host/actions.d.ts +37 -0
- package/dist/host/actions.d.ts.map +1 -0
- package/dist/host/actions.js +47 -0
- package/dist/host/create-host.d.ts +9 -0
- package/dist/host/create-host.d.ts.map +1 -0
- package/dist/host/create-host.js +194 -0
- package/dist/host/diagnostics.d.ts +14 -0
- package/dist/host/diagnostics.d.ts.map +1 -0
- package/dist/host/diagnostics.js +26 -0
- package/dist/host/frames.d.ts +43 -0
- package/dist/host/frames.d.ts.map +1 -0
- package/dist/host/frames.js +63 -0
- package/dist/host/generation.d.ts +24 -0
- package/dist/host/generation.d.ts.map +1 -0
- package/dist/host/generation.js +38 -0
- package/dist/host/install.d.ts +43 -0
- package/dist/host/install.d.ts.map +1 -0
- package/dist/host/install.js +168 -0
- package/dist/host/manifest.d.ts +23 -0
- package/dist/host/manifest.d.ts.map +1 -0
- package/dist/host/manifest.js +37 -0
- package/dist/host/mount.d.ts +15 -0
- package/dist/host/mount.d.ts.map +1 -0
- package/dist/host/mount.js +57 -0
- package/dist/host/ordering.d.ts +20 -0
- package/dist/host/ordering.d.ts.map +1 -0
- package/dist/host/ordering.js +12 -0
- package/dist/host/plugin-api.d.ts +33 -0
- package/dist/host/plugin-api.d.ts.map +1 -0
- package/dist/host/plugin-api.js +113 -0
- package/dist/host/preferences.d.ts +57 -0
- package/dist/host/preferences.d.ts.map +1 -0
- package/dist/host/preferences.js +137 -0
- package/dist/host/registry.d.ts +43 -0
- package/dist/host/registry.d.ts.map +1 -0
- package/dist/host/registry.js +123 -0
- package/dist/host/resources.d.ts +20 -0
- package/dist/host/resources.d.ts.map +1 -0
- package/dist/host/resources.js +45 -0
- package/dist/ids.d.ts +32 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/ids.js +51 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/react/index.d.ts +19 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +25 -0
- package/dist/render/keys.d.ts +7 -0
- package/dist/render/keys.d.ts.map +1 -0
- package/dist/render/keys.js +15 -0
- package/dist/render/mount-manager.d.ts +36 -0
- package/dist/render/mount-manager.d.ts.map +1 -0
- package/dist/render/mount-manager.js +128 -0
- package/dist/render/view-binding.d.ts +19 -0
- package/dist/render/view-binding.d.ts.map +1 -0
- package/dist/render/view-binding.js +7 -0
- package/dist/render/workbench-components.d.ts +39 -0
- package/dist/render/workbench-components.d.ts.map +1 -0
- package/dist/render/workbench-components.js +76 -0
- package/dist/session/context.d.ts +66 -0
- package/dist/session/context.d.ts.map +1 -0
- package/dist/session/context.js +173 -0
- package/dist/session/frames.d.ts +46 -0
- package/dist/session/frames.d.ts.map +1 -0
- package/dist/session/frames.js +68 -0
- package/dist/shortcuts.d.ts +94 -0
- package/dist/shortcuts.d.ts.map +1 -0
- package/dist/shortcuts.js +157 -0
- package/dist/styles.d.ts +3 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +25 -0
- package/dist/svelte4/index.d.ts +27 -0
- package/dist/svelte4/index.d.ts.map +1 -0
- package/dist/svelte4/index.js +16 -0
- package/dist/svelte5/index.d.ts +21 -0
- package/dist/svelte5/index.d.ts.map +1 -0
- package/dist/svelte5/index.js +40 -0
- package/dist/types/actions.d.ts +12 -0
- package/dist/types/actions.d.ts.map +1 -0
- package/dist/types/actions.js +1 -0
- package/dist/types/base.d.ts +12 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +1 -0
- package/dist/types/canvas.d.ts +150 -0
- package/dist/types/canvas.d.ts.map +1 -0
- package/dist/types/canvas.js +1 -0
- package/dist/types/channel.d.ts +28 -0
- package/dist/types/channel.d.ts.map +1 -0
- package/dist/types/channel.js +1 -0
- package/dist/types/commands.d.ts +35 -0
- package/dist/types/commands.d.ts.map +1 -0
- package/dist/types/commands.js +1 -0
- package/dist/types/common.d.ts +7 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +1 -0
- package/dist/types/context.d.ts +72 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/context.js +1 -0
- package/dist/types/contribution.d.ts +56 -0
- package/dist/types/contribution.d.ts.map +1 -0
- package/dist/types/contribution.js +1 -0
- package/dist/types/frame.d.ts +41 -0
- package/dist/types/frame.d.ts.map +1 -0
- package/dist/types/frame.js +1 -0
- package/dist/types/host.d.ts +123 -0
- package/dist/types/host.d.ts.map +1 -0
- package/dist/types/host.js +1 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/inspector.d.ts +38 -0
- package/dist/types/inspector.d.ts.map +1 -0
- package/dist/types/inspector.js +1 -0
- package/dist/types/menus.d.ts +71 -0
- package/dist/types/menus.d.ts.map +1 -0
- package/dist/types/menus.js +1 -0
- package/dist/types/plugin.d.ts +133 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +1 -0
- package/dist/types/preferences.d.ts +31 -0
- package/dist/types/preferences.d.ts.map +1 -0
- package/dist/types/preferences.js +1 -0
- package/dist/types/services.d.ts +175 -0
- package/dist/types/services.d.ts.map +1 -0
- package/dist/types/services.js +1 -0
- package/dist/types/shell.d.ts +47 -0
- package/dist/types/shell.d.ts.map +1 -0
- package/dist/types/shell.js +1 -0
- package/dist/types/toolbar.d.ts +59 -0
- package/dist/types/toolbar.d.ts.map +1 -0
- package/dist/types/toolbar.js +1 -0
- package/dist/types/view.d.ts +82 -0
- package/dist/types/view.d.ts.map +1 -0
- package/dist/types/view.js +1 -0
- package/dist/vue/components.d.ts +122 -0
- package/dist/vue/components.d.ts.map +1 -0
- package/dist/vue/components.js +112 -0
- package/dist/vue/index.d.ts +21 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +47 -0
- package/dist/vue/mount.d.ts +9 -0
- package/dist/vue/mount.d.ts.map +1 -0
- package/dist/vue/mount.js +32 -0
- package/dist/vue/panel-action.d.ts +60 -0
- package/dist/vue/panel-action.d.ts.map +1 -0
- package/dist/vue/panel-action.js +28 -0
- package/package.json +92 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/types/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AACvM,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAAC,CAAA;IACpD,gCAAgC;IAChC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAC5D,yDAAyD;IACzD,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAAC,CAAA;IACnE;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,QAAQ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A;IACzF,qDAAqD;IACrD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,QAAQ,CAAA;CAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ContributionBase } from './base.js';
|
|
2
|
+
import type { WorkbenchIcon } from './common.js';
|
|
3
|
+
import type { WorkbenchContext } from './context.js';
|
|
4
|
+
import type { ContributionView } from './view.js';
|
|
5
|
+
/** Rail pane appended after built-in panes. */
|
|
6
|
+
export type ShellPaneInput = ContributionBase<WorkbenchContext> & {
|
|
7
|
+
/** Visible label. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Rail icon. */
|
|
10
|
+
icon: WorkbenchIcon;
|
|
11
|
+
/** Local or same-plugin qualified command id; the host publishes its qualified identity. */
|
|
12
|
+
primaryCommand?: string;
|
|
13
|
+
/** Optional count or short text shown on the rail item. */
|
|
14
|
+
badge?: (context: WorkbenchContext) => string | number | null | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the host renders a title header above the view; defaults to `true`. Set `false` when
|
|
17
|
+
* the view renders its own `WorkbenchPaneHeader` (for example to hold actions).
|
|
18
|
+
*/
|
|
19
|
+
header?: boolean;
|
|
20
|
+
} & ContributionView<WorkbenchContext>;
|
|
21
|
+
/** Settings section appended after built-in sections. */
|
|
22
|
+
export type SettingsSectionInput = ContributionBase<WorkbenchContext> & {
|
|
23
|
+
/** Visible label in settings navigation. */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Navigation icon. */
|
|
26
|
+
icon: WorkbenchIcon;
|
|
27
|
+
} & ContributionView<WorkbenchContext>;
|
|
28
|
+
/** Home page section appended to one column. */
|
|
29
|
+
export type HomeSectionInput = ContributionBase<WorkbenchContext> & {
|
|
30
|
+
/** Column receiving the section. */
|
|
31
|
+
column: 'primary' | 'secondary';
|
|
32
|
+
/** Section heading. */
|
|
33
|
+
title: string;
|
|
34
|
+
} & ContributionView<WorkbenchContext>;
|
|
35
|
+
/** Registered rail pane. */
|
|
36
|
+
export type ShellPaneContribution = ShellPaneInput & {
|
|
37
|
+
kind: 'shell.pane';
|
|
38
|
+
};
|
|
39
|
+
/** Registered settings section. */
|
|
40
|
+
export type SettingsSectionContribution = SettingsSectionInput & {
|
|
41
|
+
kind: 'settings.section';
|
|
42
|
+
};
|
|
43
|
+
/** Registered home section. */
|
|
44
|
+
export type HomeSectionContribution = HomeSectionInput & {
|
|
45
|
+
kind: 'home.section';
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/types/shell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAEjD,+CAA+C;AAC/C,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,GAAG;IAChE,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB;IACjB,IAAI,EAAE,aAAa,CAAA;IACnB,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACzE;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;AAEtC,yDAAyD;AACzD,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,GAAG;IACtE,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAA;IACb,uBAAuB;IACvB,IAAI,EAAE,aAAa,CAAA;CACpB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;AAEtC,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,GAAG;IAClE,oCAAoC;IACpC,MAAM,EAAE,SAAS,GAAG,WAAW,CAAA;IAC/B,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;AAEtC,4BAA4B;AAC5B,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAA;AAE3E,mCAAmC;AACnC,MAAM,MAAM,2BAA2B,GAAG,oBAAoB,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAE7F,+BAA+B;AAC/B,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ActionRun } from './actions.js';
|
|
2
|
+
import type { ContributionBase } from './base.js';
|
|
3
|
+
import type { WorkbenchIcon } from './common.js';
|
|
4
|
+
import type { WorkbenchContext } from './context.js';
|
|
5
|
+
import type { ContributionView } from './view.js';
|
|
6
|
+
/** Canvas contribution groups; `plugins` trails them before the built-in inspector action. */
|
|
7
|
+
export type ToolbarGroup = 'search' | 'tools' | 'arrange' | 'viewport' | 'zoom' | 'background' | 'screenshot' | 'embed' | 'inspector' | 'ui' | 'plugins';
|
|
8
|
+
/** Fields shared by every toolbar item type. */
|
|
9
|
+
type ToolbarItemCommon = ContributionBase<WorkbenchContext> & {
|
|
10
|
+
/** Overflow group receiving the item. */
|
|
11
|
+
group: ToolbarGroup;
|
|
12
|
+
/** Accessible name; also used in the overflow menu. */
|
|
13
|
+
label: string;
|
|
14
|
+
/** Button icon. */
|
|
15
|
+
icon: WorkbenchIcon;
|
|
16
|
+
};
|
|
17
|
+
/** Fields of button items (action, toggle, popover trigger). */
|
|
18
|
+
type ToolbarButtonCommon = ToolbarItemCommon & {
|
|
19
|
+
/**
|
|
20
|
+
* Qualified id of the command this button mirrors (`acme:toggle-grid`). The shortcut bound to
|
|
21
|
+
* that command is shown as the button's hint (tooltip, overflow menu), like built-in toolbar
|
|
22
|
+
* items. Clicking still calls `run` (or opens the popover); the shortcut runs the command.
|
|
23
|
+
*/
|
|
24
|
+
command?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Button running an action. */
|
|
27
|
+
export type ToolbarActionInput = ToolbarButtonCommon & {
|
|
28
|
+
/** Item type. */
|
|
29
|
+
type: 'action';
|
|
30
|
+
/** Action run on click. */
|
|
31
|
+
run: ActionRun<WorkbenchContext>;
|
|
32
|
+
};
|
|
33
|
+
/** Pressed-state button. */
|
|
34
|
+
export type ToolbarToggleInput = ToolbarButtonCommon & {
|
|
35
|
+
/** Item type. */
|
|
36
|
+
type: 'toggle';
|
|
37
|
+
/** Current pressed state, re-read on context and preference changes and `api.invalidate()`. */
|
|
38
|
+
pressed: (context: WorkbenchContext) => boolean;
|
|
39
|
+
/** Toggles state on click. */
|
|
40
|
+
run: ActionRun<WorkbenchContext>;
|
|
41
|
+
};
|
|
42
|
+
/** Button opening a popover rendering the view. */
|
|
43
|
+
export type ToolbarPopoverInput = ToolbarButtonCommon & {
|
|
44
|
+
/** Item type. */
|
|
45
|
+
type: 'popover';
|
|
46
|
+
} & ContributionView<WorkbenchContext>;
|
|
47
|
+
/** Arbitrary inline control rendered by the view; it owns its own hint, so there is no `command`. */
|
|
48
|
+
export type ToolbarCustomInput = ToolbarItemCommon & {
|
|
49
|
+
/** Item type. */
|
|
50
|
+
type: 'custom';
|
|
51
|
+
} & ContributionView<WorkbenchContext>;
|
|
52
|
+
/** Any toolbar item accepted by `api.toolbar.addItem`. */
|
|
53
|
+
export type ToolbarItemInput = ToolbarActionInput | ToolbarToggleInput | ToolbarPopoverInput | ToolbarCustomInput;
|
|
54
|
+
/** Registered toolbar item. */
|
|
55
|
+
export type ToolbarItemContribution = ToolbarItemInput & {
|
|
56
|
+
kind: 'toolbar.item';
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/types/toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAEjD,8FAA8F;AAC9F,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,OAAO,GACP,SAAS,GACT,UAAU,GACV,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,WAAW,GACX,IAAI,GACJ,SAAS,CAAA;AAEb,gDAAgD;AAChD,KAAK,iBAAiB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,GAAG;IAC5D,yCAAyC;IACzC,KAAK,EAAE,YAAY,CAAA;IACnB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,mBAAmB;IACnB,IAAI,EAAE,aAAa,CAAA;CACpB,CAAA;AAED,gEAAgE;AAChE,KAAK,mBAAmB,GAAG,iBAAiB,GAAG;IAC7C;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,gCAAgC;AAChC,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAAG;IACrD,iBAAiB;IACjB,IAAI,EAAE,QAAQ,CAAA;IACd,2BAA2B;IAC3B,GAAG,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAA;CACjC,CAAA;AAED,4BAA4B;AAC5B,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAAG;IACrD,iBAAiB;IACjB,IAAI,EAAE,QAAQ,CAAA;IACd,+FAA+F;IAC/F,OAAO,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAA;IAC/C,8BAA8B;IAC9B,GAAG,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAA;CACjC,CAAA;AAED,mDAAmD;AACnD,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG;IACtD,iBAAiB;IACjB,IAAI,EAAE,SAAS,CAAA;CAChB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;AAEtC,qGAAqG;AACrG,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG;IACnD,iBAAiB;IACjB,IAAI,EAAE,QAAQ,CAAA;CACf,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;AAEtC,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,kBAAkB,CAAA;AAEjH,+BAA+B;AAC/B,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Awaitable } from './common.js';
|
|
2
|
+
/**
|
|
3
|
+
* Vue component compiled against the workbench Vue instance.
|
|
4
|
+
* Kept opaque in the root entry so importing contracts never pulls `vue` types.
|
|
5
|
+
*/
|
|
6
|
+
export type WorkbenchComponent = object;
|
|
7
|
+
/** Presentation options shared by both view renderers. */
|
|
8
|
+
export interface ViewPresentation {
|
|
9
|
+
/** Ask the host to frame a view that cannot visually integrate with its surrounding surface. */
|
|
10
|
+
degradedVisualIntegration?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** View rendered as a workbench Vue component receiving a `context` prop. */
|
|
13
|
+
export interface ComponentView extends ViewPresentation {
|
|
14
|
+
/** Component rendered with the surface context as its `context` prop. */
|
|
15
|
+
component: WorkbenchComponent;
|
|
16
|
+
/** Exclusive with `component`. */
|
|
17
|
+
mount?: never;
|
|
18
|
+
}
|
|
19
|
+
/** View rendered through the framework-neutral DOM mount contract. */
|
|
20
|
+
export interface MountView<C> extends ViewPresentation {
|
|
21
|
+
/** Mounts into a host-owned container. */
|
|
22
|
+
mount: ViewMount<C>;
|
|
23
|
+
/** Exclusive with `mount`. */
|
|
24
|
+
component?: never;
|
|
25
|
+
}
|
|
26
|
+
/** Either renderer; both are first-class for every view-bearing contribution. */
|
|
27
|
+
export type ContributionView<C> = ComponentView | MountView<C>;
|
|
28
|
+
/**
|
|
29
|
+
* Mounts a view into `container`. The host owns the container; the view owns its children.
|
|
30
|
+
* Returning a handle lets the host push context snapshots and dispose the view.
|
|
31
|
+
*/
|
|
32
|
+
export type ViewMount<C> = (container: HTMLElement, context: C, host: ViewHost) => Awaitable<ViewHandle<C> | void>;
|
|
33
|
+
/** Host services available to one mounted view. */
|
|
34
|
+
export interface ViewHost {
|
|
35
|
+
/** Aborted when the view's scope retires; late mount completions are disposed immediately. */
|
|
36
|
+
signal: AbortSignal;
|
|
37
|
+
/** Element for popovers and menus that inherits workbench theme variables. */
|
|
38
|
+
overlayRoot: HTMLElement;
|
|
39
|
+
/** Reports an error attributed to this view's plugin and contribution. */
|
|
40
|
+
reportError: (error: unknown) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Renders a workbench empty, loading or error state into `container` (an element the view
|
|
43
|
+
* owns), replacing its children; `null` clears it. Calling again re-renders in place. Hosts
|
|
44
|
+
* render their own state components; without one, plain accessible markup.
|
|
45
|
+
*/
|
|
46
|
+
renderState: (container: HTMLElement, state: WorkbenchState | null) => void;
|
|
47
|
+
}
|
|
48
|
+
/** Shared state rendered by {@link ViewHost.renderState}, mirroring the workbench Vue state components. */
|
|
49
|
+
export type WorkbenchState = {
|
|
50
|
+
/** Nothing to show (no results, no selection). */
|
|
51
|
+
kind: 'empty';
|
|
52
|
+
/** Offline Carbon glyph name. */
|
|
53
|
+
icon: string;
|
|
54
|
+
/** Short headline, no trailing period. */
|
|
55
|
+
title: string;
|
|
56
|
+
/** Optional detail line. */
|
|
57
|
+
detail?: string;
|
|
58
|
+
} | {
|
|
59
|
+
/** Operation in progress. */
|
|
60
|
+
kind: 'loading';
|
|
61
|
+
/** Short headline naming the operation. */
|
|
62
|
+
title: string;
|
|
63
|
+
/** Optional detail line. */
|
|
64
|
+
detail?: string;
|
|
65
|
+
} | {
|
|
66
|
+
/** Operation failed; announced as an alert. */
|
|
67
|
+
kind: 'error';
|
|
68
|
+
/** Offline Carbon glyph name; hosts default to an error glyph. */
|
|
69
|
+
icon?: string;
|
|
70
|
+
/** Short headline naming the failed operation, no trailing period. */
|
|
71
|
+
title: string;
|
|
72
|
+
/** Optional error detail. */
|
|
73
|
+
detail?: string;
|
|
74
|
+
};
|
|
75
|
+
/** Lifecycle handle returned by a mounted view. */
|
|
76
|
+
export interface ViewHandle<C> {
|
|
77
|
+
/** Called with each new context snapshot instead of remounting. */
|
|
78
|
+
update?: (context: C) => void;
|
|
79
|
+
/** Releases everything the view created inside its container and overlay root. */
|
|
80
|
+
dispose?: () => Awaitable<void>;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/types/view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAEvC,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,gGAAgG;IAChG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AAA;CAChB,GACC;IACA,6BAA6B;IAC7B,IAAI,EAAE,SAAS,CAAA;IACf,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GACC;IACA,+CAA+C;IAC/C,IAAI,EAAE,OAAO,CAAA;IACb,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAA;IACb,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAEH,mDAAmD;AACnD,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,mEAAmE;IACnE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAA;IAC7B,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,CAAA;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { PropType, SlotsType, VNode } from 'vue';
|
|
2
|
+
/** Slots of the state components. */
|
|
3
|
+
interface StateSlots {
|
|
4
|
+
/** Optional detail line. */
|
|
5
|
+
default?: () => VNode[];
|
|
6
|
+
/** Optional follow-up or recovery buttons (empty and error states only). */
|
|
7
|
+
actions?: () => VNode[];
|
|
8
|
+
}
|
|
9
|
+
/** Empty area (no results, no selection), rendered with the host's empty state. */
|
|
10
|
+
export declare const WorkbenchEmptyState: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
11
|
+
/** Offline Carbon glyph name. */
|
|
12
|
+
icon: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
/** Short headline, no trailing period. */
|
|
17
|
+
title: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
/** Badge color: `accent` (default) or `neutral` for areas that are empty by default. */
|
|
22
|
+
tone: {
|
|
23
|
+
type: PropType<'accent' | 'neutral'>;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
/** Offline Carbon glyph name. */
|
|
30
|
+
icon: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
/** Short headline, no trailing period. */
|
|
35
|
+
title: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
/** Badge color: `accent` (default) or `neutral` for areas that are empty by default. */
|
|
40
|
+
tone: {
|
|
41
|
+
type: PropType<'accent' | 'neutral'>;
|
|
42
|
+
default: undefined;
|
|
43
|
+
};
|
|
44
|
+
}>> & Readonly<{}>, {
|
|
45
|
+
tone: "accent" | "neutral";
|
|
46
|
+
}, SlotsType<StateSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
/** Panel loading placeholder, rendered with the host's loading state. */
|
|
48
|
+
export declare const WorkbenchLoadingState: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
49
|
+
/** Short headline naming the operation in progress. */
|
|
50
|
+
title: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
required: true;
|
|
53
|
+
};
|
|
54
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
/** Short headline naming the operation in progress. */
|
|
58
|
+
title: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
required: true;
|
|
61
|
+
};
|
|
62
|
+
}>> & Readonly<{}>, {}, SlotsType<Pick<StateSlots, "default">>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
63
|
+
/** Panel failure announced as an alert, rendered with the host's error state. */
|
|
64
|
+
export declare const WorkbenchErrorState: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
65
|
+
/** Offline Carbon glyph name; the host defaults to an error glyph. */
|
|
66
|
+
icon: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: undefined;
|
|
69
|
+
};
|
|
70
|
+
/** Short headline naming the failed operation, no trailing period. */
|
|
71
|
+
title: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
76
|
+
[key: string]: any;
|
|
77
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
78
|
+
/** Offline Carbon glyph name; the host defaults to an error glyph. */
|
|
79
|
+
icon: {
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
default: undefined;
|
|
82
|
+
};
|
|
83
|
+
/** Short headline naming the failed operation, no trailing period. */
|
|
84
|
+
title: {
|
|
85
|
+
type: StringConstructor;
|
|
86
|
+
required: true;
|
|
87
|
+
};
|
|
88
|
+
}>> & Readonly<{}>, {
|
|
89
|
+
icon: string;
|
|
90
|
+
}, SlotsType<StateSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
91
|
+
/** Fixed-height pane header with a title and trailing actions. */
|
|
92
|
+
export declare const WorkbenchPaneHeader: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
93
|
+
/** Pane title. */
|
|
94
|
+
title: {
|
|
95
|
+
type: StringConstructor;
|
|
96
|
+
required: true;
|
|
97
|
+
};
|
|
98
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
101
|
+
/** Pane title. */
|
|
102
|
+
title: {
|
|
103
|
+
type: StringConstructor;
|
|
104
|
+
required: true;
|
|
105
|
+
};
|
|
106
|
+
}>> & Readonly<{}>, {}, SlotsType<{
|
|
107
|
+
default?: () => VNode[];
|
|
108
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
109
|
+
/** Filter or section switch row of a pane; a button group fills it. */
|
|
110
|
+
export declare const WorkbenchPaneToolbar: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
|
|
113
|
+
default?: () => VNode[];
|
|
114
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
115
|
+
/** Scrolling list body inset by the pane gutter; rows pad their content by the row inset. */
|
|
116
|
+
export declare const WorkbenchPaneList: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
117
|
+
[key: string]: any;
|
|
118
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
|
|
119
|
+
default?: () => VNode[];
|
|
120
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
121
|
+
export {};
|
|
122
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/vue/components.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAShE,qCAAqC;AACrC,UAAU,UAAU;IAClB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,KAAK,EAAE,CAAA;IACvB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,KAAK,EAAE,CAAA;CACxB;AAiCD,mFAAmF;AACnF,eAAO,MAAM,mBAAmB;IAG5B,iCAAiC;;;;;IAEjC,0CAA0C;;;;;IAE1C,wFAAwF;;QAChF,IAAI,EAAY,QAAQ,CAAC,QAAQ,GAAG,SAAS,CAAC;QAAE,OAAO;;;;;IAL/D,iCAAiC;;;;;IAEjC,0CAA0C;;;;;IAE1C,wFAAwF;;;;;;;+FAQ1F,CAAA;AAEF,yEAAyE;AACzE,eAAO,MAAM,qBAAqB;IAG9B,uDAAuD;;;;;;;;IAAvD,uDAAuD;;;;;qIAYzD,CAAA;AAEF,iFAAiF;AACjF,eAAO,MAAM,mBAAmB;IAG5B,sEAAsE;;QAC9D,IAAI;QAAU,OAAO;;IAC7B,sEAAsE;;;;;;;;IAFtE,sEAAsE;;;;;IAEtE,sEAAsE;;;;;;;+FAQxE,CAAA;AAEF,kEAAkE;AAClE,eAAO,MAAM,mBAAmB;IAG5B,kBAAkB;;;;;;;;IAAlB,kBAAkB;;;;;;cAGmB,MAAM,KAAK,EAAE;yEAKpD,CAAA;AAEF,uEAAuE;AACvE,eAAO,MAAM,oBAAoB;;;cAEQ,MAAM,KAAK,EAAE;yEAKpD,CAAA;AAEF,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB;;;cAEW,MAAM,KAAK,EAAE;yEAKpD,CAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { createLoadingDelay } from '@histoire/shared/loading-delay';
|
|
2
|
+
import { defineComponent, h, inject, onScopeDispose, ref } from 'vue';
|
|
3
|
+
import { WORKBENCH_COMPONENTS_KEY } from '../render/workbench-components.js';
|
|
4
|
+
/**
|
|
5
|
+
* Host implementation of one component, read once in setup.
|
|
6
|
+
* @param name Exported component name.
|
|
7
|
+
*/
|
|
8
|
+
function useImplementation(name) {
|
|
9
|
+
return inject(WORKBENCH_COMPONENTS_KEY, null)?.[name];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Props without `undefined` entries, so host defaults (such as the error icon) apply.
|
|
13
|
+
* @param props Wrapper props.
|
|
14
|
+
*/
|
|
15
|
+
function definedProps(props) {
|
|
16
|
+
return Object.fromEntries(Object.entries(props).filter(([, value]) => value !== undefined));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Plain state fallback: headline, detail and actions in a `status` or `alert` region.
|
|
20
|
+
* @param role Live region role.
|
|
21
|
+
* @param title Headline.
|
|
22
|
+
* @param detail Detail slot.
|
|
23
|
+
* @param actions Actions slot.
|
|
24
|
+
*/
|
|
25
|
+
function plainState(role, title, detail, actions) {
|
|
26
|
+
return h('div', { role }, [
|
|
27
|
+
h('strong', title),
|
|
28
|
+
detail ? h('p', detail()) : null,
|
|
29
|
+
actions ? h('div', actions()) : null,
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
/** Empty area (no results, no selection), rendered with the host's empty state. */
|
|
33
|
+
export const WorkbenchEmptyState = defineComponent({
|
|
34
|
+
name: 'WorkbenchEmptyState',
|
|
35
|
+
props: {
|
|
36
|
+
/** Offline Carbon glyph name. */
|
|
37
|
+
icon: { type: String, required: true },
|
|
38
|
+
/** Short headline, no trailing period. */
|
|
39
|
+
title: { type: String, required: true },
|
|
40
|
+
/** Badge color: `accent` (default) or `neutral` for areas that are empty by default. */
|
|
41
|
+
tone: { type: String, default: undefined },
|
|
42
|
+
},
|
|
43
|
+
slots: Object,
|
|
44
|
+
setup(props, { slots }) {
|
|
45
|
+
const implementation = useImplementation('WorkbenchEmptyState');
|
|
46
|
+
return () => implementation ? h(implementation, definedProps(props), slots) : plainState('status', props.title, slots.default, slots.actions);
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
/** Panel loading placeholder, rendered with the host's loading state. */
|
|
50
|
+
export const WorkbenchLoadingState = defineComponent({
|
|
51
|
+
name: 'WorkbenchLoadingState',
|
|
52
|
+
props: {
|
|
53
|
+
/** Short headline naming the operation in progress. */
|
|
54
|
+
title: { type: String, required: true },
|
|
55
|
+
},
|
|
56
|
+
slots: Object,
|
|
57
|
+
setup(props, { slots }) {
|
|
58
|
+
const implementation = useImplementation('WorkbenchLoadingState');
|
|
59
|
+
const visible = ref(false);
|
|
60
|
+
const delay = createLoadingDelay(value => visible.value = value);
|
|
61
|
+
if (!implementation)
|
|
62
|
+
delay.setPending(true);
|
|
63
|
+
onScopeDispose(delay.dispose);
|
|
64
|
+
return () => implementation ? h(implementation, definedProps(props), slots) : visible.value ? plainState('status', props.title, slots.default) : null;
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
/** Panel failure announced as an alert, rendered with the host's error state. */
|
|
68
|
+
export const WorkbenchErrorState = defineComponent({
|
|
69
|
+
name: 'WorkbenchErrorState',
|
|
70
|
+
props: {
|
|
71
|
+
/** Offline Carbon glyph name; the host defaults to an error glyph. */
|
|
72
|
+
icon: { type: String, default: undefined },
|
|
73
|
+
/** Short headline naming the failed operation, no trailing period. */
|
|
74
|
+
title: { type: String, required: true },
|
|
75
|
+
},
|
|
76
|
+
slots: Object,
|
|
77
|
+
setup(props, { slots }) {
|
|
78
|
+
const implementation = useImplementation('WorkbenchErrorState');
|
|
79
|
+
return () => implementation ? h(implementation, definedProps(props), slots) : plainState('alert', props.title, slots.default, slots.actions);
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
/** Fixed-height pane header with a title and trailing actions. */
|
|
83
|
+
export const WorkbenchPaneHeader = defineComponent({
|
|
84
|
+
name: 'WorkbenchPaneHeader',
|
|
85
|
+
props: {
|
|
86
|
+
/** Pane title. */
|
|
87
|
+
title: { type: String, required: true },
|
|
88
|
+
},
|
|
89
|
+
slots: Object,
|
|
90
|
+
setup(props, { slots }) {
|
|
91
|
+
const implementation = useImplementation('WorkbenchPaneHeader');
|
|
92
|
+
return () => implementation ? h(implementation, definedProps(props), slots) : h('header', [h('h2', props.title), slots.default?.()]);
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
/** Filter or section switch row of a pane; a button group fills it. */
|
|
96
|
+
export const WorkbenchPaneToolbar = defineComponent({
|
|
97
|
+
name: 'WorkbenchPaneToolbar',
|
|
98
|
+
slots: Object,
|
|
99
|
+
setup(_props, { slots }) {
|
|
100
|
+
const implementation = useImplementation('WorkbenchPaneToolbar');
|
|
101
|
+
return () => implementation ? h(implementation, null, slots) : h('div', slots.default?.());
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
/** Scrolling list body inset by the pane gutter; rows pad their content by the row inset. */
|
|
105
|
+
export const WorkbenchPaneList = defineComponent({
|
|
106
|
+
name: 'WorkbenchPaneList',
|
|
107
|
+
slots: Object,
|
|
108
|
+
setup(_props, { slots }) {
|
|
109
|
+
const implementation = useImplementation('WorkbenchPaneList');
|
|
110
|
+
return () => implementation ? h(implementation, null, slots) : h('div', slots.default?.());
|
|
111
|
+
},
|
|
112
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WorkbenchContext } from '../types/context.js';
|
|
2
|
+
import type { ViewHost, WorkbenchComponent } from '../types/view.js';
|
|
3
|
+
export { WorkbenchEmptyState, WorkbenchErrorState, WorkbenchLoadingState, WorkbenchPaneHeader, WorkbenchPaneList, WorkbenchPaneToolbar } from './components.js';
|
|
4
|
+
/**
|
|
5
|
+
* Types a Vue component as a workbench view component (receives a `context` prop).
|
|
6
|
+
* Identity at runtime.
|
|
7
|
+
* @param component Vue component compiled against the workbench Vue.
|
|
8
|
+
*/
|
|
9
|
+
export declare function defineWorkbenchComponent<T extends WorkbenchComponent>(component: T): T;
|
|
10
|
+
/**
|
|
11
|
+
* Reads the surface context inside a workbench Vue view component, at any depth.
|
|
12
|
+
*
|
|
13
|
+
* The returned object is a live view of the current snapshot: each property read goes to
|
|
14
|
+
* the latest context the host pushed, and reads during render re-render on change.
|
|
15
|
+
* Methods are bound to the snapshot they were read from.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useWorkbenchContext<C extends WorkbenchContext = WorkbenchContext>(): C;
|
|
18
|
+
/** Host services of the enclosing workbench view: abort signal, overlay root, error reporting. */
|
|
19
|
+
export declare function useViewHost(): ViewHost;
|
|
20
|
+
export { WorkbenchPanelAction } from './panel-action.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vue/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAIpE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE/J;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,kBAAkB,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAEtF;AASD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,KAAK,CAAC,CAgBtF;AAED,kGAAkG;AAClG,wBAAgB,WAAW,IAAI,QAAQ,CAEtC;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { inject } from 'vue';
|
|
2
|
+
import { WORKBENCH_VIEW_KEY } from '../render/view-binding.js';
|
|
3
|
+
export { WorkbenchEmptyState, WorkbenchErrorState, WorkbenchLoadingState, WorkbenchPaneHeader, WorkbenchPaneList, WorkbenchPaneToolbar } from './components.js';
|
|
4
|
+
/**
|
|
5
|
+
* Types a Vue component as a workbench view component (receives a `context` prop).
|
|
6
|
+
* Identity at runtime.
|
|
7
|
+
* @param component Vue component compiled against the workbench Vue.
|
|
8
|
+
*/
|
|
9
|
+
export function defineWorkbenchComponent(component) {
|
|
10
|
+
return component;
|
|
11
|
+
}
|
|
12
|
+
/** Binding of the nearest workbench view; throws outside one. */
|
|
13
|
+
function useBinding() {
|
|
14
|
+
const binding = inject(WORKBENCH_VIEW_KEY, null);
|
|
15
|
+
if (!binding)
|
|
16
|
+
throw new Error('[histoire plugin] workbench view helpers must be called in the setup of a component rendered as a workbench view');
|
|
17
|
+
return binding;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads the surface context inside a workbench Vue view component, at any depth.
|
|
21
|
+
*
|
|
22
|
+
* The returned object is a live view of the current snapshot: each property read goes to
|
|
23
|
+
* the latest context the host pushed, and reads during render re-render on change.
|
|
24
|
+
* Methods are bound to the snapshot they were read from.
|
|
25
|
+
*/
|
|
26
|
+
export function useWorkbenchContext() {
|
|
27
|
+
const binding = useBinding();
|
|
28
|
+
return new Proxy({}, {
|
|
29
|
+
get(_, key) {
|
|
30
|
+
const context = binding.context;
|
|
31
|
+
const value = Reflect.get(context, key, context);
|
|
32
|
+
return typeof value === 'function' ? value.bind(context) : value;
|
|
33
|
+
},
|
|
34
|
+
has: (_, key) => Reflect.has(binding.context, key),
|
|
35
|
+
ownKeys: () => Reflect.ownKeys(binding.context),
|
|
36
|
+
getOwnPropertyDescriptor(_, key) {
|
|
37
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(binding.context, key);
|
|
38
|
+
// The empty proxy target holds no properties, so every reported one must be configurable.
|
|
39
|
+
return descriptor && { ...descriptor, configurable: true };
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** Host services of the enclosing workbench view: abort signal, overlay root, error reporting. */
|
|
44
|
+
export function useViewHost() {
|
|
45
|
+
return useBinding().host;
|
|
46
|
+
}
|
|
47
|
+
export { WorkbenchPanelAction } from './panel-action.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MountView, WorkbenchComponent } from '../types/view.js';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a Vue component as a DOM `mount` view rendered in its own Vue app. The component
|
|
4
|
+
* receives `context` as a prop and through `useWorkbenchContext()`; updates re-render it
|
|
5
|
+
* without remounting.
|
|
6
|
+
* @param component Vue component receiving a `context` prop.
|
|
7
|
+
*/
|
|
8
|
+
export declare function vueView<C>(component: WorkbenchComponent): MountView<C>;
|
|
9
|
+
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/vue/mount.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAY,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAI/E;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,kBAAkB,GAAG,SAAS,CAAC,CAAC,CAAC,CAuBtE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createApp, h, shallowRef } from 'vue';
|
|
2
|
+
import { WORKBENCH_VIEW_KEY } from '../render/view-binding.js';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps a Vue component as a DOM `mount` view rendered in its own Vue app. The component
|
|
5
|
+
* receives `context` as a prop and through `useWorkbenchContext()`; updates re-render it
|
|
6
|
+
* without remounting.
|
|
7
|
+
* @param component Vue component receiving a `context` prop.
|
|
8
|
+
*/
|
|
9
|
+
export function vueView(component) {
|
|
10
|
+
return {
|
|
11
|
+
mount(container, context, host) {
|
|
12
|
+
const current = shallowRef(context);
|
|
13
|
+
const binding = {
|
|
14
|
+
get context() {
|
|
15
|
+
return current.value;
|
|
16
|
+
},
|
|
17
|
+
host,
|
|
18
|
+
};
|
|
19
|
+
const app = createApp({ render: () => h(component, { context: current.value }) });
|
|
20
|
+
app.provide(WORKBENCH_VIEW_KEY, binding);
|
|
21
|
+
app.mount(container);
|
|
22
|
+
return {
|
|
23
|
+
update(next) {
|
|
24
|
+
current.value = next;
|
|
25
|
+
},
|
|
26
|
+
dispose() {
|
|
27
|
+
app.unmount();
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Primary panel action rendered by host, with accessible fallback for external hosts. */
|
|
2
|
+
export declare const WorkbenchPanelAction: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
/** Offline Carbon glyph name. */
|
|
4
|
+
icon: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
/** Visible action label. */
|
|
9
|
+
label: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
/** Disable action and optional options trigger. */
|
|
14
|
+
disabled: BooleanConstructor;
|
|
15
|
+
/** Accessible name of optional options menu. */
|
|
16
|
+
menuLabel: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: undefined;
|
|
19
|
+
};
|
|
20
|
+
/** Optional menu width in pixels. */
|
|
21
|
+
menuWidth: {
|
|
22
|
+
type: NumberConstructor;
|
|
23
|
+
default: undefined;
|
|
24
|
+
};
|
|
25
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
/** Main action activated. */
|
|
29
|
+
click: (_event: MouseEvent) => true;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
/** Offline Carbon glyph name. */
|
|
32
|
+
icon: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
/** Visible action label. */
|
|
37
|
+
label: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
/** Disable action and optional options trigger. */
|
|
42
|
+
disabled: BooleanConstructor;
|
|
43
|
+
/** Accessible name of optional options menu. */
|
|
44
|
+
menuLabel: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
/** Optional menu width in pixels. */
|
|
49
|
+
menuWidth: {
|
|
50
|
+
type: NumberConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{
|
|
54
|
+
onClick?: ((_event: MouseEvent) => any) | undefined;
|
|
55
|
+
}>, {
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
menuLabel: string;
|
|
58
|
+
menuWidth: number;
|
|
59
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
60
|
+
//# sourceMappingURL=panel-action.d.ts.map
|