epos 1.7.6 → 1.8.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/package.json +9 -16
- package/src/epos.ts +176 -0
- package/src/libs/libs-mobx-react-lite.ts +12 -0
- package/src/libs/libs-mobx.ts +69 -0
- package/{dist/plugin/lib/lib-react-dom-client.js → src/libs/libs-react-dom-client.ts} +2 -2
- package/src/libs/libs-react-dom.ts +16 -0
- package/{dist/plugin/lib/lib-react-jsx-runtime.js → src/libs/libs-react-jsx-runtime.ts} +2 -2
- package/src/libs/libs-react.ts +40 -0
- package/src/vite.ts +21 -0
- package/dist/epos/epos.d.ts +0 -167
- package/dist/epos/epos.js +0 -2
- package/dist/epos/index.d.ts +0 -3
- package/dist/epos/index.js +0 -3
- package/dist/plugin/lib/lib-mobx-react-lite.d.ts +0 -1
- package/dist/plugin/lib/lib-mobx-react-lite.js +0 -1
- package/dist/plugin/lib/lib-mobx.d.ts +0 -6
- package/dist/plugin/lib/lib-mobx.js +0 -1
- package/dist/plugin/lib/lib-react-dom-client.d.ts +0 -3
- package/dist/plugin/lib/lib-react-dom.d.ts +0 -3
- package/dist/plugin/lib/lib-react-dom.js +0 -2
- package/dist/plugin/lib/lib-react-jsx-runtime.d.ts +0 -3
- package/dist/plugin/lib/lib-react.d.ts +0 -11
- package/dist/plugin/lib/lib-react.js +0 -2
- package/dist/plugin/plugin-esbuild.d.ts +0 -3
- package/dist/plugin/plugin-esbuild.js +0 -27
- package/dist/plugin/plugin-vite.d.ts +0 -3
- package/dist/plugin/plugin-vite.js +0 -29
package/package.json
CHANGED
|
@@ -1,47 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "epos",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "imkost",
|
|
7
7
|
"description": "",
|
|
8
8
|
"keywords": [],
|
|
9
9
|
"scripts": {
|
|
10
|
-
"dev": "rm -rf dist && tsc -w",
|
|
11
|
-
"build": "rm -rf dist && tsc",
|
|
12
10
|
"lint": "tsc --noEmit",
|
|
13
|
-
"release": "sh -c 'npm version ${1:-patch} && npm
|
|
11
|
+
"release": "sh -c 'npm version ${1:-patch} && npm publish' --"
|
|
14
12
|
},
|
|
15
13
|
"exports": {
|
|
16
14
|
".": {
|
|
17
|
-
"import": "./
|
|
15
|
+
"import": "./src/epos.ts"
|
|
18
16
|
},
|
|
19
17
|
"./vite": {
|
|
20
|
-
"import": "./
|
|
21
|
-
},
|
|
22
|
-
"./esbuild": {
|
|
23
|
-
"import": "./dist/plugin/plugin-esbuild.js"
|
|
18
|
+
"import": "./src/vite.ts"
|
|
24
19
|
}
|
|
25
20
|
},
|
|
26
21
|
"files": [
|
|
27
|
-
"
|
|
22
|
+
"src",
|
|
28
23
|
"epos.schema.json"
|
|
29
24
|
],
|
|
30
25
|
"dependencies": {
|
|
31
|
-
"@types/chrome": "^0.1.
|
|
32
|
-
"@types/react": "^19.1.
|
|
26
|
+
"@types/chrome": "^0.1.12",
|
|
27
|
+
"@types/react": "^19.1.14",
|
|
33
28
|
"@types/react-dom": "^19.1.9",
|
|
34
|
-
"mobx": "^6.
|
|
29
|
+
"mobx": "^6.15.0",
|
|
35
30
|
"mobx-react-lite": "^4.1.0",
|
|
36
31
|
"react": "^19.1.1",
|
|
37
32
|
"yjs": "^13.6.27"
|
|
38
33
|
},
|
|
39
34
|
"devDependencies": {
|
|
40
|
-
"
|
|
41
|
-
"vite": "^7.1.5"
|
|
35
|
+
"vite": "^7.1.7"
|
|
42
36
|
},
|
|
43
37
|
"peerDependencies": {
|
|
44
|
-
"esbuild": "^0.25.9",
|
|
45
38
|
"vite": "^7.1.4"
|
|
46
39
|
}
|
|
47
40
|
}
|
package/src/epos.ts
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type * as mobx from 'mobx'
|
|
2
|
+
import type * as mobxReactLite from 'mobx-react-lite'
|
|
3
|
+
import type * as react from 'react'
|
|
4
|
+
import type * as reactDom from 'react-dom'
|
|
5
|
+
import type * as reactDomClient from 'react-dom/client'
|
|
6
|
+
import type * as reactJsxRuntime from 'react/jsx-runtime'
|
|
7
|
+
import type * as yjs from 'yjs'
|
|
8
|
+
|
|
9
|
+
export type Fn<T = any> = (...args: any[]) => T
|
|
10
|
+
export type Obj = Record<string, unknown>
|
|
11
|
+
export type Versioner = Record<number, (this: any, state: any) => void>
|
|
12
|
+
export type ClassName = string | null | boolean | undefined | ClassName[]
|
|
13
|
+
export type ModelClass = new (...args: any[]) => any
|
|
14
|
+
|
|
15
|
+
export type ConnectOptions<T extends Obj> = {
|
|
16
|
+
getInitialState?: () => T
|
|
17
|
+
models?: Record<string, ModelClass>
|
|
18
|
+
versioner?: Versioner
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type Storage = {
|
|
22
|
+
/** Get value from the storage. */
|
|
23
|
+
get<T = unknown>(key: string): Promise<T>
|
|
24
|
+
/** Set value in the storage. */
|
|
25
|
+
set<T = unknown>(key: string, value: T): Promise<void>
|
|
26
|
+
/** Delete value from the storage. */
|
|
27
|
+
delete(key: string): Promise<void>
|
|
28
|
+
/** Get all keys from the storage. */
|
|
29
|
+
keys(): Promise<string[]>
|
|
30
|
+
/** Clear the storage. Deletes all keys and storage itself. */
|
|
31
|
+
clear(): Promise<void>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Epos {
|
|
35
|
+
// General
|
|
36
|
+
fetch: typeof window.fetch
|
|
37
|
+
browser: typeof chrome
|
|
38
|
+
element: HTMLDivElement
|
|
39
|
+
render(node: react.ReactNode, container?: reactDomClient.Container): void
|
|
40
|
+
component: {
|
|
41
|
+
<P>(Component: react.FC<P>): typeof Component
|
|
42
|
+
<P>(name: string, Component: react.FC<P>): typeof Component
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Bus
|
|
46
|
+
bus: {
|
|
47
|
+
/** Listen for an event. */
|
|
48
|
+
on(eventName: string, callback: Fn, thisValue?: unknown): void
|
|
49
|
+
/** Remove event listener. */
|
|
50
|
+
off(eventName: string, callback?: Fn): void
|
|
51
|
+
/** Listen for an event once. */
|
|
52
|
+
once(eventName: string, callback: Fn, thisValue?: unknown): void
|
|
53
|
+
/** Send an event to all remote listeners (local listeners are ignored). */
|
|
54
|
+
send<T = unknown>(eventName: string, ...args: unknown[]): Promise<T>
|
|
55
|
+
/** Emit event locally (calls local listeners only). */
|
|
56
|
+
emit<T = unknown>(eventName: string, ...args: unknown[]): Promise<T>
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// State
|
|
60
|
+
state: {
|
|
61
|
+
/** Connect state. */
|
|
62
|
+
connect: {
|
|
63
|
+
<T extends Obj>(name?: string, options?: ConnectOptions<T>): Promise<T>
|
|
64
|
+
<T extends Obj>(options?: ConnectOptions<T>): Promise<T>
|
|
65
|
+
}
|
|
66
|
+
/** Disconnect state. */
|
|
67
|
+
disconnect(name?: string): void
|
|
68
|
+
/** Run any state changes in a batch. */
|
|
69
|
+
transaction: (fn: () => void) => void
|
|
70
|
+
/** Create local state (no sync). */
|
|
71
|
+
local<T extends Obj = {}>(state?: T): T
|
|
72
|
+
/** Get the list of all state names. */
|
|
73
|
+
list(filter?: { connected?: boolean }): Promise<Array<{ name: string | null }>>
|
|
74
|
+
/** Remove state and all its data. */
|
|
75
|
+
destroy(name?: string): Promise<void>
|
|
76
|
+
/** Dynamically register models for all states. */
|
|
77
|
+
registerGlobalModels(models: Record<string, ModelClass>): void
|
|
78
|
+
symbols: {
|
|
79
|
+
model: {
|
|
80
|
+
readonly init: unique symbol
|
|
81
|
+
readonly cleanup: unique symbol
|
|
82
|
+
readonly versioner: unique symbol
|
|
83
|
+
readonly parent: unique symbol
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Storage
|
|
89
|
+
storage: {
|
|
90
|
+
/** Get value from the storage. */
|
|
91
|
+
get<T = unknown>(key: string, storageName?: string): Promise<T>
|
|
92
|
+
/** Set value in the storage. */
|
|
93
|
+
set<T = unknown>(key: string, value: T, storageName?: string): Promise<void>
|
|
94
|
+
/** Delete value from the storage. */
|
|
95
|
+
delete(key: string, storageName?: string): Promise<void>
|
|
96
|
+
/** Get all keys from the storage. */
|
|
97
|
+
keys(storageName?: string): Promise<string[]>
|
|
98
|
+
/** Clear storage. Removes all keys and storage itself. */
|
|
99
|
+
clear(storageName?: string): Promise<void>
|
|
100
|
+
/** Create storage API. */
|
|
101
|
+
use(name: string): Promise<Storage>
|
|
102
|
+
/** Get list of all storage names. */
|
|
103
|
+
list(): Promise<Array<{ name: string | null }>>
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Assets
|
|
107
|
+
assets: {
|
|
108
|
+
/** Get asset URL. Asset must be loaded first. */
|
|
109
|
+
url(path: string): string
|
|
110
|
+
/** Load asset by path. */
|
|
111
|
+
load(path: string): Promise<Blob>
|
|
112
|
+
/** Load all assets. */
|
|
113
|
+
loadAll(): Promise<Blob[]>
|
|
114
|
+
/** Unload asset from memory. */
|
|
115
|
+
unload(path: string): void
|
|
116
|
+
/** Unload all assets from memory. */
|
|
117
|
+
unloadAll(): void
|
|
118
|
+
/** Get list of all available asset paths. */
|
|
119
|
+
list(filter?: { loaded?: boolean }): Array<{ path: string; loaded: boolean }>
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Frames
|
|
123
|
+
frames: {
|
|
124
|
+
/** Create a new frame. */
|
|
125
|
+
create(name: string, url: string, attributes?: Record<string, unknown>): Promise<void>
|
|
126
|
+
/** Remove frame by name. */
|
|
127
|
+
remove(name: string): Promise<void>
|
|
128
|
+
/** Get list of all created frames. */
|
|
129
|
+
list(): Promise<Array<{ name: string; url: string }>>
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Env
|
|
133
|
+
env: {
|
|
134
|
+
/** Current tab ID. */
|
|
135
|
+
tabId: number
|
|
136
|
+
/** True if running in a tab (top-level, not iframe). */
|
|
137
|
+
isTab: boolean
|
|
138
|
+
/** True if running in an iframe. */
|
|
139
|
+
isFrame: boolean
|
|
140
|
+
/** True if running in a popup or side panel (`<popup>` or `<sidePanel>`). */
|
|
141
|
+
isShell: boolean
|
|
142
|
+
/** True if running in a popup (`<popup>`). */
|
|
143
|
+
isPopup: boolean
|
|
144
|
+
/** True if running in a side panel (`<sidePanel>`). */
|
|
145
|
+
isSidePanel: boolean
|
|
146
|
+
/** True if running in the background (`<background>`). */
|
|
147
|
+
isBackground: boolean
|
|
148
|
+
/** True if running in the foreground (not `<background>` and not inside iframe). */
|
|
149
|
+
isForeground: boolean
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Libs
|
|
153
|
+
libs: {
|
|
154
|
+
mobx: typeof mobx
|
|
155
|
+
mobxReactLite: typeof mobxReactLite
|
|
156
|
+
react: typeof react
|
|
157
|
+
reactDom: typeof reactDom
|
|
158
|
+
reactDomClient: typeof reactDomClient
|
|
159
|
+
reactJsxRuntime: typeof reactJsxRuntime
|
|
160
|
+
yjs: typeof yjs
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare global {
|
|
165
|
+
var epos: Epos
|
|
166
|
+
|
|
167
|
+
namespace React {
|
|
168
|
+
interface HTMLAttributes<T> {
|
|
169
|
+
class?: ClassName
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const epos = self.epos
|
|
175
|
+
export { epos }
|
|
176
|
+
export default epos
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const {
|
|
2
|
+
_allowStateChanges,
|
|
3
|
+
_allowStateChangesInsideComputed,
|
|
4
|
+
_allowStateReadsEnd,
|
|
5
|
+
_allowStateReadsStart,
|
|
6
|
+
_autoAction,
|
|
7
|
+
_endAction,
|
|
8
|
+
_getAdministration,
|
|
9
|
+
_getGlobalState,
|
|
10
|
+
_interceptReads,
|
|
11
|
+
_isComputingDerivation,
|
|
12
|
+
_resetGlobalState,
|
|
13
|
+
_startAction,
|
|
14
|
+
$mobx,
|
|
15
|
+
action,
|
|
16
|
+
autorun,
|
|
17
|
+
comparer,
|
|
18
|
+
computed,
|
|
19
|
+
configure,
|
|
20
|
+
createAtom,
|
|
21
|
+
defineProperty,
|
|
22
|
+
entries,
|
|
23
|
+
extendObservable,
|
|
24
|
+
FlowCancellationError,
|
|
25
|
+
flowResult,
|
|
26
|
+
get,
|
|
27
|
+
getAtom,
|
|
28
|
+
getDebugName,
|
|
29
|
+
getDependencyTree,
|
|
30
|
+
getObserverTree,
|
|
31
|
+
has,
|
|
32
|
+
intercept,
|
|
33
|
+
isAction,
|
|
34
|
+
isBoxedObservable,
|
|
35
|
+
isComputed,
|
|
36
|
+
isComputedProp,
|
|
37
|
+
isFlow,
|
|
38
|
+
isFlowCancellationError,
|
|
39
|
+
isObservable,
|
|
40
|
+
isObservableArray,
|
|
41
|
+
isObservableMap,
|
|
42
|
+
isObservableObject,
|
|
43
|
+
isObservableProp,
|
|
44
|
+
isObservableSet,
|
|
45
|
+
keys,
|
|
46
|
+
makeAutoObservable,
|
|
47
|
+
makeObservable,
|
|
48
|
+
observable,
|
|
49
|
+
ObservableMap,
|
|
50
|
+
ObservableSet,
|
|
51
|
+
observe,
|
|
52
|
+
onBecomeObserved,
|
|
53
|
+
onBecomeUnobserved,
|
|
54
|
+
onReactionError,
|
|
55
|
+
override,
|
|
56
|
+
ownKeys,
|
|
57
|
+
reaction,
|
|
58
|
+
Reaction,
|
|
59
|
+
remove,
|
|
60
|
+
runInAction,
|
|
61
|
+
set,
|
|
62
|
+
spy,
|
|
63
|
+
toJS,
|
|
64
|
+
trace,
|
|
65
|
+
transaction,
|
|
66
|
+
untracked,
|
|
67
|
+
values,
|
|
68
|
+
when,
|
|
69
|
+
} = epos.libs.mobx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default epos.libs.reactDomClient
|
|
2
|
-
export const { createRoot, hydrateRoot } = epos.libs.reactDomClient
|
|
1
|
+
export default epos.libs.reactDomClient
|
|
2
|
+
export const { createRoot, hydrateRoot } = epos.libs.reactDomClient
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default epos.libs.reactDom
|
|
2
|
+
export const {
|
|
3
|
+
createPortal,
|
|
4
|
+
flushSync,
|
|
5
|
+
preconnect,
|
|
6
|
+
prefetchDNS,
|
|
7
|
+
preinit,
|
|
8
|
+
preinitModule,
|
|
9
|
+
preload,
|
|
10
|
+
preloadModule,
|
|
11
|
+
requestFormReset,
|
|
12
|
+
unstable_batchedUpdates,
|
|
13
|
+
useFormState,
|
|
14
|
+
useFormStatus,
|
|
15
|
+
version,
|
|
16
|
+
} = epos.libs.reactDom
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default epos.libs.reactJsxRuntime
|
|
2
|
-
export const { Fragment, jsx, jsxs } = epos.libs.reactJsxRuntime
|
|
1
|
+
export default epos.libs.reactJsxRuntime
|
|
2
|
+
export const { Fragment, jsx, jsxs } = epos.libs.reactJsxRuntime
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default epos.libs.react
|
|
2
|
+
export const {
|
|
3
|
+
act,
|
|
4
|
+
cache,
|
|
5
|
+
Children,
|
|
6
|
+
cloneElement,
|
|
7
|
+
Component,
|
|
8
|
+
createContext,
|
|
9
|
+
createElement,
|
|
10
|
+
createRef,
|
|
11
|
+
forwardRef,
|
|
12
|
+
Fragment,
|
|
13
|
+
isValidElement,
|
|
14
|
+
lazy,
|
|
15
|
+
memo,
|
|
16
|
+
Profiler,
|
|
17
|
+
PureComponent,
|
|
18
|
+
startTransition,
|
|
19
|
+
StrictMode,
|
|
20
|
+
Suspense,
|
|
21
|
+
use,
|
|
22
|
+
useActionState,
|
|
23
|
+
useCallback,
|
|
24
|
+
useContext,
|
|
25
|
+
useDebugValue,
|
|
26
|
+
useDeferredValue,
|
|
27
|
+
useEffect,
|
|
28
|
+
useId,
|
|
29
|
+
useImperativeHandle,
|
|
30
|
+
useInsertionEffect,
|
|
31
|
+
useLayoutEffect,
|
|
32
|
+
useMemo,
|
|
33
|
+
useOptimistic,
|
|
34
|
+
useReducer,
|
|
35
|
+
useRef,
|
|
36
|
+
useState,
|
|
37
|
+
useSyncExternalStore,
|
|
38
|
+
useTransition,
|
|
39
|
+
version,
|
|
40
|
+
} = epos.libs.react
|
package/src/vite.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { resolve } from 'node:path'
|
|
2
|
+
import type { Plugin } from 'vite'
|
|
3
|
+
|
|
4
|
+
const mapping: Record<string, string> = {
|
|
5
|
+
'react': resolve(import.meta.dirname, './libs/libs-react.ts'),
|
|
6
|
+
'react/jsx-runtime': resolve(import.meta.dirname, './libs/libs-react-jsx-runtime.ts'),
|
|
7
|
+
'react-dom': resolve(import.meta.dirname, './libs/libs-react-dom.ts'),
|
|
8
|
+
'react-dom/client': resolve(import.meta.dirname, './libs/libs-react-dom-client.ts'),
|
|
9
|
+
'mobx': resolve(import.meta.dirname, './libs/libs-mobx.ts'),
|
|
10
|
+
'mobx-react-lite': resolve(import.meta.dirname, './libs/libs-mobx-react-lite.ts'),
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function epos(): Plugin {
|
|
14
|
+
return {
|
|
15
|
+
name: 'epos',
|
|
16
|
+
enforce: 'pre',
|
|
17
|
+
resolveId: source => mapping[source] ?? null,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default epos
|
package/dist/epos/epos.d.ts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import type * as mobx from 'mobx';
|
|
2
|
-
import type * as mobxReactLite from 'mobx-react-lite';
|
|
3
|
-
import type * as react from 'react';
|
|
4
|
-
import type * as reactDom from 'react-dom';
|
|
5
|
-
import type * as reactDomClient from 'react-dom/client';
|
|
6
|
-
import type * as reactJsxRuntime from 'react/jsx-runtime';
|
|
7
|
-
import type * as yjs from 'yjs';
|
|
8
|
-
export type Fn<T = any> = (...args: any[]) => T;
|
|
9
|
-
export type Obj = Record<string, unknown>;
|
|
10
|
-
export type Versioner = Record<number, (this: any, state: any) => void>;
|
|
11
|
-
export type ClassName = string | null | boolean | undefined | ClassName[];
|
|
12
|
-
export type ModelClass = new (...args: any[]) => any;
|
|
13
|
-
export type ConnectOptions<T extends Obj> = {
|
|
14
|
-
initial?: () => T;
|
|
15
|
-
models?: Record<string, ModelClass>;
|
|
16
|
-
versioner?: Versioner;
|
|
17
|
-
};
|
|
18
|
-
type Storage = {
|
|
19
|
-
/** Get value from the storage. */
|
|
20
|
-
get<T = unknown>(key: string): Promise<T>;
|
|
21
|
-
/** Set value in the storage. */
|
|
22
|
-
set<T = unknown>(key: string, value: T): Promise<void>;
|
|
23
|
-
/** Delete value from the storage. */
|
|
24
|
-
delete(key: string): Promise<void>;
|
|
25
|
-
/** Get all keys from the storage. */
|
|
26
|
-
keys(): Promise<string[]>;
|
|
27
|
-
/** Clear the storage. Deletes all keys and storage itself. */
|
|
28
|
-
clear(): Promise<void>;
|
|
29
|
-
};
|
|
30
|
-
export interface Epos {
|
|
31
|
-
fetch: typeof window.fetch;
|
|
32
|
-
browser: typeof chrome;
|
|
33
|
-
element: HTMLDivElement;
|
|
34
|
-
render(node: react.ReactNode, container?: reactDomClient.Container): void;
|
|
35
|
-
component: {
|
|
36
|
-
<P>(Component: react.FC<P>): typeof Component;
|
|
37
|
-
<P>(name: string, Component: react.FC<P>): typeof Component;
|
|
38
|
-
};
|
|
39
|
-
bus: {
|
|
40
|
-
/** Listen for an event. */
|
|
41
|
-
on(eventName: string, callback: Fn, thisValue?: unknown): void;
|
|
42
|
-
/** Remove event listener. */
|
|
43
|
-
off(eventName: string, callback?: Fn): void;
|
|
44
|
-
/** Listen for an event once. */
|
|
45
|
-
once(eventName: string, callback: Fn, thisValue?: unknown): void;
|
|
46
|
-
/** Send an event to all remote listeners (local listeners are ignored). */
|
|
47
|
-
send<T = unknown>(eventName: string, ...args: unknown[]): Promise<T>;
|
|
48
|
-
/** Emit event locally (calls local listeners only). */
|
|
49
|
-
emit<T = unknown>(eventName: string, ...args: unknown[]): Promise<T>;
|
|
50
|
-
};
|
|
51
|
-
state: {
|
|
52
|
-
/** Connect state. */
|
|
53
|
-
connect: {
|
|
54
|
-
<T extends Obj>(name?: string, options?: ConnectOptions<T>): Promise<T>;
|
|
55
|
-
<T extends Obj>(options?: ConnectOptions<T>): Promise<T>;
|
|
56
|
-
};
|
|
57
|
-
/** Disconnect state. */
|
|
58
|
-
disconnect(name?: string): void;
|
|
59
|
-
/** Run any state changes in a batch. */
|
|
60
|
-
transaction: (fn: () => void) => void;
|
|
61
|
-
/** Create local state (no sync). */
|
|
62
|
-
local<T extends Obj = {}>(state?: T): T;
|
|
63
|
-
/** Get the list of all state names. */
|
|
64
|
-
list(filter?: {
|
|
65
|
-
connected?: boolean;
|
|
66
|
-
}): Promise<Array<{
|
|
67
|
-
name: string | null;
|
|
68
|
-
}>>;
|
|
69
|
-
/** Remove state and all its data. */
|
|
70
|
-
destroy(name?: string): Promise<void>;
|
|
71
|
-
/** Dynamically register models for all states. */
|
|
72
|
-
registerGlobalModels(models: Record<string, ModelClass>): void;
|
|
73
|
-
symbols: {
|
|
74
|
-
model: {
|
|
75
|
-
readonly init: unique symbol;
|
|
76
|
-
readonly cleanup: unique symbol;
|
|
77
|
-
readonly versioner: unique symbol;
|
|
78
|
-
readonly parent: unique symbol;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
storage: {
|
|
83
|
-
/** Get value from the storage. */
|
|
84
|
-
get<T = unknown>(key: string, storageName?: string): Promise<T>;
|
|
85
|
-
/** Set value in the storage. */
|
|
86
|
-
set<T = unknown>(key: string, value: T, storageName?: string): Promise<void>;
|
|
87
|
-
/** Delete value from the storage. */
|
|
88
|
-
delete(key: string, storageName?: string): Promise<void>;
|
|
89
|
-
/** Get all keys from the storage. */
|
|
90
|
-
keys(storageName?: string): Promise<string[]>;
|
|
91
|
-
/** Clear storage. Removes all keys and storage itself. */
|
|
92
|
-
clear(storageName?: string): Promise<void>;
|
|
93
|
-
/** Create storage API. */
|
|
94
|
-
use(name: string): Promise<Storage>;
|
|
95
|
-
/** Get list of all storage names. */
|
|
96
|
-
list(): Promise<Array<{
|
|
97
|
-
name: string | null;
|
|
98
|
-
}>>;
|
|
99
|
-
};
|
|
100
|
-
assets: {
|
|
101
|
-
/** Get asset URL. Asset must be loaded first. */
|
|
102
|
-
url(path: string): string;
|
|
103
|
-
/** Load asset by path. */
|
|
104
|
-
load(path: string): Promise<Blob>;
|
|
105
|
-
/** Load all assets. */
|
|
106
|
-
loadAll(): Promise<Blob[]>;
|
|
107
|
-
/** Unload asset from memory. */
|
|
108
|
-
unload(path: string): void;
|
|
109
|
-
/** Unload all assets from memory. */
|
|
110
|
-
unloadAll(): void;
|
|
111
|
-
/** Get list of all available asset paths. */
|
|
112
|
-
list(filter?: {
|
|
113
|
-
loaded?: boolean;
|
|
114
|
-
}): Array<{
|
|
115
|
-
path: string;
|
|
116
|
-
loaded: boolean;
|
|
117
|
-
}>;
|
|
118
|
-
};
|
|
119
|
-
frames: {
|
|
120
|
-
/** Create a new frame. */
|
|
121
|
-
create(name: string, url: string, attributes?: Record<string, unknown>): Promise<void>;
|
|
122
|
-
/** Remove frame by name. */
|
|
123
|
-
remove(name: string): Promise<void>;
|
|
124
|
-
/** Get list of all created frames. */
|
|
125
|
-
list(): Promise<Array<{
|
|
126
|
-
name: string;
|
|
127
|
-
url: string;
|
|
128
|
-
}>>;
|
|
129
|
-
};
|
|
130
|
-
env: {
|
|
131
|
-
/** Current tab ID. */
|
|
132
|
-
tabId: number;
|
|
133
|
-
/** True if running in a tab (top-level, not iframe). */
|
|
134
|
-
isTab: boolean;
|
|
135
|
-
/** True if running in an iframe. */
|
|
136
|
-
isFrame: boolean;
|
|
137
|
-
/** True if running in a popup or side panel (`<popup>` or `<sidePanel>`). */
|
|
138
|
-
isShell: boolean;
|
|
139
|
-
/** True if running in a popup (`<popup>`). */
|
|
140
|
-
isPopup: boolean;
|
|
141
|
-
/** True if running in a side panel (`<sidePanel>`). */
|
|
142
|
-
isSidePanel: boolean;
|
|
143
|
-
/** True if running in the background (`<background>`). */
|
|
144
|
-
isBackground: boolean;
|
|
145
|
-
/** True if running in the foreground (not `<background>` and not inside iframe). */
|
|
146
|
-
isForeground: boolean;
|
|
147
|
-
};
|
|
148
|
-
libs: {
|
|
149
|
-
mobx: typeof mobx;
|
|
150
|
-
mobxReactLite: typeof mobxReactLite;
|
|
151
|
-
react: typeof react;
|
|
152
|
-
reactDom: typeof reactDom;
|
|
153
|
-
reactDomClient: typeof reactDomClient;
|
|
154
|
-
reactJsxRuntime: typeof reactJsxRuntime;
|
|
155
|
-
yjs: typeof yjs;
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
declare global {
|
|
159
|
-
var epos: Epos;
|
|
160
|
-
namespace React {
|
|
161
|
-
interface HTMLAttributes<T> {
|
|
162
|
-
class?: ClassName;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
declare const _epos: Epos;
|
|
167
|
-
export { _epos as epos };
|
package/dist/epos/epos.js
DELETED
package/dist/epos/index.d.ts
DELETED
package/dist/epos/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const enableStaticRendering: typeof import("mobx-react-lite").enableStaticRendering, isUsingStaticRendering: typeof import("mobx-react-lite").isUsingStaticRendering, observer: typeof import("mobx-react-lite").observer, Observer: typeof import("mobx-react-lite").Observer, observerBatching: typeof import("mobx-react-lite").observerBatching, useAsObservableSource: typeof import("mobx-react-lite").useAsObservableSource, useLocalObservable: typeof import("mobx-react-lite").useLocalObservable, useLocalStore: typeof import("mobx-react-lite").useLocalStore, useObserver: typeof import("mobx-react-lite").useObserver, useStaticRendering: typeof import("mobx-react-lite").useStaticRendering;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const { enableStaticRendering, isUsingStaticRendering, observer, Observer, observerBatching, useAsObservableSource, useLocalObservable, useLocalStore, useObserver, useStaticRendering, } = epos.libs.mobxReactLite;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const _allowStateChanges: typeof import("mobx")._allowStateChanges, _allowStateChangesInsideComputed: typeof import("mobx").runInAction, _allowStateReadsEnd: typeof import("mobx")._allowStateReadsEnd, _allowStateReadsStart: typeof import("mobx")._allowStateReadsStart, _autoAction: import("mobx").IActionFactory, _endAction: typeof import("mobx")._endAction, _getAdministration: typeof import("mobx")._getAdministration, _getGlobalState: typeof import("mobx")._getGlobalState, _interceptReads: typeof import("mobx")._interceptReads, _isComputingDerivation: typeof import("mobx")._isComputingDerivation, _resetGlobalState: typeof import("mobx")._resetGlobalState, _startAction: typeof import("mobx")._startAction, $mobx: symbol, action: import("mobx").IActionFactory, autorun: typeof import("mobx").autorun, comparer: {
|
|
2
|
-
identity: (a: any, b: any) => boolean;
|
|
3
|
-
structural: (a: any, b: any) => boolean;
|
|
4
|
-
default: (a: any, b: any) => boolean;
|
|
5
|
-
shallow: (a: any, b: any) => boolean;
|
|
6
|
-
}, computed: import("mobx").IComputedFactory, configure: typeof import("mobx").configure, createAtom: typeof import("mobx").createAtom, defineProperty: typeof import("mobx").defineProperty, entries: typeof import("mobx").entries, extendObservable: typeof import("mobx").extendObservable, FlowCancellationError: typeof import("mobx").FlowCancellationError, flowResult: typeof import("mobx").flowResult, get: typeof import("mobx").get, getAtom: typeof import("mobx").getAtom, getDebugName: typeof import("mobx").getDebugName, getDependencyTree: typeof import("mobx").getDependencyTree, getObserverTree: typeof import("mobx").getObserverTree, has: typeof import("mobx").has, intercept: typeof import("mobx").intercept, isAction: typeof import("mobx").isAction, isBoxedObservable: (x: any) => x is import("mobx").IObservableValue<any>, isComputed: typeof import("mobx").isComputed, isComputedProp: typeof import("mobx").isComputedProp, isFlow: typeof import("mobx").isFlow, isFlowCancellationError: typeof import("mobx").isFlowCancellationError, isObservable: typeof import("mobx").isObservable, isObservableArray: typeof import("mobx").isObservableArray, isObservableMap: (thing: any) => thing is import("mobx").ObservableMap<any, any>, isObservableObject: typeof import("mobx").isObservableObject, isObservableProp: typeof import("mobx").isObservableProp, isObservableSet: (thing: any) => thing is import("mobx").ObservableSet<any>, keys: typeof import("mobx").keys, makeAutoObservable: typeof import("mobx").makeAutoObservable, makeObservable: typeof import("mobx").makeObservable, observable: import("mobx").IObservableFactory, ObservableMap: typeof import("mobx").ObservableMap, ObservableSet: typeof import("mobx").ObservableSet, observe: typeof import("mobx").observe, onBecomeObserved: typeof import("mobx").onBecomeObserved, onBecomeUnobserved: typeof import("mobx").onBecomeUnobserved, onReactionError: typeof import("mobx").onReactionError, override: import("mobx/dist/internal").Annotation & PropertyDecorator & import("mobx/dist/types/decorator_fills").ClassMethodDecorator, ownKeys: typeof import("mobx").ownKeys, reaction: typeof import("mobx").reaction, Reaction: typeof import("mobx").Reaction, remove: typeof import("mobx").remove, runInAction: typeof import("mobx").runInAction, set: typeof import("mobx").set, spy: typeof import("mobx").spy, toJS: typeof import("mobx").toJS, trace: typeof import("mobx").trace, transaction: typeof import("mobx").transaction, untracked: typeof import("mobx").untracked, values: typeof import("mobx").values, when: typeof import("mobx").when;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const { _allowStateChanges, _allowStateChangesInsideComputed, _allowStateReadsEnd, _allowStateReadsStart, _autoAction, _endAction, _getAdministration, _getGlobalState, _interceptReads, _isComputingDerivation, _resetGlobalState, _startAction, $mobx, action, autorun, comparer, computed, configure, createAtom, defineProperty, entries, extendObservable, FlowCancellationError, flowResult, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isBoxedObservable, isComputed, isComputedProp, isFlow, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, makeAutoObservable, makeObservable, observable, ObservableMap, ObservableSet, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, override, ownKeys, reaction, Reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when, } = epos.libs.mobx;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const _default: typeof import("react-dom");
|
|
2
|
-
export default _default;
|
|
3
|
-
export declare const createPortal: typeof import("react-dom").createPortal, flushSync: typeof import("react-dom").flushSync, preconnect: typeof import("react-dom").preconnect, prefetchDNS: typeof import("react-dom").prefetchDNS, preinit: typeof import("react-dom").preinit, preinitModule: typeof import("react-dom").preinitModule, preload: typeof import("react-dom").preload, preloadModule: typeof import("react-dom").preloadModule, requestFormReset: typeof import("react-dom").requestFormReset, unstable_batchedUpdates: typeof import("react-dom").unstable_batchedUpdates, useFormState: typeof import("react-dom").useFormState, useFormStatus: typeof import("react-dom").useFormStatus, version: string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const _default: typeof React;
|
|
2
|
-
export default _default;
|
|
3
|
-
export declare const act: typeof React.act, cache: typeof React.cache, Children: {
|
|
4
|
-
map<T, C>(children: C | readonly C[], fn: (child: C, index: number) => T): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
|
|
5
|
-
forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
|
|
6
|
-
count(children: any): number;
|
|
7
|
-
only<C>(children: C): C extends any[] ? never : C;
|
|
8
|
-
toArray(children: React.ReactNode | React.ReactNode[]): Array<Exclude<React.ReactNode, boolean | null | undefined>>;
|
|
9
|
-
}, cloneElement: typeof React.cloneElement, Component: typeof React.Component, createContext: typeof React.createContext, createElement: typeof React.createElement, createRef: typeof React.createRef, forwardRef: typeof React.forwardRef, Fragment: React.ExoticComponent<React.FragmentProps>, isValidElement: typeof React.isValidElement, lazy: typeof React.lazy, memo: typeof React.memo, Profiler: React.ExoticComponent<React.ProfilerProps>, PureComponent: typeof React.PureComponent, startTransition: typeof React.startTransition, StrictMode: React.ExoticComponent<{
|
|
10
|
-
children?: React.ReactNode | undefined;
|
|
11
|
-
}>, Suspense: React.ExoticComponent<React.SuspenseProps>, use: typeof React.use, useActionState: typeof React.useActionState, useCallback: typeof React.useCallback, useContext: typeof React.useContext, useDebugValue: typeof React.useDebugValue, useDeferredValue: typeof React.useDeferredValue, useEffect: typeof React.useEffect, useId: typeof React.useId, useImperativeHandle: typeof React.useImperativeHandle, useInsertionEffect: typeof React.useInsertionEffect, useLayoutEffect: typeof React.useLayoutEffect, useMemo: typeof React.useMemo, useOptimistic: typeof React.useOptimistic, useReducer: typeof React.useReducer, useRef: typeof React.useRef, useState: typeof React.useState, useSyncExternalStore: typeof React.useSyncExternalStore, useTransition: typeof React.useTransition, version: string;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export default epos.libs.react;
|
|
2
|
-
export const { act, cache, Children, cloneElement, Component, createContext, createElement, createRef, forwardRef, Fragment, isValidElement, lazy, memo, Profiler, PureComponent, startTransition, StrictMode, Suspense, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, version, } = epos.libs.react;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
export function epos() {
|
|
3
|
-
return {
|
|
4
|
-
name: 'epos',
|
|
5
|
-
setup(build) {
|
|
6
|
-
build.onResolve({ filter: /^react$/ }, () => ({
|
|
7
|
-
path: path.resolve(import.meta.dirname, './lib/lib-react.js'),
|
|
8
|
-
}));
|
|
9
|
-
build.onResolve({ filter: /^react\/jsx-runtime$/ }, () => ({
|
|
10
|
-
path: path.resolve(import.meta.dirname, './lib/lib-react-jsx-runtime.js'),
|
|
11
|
-
}));
|
|
12
|
-
build.onResolve({ filter: /^react-dom$/ }, () => ({
|
|
13
|
-
path: path.resolve(import.meta.dirname, './lib/lib-react-dom.js'),
|
|
14
|
-
}));
|
|
15
|
-
build.onResolve({ filter: /^react-dom\/client$/ }, () => ({
|
|
16
|
-
path: path.resolve(import.meta.dirname, './lib/lib-react-dom-client.js'),
|
|
17
|
-
}));
|
|
18
|
-
build.onResolve({ filter: /^mobx$/ }, () => ({
|
|
19
|
-
path: path.resolve(import.meta.dirname, './lib/lib-mobx.js'),
|
|
20
|
-
}));
|
|
21
|
-
build.onResolve({ filter: /^mobx-react$/ }, () => ({
|
|
22
|
-
path: path.resolve(import.meta.dirname, './lib/lib-mobx-react.js'),
|
|
23
|
-
}));
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export default epos;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
export function epos() {
|
|
3
|
-
return {
|
|
4
|
-
name: 'epos',
|
|
5
|
-
enforce: 'pre',
|
|
6
|
-
resolveId(source) {
|
|
7
|
-
if (source === 'react') {
|
|
8
|
-
return path.resolve(import.meta.dirname, './lib/lib-react.js');
|
|
9
|
-
}
|
|
10
|
-
if (source === 'react/jsx-runtime') {
|
|
11
|
-
return path.resolve(import.meta.dirname, './lib/lib-react-jsx-runtime.js');
|
|
12
|
-
}
|
|
13
|
-
if (source === 'react-dom') {
|
|
14
|
-
return path.resolve(import.meta.dirname, './lib/lib-react-dom.js');
|
|
15
|
-
}
|
|
16
|
-
if (source === 'react-dom/client') {
|
|
17
|
-
return path.resolve(import.meta.dirname, './lib/lib-react-dom-client.js');
|
|
18
|
-
}
|
|
19
|
-
if (source === 'mobx') {
|
|
20
|
-
return path.resolve(import.meta.dirname, './lib/lib-mobx.js');
|
|
21
|
-
}
|
|
22
|
-
if (source === 'mobx-react') {
|
|
23
|
-
return path.resolve(import.meta.dirname, './lib/lib-mobx-react.js');
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export default epos;
|