@devframes/hub-ui 0.9.7 → 0.9.9
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/dist/client/embedded.js +4592 -4372
- package/dist/client/standalone/assets/DockStandalone-Ce0YdEIy.js +3 -0
- package/dist/client/standalone/assets/context-DBww7Wy4.js +1 -0
- package/dist/client/standalone/assets/index-WkX38nos.js +9 -0
- package/dist/client/standalone/assets/popup-e5pfQ1h4.js +4 -0
- package/dist/client/standalone/index.html +10 -7
- package/dist/index.d.mts +37 -22
- package/dist/index.mjs +8 -3
- package/package.json +19 -19
- package/dist/client/standalone/assets/DockStandalone-CUnO93Bh.js +0 -3
- package/dist/client/standalone/assets/context-XVfTZFii.js +0 -1
- package/dist/client/standalone/assets/docks-DZd0ZNrd.js +0 -6
- package/dist/client/standalone/assets/index-Cm_XqfDS.js +0 -4
- package/dist/client/standalone/assets/keybindings-D1V7S3LX.js +0 -4
package/dist/index.d.mts
CHANGED
|
@@ -4,11 +4,11 @@ import { DevframeHubUi } from "@devframes/hub/initiate";
|
|
|
4
4
|
* Published `createUi()` config types, kept framework-free so the node
|
|
5
5
|
* entry's declaration rollup (`dist/index.d.mts`) never pulls in Vue's type
|
|
6
6
|
* surface. Client modules that need these types import them *from* here
|
|
7
|
-
* (never the reverse)
|
|
7
|
+
* (never the reverse); see `client/state/branding.ts`,
|
|
8
8
|
* `client/embedded/visibility.ts`.
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
|
-
* A logo asset
|
|
11
|
+
* A logo asset: a single URL/data-URI, or per-color-scheme variants. The dark
|
|
12
12
|
* variant falls back to the light one when only `light` is given (or a bare
|
|
13
13
|
* string is used for both).
|
|
14
14
|
*/
|
|
@@ -16,17 +16,30 @@ type BrandingLogo = string | {
|
|
|
16
16
|
light: string;
|
|
17
17
|
dark: string;
|
|
18
18
|
};
|
|
19
|
+
/** A value that can vary with the viewer color scheme. */
|
|
20
|
+
type ColorSchemeValue = string | {
|
|
21
|
+
light: string;
|
|
22
|
+
dark: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The standalone viewer background. The flat form applies in every context;
|
|
26
|
+
* the structured form may provide an iframe-specific value.
|
|
27
|
+
*/
|
|
28
|
+
type ViewerBackground = ColorSchemeValue | {
|
|
29
|
+
standalone: ColorSchemeValue;
|
|
30
|
+
iframe?: ColorSchemeValue;
|
|
31
|
+
};
|
|
19
32
|
/**
|
|
20
33
|
* Consumer-facing branding for the reference hub-ui. Every field is optional
|
|
21
34
|
* and falls back to devframe's own identity. Published as
|
|
22
35
|
* `ConnectionMeta.configs.ui.branding` via `createUi({ branding })`, and
|
|
23
|
-
* read from the one connection handshake the dock already performs
|
|
36
|
+
* read from the one connection handshake the dock already performs;
|
|
24
37
|
* `ConnectionMeta` has its own cross-realm propagation (see
|
|
25
38
|
* `DEVFRAME_CONNECTION_KEY`), so branding needs no globals or query params
|
|
26
39
|
* of its own.
|
|
27
40
|
*/
|
|
28
41
|
interface DevframeBranding {
|
|
29
|
-
/** Product name
|
|
42
|
+
/** Product name: the wordmark, window titles, and all user-visible copy. */
|
|
30
43
|
productName?: string;
|
|
31
44
|
/** Logo mark (URL / data-URI), rendered via `<img>`. */
|
|
32
45
|
logo?: BrandingLogo;
|
|
@@ -34,9 +47,11 @@ interface DevframeBranding {
|
|
|
34
47
|
wordmark?: BrandingLogo;
|
|
35
48
|
/** Brand color; feeds `--devframe-primary` and the whole primary ramp. */
|
|
36
49
|
primaryColor?: string;
|
|
50
|
+
/** Standalone viewer CSS `background`, optionally specialized for iframe use. */
|
|
51
|
+
background?: ViewerBackground;
|
|
37
52
|
/** Short line for the auth screen and the standalone meta description. */
|
|
38
53
|
tagline?: string;
|
|
39
|
-
/** Favicon URL
|
|
54
|
+
/** Favicon URL, applied on the standalone viewer and the popped-out window only. */
|
|
40
55
|
favicon?: string;
|
|
41
56
|
/** Window/tab title; defaults to `productName`. */
|
|
42
57
|
windowTitle?: string;
|
|
@@ -47,19 +62,19 @@ interface DevframeBranding {
|
|
|
47
62
|
* `ConnectionMeta.configs.ui.dockPreferences`. Read by the embedded dock and
|
|
48
63
|
* the standalone viewer at boot.
|
|
49
64
|
*
|
|
50
|
-
* Like the float/edge dock mode, these seed user-overridable state
|
|
65
|
+
* Like the float/edge dock mode, these seed user-overridable state; the
|
|
51
66
|
* config sets the default, the visitor's own choice wins from then on.
|
|
52
67
|
*/
|
|
53
68
|
interface DevframeDockPreferences {
|
|
54
69
|
/**
|
|
55
|
-
* The top-level dock-bar **category** ordering
|
|
70
|
+
* The top-level dock-bar **category** ordering: a map of category id →
|
|
56
71
|
* ordering weight (lower sorts earlier), merged beneath
|
|
57
72
|
* `DEFAULT_CATEGORIES_ORDER`.
|
|
58
73
|
*/
|
|
59
74
|
categoryOrder?: Record<string, number>;
|
|
60
75
|
/**
|
|
61
76
|
* Preferred inline-item capacity for the floating dock bar before entries
|
|
62
|
-
* overflow. Edge mode ignores it
|
|
77
|
+
* overflow. Edge mode ignores it; it shows every entry with no cutoff.
|
|
63
78
|
*/
|
|
64
79
|
maxVisibleItems?: number;
|
|
65
80
|
/** Seeds a first-run visitor's dock mode (float vs edge). */
|
|
@@ -68,19 +83,19 @@ interface DevframeDockPreferences {
|
|
|
68
83
|
defaultPosition?: 'left' | 'right' | 'top' | 'bottom';
|
|
69
84
|
}
|
|
70
85
|
/**
|
|
71
|
-
* How the embedded floating dock reveals itself on a fresh page
|
|
86
|
+
* How the embedded floating dock reveals itself on a fresh page: the
|
|
72
87
|
* reference UI's port of Nuxt DevTools' opt-in overlay, published as
|
|
73
88
|
* `ConnectionMeta.configs.ui.embeddedVisibility` and set via
|
|
74
89
|
* `createUi({ embeddedVisibility })`.
|
|
75
90
|
*
|
|
76
|
-
* - `normal` (default)
|
|
77
|
-
* - `passive
|
|
91
|
+
* - `normal` (default): the dock is shown immediately.
|
|
92
|
+
* - `passive`: the dock starts hidden and a console hint offers the reveal
|
|
78
93
|
* shortcut; revealing persists per-origin, so later sessions on this
|
|
79
94
|
* browser start shown. The "Hide" command returns to passive.
|
|
80
|
-
* - `hidden
|
|
95
|
+
* - `hidden`: the dock starts hidden and the shortcut reveals it for the
|
|
81
96
|
* current session only; nothing is persisted.
|
|
82
97
|
*
|
|
83
|
-
* Whatever the policy, the reveal state is a user-overridable preference
|
|
98
|
+
* Whatever the policy, the reveal state is a user-overridable preference,
|
|
84
99
|
* the same shape as the float/edge dock mode: the config seeds it, the
|
|
85
100
|
* visitor's own reveal/hide wins from then on.
|
|
86
101
|
*/
|
|
@@ -102,7 +117,7 @@ interface CreateUiOptions {
|
|
|
102
117
|
/** Serve the floating-dock bootstrap at `<base>embedded.js`. Default: `true`. */
|
|
103
118
|
embedded?: boolean;
|
|
104
119
|
/**
|
|
105
|
-
* Rebrand the reference UI
|
|
120
|
+
* Rebrand the reference UI: logo, product name, primary color, and more.
|
|
106
121
|
* Published as `ConnectionMeta.configs.ui.branding`, read by the dock at
|
|
107
122
|
* boot from the one connection handshake it already performs. Reaches
|
|
108
123
|
* both the embedded dock and the standalone viewer.
|
|
@@ -111,20 +126,20 @@ interface CreateUiOptions {
|
|
|
111
126
|
/**
|
|
112
127
|
* How the embedded floating dock reveals itself on a fresh page:
|
|
113
128
|
*
|
|
114
|
-
* - `'normal'` (default)
|
|
115
|
-
* - `'passive'
|
|
129
|
+
* - `'normal'` (default): shown immediately.
|
|
130
|
+
* - `'passive'`: starts hidden with a console hint; `Shift+Alt+D` reveals
|
|
116
131
|
* it, and the reveal persists per-origin so later sessions start shown.
|
|
117
|
-
* - `'hidden'
|
|
132
|
+
* - `'hidden'`: starts hidden; `Shift+Alt+D` reveals it for the current
|
|
118
133
|
* session only.
|
|
119
134
|
*
|
|
120
135
|
* Published as `ConnectionMeta.configs.ui.embeddedVisibility`. Like the
|
|
121
|
-
* float/edge dock mode, it seeds a user-overridable preference
|
|
136
|
+
* float/edge dock mode, it seeds a user-overridable preference; the
|
|
122
137
|
* visitor's own reveal/hide wins from then on. Applies to the embedded
|
|
123
138
|
* dock only; the standalone viewer is an explicit visit and always shows.
|
|
124
139
|
*/
|
|
125
140
|
embeddedVisibility?: EmbeddedVisibility;
|
|
126
141
|
/**
|
|
127
|
-
* Dock-bar rendering preferences
|
|
142
|
+
* Dock-bar rendering preferences: category ordering, floating-dock
|
|
128
143
|
* inline-item capacity, and the first-run float/edge mode and position.
|
|
129
144
|
* Published as `ConnectionMeta.configs.ui.dockPreferences`; each seeds a
|
|
130
145
|
* user-overridable preference the visitor's own choice then wins.
|
|
@@ -132,7 +147,7 @@ interface CreateUiOptions {
|
|
|
132
147
|
dockPreferences?: DevframeDockPreferences;
|
|
133
148
|
}
|
|
134
149
|
/**
|
|
135
|
-
* The reference implementation of the hub's {@link DevframeHubUi} slot
|
|
150
|
+
* The reference implementation of the hub's {@link DevframeHubUi} slot,
|
|
136
151
|
* prebuilt from this package's web components (the floating `DockEmbedded`
|
|
137
152
|
* bootstrap and the standalone `DockStandalone` SPA), styled with the
|
|
138
153
|
* shared devframe design system.
|
|
@@ -144,10 +159,10 @@ interface CreateUiOptions {
|
|
|
144
159
|
* const hub = initHub({ devframes: [git, terminals], ui: createUi() })
|
|
145
160
|
* ```
|
|
146
161
|
*
|
|
147
|
-
* The hub stays headless either way
|
|
162
|
+
* The hub stays headless either way; this object is one implementation of
|
|
148
163
|
* the slot; a hub UI provider (a product's or your own) supplies a different one to the
|
|
149
164
|
* same option and reuses all the infrastructure.
|
|
150
165
|
*/
|
|
151
166
|
declare function createUi(options?: CreateUiOptions): DevframeHubUi;
|
|
152
167
|
//#endregion
|
|
153
|
-
export { CreateUiOptions, type DevframeBranding, type DevframeDockPreferences, type EmbeddedVisibility, createUi };
|
|
168
|
+
export { type ColorSchemeValue, CreateUiOptions, type DevframeBranding, type DevframeDockPreferences, type EmbeddedVisibility, type ViewerBackground, createUi };
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
* The built client assets live next to the built entry (`dist/index.mjs` →
|
|
7
7
|
* `dist/client/`). When this module runs from source instead (tests and
|
|
8
8
|
* playgrounds resolving the workspace alias), fall back to the package's
|
|
9
|
-
* `dist/client
|
|
9
|
+
* `dist/client/`; the assets are build artifacts either way.
|
|
10
10
|
*/
|
|
11
11
|
function clientDir() {
|
|
12
12
|
const here = fileURLToPath(new URL(".", import.meta.url));
|
|
@@ -15,7 +15,7 @@ function clientDir() {
|
|
|
15
15
|
return join(here, "../dist/client");
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* The reference implementation of the hub's {@link DevframeHubUi} slot
|
|
18
|
+
* The reference implementation of the hub's {@link DevframeHubUi} slot,
|
|
19
19
|
* prebuilt from this package's web components (the floating `DockEmbedded`
|
|
20
20
|
* bootstrap and the standalone `DockStandalone` SPA), styled with the
|
|
21
21
|
* shared devframe design system.
|
|
@@ -27,7 +27,7 @@ function clientDir() {
|
|
|
27
27
|
* const hub = initHub({ devframes: [git, terminals], ui: createUi() })
|
|
28
28
|
* ```
|
|
29
29
|
*
|
|
30
|
-
* The hub stays headless either way
|
|
30
|
+
* The hub stays headless either way; this object is one implementation of
|
|
31
31
|
* the slot; a hub UI provider (a product's or your own) supplies a different one to the
|
|
32
32
|
* same option and reuses all the infrastructure.
|
|
33
33
|
*/
|
|
@@ -36,6 +36,11 @@ function createUi(options = {}) {
|
|
|
36
36
|
return {
|
|
37
37
|
...options.viewer !== false ? { viewer: { distDir: join(client, "standalone") } } : {},
|
|
38
38
|
...options.embedded !== false ? { embedded: { entry: join(client, "embedded.js") } } : {},
|
|
39
|
+
/**
|
|
40
|
+
* Publish the reference UI's config through the generic `ctx.staticConfig`,
|
|
41
|
+
* which rides the connection handshake to every mounted frame and the
|
|
42
|
+
* standalone viewer as `ConnectionMeta.configs.ui`.
|
|
43
|
+
*/
|
|
39
44
|
setup(ctx) {
|
|
40
45
|
ctx.staticConfig.ui = {
|
|
41
46
|
branding: options.branding || {},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/hub-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.9",
|
|
5
5
|
"description": "Reference UI for the devframe hub, providing the floating dock and standalone viewer.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@devframes/
|
|
33
|
-
"@devframes/
|
|
34
|
-
"devframe": "0.9.
|
|
32
|
+
"@devframes/hub": "0.9.9",
|
|
33
|
+
"@devframes/json-render": "0.9.9",
|
|
34
|
+
"devframe": "0.9.9"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@devframes/json-render": {
|
|
@@ -39,27 +39,27 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@antfu/design": "^0.
|
|
42
|
+
"@antfu/design": "^0.4.0",
|
|
43
|
+
"@devframes/hub": "0.9.9",
|
|
44
|
+
"@devframes/json-render": "0.9.9",
|
|
45
|
+
"@devframes/plugin-git": "0.9.9",
|
|
43
46
|
"@iconify-json/ph": "^1.2.2",
|
|
44
|
-
"@storybook/addon-docs": "^10.5.
|
|
45
|
-
"@storybook/vue3-vite": "^10.5.
|
|
46
|
-
"@types/node": "^26.
|
|
47
|
-
"@unocss/reset": "^66.
|
|
47
|
+
"@storybook/addon-docs": "^10.5.10",
|
|
48
|
+
"@storybook/vue3-vite": "^10.5.10",
|
|
49
|
+
"@types/node": "^26.4.0",
|
|
50
|
+
"@unocss/reset": "^66.8.1",
|
|
48
51
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
49
52
|
"@vueuse/core": "^14.4.0",
|
|
50
|
-
"
|
|
53
|
+
"devframe": "0.9.9",
|
|
54
|
+
"dompurify": "^3.4.14",
|
|
51
55
|
"fuse.js": "^7.5.0",
|
|
52
56
|
"iframe-pane": "^1.1.0",
|
|
53
|
-
"storybook": "^10.5.
|
|
57
|
+
"storybook": "^10.5.10",
|
|
54
58
|
"tsdown": "^0.22.14",
|
|
55
|
-
"tsx": "^4.23.
|
|
56
|
-
"unocss": "^66.
|
|
57
|
-
"vite": "^8.2.
|
|
58
|
-
"vue": "^3.5.
|
|
59
|
-
"@devframes/hub": "0.9.7",
|
|
60
|
-
"@devframes/plugin-git": "0.9.7",
|
|
61
|
-
"@devframes/json-render": "0.9.7",
|
|
62
|
-
"devframe": "0.9.7"
|
|
59
|
+
"tsx": "^4.23.13",
|
|
60
|
+
"unocss": "^66.8.1",
|
|
61
|
+
"vite": "^8.2.2",
|
|
62
|
+
"vue": "^3.5.42"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "pnpm run build:css && pnpm run build:node && pnpm run build:embedded && pnpm run build:standalone",
|