dotmem 0.0.0-stage → 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/index.d.ts +0 -0
- package/package.json +69 -3
- package/types/reattach.d.ts +87 -0
- package/README.md +0 -3
package/index.d.ts
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotmem",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"codeName": "dotmem",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"description": "Append your component in any part of your html using reattach",
|
|
6
|
+
"license": "PROPRIETARY",
|
|
7
|
+
"author": "Dario Passariello",
|
|
8
|
+
"main": "./index.js",
|
|
9
|
+
"module": "./index.mjs",
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"typings": "./index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"import": "./index.mjs",
|
|
16
|
+
"require": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"./types/*": "./types/*"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"index.js",
|
|
22
|
+
"index.mjs",
|
|
23
|
+
"index.d.ts",
|
|
24
|
+
"types",
|
|
25
|
+
"AGENTS.md",
|
|
26
|
+
"CITATION.md",
|
|
27
|
+
"CODEOWNERS.md",
|
|
28
|
+
"COPYRIGHT.md",
|
|
29
|
+
"LICENSE.md",
|
|
30
|
+
"llms.txt",
|
|
31
|
+
"README.md",
|
|
32
|
+
"SECURITY.md"
|
|
33
|
+
],
|
|
34
|
+
"keywords": [
|
|
35
|
+
".mem",
|
|
36
|
+
"memory",
|
|
37
|
+
"joy",
|
|
38
|
+
"jo",
|
|
39
|
+
"mcp",
|
|
40
|
+
"ai",
|
|
41
|
+
"agents",
|
|
42
|
+
"assistant"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"npm:publish": "npm run build && npm publish ./dist",
|
|
47
|
+
"": "-----------",
|
|
48
|
+
"lint": "cd tests && npm run lint",
|
|
49
|
+
"tsc": "cd tests && npm run tsc",
|
|
50
|
+
"test": "cd tests && npm run test",
|
|
51
|
+
"test:coverage": "cd tests && npm run test:coverage",
|
|
52
|
+
"pw": "cd tests && npm run pw",
|
|
53
|
+
"pw:browser": "cd tests && npm run pw"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
57
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=18"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "26.6.5",
|
|
64
|
+
"react": "^19.3.1",
|
|
65
|
+
"react-dom": "^19.3.1",
|
|
66
|
+
"terser": "5.51.2",
|
|
67
|
+
"tslib": "^2.8.1",
|
|
68
|
+
"tsup": "^9.0.0",
|
|
69
|
+
"tsx": "4.23.15",
|
|
70
|
+
"typescript": "7.0.2"
|
|
71
|
+
}
|
|
6
72
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode, CSSProperties, Context } from "react"
|
|
2
|
+
import type { Root } from "react-dom/client"
|
|
3
|
+
|
|
4
|
+
export type ReattachWhere = string
|
|
5
|
+
|
|
6
|
+
export interface ReattachElementAttributes {
|
|
7
|
+
id?: string
|
|
8
|
+
class?: string
|
|
9
|
+
name?: string
|
|
10
|
+
dataset?: Record<string, string>
|
|
11
|
+
style?: CSSProperties | string
|
|
12
|
+
[key: string]: unknown
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface OverlayOptions {
|
|
16
|
+
trapFocus?: boolean
|
|
17
|
+
lockScroll?: boolean
|
|
18
|
+
closeOnEscape?: boolean
|
|
19
|
+
stackingOrder?: "top" | "bottom" | "exact"
|
|
20
|
+
zIndex?: number
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface LayoutOptions {
|
|
24
|
+
anchor?: string
|
|
25
|
+
placement?: "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end"
|
|
26
|
+
offset?: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type EventHandlerKey = `on${string}`
|
|
30
|
+
|
|
31
|
+
export interface AttachmentHandle {
|
|
32
|
+
updateProps: (newProps: Record<string, unknown>) => void
|
|
33
|
+
getContainer: () => HTMLElement
|
|
34
|
+
destroy: () => void
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface MountOptions extends Partial<ReattachElementAttributes> {
|
|
38
|
+
root?: Root
|
|
39
|
+
inheritContext?: boolean
|
|
40
|
+
resilient?: boolean
|
|
41
|
+
overlay?: OverlayOptions
|
|
42
|
+
bubbleEvents?: EventHandlerKey[]
|
|
43
|
+
isolateNativeEvents?: boolean
|
|
44
|
+
layout?: LayoutOptions
|
|
45
|
+
hydrate?: boolean
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ReattachProps extends ReattachElementAttributes {
|
|
49
|
+
where: ReattachWhere
|
|
50
|
+
children: ReactNode
|
|
51
|
+
inheritContext?: boolean
|
|
52
|
+
resilient?: boolean
|
|
53
|
+
overlay?: OverlayOptions
|
|
54
|
+
bubbleEvents?: EventHandlerKey[]
|
|
55
|
+
isolateNativeEvents?: boolean
|
|
56
|
+
layout?: LayoutOptions
|
|
57
|
+
hydrate?: boolean
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare class ReattachError extends Error {
|
|
61
|
+
readonly code: string
|
|
62
|
+
readonly details?: unknown
|
|
63
|
+
constructor(message: string, code: string, details?: unknown)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ReattachFn {
|
|
67
|
+
(where: string): HTMLElement | null
|
|
68
|
+
(where: string, id: string, children: ReactNode, options?: MountOptions): HTMLElement
|
|
69
|
+
(where: string, children: ReactNode, options?: MountOptions): HTMLElement
|
|
70
|
+
(where: string, attrs: ReattachElementAttributes, children: ReactNode, options?: MountOptions): HTMLElement
|
|
71
|
+
readonly mount: (container: HTMLElement, children: ReactNode, options?: MountOptions) => HTMLElement
|
|
72
|
+
readonly unmount: (where?: string, id?: string) => boolean
|
|
73
|
+
readonly clear: (where?: string) => number
|
|
74
|
+
readonly has: (where?: string, id?: string) => boolean
|
|
75
|
+
readonly when: (where: string, timeout?: number) => Promise<HTMLElement>
|
|
76
|
+
readonly global: () => ReattachFn
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare const Reattach: (props: ReattachProps) => ReactElement | null
|
|
80
|
+
|
|
81
|
+
export declare const reattach: ReattachFn
|
|
82
|
+
|
|
83
|
+
export declare function captureContext<T>(ctx: Context<T>, value: T): void
|
|
84
|
+
|
|
85
|
+
interface Window {
|
|
86
|
+
reattach?: ReattachFn
|
|
87
|
+
}
|
package/README.md
DELETED