@sakana-y/vue-grab-shared 0.0.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 sakana
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ import { FloatingButtonConfig, GrabConfig } from './types';
2
+ export declare const DEFAULT_HIGHLIGHT_COLOR = "#4f46e5";
3
+ export declare const DEFAULT_LABEL_TEXT_COLOR = "#ffffff";
4
+ export declare const DEFAULT_HOTKEY = "Alt+Shift+G";
5
+ export declare const DEFAULT_FLOATING_BUTTON: FloatingButtonConfig;
6
+ export declare const DEFAULT_CONFIG: GrabConfig;
7
+ /**
8
+ * Deep-merge user config with defaults, properly handling nested objects.
9
+ */
10
+ export declare function mergeConfig(defaults: GrabConfig, options: Partial<GrabConfig>): GrabConfig;
11
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEhE,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C,eAAO,MAAM,uBAAuB,EAAE,oBAKrC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,UAW5B,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAc1F"}
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`#4f46e5`,t=`#ffffff`,n=`Alt+Shift+G`,r={enabled:!1,initialPosition:`top-center`,storageKey:`vue-grab-fab-pos`,hotkeyStorageKey:`vue-grab-hotkey`},i={highlightColor:e,labelTextColor:t,showTagHint:!0,maxHtmlLength:1e4,filter:{ignoreSelectors:[],ignoreTags:[],skipCommonComponents:!1},floatingButton:r};function a(e,t){let{filter:n,floatingButton:r,...i}=t;return{...e,...i,filter:{...e.filter,...n},floatingButton:{...e.floatingButton,...r}}}exports.DEFAULT_CONFIG=i,exports.DEFAULT_FLOATING_BUTTON=r,exports.DEFAULT_HIGHLIGHT_COLOR=e,exports.DEFAULT_HOTKEY=n,exports.DEFAULT_LABEL_TEXT_COLOR=t,exports.mergeConfig=a;
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export * from './constants';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
package/dist/index.mjs ADDED
@@ -0,0 +1,35 @@
1
+ //#region src/constants.ts
2
+ var e = "#4f46e5", t = "#ffffff", n = "Alt+Shift+G", r = {
3
+ enabled: !1,
4
+ initialPosition: "top-center",
5
+ storageKey: "vue-grab-fab-pos",
6
+ hotkeyStorageKey: "vue-grab-hotkey"
7
+ }, i = {
8
+ highlightColor: e,
9
+ labelTextColor: t,
10
+ showTagHint: !0,
11
+ maxHtmlLength: 1e4,
12
+ filter: {
13
+ ignoreSelectors: [],
14
+ ignoreTags: [],
15
+ skipCommonComponents: !1
16
+ },
17
+ floatingButton: r
18
+ };
19
+ function a(e, t) {
20
+ let { filter: n, floatingButton: r, ...i } = t;
21
+ return {
22
+ ...e,
23
+ ...i,
24
+ filter: {
25
+ ...e.filter,
26
+ ...n
27
+ },
28
+ floatingButton: {
29
+ ...e.floatingButton,
30
+ ...r
31
+ }
32
+ };
33
+ }
34
+ //#endregion
35
+ export { i as DEFAULT_CONFIG, r as DEFAULT_FLOATING_BUTTON, e as DEFAULT_HIGHLIGHT_COLOR, n as DEFAULT_HOTKEY, t as DEFAULT_LABEL_TEXT_COLOR, a as mergeConfig };
@@ -0,0 +1,51 @@
1
+ export interface FloatingButtonConfig {
2
+ /** Show the floating button. Default: false (opt-in). */
3
+ enabled: boolean;
4
+ /** Initial position before any localStorage override. */
5
+ initialPosition: "bottom-right" | "bottom-left" | "top-right" | "top-left" | "top-center";
6
+ /** localStorage key for persisting position. Set to "" to disable persistence. */
7
+ storageKey: string;
8
+ /** localStorage key for persisting hotkey. Set to "" to disable persistence. */
9
+ hotkeyStorageKey: string;
10
+ }
11
+ export interface GrabConfig {
12
+ /** Highlight border color */
13
+ highlightColor: string;
14
+ /** Label text color */
15
+ labelTextColor: string;
16
+ /** Show floating tag hint on hover */
17
+ showTagHint: boolean;
18
+ /** Maximum length of captured outerHTML (0 = unlimited) */
19
+ maxHtmlLength: number;
20
+ /** Filter options for element selection */
21
+ filter: GrabFilterConfig;
22
+ /** Floating button configuration */
23
+ floatingButton: FloatingButtonConfig;
24
+ }
25
+ export interface GrabFilterConfig {
26
+ /** CSS selectors to ignore */
27
+ ignoreSelectors: string[];
28
+ /** HTML tags to ignore */
29
+ ignoreTags: string[];
30
+ /** Skip common layout components (header, nav, footer, aside) */
31
+ skipCommonComponents: boolean;
32
+ }
33
+ export interface GrabResult {
34
+ /** The selected DOM element */
35
+ element: Element;
36
+ /** HTML source of the element */
37
+ html: string;
38
+ /** Vue component hierarchy leading to this element */
39
+ componentStack: ComponentInfo[];
40
+ /** CSS selector for the element */
41
+ selector: string;
42
+ }
43
+ export interface ComponentInfo {
44
+ /** Component name */
45
+ name: string;
46
+ /** File path if available from Vue devtools */
47
+ filePath?: string;
48
+ /** Line number if available */
49
+ line?: number;
50
+ }
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,eAAe,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,CAAC;IAC1F,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,MAAM,EAAE,gBAAgB,CAAC;IACzB,oCAAoC;IACpC,cAAc,EAAE,oBAAoB,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,iEAAiE;IACjE,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU;IACzB,+BAA+B;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@sakana-y/vue-grab-shared",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "main": "./dist/index.cjs",
10
+ "module": "./dist/index.mjs",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.mjs",
15
+ "require": "./dist/index.cjs",
16
+ "types": "./dist/index.d.ts"
17
+ }
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "devDependencies": {
23
+ "typescript": "~5.9.3",
24
+ "vite": "^8.0.0",
25
+ "vite-plugin-dts": "^4.5.0",
26
+ "vitest": "^4.1.0"
27
+ },
28
+ "scripts": {
29
+ "build": "vite build",
30
+ "test": "vitest run",
31
+ "typecheck": "tsc --noEmit"
32
+ }
33
+ }