@sakana-y/vue-grab-shared 0.1.1 → 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # @sakana-y/vue-grab-shared
2
+
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#38](https://github.com/SaKaNa-Y/vue-grab/pull/38) [`a90677f`](https://github.com/SaKaNa-Y/vue-grab/commit/a90677f19389bb7875ca54164e4554830f80a2d7) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Hide beta toolbar entries by default and label Magnifier, Logs, and Network as Beta in Dock settings.
8
+
9
+ - [#38](https://github.com/SaKaNa-Y/vue-grab/pull/38) [`a90677f`](https://github.com/SaKaNa-Y/vue-grab/commit/a90677f19389bb7875ca54164e4554830f80a2d7) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Add package README, license, and npm metadata so published package pages show documentation and project links.
10
+
11
+ ## 0.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#35](https://github.com/SaKaNa-Y/vue-grab/pull/35) [`56d9d44`](https://github.com/SaKaNa-Y/vue-grab/commit/56d9d448c62ce2f11607fe7bf5b570ce4ecad40a) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Add floating-button toolbar entry visibility and ordering preferences with a locked Settings entry, grouped shortcut settings, and drag reordering within Dock feature groups.
16
+
17
+ - [#31](https://github.com/SaKaNa-Y/vue-grab/pull/31) [`151ffdb`](https://github.com/SaKaNa-Y/vue-grab/commit/151ffdbd6b8b56ecff1437debd3a38cfbc57b618) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Expose shared protocol constants and request types for advanced integrations.
18
+
19
+ - [#32](https://github.com/SaKaNa-Y/vue-grab/pull/32) [`14163a0`](https://github.com/SaKaNa-Y/vue-grab/commit/14163a075eeb8783a490b7997e8b8ce1b048b9c7) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Add floating-button dock modes with persisted Float and Edge panel behavior plus outside-click panel closing.
20
+
21
+ - [#36](https://github.com/SaKaNa-Y/vue-grab/pull/36) [`0cdf6ae`](https://github.com/SaKaNa-Y/vue-grab/commit/0cdf6ae870fa9da9b4a66de45679365dff85a978) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Add persisted, user-configurable shortcuts for every floating-bar feature.
22
+
23
+ - [#28](https://github.com/SaKaNa-Y/vue-grab/pull/28) [`4ad57b5`](https://github.com/SaKaNa-Y/vue-grab/commit/4ad57b57e86a4c3c3f37d1d951ab69b8c5151a97) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Harden the Vite open-in-editor endpoint and make network body capture opt-in by default.
24
+
25
+ ## 0.1.0
26
+
27
+ ### Minor Changes
28
+
29
+ - [#21](https://github.com/SaKaNa-Y/vue-grab/pull/21) [`6df5750`](https://github.com/SaKaNa-Y/vue-grab/commit/6df5750f22dc975340180c22a656294a4d85291d) Thanks [@SaKaNa-Y](https://github.com/SaKaNa-Y)! - Rename `errorCapture` → `consoleCapture` and broaden capture from `console.error` only to all five console levels (`log`, `info`, `warn`, `error`, `debug`). The FloatingButton panel now surfaces every captured entry with per-level filter pills and a message search input; the badge counts only `warn` + `error` entries to keep it actionable.
30
+
31
+ Breaking changes — no backwards-compatible aliases:
32
+ - Config key `errorCapture` → `consoleCapture`.
33
+ - Type `ErrorCaptureConfig` → `ConsoleCaptureConfig`:
34
+ - `maxErrors` (default 50) → `maxEntries` (default 200).
35
+ - `captureConsoleError: boolean` replaced by `levels: LogLevel[]` (default is all five levels enabled). The levels array is replaced wholesale by `mergeConfig`, not element-merged.
36
+ - `captureUnhandled` and `captureVueErrors` retained with identical semantics.
37
+ - Type `CapturedError` → `CapturedLog`. The single `type` field is replaced with two axes: `level: "log" | "info" | "warn" | "error" | "debug"` and `source: "console" | "runtime" | "promise" | "vue"`. Runtime/promise/Vue entries always carry `level: "error"`.
38
+ - Constant `VUE_ERROR_EVENT` retained (the underlying window-event string `"vue-grab:vue-error"` is unchanged).
39
+ - Standalone `init()` API: `onError` / `clearErrors` → `onLog` / `clearLogs`.
40
+ - FloatingButton methods: `setErrors` / `onErrorsClear` → `setLogs` / `onLogsClear` (internal, only affects code that imports `FloatingButton` directly).
41
+ - Dedup fingerprint now includes `source` and `level`, so the same message at different levels or from different sources produces distinct entries.
42
+ - Arguments passed to `console.*` are now stringified at capture time via a safe stringifier that handles circular references, Error instances (preserving `.stack`), and truncates very long values.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Vue Grab Shared
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@sakana-y/vue-grab-shared)](https://www.npmjs.com/package/@sakana-y/vue-grab-shared)
4
+ [![license](https://img.shields.io/npm/l/@sakana-y/vue-grab-shared)](./LICENSE)
5
+
6
+ Shared types, defaults, config merging, and protocol constants for Vue Grab integrations.
7
+
8
+ Most applications should import from `@sakana-y/vue-grab`. Use this package when you are building tooling, tests, or integrations that need stable Vue Grab contracts without importing the Vue runtime.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ pnpm add -D @sakana-y/vue-grab-shared
14
+ ```
15
+
16
+ ## Exports
17
+
18
+ ```ts
19
+ import {
20
+ DEFAULT_CONFIG,
21
+ DEFAULT_FLOATING_BUTTON,
22
+ OPEN_IN_EDITOR_CONTENT_TYPE,
23
+ OPEN_IN_EDITOR_ENDPOINT,
24
+ VUE_ERROR_EVENT,
25
+ mergeConfig,
26
+ } from "@sakana-y/vue-grab-shared";
27
+
28
+ import type {
29
+ CapturedLog,
30
+ CapturedRequest,
31
+ ComponentInfo,
32
+ GrabConfig,
33
+ GrabResult,
34
+ GrabUserConfig,
35
+ OpenInEditorRequest,
36
+ } from "@sakana-y/vue-grab-shared";
37
+ ```
38
+
39
+ ## Configuration Merging
40
+
41
+ Use `mergeConfig()` whenever you combine user config with defaults:
42
+
43
+ ```ts
44
+ import { DEFAULT_CONFIG, mergeConfig } from "@sakana-y/vue-grab-shared";
45
+
46
+ const config = mergeConfig(DEFAULT_CONFIG, {
47
+ floatingButton: { enabled: true },
48
+ networkCapture: {
49
+ redactHeaders: ["authorization", "x-api-key"],
50
+ },
51
+ });
52
+ ```
53
+
54
+ `GrabConfig` contains nested objects, so object spread is not enough for safe overrides. Array fields such as `consoleCapture.levels`, `networkCapture.redactHeaders`, and `networkCapture.urlDenyList` are replaced wholesale.
55
+
56
+ ## Related Packages
57
+
58
+ - `@sakana-y/vue-grab`: Vue plugin, runtime APIs, and Vite integration.
59
+ - `@sakana-y/vue-grab-cli`: CLI setup tool for Vite and Vue projects.
60
+
61
+ ## Links
62
+
63
+ - Repository: https://github.com/SaKaNa-Y/vue-grab
64
+ - Issues: https://github.com/SaKaNa-Y/vue-grab/issues
65
+ - Changelog: ./CHANGELOG.md
66
+ - License: ./LICENSE
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`/__open-in-editor`,t=`application/json`,n=8192,r=`__VUE_GRAB_ROOT__`,i=[`atom`,`code`,`cursor`,`emacs`,`idea`,`nvim`,`phpstorm`,`sublime`,`vim`,`visualstudio`,`webstorm`];function a(e){return typeof e==`string`&&i.includes(e)}var o=`#4f46e5`,s=`#ffffff`,c=`Alt+Shift+G`,l=[`grab`,`settings`,`magnifier`,`measurer`,`accessibility`,`logs`,`network`],u={enabled:!1,initialPosition:`top-center`,dockMode:`float`,dockEntries:{order:[...l],hidden:[]},shortcuts:{grab:[c],measurer:[`Alt+Shift+M`]},storageKey:`vue-grab-fab-pos`,dockModeStorageKey:`vue-grab-dock-mode`,dockEntriesStorageKey:`vue-grab-dock-entries`,shortcutsStorageKey:`vue-grab-shortcuts`,hotkeyStorageKey:`vue-grab-hotkey`,editorStorageKey:`vue-grab-editor`,measurerHotkeyStorageKey:`vue-grab-measurer-hotkey`,closeOnOutsideClick:!0,closeOnOutsideClickStorageKey:`vue-grab-close-on-outside-click`},d=`vue-grab:vue-error`,f=[`log`,`info`,`warn`,`error`,`debug`],p={enabled:!0,maxEntries:200,levels:[...f],captureUnhandled:!0,captureVueErrors:!0},m=[`2xx`,`3xx`,`4xx`,`5xx`,`failed`],h=new Set([`5xx`,`failed`]),g=new Set([`4xx`]),_=[`authorization`,`cookie`,`set-cookie`,`x-api-key`],v=[e],y={enabled:!0,maxEntries:100,captureFetch:!0,captureXhr:!0,captureBodies:!1,bodyMaxBytes:2048,redactHeaders:[..._],urlDenyList:[...v],grabSnapshot:{enabled:!0,maxEntries:20,windowMs:1e4}},b={enabled:!0,loupeSize:400,zoomLevel:3,showHtmlOverlay:!0,maxOverlayHtmlLength:200},x={enabled:!0,lineColor:`#06b6d4`,guideColor:`#a855f7`,lineWidth:1,showAlignmentGuides:!0,alignmentTolerance:3},S={highlightColor:o,labelTextColor:s,showTagHint:!0,maxHtmlLength:1e4,filter:{ignoreSelectors:[],ignoreTags:[],skipCommonComponents:!1},floatingButton:u,consoleCapture:p,networkCapture:y,magnifier:b,measurer:x};function C(e,t){let{filter:n,floatingButton:r,consoleCapture:i,networkCapture:a,magnifier:o,measurer:s,...c}=t;return{...e,...c,filter:{...e.filter,...n},floatingButton:{...e.floatingButton,...r,dockEntries:{...e.floatingButton.dockEntries,...r?.dockEntries,order:[...r?.dockEntries?.order??e.floatingButton.dockEntries.order],hidden:[...r?.dockEntries?.hidden??e.floatingButton.dockEntries.hidden]},shortcuts:Object.fromEntries(Object.entries({...e.floatingButton.shortcuts,...r?.shortcuts}).map(([e,t])=>[e,[...t??[]]]))},consoleCapture:{...e.consoleCapture,...i,levels:[...i?.levels??e.consoleCapture.levels]},networkCapture:{...e.networkCapture,...a,redactHeaders:[...a?.redactHeaders??e.networkCapture.redactHeaders],urlDenyList:[...a?.urlDenyList??e.networkCapture.urlDenyList],grabSnapshot:{...e.networkCapture.grabSnapshot,...a?.grabSnapshot}},magnifier:{...e.magnifier,...o},measurer:{...e.measurer,...s}}}exports.ALL_LOG_LEVELS=f,exports.ALL_NETWORK_STATUS_CLASSES=m,exports.DEFAULT_CONFIG=S,exports.DEFAULT_CONSOLE_CAPTURE=p,exports.DEFAULT_FLOATING_BUTTON=u,exports.DEFAULT_FLOATING_BUTTON_DOCK_ENTRY_ORDER=l,exports.DEFAULT_HIGHLIGHT_COLOR=o,exports.DEFAULT_HOTKEY=c,exports.DEFAULT_LABEL_TEXT_COLOR=s,exports.DEFAULT_MAGNIFIER=b,exports.DEFAULT_MEASURER=x,exports.DEFAULT_NETWORK_CAPTURE=y,exports.DEFAULT_REDACT_HEADERS=_,exports.DEFAULT_URL_DENY_LIST=v,exports.NETWORK_ERROR_CLASSES=h,exports.NETWORK_WARN_CLASSES=g,exports.OPEN_IN_EDITOR_ALLOWED_EDITORS=i,exports.OPEN_IN_EDITOR_CONTENT_TYPE=t,exports.OPEN_IN_EDITOR_ENDPOINT=e,exports.OPEN_IN_EDITOR_REQUEST_MAX_BYTES=n,exports.VUE_ERROR_EVENT=d,exports.VUE_GRAB_ROOT_GLOBAL=r,exports.isOpenInEditorAllowedEditor=a,exports.mergeConfig=C;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`/__open-in-editor`,t=`application/json`,n=8192,r=`__VUE_GRAB_ROOT__`,i=[`atom`,`code`,`cursor`,`emacs`,`idea`,`nvim`,`phpstorm`,`sublime`,`vim`,`visualstudio`,`webstorm`];function a(e){return typeof e==`string`&&i.includes(e)}var o=`#4f46e5`,s=`#ffffff`,c=`Alt+Shift+G`,l=[`grab`,`settings`,`magnifier`,`measurer`,`accessibility`,`logs`,`network`],u={enabled:!1,initialPosition:`top-center`,dockMode:`float`,dockEntries:{order:[...l],hidden:[`magnifier`,`logs`,`network`]},shortcuts:{grab:[c],measurer:[`Alt+Shift+M`]},storageKey:`vue-grab-fab-pos`,dockModeStorageKey:`vue-grab-dock-mode`,dockEntriesStorageKey:`vue-grab-dock-entries`,shortcutsStorageKey:`vue-grab-shortcuts`,hotkeyStorageKey:`vue-grab-hotkey`,editorStorageKey:`vue-grab-editor`,measurerHotkeyStorageKey:`vue-grab-measurer-hotkey`,closeOnOutsideClick:!0,closeOnOutsideClickStorageKey:`vue-grab-close-on-outside-click`},d=`vue-grab:vue-error`,f=[`log`,`info`,`warn`,`error`,`debug`],p={enabled:!0,maxEntries:200,levels:[...f],captureUnhandled:!0,captureVueErrors:!0},m=[`2xx`,`3xx`,`4xx`,`5xx`,`failed`],h=new Set([`5xx`,`failed`]),g=new Set([`4xx`]),_=[`authorization`,`cookie`,`set-cookie`,`x-api-key`],v=[e],y={enabled:!0,maxEntries:100,captureFetch:!0,captureXhr:!0,captureBodies:!1,bodyMaxBytes:2048,redactHeaders:[..._],urlDenyList:[...v],grabSnapshot:{enabled:!0,maxEntries:20,windowMs:1e4}},b={enabled:!0,loupeSize:400,zoomLevel:3,showHtmlOverlay:!0,maxOverlayHtmlLength:200},x={enabled:!0,lineColor:`#06b6d4`,guideColor:`#a855f7`,lineWidth:1,showAlignmentGuides:!0,alignmentTolerance:3},S={highlightColor:o,labelTextColor:s,showTagHint:!0,maxHtmlLength:1e4,filter:{ignoreSelectors:[],ignoreTags:[],skipCommonComponents:!1},floatingButton:u,consoleCapture:p,networkCapture:y,magnifier:b,measurer:x};function C(e,t){let{filter:n,floatingButton:r,consoleCapture:i,networkCapture:a,magnifier:o,measurer:s,...c}=t;return{...e,...c,filter:{...e.filter,...n},floatingButton:{...e.floatingButton,...r,dockEntries:{...e.floatingButton.dockEntries,...r?.dockEntries,order:[...r?.dockEntries?.order??e.floatingButton.dockEntries.order],hidden:[...r?.dockEntries?.hidden??e.floatingButton.dockEntries.hidden]},shortcuts:Object.fromEntries(Object.entries({...e.floatingButton.shortcuts,...r?.shortcuts}).map(([e,t])=>[e,[...t??[]]]))},consoleCapture:{...e.consoleCapture,...i,levels:[...i?.levels??e.consoleCapture.levels]},networkCapture:{...e.networkCapture,...a,redactHeaders:[...a?.redactHeaders??e.networkCapture.redactHeaders],urlDenyList:[...a?.urlDenyList??e.networkCapture.urlDenyList],grabSnapshot:{...e.networkCapture.grabSnapshot,...a?.grabSnapshot}},magnifier:{...e.magnifier,...o},measurer:{...e.measurer,...s}}}exports.ALL_LOG_LEVELS=f,exports.ALL_NETWORK_STATUS_CLASSES=m,exports.DEFAULT_CONFIG=S,exports.DEFAULT_CONSOLE_CAPTURE=p,exports.DEFAULT_FLOATING_BUTTON=u,exports.DEFAULT_FLOATING_BUTTON_DOCK_ENTRY_ORDER=l,exports.DEFAULT_HIGHLIGHT_COLOR=o,exports.DEFAULT_HOTKEY=c,exports.DEFAULT_LABEL_TEXT_COLOR=s,exports.DEFAULT_MAGNIFIER=b,exports.DEFAULT_MEASURER=x,exports.DEFAULT_NETWORK_CAPTURE=y,exports.DEFAULT_REDACT_HEADERS=_,exports.DEFAULT_URL_DENY_LIST=v,exports.NETWORK_ERROR_CLASSES=h,exports.NETWORK_WARN_CLASSES=g,exports.OPEN_IN_EDITOR_ALLOWED_EDITORS=i,exports.OPEN_IN_EDITOR_CONTENT_TYPE=t,exports.OPEN_IN_EDITOR_ENDPOINT=e,exports.OPEN_IN_EDITOR_REQUEST_MAX_BYTES=n,exports.VUE_ERROR_EVENT=d,exports.VUE_GRAB_ROOT_GLOBAL=r,exports.isOpenInEditorAllowedEditor=a,exports.mergeConfig=C;
package/dist/index.mjs CHANGED
@@ -31,7 +31,11 @@ var o = "#4f46e5", s = "#ffffff", c = "Alt+Shift+G", l = [
31
31
  dockMode: "float",
32
32
  dockEntries: {
33
33
  order: [...l],
34
- hidden: []
34
+ hidden: [
35
+ "magnifier",
36
+ "logs",
37
+ "network"
38
+ ]
35
39
  },
36
40
  shortcuts: {
37
41
  grab: [c],
package/package.json CHANGED
@@ -1,9 +1,32 @@
1
1
  {
2
2
  "name": "@sakana-y/vue-grab-shared",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
+ "description": "Shared types, defaults, config merging, and protocol constants for Vue Grab integrations.",
6
+ "keywords": [
7
+ "ai",
8
+ "configuration",
9
+ "devtools",
10
+ "protocol",
11
+ "types",
12
+ "vite",
13
+ "vue"
14
+ ],
15
+ "bugs": {
16
+ "url": "https://github.com/SaKaNa-Y/vue-grab/issues"
17
+ },
18
+ "license": "MIT",
19
+ "author": "SaKaNa-Y",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/SaKaNa-Y/vue-grab.git",
23
+ "directory": "packages/shared"
24
+ },
5
25
  "files": [
6
- "dist"
26
+ "dist",
27
+ "README.md",
28
+ "LICENSE",
29
+ "CHANGELOG.md"
7
30
  ],
8
31
  "type": "module",
9
32
  "main": "./dist/index.cjs",