dev-inspector 1.1.0 → 1.2.0
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 +12 -7
- package/lib/init.d.ts +9 -0
- package/lib/init.js +3 -2
- package/lib/ui/panel/behavior/setupPanelBehavior.d.ts +3 -0
- package/lib/ui/panel/behavior/setupPanelBehavior.js +3 -1
- package/lib/ui/panel/index.d.ts +2 -0
- package/lib/ui/panel/index.js +2 -2
- package/lib/ui/panel/shared/ensureStyle.js +2 -1
- package/lib/ui/panel/skin/applySkin.d.ts +2 -0
- package/lib/ui/panel/skin/applySkin.js +6 -0
- package/lib/ui/panel/skin/cartoonStyles.d.ts +14 -0
- package/lib/ui/panel/skin/cartoonStyles.js +172 -0
- package/lib/ui/panel/skin/index.d.ts +3 -0
- package/lib/ui/panel/skin/index.js +7 -0
- package/lib/ui/panel/skin/types.d.ts +4 -0
- package/package.json +3 -2
- package/lib/integrations/index.d.ts +0 -2
- package/lib/integrations/index.js +0 -7
- package/lib/integrations/jira/adf.d.ts +0 -11
- package/lib/integrations/jira/adf.js +0 -17
- package/lib/integrations/jira/client.d.ts +0 -4
- package/lib/integrations/jira/client.js +0 -113
- package/lib/integrations/jira/errors.d.ts +0 -10
- package/lib/integrations/jira/errors.js +0 -13
- package/lib/integrations/jira/index.d.ts +0 -2
- package/lib/integrations/jira/index.js +0 -8
- package/lib/integrations/types.d.ts +0 -54
- package/lib/storage/localStorage.d.ts +0 -30
- package/lib/storage/localStorage.js +0 -166
- package/lib/ui/logList.d.ts +0 -7
- package/lib/ui/logList.js +0 -117
- package/lib/ui/panel/integrations/icons.d.ts +0 -1
- package/lib/ui/panel/integrations/icons.js +0 -7
- package/lib/ui/panel/integrations/index.d.ts +0 -1
- package/lib/ui/panel/integrations/index.js +0 -5
- package/lib/ui/panel/integrations/jiraDialog.d.ts +0 -6
- package/lib/ui/panel/integrations/jiraDialog.js +0 -234
- package/lib/ui/panel/integrations/screenshot.d.ts +0 -4
- package/lib/ui/panel/integrations/screenshot.js +0 -51
- package/lib/ui/panel/localStorage/createLocalStorageView.d.ts +0 -4
- package/lib/ui/panel/localStorage/createLocalStorageView.js +0 -108
- package/lib/ui/panel/localStorage/index.d.ts +0 -3
- package/lib/ui/panel/localStorage/index.js +0 -7
- package/lib/ui/panel/localStorage/setupLocalStorageSync.d.ts +0 -9
- package/lib/ui/panel/localStorage/setupLocalStorageSync.js +0 -30
- package/lib/ui/panel/localStorage/types.d.ts +0 -6
- package/lib/ui/panel/localStorage/types.js +0 -2
- package/lib/ui/panel.d.ts +0 -15
- package/lib/ui/panel.js +0 -375
- package/lib/ui/shared/copy.d.ts +0 -2
- package/lib/ui/shared/copy.js +0 -101
- /package/lib/{integrations → ui/panel/skin}/types.js +0 -0
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ In-page devtools-style logger panel for web apps. Capture **console** and **netw
|
|
|
22
22
|
- Search across console messages and network requests (URL, method, status, body)
|
|
23
23
|
- Auto-scroll lock with a "Latest" jump button that surfaces unread entries
|
|
24
24
|
- Light / dark theme with `localStorage` persistence (defaults to light)
|
|
25
|
+
- Optional cartoon skin (Arc-inspired sticker look) selectable at init
|
|
25
26
|
- Configurable panel title (used in the header and the floating toggle)
|
|
26
27
|
- Vite demo playground
|
|
27
28
|
|
|
@@ -44,22 +45,26 @@ initDevInspector({
|
|
|
44
45
|
title: "My App Inspector",
|
|
45
46
|
theme: "light",
|
|
46
47
|
persistTheme: true,
|
|
48
|
+
skin: "default",
|
|
47
49
|
},
|
|
48
50
|
});
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
### Panel options
|
|
52
54
|
|
|
53
|
-
| Option | Type
|
|
54
|
-
| ----------------- |
|
|
55
|
-
| `title` | `string`
|
|
56
|
-
| `initiallyOpen` | `boolean`
|
|
57
|
-
| `theme` | `"light" \| "dark"`
|
|
58
|
-
| `persistTheme` | `boolean`
|
|
59
|
-
| `themeStorageKey` | `string`
|
|
55
|
+
| Option | Type | Default | Description |
|
|
56
|
+
| ----------------- | ------------------------ | ----------------------- | ------------------------------------------------------------------------------------ |
|
|
57
|
+
| `title` | `string` | `"Dev Inspector"` | Label shown in the panel header **and** the floating toggle pill in the bottom-right |
|
|
58
|
+
| `initiallyOpen` | `boolean` | `true` | Open the panel on mount |
|
|
59
|
+
| `theme` | `"light" \| "dark"` | `"light"` | Initial theme. Overridden by a stored value when `persistTheme` is `true` |
|
|
60
|
+
| `persistTheme` | `boolean` | `true` | Persist the user's theme choice in `localStorage` |
|
|
61
|
+
| `themeStorageKey` | `string` | `"dev-inspector:theme"` | Key used by `localStorage` to remember the theme |
|
|
62
|
+
| `skin` | `"default" \| "cartoon"` | `"default"` | Visual skin. `"cartoon"` switches to an Arc-inspired sticker look (light + dark) |
|
|
60
63
|
|
|
61
64
|
The theme can also be toggled at runtime via the sun/moon button in the panel header. When `persistTheme` is `true`, the choice is stored under `themeStorageKey` and restored on the next load.
|
|
62
65
|
|
|
66
|
+
The **skin** is an init-time decision (not exposed to end users). The cartoon skin shares the same dark/light toggle behaviour — both palettes are themed.
|
|
67
|
+
|
|
63
68
|
## Important: Browser-only (SSR)
|
|
64
69
|
|
|
65
70
|
Dev Inspector’s UI (`createPanel()` and the default `initDevInspector()` flow) requires a **browser environment** (it needs `document`).
|
package/lib/init.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type Theme = "light" | "dark";
|
|
2
|
+
export type Skin = "default" | "cartoon";
|
|
2
3
|
export type InitOptions = {
|
|
3
4
|
maxSize?: number;
|
|
4
5
|
panelOptions?: {
|
|
@@ -7,6 +8,14 @@ export type InitOptions = {
|
|
|
7
8
|
theme?: Theme;
|
|
8
9
|
persistTheme?: boolean;
|
|
9
10
|
themeStorageKey?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Visual skin for the inspector panel. Chosen at init time only —
|
|
13
|
+
* runtime users can still toggle dark/light, but the skin choice
|
|
14
|
+
* (e.g. cartoon branding) is a developer-side decision.
|
|
15
|
+
*
|
|
16
|
+
* @default "default"
|
|
17
|
+
*/
|
|
18
|
+
skin?: Skin;
|
|
10
19
|
};
|
|
11
20
|
networkOptions?: {
|
|
12
21
|
includeBodies?: boolean;
|
package/lib/init.js
CHANGED
|
@@ -12,7 +12,7 @@ function getGlobalBag() {
|
|
|
12
12
|
return globalThis;
|
|
13
13
|
}
|
|
14
14
|
function initDevInspector(options = {}) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
16
16
|
const key = getGlobalInstanceKey();
|
|
17
17
|
const bag = getGlobalBag();
|
|
18
18
|
const prev = bag[key];
|
|
@@ -20,7 +20,7 @@ function initDevInspector(options = {}) {
|
|
|
20
20
|
try {
|
|
21
21
|
prev.destroy();
|
|
22
22
|
}
|
|
23
|
-
catch (
|
|
23
|
+
catch (_p) {
|
|
24
24
|
void 0;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -38,6 +38,7 @@ function initDevInspector(options = {}) {
|
|
|
38
38
|
theme: (_k = options.panelOptions) === null || _k === void 0 ? void 0 : _k.theme,
|
|
39
39
|
persistTheme: (_l = options.panelOptions) === null || _l === void 0 ? void 0 : _l.persistTheme,
|
|
40
40
|
themeStorageKey: (_m = options.panelOptions) === null || _m === void 0 ? void 0 : _m.themeStorageKey,
|
|
41
|
+
skin: (_o = options.panelOptions) === null || _o === void 0 ? void 0 : _o.skin,
|
|
41
42
|
});
|
|
42
43
|
const destroy = () => {
|
|
43
44
|
try {
|
|
@@ -2,7 +2,10 @@ import type { LogStorage } from "../../../storage/logStorage";
|
|
|
2
2
|
import type { PanelHandle } from "..";
|
|
3
3
|
import type { PanelDOM } from "../dom/types";
|
|
4
4
|
import type { PanelState } from "../state/types";
|
|
5
|
+
import { type Skin } from "../skin";
|
|
5
6
|
export declare function setupPanelBehavior(dom: PanelDOM, state: PanelState, storage: LogStorage, themeConfig: {
|
|
6
7
|
storageKey: string;
|
|
7
8
|
persist: boolean;
|
|
9
|
+
}, skinConfig: {
|
|
10
|
+
skin: Skin;
|
|
8
11
|
}): PanelHandle;
|
|
@@ -4,7 +4,8 @@ exports.setupPanelBehavior = setupPanelBehavior;
|
|
|
4
4
|
const bindings_1 = require("../bindings");
|
|
5
5
|
const resize_1 = require("../resize");
|
|
6
6
|
const theme_1 = require("../theme");
|
|
7
|
-
|
|
7
|
+
const skin_1 = require("../skin");
|
|
8
|
+
function setupPanelBehavior(dom, state, storage, themeConfig, skinConfig) {
|
|
8
9
|
const applyVisibility = () => {
|
|
9
10
|
if (state.open)
|
|
10
11
|
dom.panel.classList.remove("di-hidden");
|
|
@@ -32,6 +33,7 @@ function setupPanelBehavior(dom, state, storage, themeConfig) {
|
|
|
32
33
|
if (themeConfig.persist)
|
|
33
34
|
(0, theme_1.saveTheme)(themeConfig.storageKey, next);
|
|
34
35
|
};
|
|
36
|
+
(0, skin_1.applySkin)(dom.root, skinConfig.skin);
|
|
35
37
|
(0, theme_1.applyTheme)(dom.root, state.theme);
|
|
36
38
|
updateThemeButton();
|
|
37
39
|
const bindings = (0, bindings_1.bindStorageToPanelView)({
|
package/lib/ui/panel/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LogStorage } from "../../storage/logStorage";
|
|
2
2
|
import { type Theme } from "./theme";
|
|
3
|
+
import type { Skin } from "./skin";
|
|
3
4
|
export type PanelOptions = {
|
|
4
5
|
storage: LogStorage;
|
|
5
6
|
title?: string;
|
|
@@ -8,6 +9,7 @@ export type PanelOptions = {
|
|
|
8
9
|
theme?: Theme;
|
|
9
10
|
persistTheme?: boolean;
|
|
10
11
|
themeStorageKey?: string;
|
|
12
|
+
skin?: Skin;
|
|
11
13
|
};
|
|
12
14
|
export type PanelHandle = {
|
|
13
15
|
open: () => void;
|
package/lib/ui/panel/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const state_1 = require("./state");
|
|
|
8
8
|
const behavior_1 = require("./behavior");
|
|
9
9
|
const theme_1 = require("./theme");
|
|
10
10
|
function createPanel(options) {
|
|
11
|
-
var _a, _b, _c, _d;
|
|
11
|
+
var _a, _b, _c, _d, _e;
|
|
12
12
|
const doc = (0, ensureDocument_1.ensureDocument)();
|
|
13
13
|
(0, ensureStyle_1.ensureStyle)(doc);
|
|
14
14
|
const persistTheme = (_a = options.persistTheme) !== null && _a !== void 0 ? _a : true;
|
|
@@ -17,5 +17,5 @@ function createPanel(options) {
|
|
|
17
17
|
const initialTheme = (_c = stored !== null && stored !== void 0 ? stored : options.theme) !== null && _c !== void 0 ? _c : "light";
|
|
18
18
|
const dom = (0, dom_1.buildPanelDOM)(doc, options);
|
|
19
19
|
const state = (0, state_1.createPanelState)((_d = options.initiallyOpen) !== null && _d !== void 0 ? _d : false, initialTheme);
|
|
20
|
-
return (0, behavior_1.setupPanelBehavior)(dom, state, options.storage, { storageKey, persist: persistTheme });
|
|
20
|
+
return (0, behavior_1.setupPanelBehavior)(dom, state, options.storage, { storageKey, persist: persistTheme }, { skin: (_e = options.skin) !== null && _e !== void 0 ? _e : "default" });
|
|
21
21
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureStyle = ensureStyle;
|
|
4
4
|
const panelStyles_1 = require("../../panelStyles");
|
|
5
|
+
const skin_1 = require("../skin");
|
|
5
6
|
function ensureStyle(doc) {
|
|
6
7
|
const id = "dev-inspector-panel-style";
|
|
7
8
|
const existing = doc.getElementById(id);
|
|
@@ -9,6 +10,6 @@ function ensureStyle(doc) {
|
|
|
9
10
|
return;
|
|
10
11
|
const style = doc.createElement("style");
|
|
11
12
|
style.id = id;
|
|
12
|
-
style.textContent = panelStyles_1.PANEL_CSS
|
|
13
|
+
style.textContent = `${panelStyles_1.PANEL_CSS}\n${skin_1.CARTOON_CSS}`;
|
|
13
14
|
doc.head.append(style);
|
|
14
15
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cartoon skin — Arc-inspired sticker / comic look.
|
|
3
|
+
*
|
|
4
|
+
* Activated by `data-di-skin="cartoon"` on `.di-root`. Combined with the
|
|
5
|
+
* existing `data-di-theme` attribute so we ship two cartoon variants
|
|
6
|
+
* (light + dark) that swap palette but keep the chunky borders, hard
|
|
7
|
+
* offset shadows, and rounded sticker shapes.
|
|
8
|
+
*
|
|
9
|
+
* The strategy is to redeclare the public `--di-*` design tokens for
|
|
10
|
+
* cartoon mode (so every component picks up the new look automatically)
|
|
11
|
+
* and then layer a few targeted overrides on top of the chrome elements
|
|
12
|
+
* that need a slightly different shape (thicker borders, no blur shadow).
|
|
13
|
+
*/
|
|
14
|
+
export declare const CARTOON_CSS = "\n/* ---- Cartoon \u00B7 Light --------------------------------------------------- */\n.di-root[data-di-skin=\"cartoon\"][data-di-theme=\"light\"] {\n --di-radius-sm: 10px;\n --di-radius-md: 14px;\n --di-radius-lg: 18px;\n --di-radius-pill: 999px;\n\n --di-bg: #FFF1D2;\n --di-bg-elev: #FFE6A8;\n --di-bg-soft: #FFF8E1;\n --di-bg-hover: #FFD56F;\n --di-bg-row: #FFF1D2;\n --di-bg-row-alt: #FFEAB8;\n --di-overlay: rgba(26, 31, 58, 0.06);\n\n --di-border: #1A1F3A;\n --di-border-strong: #1A1F3A;\n --di-border-soft: #1A1F3A;\n\n --di-text: #1A1F3A;\n --di-text-muted: #4A4F6A;\n --di-text-faint: #6A6F8A;\n --di-text-on-accent: #FFF1D2;\n\n --di-accent: #2E36C8;\n --di-accent-hover: #1F26A8;\n --di-accent-soft: rgba(46, 54, 200, 0.14);\n\n --di-success: #1A8260;\n --di-success-bg: rgba(167, 255, 0, 0.22);\n --di-success-border: #1A1F3A;\n\n --di-warning: #B5530A;\n --di-warning-bg: rgba(255, 213, 111, 0.32);\n --di-warning-border: #1A1F3A;\n\n --di-error: #C8102E;\n --di-error-bg: rgba(255, 110, 130, 0.20);\n --di-error-border: #1A1F3A;\n\n --di-shadow: 4px 4px 0 #1A1F3A;\n --di-shadow-lg: 6px 6px 0 #1A1F3A;\n --di-ring: 0 0 0 3px rgba(46, 54, 200, 0.32);\n}\n\n/* ---- Cartoon \u00B7 Dark ---------------------------------------------------- */\n.di-root[data-di-skin=\"cartoon\"][data-di-theme=\"dark\"] {\n --di-radius-sm: 10px;\n --di-radius-md: 14px;\n --di-radius-lg: 18px;\n --di-radius-pill: 999px;\n\n --di-bg: #1A1D38;\n --di-bg-elev: #232752;\n --di-bg-soft: #2A2E5C;\n --di-bg-hover: #353A6E;\n --di-bg-row: #1A1D38;\n --di-bg-row-alt: #232752;\n --di-overlay: rgba(255, 238, 184, 0.06);\n\n --di-border: #FFEEB8;\n --di-border-strong: #FFEEB8;\n --di-border-soft: #FFEEB8;\n\n --di-text: #FFEEB8;\n --di-text-muted: #C8C8E0;\n --di-text-faint: #8A8DAA;\n --di-text-on-accent: #1A1D38;\n\n --di-accent: #A7FF00;\n --di-accent-hover: #C5FF45;\n --di-accent-soft: rgba(167, 255, 0, 0.18);\n\n --di-success: #A7FF00;\n --di-success-bg: rgba(167, 255, 0, 0.18);\n --di-success-border: #FFEEB8;\n\n --di-warning: #FFD56F;\n --di-warning-bg: rgba(255, 213, 111, 0.18);\n --di-warning-border: #FFEEB8;\n\n --di-error: #FF8FA3;\n --di-error-bg: rgba(255, 143, 163, 0.18);\n --di-error-border: #FFEEB8;\n\n --di-shadow: 4px 4px 0 #FFEEB8;\n --di-shadow-lg: 6px 6px 0 #FFEEB8;\n --di-ring: 0 0 0 3px rgba(167, 255, 0, 0.36);\n}\n\n/* ---- Cartoon \u00B7 shared chrome ------------------------------------------- */\n.di-root[data-di-skin=\"cartoon\"] .di-toggle,\n.di-root[data-di-skin=\"cartoon\"] .di-panel,\n.di-root[data-di-skin=\"cartoon\"] .di-tab,\n.di-root[data-di-skin=\"cartoon\"] .di-jumpBtn {\n border-width: 2px;\n border-style: solid;\n}\n\n.di-root[data-di-skin=\"cartoon\"] .di-toggle {\n font-weight: 700;\n letter-spacing: 0.01em;\n}\n\n.di-root[data-di-skin=\"cartoon\"] .di-toggle:hover,\n.di-root[data-di-skin=\"cartoon\"] .di-jumpBtn:hover {\n transform: translate(-1px, -1px);\n box-shadow: var(--di-shadow-lg);\n}\n\n.di-root[data-di-skin=\"cartoon\"] .di-toggle:active,\n.di-root[data-di-skin=\"cartoon\"] .di-jumpBtn:active {\n transform: translate(2px, 2px);\n box-shadow: 0 0 0 #1A1F3A;\n}\n\n.di-root[data-di-skin=\"cartoon\"][data-di-theme=\"dark\"] .di-toggle:active,\n.di-root[data-di-skin=\"cartoon\"][data-di-theme=\"dark\"] .di-jumpBtn:active {\n box-shadow: 0 0 0 #FFEEB8;\n}\n\n.di-root[data-di-skin=\"cartoon\"] .di-tabActive {\n font-weight: 700;\n}\n\n/* Search bar: tighter sticker-style chip instead of stretched outlined input. */\n.di-root[data-di-skin=\"cartoon\"] .di-searchRow {\n padding: 6px 12px 10px;\n}\n\n.di-root[data-di-skin=\"cartoon\"] .di-searchWrap {\n border: 2px solid var(--di-border);\n border-radius: var(--di-radius-pill);\n background: var(--di-bg-soft);\n box-shadow: 2px 2px 0 var(--di-border);\n transition: box-shadow 120ms ease, transform 120ms ease;\n}\n\n.di-root[data-di-skin=\"cartoon\"] .di-searchWrap:focus-within {\n box-shadow: 3px 3px 0 var(--di-accent);\n border-color: var(--di-border);\n transform: translate(-1px, -1px);\n}\n\n.di-root[data-di-skin=\"cartoon\"] .di-searchInput {\n font-weight: 600;\n padding: 6px 10px;\n}\n\n.di-root[data-di-skin=\"cartoon\"] .di-searchInput::placeholder {\n font-weight: 500;\n color: var(--di-text-muted);\n opacity: 0.7;\n}\n";
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CARTOON_CSS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Cartoon skin — Arc-inspired sticker / comic look.
|
|
6
|
+
*
|
|
7
|
+
* Activated by `data-di-skin="cartoon"` on `.di-root`. Combined with the
|
|
8
|
+
* existing `data-di-theme` attribute so we ship two cartoon variants
|
|
9
|
+
* (light + dark) that swap palette but keep the chunky borders, hard
|
|
10
|
+
* offset shadows, and rounded sticker shapes.
|
|
11
|
+
*
|
|
12
|
+
* The strategy is to redeclare the public `--di-*` design tokens for
|
|
13
|
+
* cartoon mode (so every component picks up the new look automatically)
|
|
14
|
+
* and then layer a few targeted overrides on top of the chrome elements
|
|
15
|
+
* that need a slightly different shape (thicker borders, no blur shadow).
|
|
16
|
+
*/
|
|
17
|
+
exports.CARTOON_CSS = `
|
|
18
|
+
/* ---- Cartoon · Light --------------------------------------------------- */
|
|
19
|
+
.di-root[data-di-skin="cartoon"][data-di-theme="light"] {
|
|
20
|
+
--di-radius-sm: 10px;
|
|
21
|
+
--di-radius-md: 14px;
|
|
22
|
+
--di-radius-lg: 18px;
|
|
23
|
+
--di-radius-pill: 999px;
|
|
24
|
+
|
|
25
|
+
--di-bg: #FFF1D2;
|
|
26
|
+
--di-bg-elev: #FFE6A8;
|
|
27
|
+
--di-bg-soft: #FFF8E1;
|
|
28
|
+
--di-bg-hover: #FFD56F;
|
|
29
|
+
--di-bg-row: #FFF1D2;
|
|
30
|
+
--di-bg-row-alt: #FFEAB8;
|
|
31
|
+
--di-overlay: rgba(26, 31, 58, 0.06);
|
|
32
|
+
|
|
33
|
+
--di-border: #1A1F3A;
|
|
34
|
+
--di-border-strong: #1A1F3A;
|
|
35
|
+
--di-border-soft: #1A1F3A;
|
|
36
|
+
|
|
37
|
+
--di-text: #1A1F3A;
|
|
38
|
+
--di-text-muted: #4A4F6A;
|
|
39
|
+
--di-text-faint: #6A6F8A;
|
|
40
|
+
--di-text-on-accent: #FFF1D2;
|
|
41
|
+
|
|
42
|
+
--di-accent: #2E36C8;
|
|
43
|
+
--di-accent-hover: #1F26A8;
|
|
44
|
+
--di-accent-soft: rgba(46, 54, 200, 0.14);
|
|
45
|
+
|
|
46
|
+
--di-success: #1A8260;
|
|
47
|
+
--di-success-bg: rgba(167, 255, 0, 0.22);
|
|
48
|
+
--di-success-border: #1A1F3A;
|
|
49
|
+
|
|
50
|
+
--di-warning: #B5530A;
|
|
51
|
+
--di-warning-bg: rgba(255, 213, 111, 0.32);
|
|
52
|
+
--di-warning-border: #1A1F3A;
|
|
53
|
+
|
|
54
|
+
--di-error: #C8102E;
|
|
55
|
+
--di-error-bg: rgba(255, 110, 130, 0.20);
|
|
56
|
+
--di-error-border: #1A1F3A;
|
|
57
|
+
|
|
58
|
+
--di-shadow: 4px 4px 0 #1A1F3A;
|
|
59
|
+
--di-shadow-lg: 6px 6px 0 #1A1F3A;
|
|
60
|
+
--di-ring: 0 0 0 3px rgba(46, 54, 200, 0.32);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* ---- Cartoon · Dark ---------------------------------------------------- */
|
|
64
|
+
.di-root[data-di-skin="cartoon"][data-di-theme="dark"] {
|
|
65
|
+
--di-radius-sm: 10px;
|
|
66
|
+
--di-radius-md: 14px;
|
|
67
|
+
--di-radius-lg: 18px;
|
|
68
|
+
--di-radius-pill: 999px;
|
|
69
|
+
|
|
70
|
+
--di-bg: #1A1D38;
|
|
71
|
+
--di-bg-elev: #232752;
|
|
72
|
+
--di-bg-soft: #2A2E5C;
|
|
73
|
+
--di-bg-hover: #353A6E;
|
|
74
|
+
--di-bg-row: #1A1D38;
|
|
75
|
+
--di-bg-row-alt: #232752;
|
|
76
|
+
--di-overlay: rgba(255, 238, 184, 0.06);
|
|
77
|
+
|
|
78
|
+
--di-border: #FFEEB8;
|
|
79
|
+
--di-border-strong: #FFEEB8;
|
|
80
|
+
--di-border-soft: #FFEEB8;
|
|
81
|
+
|
|
82
|
+
--di-text: #FFEEB8;
|
|
83
|
+
--di-text-muted: #C8C8E0;
|
|
84
|
+
--di-text-faint: #8A8DAA;
|
|
85
|
+
--di-text-on-accent: #1A1D38;
|
|
86
|
+
|
|
87
|
+
--di-accent: #A7FF00;
|
|
88
|
+
--di-accent-hover: #C5FF45;
|
|
89
|
+
--di-accent-soft: rgba(167, 255, 0, 0.18);
|
|
90
|
+
|
|
91
|
+
--di-success: #A7FF00;
|
|
92
|
+
--di-success-bg: rgba(167, 255, 0, 0.18);
|
|
93
|
+
--di-success-border: #FFEEB8;
|
|
94
|
+
|
|
95
|
+
--di-warning: #FFD56F;
|
|
96
|
+
--di-warning-bg: rgba(255, 213, 111, 0.18);
|
|
97
|
+
--di-warning-border: #FFEEB8;
|
|
98
|
+
|
|
99
|
+
--di-error: #FF8FA3;
|
|
100
|
+
--di-error-bg: rgba(255, 143, 163, 0.18);
|
|
101
|
+
--di-error-border: #FFEEB8;
|
|
102
|
+
|
|
103
|
+
--di-shadow: 4px 4px 0 #FFEEB8;
|
|
104
|
+
--di-shadow-lg: 6px 6px 0 #FFEEB8;
|
|
105
|
+
--di-ring: 0 0 0 3px rgba(167, 255, 0, 0.36);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* ---- Cartoon · shared chrome ------------------------------------------- */
|
|
109
|
+
.di-root[data-di-skin="cartoon"] .di-toggle,
|
|
110
|
+
.di-root[data-di-skin="cartoon"] .di-panel,
|
|
111
|
+
.di-root[data-di-skin="cartoon"] .di-tab,
|
|
112
|
+
.di-root[data-di-skin="cartoon"] .di-jumpBtn {
|
|
113
|
+
border-width: 2px;
|
|
114
|
+
border-style: solid;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.di-root[data-di-skin="cartoon"] .di-toggle {
|
|
118
|
+
font-weight: 700;
|
|
119
|
+
letter-spacing: 0.01em;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.di-root[data-di-skin="cartoon"] .di-toggle:hover,
|
|
123
|
+
.di-root[data-di-skin="cartoon"] .di-jumpBtn:hover {
|
|
124
|
+
transform: translate(-1px, -1px);
|
|
125
|
+
box-shadow: var(--di-shadow-lg);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.di-root[data-di-skin="cartoon"] .di-toggle:active,
|
|
129
|
+
.di-root[data-di-skin="cartoon"] .di-jumpBtn:active {
|
|
130
|
+
transform: translate(2px, 2px);
|
|
131
|
+
box-shadow: 0 0 0 #1A1F3A;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.di-root[data-di-skin="cartoon"][data-di-theme="dark"] .di-toggle:active,
|
|
135
|
+
.di-root[data-di-skin="cartoon"][data-di-theme="dark"] .di-jumpBtn:active {
|
|
136
|
+
box-shadow: 0 0 0 #FFEEB8;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.di-root[data-di-skin="cartoon"] .di-tabActive {
|
|
140
|
+
font-weight: 700;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Search bar: tighter sticker-style chip instead of stretched outlined input. */
|
|
144
|
+
.di-root[data-di-skin="cartoon"] .di-searchRow {
|
|
145
|
+
padding: 6px 12px 10px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.di-root[data-di-skin="cartoon"] .di-searchWrap {
|
|
149
|
+
border: 2px solid var(--di-border);
|
|
150
|
+
border-radius: var(--di-radius-pill);
|
|
151
|
+
background: var(--di-bg-soft);
|
|
152
|
+
box-shadow: 2px 2px 0 var(--di-border);
|
|
153
|
+
transition: box-shadow 120ms ease, transform 120ms ease;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.di-root[data-di-skin="cartoon"] .di-searchWrap:focus-within {
|
|
157
|
+
box-shadow: 3px 3px 0 var(--di-accent);
|
|
158
|
+
border-color: var(--di-border);
|
|
159
|
+
transform: translate(-1px, -1px);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.di-root[data-di-skin="cartoon"] .di-searchInput {
|
|
163
|
+
font-weight: 600;
|
|
164
|
+
padding: 6px 10px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.di-root[data-di-skin="cartoon"] .di-searchInput::placeholder {
|
|
168
|
+
font-weight: 500;
|
|
169
|
+
color: var(--di-text-muted);
|
|
170
|
+
opacity: 0.7;
|
|
171
|
+
}
|
|
172
|
+
`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CARTOON_CSS = exports.applySkin = void 0;
|
|
4
|
+
var applySkin_1 = require("./applySkin");
|
|
5
|
+
Object.defineProperty(exports, "applySkin", { enumerable: true, get: function () { return applySkin_1.applySkin; } });
|
|
6
|
+
var cartoonStyles_1 = require("./cartoonStyles");
|
|
7
|
+
Object.defineProperty(exports, "CARTOON_CSS", { enumerable: true, get: function () { return cartoonStyles_1.CARTOON_CSS; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev-inspector",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "In-page devtools-style logger panel for web apps (console + network).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"lint-staged": "lint-staged",
|
|
17
17
|
"demo": "vite demo --open",
|
|
18
18
|
"demo:build": "vite build demo",
|
|
19
|
-
"
|
|
19
|
+
"clean": "rm -rf lib",
|
|
20
|
+
"build": "npm run clean && tsc -p tsconfig.json",
|
|
20
21
|
"lint": "eslint \"src/**/*.{ts,tsx,js}\"",
|
|
21
22
|
"prepublishOnly": "npm run build"
|
|
22
23
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JiraIntegrationError = exports.fetchJiraIssueTypes = exports.createJiraIssue = void 0;
|
|
4
|
-
var jira_1 = require("./jira");
|
|
5
|
-
Object.defineProperty(exports, "createJiraIssue", { enumerable: true, get: function () { return jira_1.createJiraIssue; } });
|
|
6
|
-
Object.defineProperty(exports, "fetchJiraIssueTypes", { enumerable: true, get: function () { return jira_1.fetchJiraIssueTypes; } });
|
|
7
|
-
Object.defineProperty(exports, "JiraIntegrationError", { enumerable: true, get: function () { return jira_1.JiraIntegrationError; } });
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.textToAdf = textToAdf;
|
|
4
|
-
function paragraph(text) {
|
|
5
|
-
return {
|
|
6
|
-
type: "paragraph",
|
|
7
|
-
content: text.length > 0 ? [{ type: "text", text }] : [],
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function textToAdf(text) {
|
|
11
|
-
const lines = text.split(/\r?\n/);
|
|
12
|
-
return {
|
|
13
|
-
type: "doc",
|
|
14
|
-
version: 1,
|
|
15
|
-
content: lines.map((l) => paragraph(l)),
|
|
16
|
-
};
|
|
17
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CreateIssueInput, CreateIssueResult, JiraIntegrationConfig } from "../types";
|
|
2
|
-
import type { JiraIssueTypeOption } from "../types";
|
|
3
|
-
export declare function fetchJiraIssueTypes(config: JiraIntegrationConfig, projectKey?: string): Promise<JiraIssueTypeOption[]>;
|
|
4
|
-
export declare function createJiraIssue(input: CreateIssueInput, config: JiraIntegrationConfig): Promise<CreateIssueResult>;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchJiraIssueTypes = fetchJiraIssueTypes;
|
|
4
|
-
exports.createJiraIssue = createJiraIssue;
|
|
5
|
-
const adf_1 = require("./adf");
|
|
6
|
-
const errors_1 = require("./errors");
|
|
7
|
-
async function readJsonSafe(res) {
|
|
8
|
-
try {
|
|
9
|
-
return (await res.json());
|
|
10
|
-
}
|
|
11
|
-
catch (_a) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function mapStatus(status) {
|
|
16
|
-
if (status === 400)
|
|
17
|
-
return { code: "bad_request", message: "Bad request. Check required fields and Jira configuration." };
|
|
18
|
-
if (status === 401)
|
|
19
|
-
return { code: "unauthorized", message: "Unauthorized. Check Jira credentials." };
|
|
20
|
-
if (status === 403)
|
|
21
|
-
return { code: "forbidden", message: "Forbidden. Check Jira permissions." };
|
|
22
|
-
if (status === 429)
|
|
23
|
-
return { code: "rate_limited", message: "Rate limited by Jira. Try again later." };
|
|
24
|
-
if (status >= 500)
|
|
25
|
-
return { code: "server_error", message: "Jira server error. Try again later." };
|
|
26
|
-
return { code: "unknown", message: "Unexpected Jira error." };
|
|
27
|
-
}
|
|
28
|
-
function isRecord(value) {
|
|
29
|
-
return typeof value === "object" && value !== null;
|
|
30
|
-
}
|
|
31
|
-
function toQuery(params) {
|
|
32
|
-
const sp = new URLSearchParams();
|
|
33
|
-
for (const [k, v] of Object.entries(params)) {
|
|
34
|
-
if (typeof v === "string" && v.length > 0)
|
|
35
|
-
sp.set(k, v);
|
|
36
|
-
}
|
|
37
|
-
const s = sp.toString();
|
|
38
|
-
return s.length > 0 ? `?${s}` : "";
|
|
39
|
-
}
|
|
40
|
-
async function fetchJiraIssueTypes(config, projectKey) {
|
|
41
|
-
var _a;
|
|
42
|
-
const proxyUrl = config.proxyUrl;
|
|
43
|
-
if (!proxyUrl)
|
|
44
|
-
throw new errors_1.JiraIntegrationError("Missing Jira proxyUrl.", "not_configured");
|
|
45
|
-
const url = `${proxyUrl}${toQuery({ op: "issueTypes", projectKey: (_a = projectKey !== null && projectKey !== void 0 ? projectKey : config.projectKey) !== null && _a !== void 0 ? _a : "" })}`;
|
|
46
|
-
let res;
|
|
47
|
-
try {
|
|
48
|
-
res = await fetch(url, { method: "GET", headers: { accept: "application/json" } });
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
throw new errors_1.JiraIntegrationError("Network error while loading Jira issue types.", "network_error", { details: String(e) });
|
|
52
|
-
}
|
|
53
|
-
const data = await readJsonSafe(res);
|
|
54
|
-
if (!res.ok) {
|
|
55
|
-
const mapped = mapStatus(res.status);
|
|
56
|
-
throw new errors_1.JiraIntegrationError(mapped.message, mapped.code, { status: res.status, details: data });
|
|
57
|
-
}
|
|
58
|
-
if (!Array.isArray(data))
|
|
59
|
-
return [];
|
|
60
|
-
const out = [];
|
|
61
|
-
for (const it of data) {
|
|
62
|
-
if (!isRecord(it))
|
|
63
|
-
continue;
|
|
64
|
-
const id = typeof it.id === "string" ? it.id : undefined;
|
|
65
|
-
const name = typeof it.name === "string" ? it.name : undefined;
|
|
66
|
-
if (id && name)
|
|
67
|
-
out.push({ id, name });
|
|
68
|
-
}
|
|
69
|
-
return out;
|
|
70
|
-
}
|
|
71
|
-
async function createJiraIssue(input, config) {
|
|
72
|
-
var _a, _b, _c, _d, _e, _f;
|
|
73
|
-
const title = input.title.trim();
|
|
74
|
-
if (title.length === 0)
|
|
75
|
-
throw new errors_1.JiraIntegrationError("Title is required.", "bad_request");
|
|
76
|
-
const projectKey = (_b = (_a = input.jira) === null || _a === void 0 ? void 0 : _a.projectKey) !== null && _b !== void 0 ? _b : config.projectKey;
|
|
77
|
-
if (!projectKey)
|
|
78
|
-
throw new errors_1.JiraIntegrationError("Missing Jira project key.", "not_configured");
|
|
79
|
-
const issueType = (_e = (_d = (_c = input.jira) === null || _c === void 0 ? void 0 : _c.issueType) !== null && _d !== void 0 ? _d : config.issueType) !== null && _e !== void 0 ? _e : {};
|
|
80
|
-
if (!issueType.name && !issueType.id)
|
|
81
|
-
throw new errors_1.JiraIntegrationError("Missing Jira issue type (name or id).", "not_configured");
|
|
82
|
-
const descriptionText = (_f = input.description) !== null && _f !== void 0 ? _f : "";
|
|
83
|
-
const adf = (0, adf_1.textToAdf)(descriptionText);
|
|
84
|
-
const proxyUrl = config.proxyUrl;
|
|
85
|
-
if (!proxyUrl)
|
|
86
|
-
throw new errors_1.JiraIntegrationError("Missing Jira proxyUrl.", "not_configured");
|
|
87
|
-
const res = await fetch(proxyUrl, {
|
|
88
|
-
method: "POST",
|
|
89
|
-
headers: { "content-type": "application/json" },
|
|
90
|
-
body: JSON.stringify({
|
|
91
|
-
provider: "jira",
|
|
92
|
-
input: {
|
|
93
|
-
title,
|
|
94
|
-
descriptionAdf: adf,
|
|
95
|
-
context: input.context,
|
|
96
|
-
screenshot: input.screenshot,
|
|
97
|
-
projectKey,
|
|
98
|
-
issueType,
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
});
|
|
102
|
-
const data = await readJsonSafe(res);
|
|
103
|
-
if (!res.ok) {
|
|
104
|
-
const mapped = mapStatus(res.status);
|
|
105
|
-
throw new errors_1.JiraIntegrationError(mapped.message, mapped.code, { status: res.status, details: data });
|
|
106
|
-
}
|
|
107
|
-
const rec = isRecord(data) ? data : {};
|
|
108
|
-
return {
|
|
109
|
-
id: typeof rec.id === "string" ? rec.id : undefined,
|
|
110
|
-
key: typeof rec.key === "string" ? rec.key : undefined,
|
|
111
|
-
url: typeof rec.url === "string" ? rec.url : undefined,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type JiraErrorCode = "not_configured" | "bad_request" | "unauthorized" | "forbidden" | "rate_limited" | "server_error" | "network_error" | "unknown";
|
|
2
|
-
export declare class JiraIntegrationError extends Error {
|
|
3
|
-
code: JiraErrorCode;
|
|
4
|
-
status?: number;
|
|
5
|
-
details?: unknown;
|
|
6
|
-
constructor(message: string, code: JiraErrorCode, options?: {
|
|
7
|
-
status?: number;
|
|
8
|
-
details?: unknown;
|
|
9
|
-
});
|
|
10
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JiraIntegrationError = void 0;
|
|
4
|
-
class JiraIntegrationError extends Error {
|
|
5
|
-
constructor(message, code, options) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = "JiraIntegrationError";
|
|
8
|
-
this.code = code;
|
|
9
|
-
this.status = options === null || options === void 0 ? void 0 : options.status;
|
|
10
|
-
this.details = options === null || options === void 0 ? void 0 : options.details;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.JiraIntegrationError = JiraIntegrationError;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JiraIntegrationError = exports.fetchJiraIssueTypes = exports.createJiraIssue = void 0;
|
|
4
|
-
var client_1 = require("./client");
|
|
5
|
-
Object.defineProperty(exports, "createJiraIssue", { enumerable: true, get: function () { return client_1.createJiraIssue; } });
|
|
6
|
-
Object.defineProperty(exports, "fetchJiraIssueTypes", { enumerable: true, get: function () { return client_1.fetchJiraIssueTypes; } });
|
|
7
|
-
var errors_1 = require("./errors");
|
|
8
|
-
Object.defineProperty(exports, "JiraIntegrationError", { enumerable: true, get: function () { return errors_1.JiraIntegrationError; } });
|