epos 1.7.1 → 1.7.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/dist/epos/epos.d.ts +128 -133
- package/dist/epos/epos.js +0 -1
- package/dist/epos/index.d.ts +3 -0
- package/dist/epos/index.js +3 -0
- package/dist/plugin/lib/lib-mobx-react-lite.js +1 -1
- package/dist/plugin/lib/lib-mobx.js +1 -1
- package/dist/plugin/lib/lib-react-dom-client.js +2 -2
- package/dist/plugin/lib/lib-react-dom.js +2 -2
- package/dist/plugin/lib/lib-react-jsx-runtime.js +2 -2
- package/dist/plugin/lib/lib-react.js +2 -2
- package/epos.schema.json +6 -1
- package/package.json +5 -5
package/dist/epos/epos.d.ts
CHANGED
|
@@ -5,164 +5,159 @@ import type * as reactDom from 'react-dom';
|
|
|
5
5
|
import type * as reactDomClient from 'react-dom/client';
|
|
6
6
|
import type * as reactJsxRuntime from 'react/jsx-runtime';
|
|
7
7
|
import type * as yjs from 'yjs';
|
|
8
|
-
type Fn<T = any> = (...args: any[]) => T;
|
|
9
|
-
type
|
|
10
|
-
type
|
|
11
|
-
type
|
|
12
|
-
type
|
|
13
|
-
type
|
|
14
|
-
|
|
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;
|
|
15
17
|
};
|
|
16
18
|
type Storage = {
|
|
17
|
-
/** Get value from storage. */
|
|
19
|
+
/** Get value from the storage. */
|
|
18
20
|
get<T = unknown>(key: string): Promise<T>;
|
|
19
|
-
/** Set value in storage. */
|
|
21
|
+
/** Set value in the storage. */
|
|
20
22
|
set<T = unknown>(key: string, value: T): Promise<void>;
|
|
21
|
-
/** Delete value from storage. */
|
|
23
|
+
/** Delete value from the storage. */
|
|
22
24
|
delete(key: string): Promise<void>;
|
|
23
|
-
/** Get all keys from storage. */
|
|
25
|
+
/** Get all keys from the storage. */
|
|
24
26
|
keys(): Promise<string[]>;
|
|
25
|
-
/** Clear storage. Deletes all keys and storage itself. */
|
|
27
|
+
/** Clear the storage. Deletes all keys and storage itself. */
|
|
26
28
|
clear(): Promise<void>;
|
|
27
29
|
};
|
|
28
|
-
declare class Unit<TRoot = unknown> {
|
|
29
|
-
/** Reference to the root unit. */
|
|
30
|
-
$: TRoot;
|
|
31
|
-
log: Fn<void> & {
|
|
32
|
-
warn: Fn<void>;
|
|
33
|
-
error: Fn<void>;
|
|
34
|
-
};
|
|
35
|
-
constructor(parent?: Unit<TRoot> | null);
|
|
36
|
-
/** Find ancestor unit by its class. */
|
|
37
|
-
up<T extends Unit<TRoot>>(Ancestor: Cls<T>): T | null;
|
|
38
|
-
up<T extends Unit<TRoot>, K extends keyof T>(Ancestor: Cls<T>, key: K): T[K] | null;
|
|
39
|
-
autorun: typeof mobx.autorun;
|
|
40
|
-
reaction: typeof mobx.reaction;
|
|
41
|
-
setTimeout: typeof self.setTimeout;
|
|
42
|
-
setInterval: typeof self.setInterval;
|
|
43
|
-
}
|
|
44
30
|
export interface Epos {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/** Listen for an event once. */
|
|
50
|
-
once(eventName: string, callback: Fn, thisValue?: unknown): void;
|
|
51
|
-
/** Send an event to all remote listeners (local listeners are ignored). */
|
|
52
|
-
send<T = unknown>(eventName: string, ...args: unknown[]): Promise<T>;
|
|
53
|
-
/** Emit event locally (calls local listeners only). */
|
|
54
|
-
emit<T = unknown>(eventName: string, ...args: unknown[]): Promise<T>;
|
|
55
|
-
/** Connect to the state. */
|
|
56
|
-
connect: {
|
|
57
|
-
<T extends State = {}>(): Promise<T>;
|
|
58
|
-
<T extends State = {}>(initial: () => T): Promise<T>;
|
|
59
|
-
<T extends State = {}>(initial: () => T, versioner: Versioner): Promise<T>;
|
|
60
|
-
<T extends State = {}>(name: string): Promise<T>;
|
|
61
|
-
<T extends State = {}>(name: string, initial: () => T): Promise<T>;
|
|
62
|
-
<T extends State = {}>(name: string, initial: () => T, versioner: Versioner): Promise<T>;
|
|
63
|
-
};
|
|
64
|
-
/** Disconnect from the state. */
|
|
65
|
-
disconnect(name?: string): void;
|
|
66
|
-
/** Performs any state changes in a batch. */
|
|
67
|
-
transaction: (fn: () => void) => void;
|
|
68
|
-
/** Create local state (no sync). */
|
|
69
|
-
local<T extends State = {}>(state?: T): T;
|
|
70
|
-
/** Get the list of all state names. */
|
|
71
|
-
states(opts?: {
|
|
72
|
-
connected?: boolean;
|
|
73
|
-
}): Promise<Array<{
|
|
74
|
-
name: string | null;
|
|
75
|
-
}>>;
|
|
76
|
-
/** Destroy state. */
|
|
77
|
-
destroy(name?: string): Promise<void>;
|
|
78
|
-
element: HTMLElement;
|
|
31
|
+
fetch: typeof window.fetch;
|
|
32
|
+
browser: typeof chrome;
|
|
33
|
+
element: HTMLDivElement;
|
|
34
|
+
render(node: react.ReactNode, container?: reactDomClient.Container): void;
|
|
79
35
|
component: {
|
|
80
36
|
<P>(Component: react.FC<P>): typeof Component;
|
|
81
37
|
<P>(name: string, Component: react.FC<P>): typeof Component;
|
|
82
38
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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>;
|
|
93
50
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
|
|
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): Promise<string>;
|
|
103
|
+
/** Load asset to memory. Pass '*' to load all assets. */
|
|
104
|
+
load(path: string): Promise<void>;
|
|
105
|
+
/** Unload asset from memory. Pass '*' to unload all assets.*/
|
|
106
|
+
unload(path: string): void;
|
|
107
|
+
/** Get list of all available asset paths. */
|
|
108
|
+
list(filter?: {
|
|
109
|
+
loaded?: boolean;
|
|
110
|
+
}): Array<{
|
|
111
|
+
path: string;
|
|
112
|
+
loaded: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
};
|
|
115
|
+
frames: {
|
|
116
|
+
/** Create a new frame. */
|
|
117
|
+
create(name: string, url: string, attributes?: Record<string, unknown>): Promise<void>;
|
|
118
|
+
/** Remove frame by name. */
|
|
119
|
+
remove(name: string): Promise<void>;
|
|
120
|
+
/** Get list of all created frames. */
|
|
121
|
+
list(): Promise<Array<{
|
|
122
|
+
name: string;
|
|
123
|
+
url: string;
|
|
124
|
+
}>>;
|
|
125
|
+
};
|
|
126
|
+
env: {
|
|
127
|
+
/** Current tab ID. */
|
|
128
|
+
tabId: number;
|
|
129
|
+
/** True if running in a tab (top-level, not iframe). */
|
|
130
|
+
isTab: boolean;
|
|
131
|
+
/** True if running in an iframe. */
|
|
132
|
+
isFrame: boolean;
|
|
133
|
+
/** True if running in a popup or side panel (`<popup>` or `<sidePanel>`). */
|
|
134
|
+
isShell: boolean;
|
|
140
135
|
/** True if running in a popup (`<popup>`). */
|
|
141
|
-
|
|
142
|
-
/** True if running in a side panel (`<
|
|
143
|
-
|
|
136
|
+
isPopup: boolean;
|
|
137
|
+
/** True if running in a side panel (`<sidePanel>`). */
|
|
138
|
+
isSidePanel: boolean;
|
|
144
139
|
/** True if running in the background (`<background>`). */
|
|
145
|
-
|
|
146
|
-
/** True if running in the foreground. */
|
|
147
|
-
|
|
140
|
+
isBackground: boolean;
|
|
141
|
+
/** True if running in the foreground (not `<background>` and not inside iframe). */
|
|
142
|
+
isForeground: boolean;
|
|
143
|
+
};
|
|
144
|
+
libs: {
|
|
145
|
+
mobx: typeof mobx;
|
|
146
|
+
mobxReactLite: typeof mobxReactLite;
|
|
147
|
+
react: typeof react;
|
|
148
|
+
reactDom: typeof reactDom;
|
|
149
|
+
reactDomClient: typeof reactDomClient;
|
|
150
|
+
reactJsxRuntime: typeof reactJsxRuntime;
|
|
151
|
+
yjs: typeof yjs;
|
|
148
152
|
};
|
|
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
153
|
}
|
|
157
154
|
declare global {
|
|
158
155
|
var epos: Epos;
|
|
159
156
|
namespace React {
|
|
160
157
|
interface HTMLAttributes<T> {
|
|
161
158
|
class?: ClassName;
|
|
162
|
-
[key: `$${string}`]: boolean;
|
|
163
159
|
}
|
|
164
160
|
}
|
|
165
161
|
}
|
|
166
162
|
declare const _epos: Epos;
|
|
167
163
|
export { _epos as epos };
|
|
168
|
-
export default _epos;
|
package/dist/epos/epos.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const { enableStaticRendering, isUsingStaticRendering, observer, Observer, observerBatching, useAsObservableSource, useLocalObservable, useLocalStore, useObserver, useStaticRendering, } = epos.mobxReactLite;
|
|
1
|
+
export const { enableStaticRendering, isUsingStaticRendering, observer, Observer, observerBatching, useAsObservableSource, useLocalObservable, useLocalStore, useObserver, useStaticRendering, } = epos.libs.mobxReactLite;
|
|
@@ -1 +1 @@
|
|
|
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.mobx;
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export default epos.reactDomClient;
|
|
2
|
-
export const { createRoot, hydrateRoot } = epos.reactDomClient;
|
|
1
|
+
export default epos.libs.reactDomClient;
|
|
2
|
+
export const { createRoot, hydrateRoot } = epos.libs.reactDomClient;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default epos.reactDom;
|
|
2
|
-
export const { createPortal, flushSync, preconnect, prefetchDNS, preinit, preinitModule, preload, preloadModule, requestFormReset, unstable_batchedUpdates, useFormState, useFormStatus, version, } = epos.reactDom;
|
|
1
|
+
export default epos.libs.reactDom;
|
|
2
|
+
export const { createPortal, flushSync, preconnect, prefetchDNS, preinit, preinitModule, preload, preloadModule, requestFormReset, unstable_batchedUpdates, useFormState, useFormStatus, version, } = epos.libs.reactDom;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default epos.reactJsxRuntime;
|
|
2
|
-
export const { Fragment, jsx, jsxs } = epos.reactJsxRuntime;
|
|
1
|
+
export default epos.libs.reactJsxRuntime;
|
|
2
|
+
export const { Fragment, jsx, jsxs } = epos.libs.reactJsxRuntime;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default epos.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.react;
|
|
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;
|
package/epos.schema.json
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"targets": { "$ref": "#/definitions/Targets" },
|
|
14
14
|
"matches": { "$ref": "#/definitions/Matches" },
|
|
15
15
|
"load": { "$ref": "#/definitions/Load" },
|
|
16
|
-
"mode": { "$ref": "#/definitions/Mode" }
|
|
16
|
+
"mode": { "$ref": "#/definitions/Mode" },
|
|
17
|
+
"manifest": { "$ref": "#/definitions/Manifest" }
|
|
17
18
|
},
|
|
18
19
|
"required": ["name"],
|
|
19
20
|
"additionalProperties": false,
|
|
@@ -97,6 +98,10 @@
|
|
|
97
98
|
"Mode": {
|
|
98
99
|
"type": "string",
|
|
99
100
|
"enum": ["normal", "shadow", "lite"]
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
"Manifest": {
|
|
104
|
+
"$ref": "https://json.schemastore.org/chrome-manifest.json"
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "epos",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "imkost",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"import": "./dist/epos/
|
|
17
|
+
"import": "./dist/epos/index.js"
|
|
18
18
|
},
|
|
19
19
|
"./vite": {
|
|
20
20
|
"import": "./dist/plugin/plugin-vite.js"
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"epos.schema.json"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@types/chrome": "^0.1.
|
|
32
|
-
"@types/react": "^19.1.
|
|
31
|
+
"@types/chrome": "^0.1.11",
|
|
32
|
+
"@types/react": "^19.1.13",
|
|
33
33
|
"@types/react-dom": "^19.1.9",
|
|
34
34
|
"mobx": "^6.13.7",
|
|
35
35
|
"mobx-react-lite": "^4.1.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"esbuild": "^0.25.9",
|
|
41
|
-
"vite": "^7.1.
|
|
41
|
+
"vite": "^7.1.5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"esbuild": "^0.25.9",
|