@merittdev/horus-lens 0.0.3 → 0.1.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 +9 -47
- package/dist/browser.cjs +1 -83
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +2 -4
- package/dist/{chunk-CTBY5XIN.js → chunk-A6SNBIRS.js} +2 -2
- package/dist/{chunk-XRONR4GR.js → chunk-MTQ3IO4U.js} +13628 -967
- package/dist/chunk-MTQ3IO4U.js.map +1 -0
- package/dist/index.cjs +1 -109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -165
- package/dist/index.d.ts +1 -165
- package/dist/index.js +1 -29
- package/dist/lens.min.js +31 -31
- package/dist/lens.min.js.map +1 -1
- package/dist/react.cjs +1 -83
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +2 -4
- package/dist/react.js.map +1 -1
- package/package.json +4 -17
- package/dist/chunk-DWOH2ENF.js +0 -17613
- package/dist/chunk-DWOH2ENF.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-XRONR4GR.js.map +0 -1
- package/dist/dashboard.cjs +0 -20124
- package/dist/dashboard.cjs.map +0 -1
- package/dist/dashboard.css +0 -2456
- package/dist/dashboard.d.cts +0 -791
- package/dist/dashboard.d.ts +0 -791
- package/dist/dashboard.js +0 -2584
- package/dist/dashboard.js.map +0 -1
- package/dist/rrweb-EYUUZIYR.js +0 -30
- package/dist/rrweb-EYUUZIYR.js.map +0 -1
- package/dist/server.cjs +0 -109
- package/dist/server.cjs.map +0 -1
- package/dist/server.d.cts +0 -59
- package/dist/server.d.ts +0 -59
- package/dist/server.js +0 -82
- package/dist/server.js.map +0 -1
- /package/dist/{chunk-CTBY5XIN.js.map → chunk-A6SNBIRS.js.map} +0 -0
package/dist/react.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
boot,
|
|
3
3
|
isGateActive
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-DWOH2ENF.js";
|
|
7
|
-
import "./chunk-PZ5AY32C.js";
|
|
4
|
+
} from "./chunk-A6SNBIRS.js";
|
|
5
|
+
import "./chunk-MTQ3IO4U.js";
|
|
8
6
|
|
|
9
7
|
// ../react/dist/index.js
|
|
10
8
|
import { useEffect, useState } from "react";
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../react/src/provider.tsx","../../react/src/context.ts","../../react/src/use-lens.ts","../../react/src/error-boundary.tsx","../../react/src/fiber.ts","../../react/src/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { boot } from '@horus-lens/browser';\nimport type { BootOptions, LensBrowser } from '@horus-lens/browser';\nimport { LensContext } from './context.js';\n\nexport interface LensProps extends Omit<BootOptions, 'force'> {\n accessId: string;\n /** Activate regardless of ?lens=true — e.g. pass your preview-env flag. */\n enabled?: boolean;\n /**\n * Optional: <Lens /> mounts standalone anywhere in the tree. Wrap children\n * only when descendants need the `useLens()` context.\n */\n children?: ReactNode;\n}\n\n/**\n * Mounts the Lens issue-capture overlay. Renders nothing itself — drop\n * `<Lens accessId=\"lai_…\" />` into your root layout and the overlay appears\n * for sessions gated in via `?lens=true` (or force it with `enabled`).\n */\nexport function Lens(props: LensProps) {\n const { children, enabled, ...bootOptions } = props;\n const [browser, setBrowser] = useState<LensBrowser | null>(null);\n\n useEffect(() => {\n const instance = boot({ ...bootOptions, force: enabled });\n if (instance) {\n instance.client.setApp({ extra: { framework: 'react' } });\n }\n setBrowser(instance);\n return () => {\n instance?.destroy();\n setBrowser(null);\n };\n }, [props.accessId]);\n\n return <LensContext.Provider value={browser}>{children ?? null}</LensContext.Provider>;\n}\n\n/** Back-compat alias — `<Lens />` is the canonical name. */\nexport const LensProvider = Lens;\nexport type LensProviderProps = LensProps;\n","import { createContext } from 'react';\nimport type { LensBrowser } from '@horus-lens/browser';\n\nexport const LensContext = createContext<LensBrowser | null>(null);\n","import { useContext } from 'react';\nimport type { AppContext } from '@horus-lens/shared';\nimport { LensContext } from './context.js';\n\ninterface Identity {\n id?: string;\n email?: string;\n name?: string;\n organization?: string;\n}\n\nexport function useLens() {\n const browser = useContext(LensContext);\n\n return {\n active: browser !== null,\n open: () => browser?.open(),\n close: () => browser?.close(),\n identify: (user: Identity) => browser?.client.setApp({ user }),\n setApp: (app: Partial<AppContext>) => browser?.client.setApp(app),\n report: async (input?: { comment?: string }): Promise<{ reportId: string } | null> => {\n if (!browser) return null;\n return browser.client.submitReport({ comment: input?.comment });\n },\n };\n}\n","import { Component } from 'react';\nimport type { ContextType, ReactNode } from 'react';\nimport { LensContext } from './context.js';\n\ninterface Props {\n children: ReactNode;\n fallback?: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n}\n\nexport class LensErrorBoundary extends Component<Props, State> {\n static contextType = LensContext;\n declare context: ContextType<typeof LensContext>;\n\n state: State = { hasError: false };\n\n static getDerivedStateFromError(): State {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error) {\n const browser = this.context;\n if (browser) {\n browser.client.setApp({ extra: { lastBoundaryError: error.message } });\n browser.open();\n }\n }\n\n render() {\n if (this.state.hasError) {\n return (\n this.props.fallback ?? (\n <div\n role=\"alert\"\n style={{\n padding: '12px 16px',\n borderRadius: 8,\n border: '1px solid rgba(0,0,0,0.1)',\n font: '14px system-ui, sans-serif',\n }}\n >\n Something went wrong.\n </div>\n )\n );\n }\n return this.props.children;\n }\n}\n","interface FiberType {\n displayName?: string;\n name?: string;\n render?: { displayName?: string; name?: string };\n}\n\ninterface FiberNode {\n type?: FiberType | string | null;\n return?: FiberNode | null;\n}\n\nfunction nameOf(type: FiberNode['type']): string | undefined {\n if (!type || typeof type === 'string') return undefined;\n return type.displayName ?? type.name ?? type.render?.displayName ?? type.render?.name;\n}\n\n/** Walk the React fiber tree from `el` upward, collecting component names. */\nexport function getComponentStack(el: Element): string[] {\n const names: string[] = [];\n try {\n const key = Object.keys(el).find((k) => k.startsWith('__reactFiber$'));\n if (!key) return names;\n\n let fiber = (el as unknown as Record<string, FiberNode | undefined>)[key] ?? null;\n const seen = new Set<FiberNode>();\n while (fiber && !seen.has(fiber)) {\n seen.add(fiber);\n const name = nameOf(fiber.type);\n if (name) names.push(name);\n fiber = fiber.return ?? null;\n }\n } catch {\n return names;\n }\n return names;\n}\n","export { Lens, LensProvider } from './provider.js';\nexport type { LensProps, LensProviderProps } from './provider.js';\nexport { useLens } from './use-lens.js';\nexport { LensErrorBoundary } from './error-boundary.js';\nexport { getComponentStack } from './fiber.js';\nexport { isGateActive } from '@horus-lens/browser';\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../react/src/provider.tsx","../../react/src/context.ts","../../react/src/use-lens.ts","../../react/src/error-boundary.tsx","../../react/src/fiber.ts","../../react/src/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { boot } from '@horus-lens/browser';\nimport type { BootOptions, LensBrowser } from '@horus-lens/browser';\nimport { LensContext } from './context.js';\n\nexport interface LensProps extends Omit<BootOptions, 'force'> {\n accessId: string;\n /** Activate regardless of ?lens=true — e.g. pass your preview-env flag. */\n enabled?: boolean;\n /**\n * Optional: <Lens /> mounts standalone anywhere in the tree. Wrap children\n * only when descendants need the `useLens()` context.\n */\n children?: ReactNode;\n}\n\n/**\n * Mounts the Lens issue-capture overlay. Renders nothing itself — drop\n * `<Lens accessId=\"lai_…\" />` into your root layout and the overlay appears\n * for sessions gated in via `?lens=true` (or force it with `enabled`).\n */\nexport function Lens(props: LensProps) {\n const { children, enabled, ...bootOptions } = props;\n const [browser, setBrowser] = useState<LensBrowser | null>(null);\n\n useEffect(() => {\n const instance = boot({ ...bootOptions, force: enabled });\n if (instance) {\n instance.client.setApp({ extra: { framework: 'react' } });\n }\n setBrowser(instance);\n return () => {\n instance?.destroy();\n setBrowser(null);\n };\n }, [props.accessId]);\n\n return <LensContext.Provider value={browser}>{children ?? null}</LensContext.Provider>;\n}\n\n/** Back-compat alias — `<Lens />` is the canonical name. */\nexport const LensProvider = Lens;\nexport type LensProviderProps = LensProps;\n","import { createContext } from 'react';\nimport type { LensBrowser } from '@horus-lens/browser';\n\nexport const LensContext = createContext<LensBrowser | null>(null);\n","import { useContext } from 'react';\nimport type { AppContext } from '@horus-lens/shared';\nimport { LensContext } from './context.js';\n\ninterface Identity {\n id?: string;\n email?: string;\n name?: string;\n organization?: string;\n}\n\nexport function useLens() {\n const browser = useContext(LensContext);\n\n return {\n active: browser !== null,\n open: () => browser?.open(),\n close: () => browser?.close(),\n identify: (user: Identity) => browser?.client.setApp({ user }),\n setApp: (app: Partial<AppContext>) => browser?.client.setApp(app),\n report: async (input?: { comment?: string }): Promise<{ reportId: string } | null> => {\n if (!browser) return null;\n return browser.client.submitReport({ comment: input?.comment });\n },\n };\n}\n","import { Component } from 'react';\nimport type { ContextType, ReactNode } from 'react';\nimport { LensContext } from './context.js';\n\ninterface Props {\n children: ReactNode;\n fallback?: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n}\n\nexport class LensErrorBoundary extends Component<Props, State> {\n static contextType = LensContext;\n declare context: ContextType<typeof LensContext>;\n\n state: State = { hasError: false };\n\n static getDerivedStateFromError(): State {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error) {\n const browser = this.context;\n if (browser) {\n browser.client.setApp({ extra: { lastBoundaryError: error.message } });\n browser.open();\n }\n }\n\n render() {\n if (this.state.hasError) {\n return (\n this.props.fallback ?? (\n <div\n role=\"alert\"\n style={{\n padding: '12px 16px',\n borderRadius: 8,\n border: '1px solid rgba(0,0,0,0.1)',\n font: '14px system-ui, sans-serif',\n }}\n >\n Something went wrong.\n </div>\n )\n );\n }\n return this.props.children;\n }\n}\n","interface FiberType {\n displayName?: string;\n name?: string;\n render?: { displayName?: string; name?: string };\n}\n\ninterface FiberNode {\n type?: FiberType | string | null;\n return?: FiberNode | null;\n}\n\nfunction nameOf(type: FiberNode['type']): string | undefined {\n if (!type || typeof type === 'string') return undefined;\n return type.displayName ?? type.name ?? type.render?.displayName ?? type.render?.name;\n}\n\n/** Walk the React fiber tree from `el` upward, collecting component names. */\nexport function getComponentStack(el: Element): string[] {\n const names: string[] = [];\n try {\n const key = Object.keys(el).find((k) => k.startsWith('__reactFiber$'));\n if (!key) return names;\n\n let fiber = (el as unknown as Record<string, FiberNode | undefined>)[key] ?? null;\n const seen = new Set<FiberNode>();\n while (fiber && !seen.has(fiber)) {\n seen.add(fiber);\n const name = nameOf(fiber.type);\n if (name) names.push(name);\n fiber = fiber.return ?? null;\n }\n } catch {\n return names;\n }\n return names;\n}\n","export { Lens, LensProvider } from './provider.js';\nexport type { LensProps, LensProviderProps } from './provider.js';\nexport { useLens } from './use-lens.js';\nexport { LensErrorBoundary } from './error-boundary.js';\nexport { getComponentStack } from './fiber.js';\nexport { isGateActive } from '@horus-lens/browser';\n"],"mappings":";;;;;;;AAAA,SAAS,WAAW,gBAAgB;ACApC,SAAS,qBAAqB;ADsCrB,SAAA,WAAA;AEtCT,SAAS,kBAAkB;ACA3B,SAAS,iBAAiB;AAmChB,SAAA,OAAAA,YAAA;AFhCH,IAAM,cAAc,cAAkC,IAAI;ADmB1D,SAAS,KAAK,OAAkB;AACrC,QAAM,EAAE,UAAU,SAAS,GAAG,YAAY,IAAI;AAC9C,QAAM,CAAC,SAAS,UAAU,IAAI,SAA6B,IAAI;AAE/D,YAAU,MAAM;AACd,UAAM,WAAW,KAAK,EAAE,GAAG,aAAa,OAAO,QAAQ,CAAC;AACxD,QAAI,UAAU;AACZ,eAAS,OAAO,OAAO,EAAE,OAAO,EAAE,WAAW,QAAQ,EAAE,CAAC;IAC1D;AACA,eAAW,QAAQ;AACnB,WAAO,MAAM;AACX,gBAAU,QAAQ;AAClB,iBAAW,IAAI;IACjB;EACF,GAAG,CAAC,MAAM,QAAQ,CAAC;AAEnB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AACF,UAAM,MAAM,OAAO,KAAK,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,WAAW,eAAe,CAAC;AACrE,QAAI,CAAC,IAAK,QAAO;AAEjB,QAAI,QAAS,GAAwD,GAAG,KAAK;AAC7E,UAAM,OAAO,oBAAI,IAAe;AAChC,WAAO,SAAS,CAAC,KAAK,IAAI,KAAK,GAAG;AAChC,WAAK,IAAI,KAAK;AACd,YAAM,OAAO,OAAO,MAAM,IAAI;AAC9B,UAAI,KAAM,OAAM,KAAK,IAAI;AACzB,cAAQ,MAAM,UAAU;IAC1B;EACF,QAAQ;AACN,WAAO;EACT;AACA,SAAO;AACT;","names":["jsx","jsx"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merittdev/horus-lens",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "Lens — context-rich issue capture for web apps: overlay, replay, and drop-in
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Lens — context-rich issue capture SDK for web apps: overlay, session replay, and drop-in browser/React capture",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -27,19 +27,7 @@
|
|
|
27
27
|
"import": "./dist/react.js",
|
|
28
28
|
"require": "./dist/react.cjs"
|
|
29
29
|
},
|
|
30
|
-
"./
|
|
31
|
-
"types": "./dist/dashboard.d.ts",
|
|
32
|
-
"import": "./dist/dashboard.js",
|
|
33
|
-
"require": "./dist/dashboard.cjs"
|
|
34
|
-
},
|
|
35
|
-
"./dashboard/styles.css": "./dist/dashboard.css",
|
|
36
|
-
"./dist/dashboard.css": "./dist/dashboard.css",
|
|
37
|
-
"./cdn": "./dist/lens.min.js",
|
|
38
|
-
"./server": {
|
|
39
|
-
"types": "./dist/server.d.ts",
|
|
40
|
-
"import": "./dist/server.js",
|
|
41
|
-
"require": "./dist/server.cjs"
|
|
42
|
-
}
|
|
30
|
+
"./cdn": "./dist/lens.min.js"
|
|
43
31
|
},
|
|
44
32
|
"peerDependencies": {
|
|
45
33
|
"react": ">=18",
|
|
@@ -58,7 +46,6 @@
|
|
|
58
46
|
"typescript": "^5.7.3",
|
|
59
47
|
"@horus-lens/browser": "0.0.1",
|
|
60
48
|
"@horus-lens/core": "0.0.1",
|
|
61
|
-
"@horus-lens/dashboard": "0.0.1",
|
|
62
49
|
"@horus-lens/react": "0.0.1",
|
|
63
50
|
"@horus-lens/shared": "0.0.1"
|
|
64
51
|
},
|
|
@@ -87,7 +74,7 @@
|
|
|
87
74
|
"url": "https://github.com/Meritt-dev/horus-lens/issues"
|
|
88
75
|
},
|
|
89
76
|
"scripts": {
|
|
90
|
-
"build": "tsup
|
|
77
|
+
"build": "tsup",
|
|
91
78
|
"typecheck": "tsc --noEmit",
|
|
92
79
|
"clean": "rm -rf dist .turbo"
|
|
93
80
|
}
|