epos 1.15.0 → 1.17.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/dist/epos.d.ts +156 -0
- package/dist/epos.js +7 -0
- package/dist/libs/libs-mobx-react-lite.d.ts +14 -0
- package/dist/libs/libs-mobx-react-lite.js +25 -0
- package/dist/libs/libs-mobx.d.ts +71 -0
- package/dist/libs/libs-mobx.js +139 -0
- package/dist/libs/libs-react-dom-client.d.ts +4 -0
- package/dist/libs/libs-react-dom-client.js +8 -0
- package/dist/libs/libs-react-dom.d.ts +18 -0
- package/dist/libs/libs-react-dom.js +33 -0
- package/dist/libs/libs-react-jsx-runtime.d.ts +4 -0
- package/dist/libs/libs-react-jsx-runtime.js +9 -0
- package/dist/libs/libs-react.d.ts +42 -0
- package/dist/libs/libs-react.js +81 -0
- package/dist/vite.d.ts +5 -0
- package/dist/vite.js +22 -0
- package/package.json +20 -9
- package/src/epos.ts +11 -9
package/dist/epos.d.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as mobx from 'mobx';
|
|
2
|
+
import * as mobxReactLite from 'mobx-react-lite';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import * as reactDom from 'react-dom';
|
|
5
|
+
import * as reactDomClient from 'react-dom/client';
|
|
6
|
+
import * as reactJsxRuntime from 'react/jsx-runtime';
|
|
7
|
+
import * as yjs from 'yjs';
|
|
8
|
+
|
|
9
|
+
type Fn<T = any> = (...args: any[]) => T;
|
|
10
|
+
type Obj = Record<string, unknown>;
|
|
11
|
+
type Versioner = Record<number, (this: any, state: any) => void>;
|
|
12
|
+
type ClassName = string | null | boolean | undefined | ClassName[];
|
|
13
|
+
type ModelClass = new (...args: any[]) => any;
|
|
14
|
+
type Model = InstanceType<ModelClass>;
|
|
15
|
+
type Initial<T extends Obj | Model> = T | (() => T);
|
|
16
|
+
type Storage = {
|
|
17
|
+
/** Get value from the storage. */
|
|
18
|
+
get<T = unknown>(key: string): Promise<T>;
|
|
19
|
+
/** Set value in the storage. */
|
|
20
|
+
set<T = unknown>(key: string, value: T): Promise<void>;
|
|
21
|
+
/** Delete value from the storage. */
|
|
22
|
+
delete(key: string): Promise<void>;
|
|
23
|
+
/** Get all keys from the storage. */
|
|
24
|
+
keys(): Promise<string[]>;
|
|
25
|
+
/** Clear the storage. Deletes all keys and storage itself. */
|
|
26
|
+
clear(): Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
interface Epos {
|
|
29
|
+
fetch: typeof window.fetch;
|
|
30
|
+
browser: typeof chrome;
|
|
31
|
+
element: HTMLDivElement;
|
|
32
|
+
render(node: react.ReactNode, container?: reactDomClient.Container): void;
|
|
33
|
+
component: {
|
|
34
|
+
<P>(Component: react.FC<P>): typeof Component;
|
|
35
|
+
<P>(name: string, Component: react.FC<P>): typeof Component;
|
|
36
|
+
};
|
|
37
|
+
bus: {
|
|
38
|
+
/** Listen for an event. */
|
|
39
|
+
on(eventName: string, callback: Fn, thisValue?: unknown): void;
|
|
40
|
+
/** Remove event listener. */
|
|
41
|
+
off(eventName: string, callback?: Fn): void;
|
|
42
|
+
/** Listen for an event once. */
|
|
43
|
+
once(eventName: string, callback: Fn, thisValue?: unknown): void;
|
|
44
|
+
/** Send an event to all remote listeners (local listeners are ignored). */
|
|
45
|
+
send<T = unknown>(eventName: string, ...args: unknown[]): Promise<T>;
|
|
46
|
+
/** Emit event locally (calls local listeners only). */
|
|
47
|
+
emit<T = unknown>(eventName: string, ...args: unknown[]): Promise<T>;
|
|
48
|
+
};
|
|
49
|
+
state: {
|
|
50
|
+
/** Connect state. */
|
|
51
|
+
connect: {
|
|
52
|
+
<T extends Obj | Model>(initial?: Initial<T>, versioner?: Versioner): Promise<T>;
|
|
53
|
+
<T extends Obj | Model>(name?: string, initial?: Initial<T>, versioner?: Versioner): Promise<T>;
|
|
54
|
+
};
|
|
55
|
+
/** Disconnect state. */
|
|
56
|
+
disconnect(name?: string): void;
|
|
57
|
+
/** Run any state changes in a batch. */
|
|
58
|
+
transaction: (fn: () => void) => void;
|
|
59
|
+
/** Create local state (no sync). */
|
|
60
|
+
local<T extends Obj = {}>(state?: T): T;
|
|
61
|
+
/** Get the list of all state names. */
|
|
62
|
+
list(filter?: {
|
|
63
|
+
connected?: boolean;
|
|
64
|
+
}): Promise<{
|
|
65
|
+
name: string | null;
|
|
66
|
+
}[]>;
|
|
67
|
+
/** Remove state and all its data. */
|
|
68
|
+
destroy(name?: string): Promise<void>;
|
|
69
|
+
/** Register models for all states. */
|
|
70
|
+
registerModels(models: Record<string, ModelClass>): void;
|
|
71
|
+
symbols: {
|
|
72
|
+
readonly parent: unique symbol;
|
|
73
|
+
readonly modelInit: unique symbol;
|
|
74
|
+
readonly modelCleanup: unique symbol;
|
|
75
|
+
readonly modelVersioner: unique symbol;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
storage: {
|
|
79
|
+
/** Get value from the storage. */
|
|
80
|
+
get<T = unknown>(key: string, storageName?: string): Promise<T>;
|
|
81
|
+
/** Set value in the storage. */
|
|
82
|
+
set<T = unknown>(key: string, value: T, storageName?: string): Promise<void>;
|
|
83
|
+
/** Delete value from the storage. */
|
|
84
|
+
delete(key: string, storageName?: string): Promise<void>;
|
|
85
|
+
/** Get all keys from the storage. */
|
|
86
|
+
keys(storageName?: string): Promise<string[]>;
|
|
87
|
+
/** Clear storage. Removes all keys and storage itself. */
|
|
88
|
+
clear(storageName?: string): Promise<void>;
|
|
89
|
+
/** Get storage API for a specific storage. */
|
|
90
|
+
use(storageName: string): Promise<Storage>;
|
|
91
|
+
/** Get this list of all storages. */
|
|
92
|
+
list(): Promise<{
|
|
93
|
+
name: string | null;
|
|
94
|
+
}[]>;
|
|
95
|
+
};
|
|
96
|
+
frame: {
|
|
97
|
+
/** Open frame in the background. */
|
|
98
|
+
open(name: string, url: string, attributes?: Record<string, unknown>): Promise<void>;
|
|
99
|
+
/** Close background frame by its name. */
|
|
100
|
+
close(name: string): Promise<void>;
|
|
101
|
+
/** Check if background frame with the given name exists. */
|
|
102
|
+
exists(name: string): Promise<boolean>;
|
|
103
|
+
/** Get list of all open background frames. */
|
|
104
|
+
list(): Promise<{
|
|
105
|
+
name: string;
|
|
106
|
+
url: string;
|
|
107
|
+
}[]>;
|
|
108
|
+
};
|
|
109
|
+
static: {
|
|
110
|
+
/** Get static file URL. The file must be loaded first via `epos.static.load`. */
|
|
111
|
+
url(path: string): string;
|
|
112
|
+
/** Load static file by path. */
|
|
113
|
+
load(path: string): Promise<Blob>;
|
|
114
|
+
/** Load all static files. */
|
|
115
|
+
loadAll(): Promise<Blob[]>;
|
|
116
|
+
/** Unload static file from memory. */
|
|
117
|
+
unload(path: string): void;
|
|
118
|
+
/** Unload all static files from memory. */
|
|
119
|
+
unloadAll(): void;
|
|
120
|
+
/** Get list of all available static files. */
|
|
121
|
+
list(filter?: {
|
|
122
|
+
loaded?: boolean;
|
|
123
|
+
}): {
|
|
124
|
+
path: string;
|
|
125
|
+
loaded: boolean;
|
|
126
|
+
}[];
|
|
127
|
+
};
|
|
128
|
+
env: {
|
|
129
|
+
tabId: number;
|
|
130
|
+
isWeb: boolean;
|
|
131
|
+
isPopup: boolean;
|
|
132
|
+
isSidePanel: boolean;
|
|
133
|
+
isBackground: boolean;
|
|
134
|
+
};
|
|
135
|
+
libs: {
|
|
136
|
+
mobx: typeof mobx;
|
|
137
|
+
mobxReactLite: typeof mobxReactLite;
|
|
138
|
+
react: typeof react;
|
|
139
|
+
reactDom: typeof reactDom;
|
|
140
|
+
reactDomClient: typeof reactDomClient;
|
|
141
|
+
reactJsxRuntime: typeof reactJsxRuntime;
|
|
142
|
+
yjs: typeof yjs;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
declare global {
|
|
146
|
+
var epos: Epos;
|
|
147
|
+
namespace React {
|
|
148
|
+
interface HTMLAttributes<T> {
|
|
149
|
+
class?: ClassName;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
declare const _epos: Epos;
|
|
154
|
+
var epos$1 = epos;
|
|
155
|
+
|
|
156
|
+
export { type ClassName, type Epos, type Fn, type Initial, type Model, type ModelClass, type Obj, type Storage, type Versioner, epos$1 as default, _epos as epos };
|
package/dist/epos.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const {
|
|
2
|
+
enableStaticRendering,
|
|
3
|
+
isUsingStaticRendering,
|
|
4
|
+
observer,
|
|
5
|
+
Observer,
|
|
6
|
+
observerBatching,
|
|
7
|
+
useAsObservableSource,
|
|
8
|
+
useLocalObservable,
|
|
9
|
+
useLocalStore,
|
|
10
|
+
useObserver,
|
|
11
|
+
useStaticRendering,
|
|
12
|
+
} = epos.libs.mobxReactLite;
|
|
13
|
+
|
|
14
|
+
export { Observer, enableStaticRendering, isUsingStaticRendering, observer, observerBatching, useAsObservableSource, useLocalObservable, useLocalStore, useObserver, useStaticRendering };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/libs/libs-mobx-react-lite.js
|
|
2
|
+
var {
|
|
3
|
+
enableStaticRendering,
|
|
4
|
+
isUsingStaticRendering,
|
|
5
|
+
observer,
|
|
6
|
+
Observer,
|
|
7
|
+
observerBatching,
|
|
8
|
+
useAsObservableSource,
|
|
9
|
+
useLocalObservable,
|
|
10
|
+
useLocalStore,
|
|
11
|
+
useObserver,
|
|
12
|
+
useStaticRendering
|
|
13
|
+
} = epos.libs.mobxReactLite;
|
|
14
|
+
export {
|
|
15
|
+
Observer,
|
|
16
|
+
enableStaticRendering,
|
|
17
|
+
isUsingStaticRendering,
|
|
18
|
+
observer,
|
|
19
|
+
observerBatching,
|
|
20
|
+
useAsObservableSource,
|
|
21
|
+
useLocalObservable,
|
|
22
|
+
useLocalStore,
|
|
23
|
+
useObserver,
|
|
24
|
+
useStaticRendering
|
|
25
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
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;
|
|
70
|
+
|
|
71
|
+
export { $mobx, FlowCancellationError, ObservableMap, ObservableSet, Reaction, _allowStateChanges, _allowStateChangesInsideComputed, _allowStateReadsEnd, _allowStateReadsStart, _autoAction, _endAction, _getAdministration, _getGlobalState, _interceptReads, _isComputingDerivation, _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, defineProperty, entries, extendObservable, flowResult, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isBoxedObservable, isComputed, isComputedProp, isFlow, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, makeAutoObservable, makeObservable, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, override, ownKeys, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// src/libs/libs-mobx.js
|
|
2
|
+
var {
|
|
3
|
+
_allowStateChanges,
|
|
4
|
+
_allowStateChangesInsideComputed,
|
|
5
|
+
_allowStateReadsEnd,
|
|
6
|
+
_allowStateReadsStart,
|
|
7
|
+
_autoAction,
|
|
8
|
+
_endAction,
|
|
9
|
+
_getAdministration,
|
|
10
|
+
_getGlobalState,
|
|
11
|
+
_interceptReads,
|
|
12
|
+
_isComputingDerivation,
|
|
13
|
+
_resetGlobalState,
|
|
14
|
+
_startAction,
|
|
15
|
+
$mobx,
|
|
16
|
+
action,
|
|
17
|
+
autorun,
|
|
18
|
+
comparer,
|
|
19
|
+
computed,
|
|
20
|
+
configure,
|
|
21
|
+
createAtom,
|
|
22
|
+
defineProperty,
|
|
23
|
+
entries,
|
|
24
|
+
extendObservable,
|
|
25
|
+
FlowCancellationError,
|
|
26
|
+
flowResult,
|
|
27
|
+
get,
|
|
28
|
+
getAtom,
|
|
29
|
+
getDebugName,
|
|
30
|
+
getDependencyTree,
|
|
31
|
+
getObserverTree,
|
|
32
|
+
has,
|
|
33
|
+
intercept,
|
|
34
|
+
isAction,
|
|
35
|
+
isBoxedObservable,
|
|
36
|
+
isComputed,
|
|
37
|
+
isComputedProp,
|
|
38
|
+
isFlow,
|
|
39
|
+
isFlowCancellationError,
|
|
40
|
+
isObservable,
|
|
41
|
+
isObservableArray,
|
|
42
|
+
isObservableMap,
|
|
43
|
+
isObservableObject,
|
|
44
|
+
isObservableProp,
|
|
45
|
+
isObservableSet,
|
|
46
|
+
keys,
|
|
47
|
+
makeAutoObservable,
|
|
48
|
+
makeObservable,
|
|
49
|
+
observable,
|
|
50
|
+
ObservableMap,
|
|
51
|
+
ObservableSet,
|
|
52
|
+
observe,
|
|
53
|
+
onBecomeObserved,
|
|
54
|
+
onBecomeUnobserved,
|
|
55
|
+
onReactionError,
|
|
56
|
+
override,
|
|
57
|
+
ownKeys,
|
|
58
|
+
reaction,
|
|
59
|
+
Reaction,
|
|
60
|
+
remove,
|
|
61
|
+
runInAction,
|
|
62
|
+
set,
|
|
63
|
+
spy,
|
|
64
|
+
toJS,
|
|
65
|
+
trace,
|
|
66
|
+
transaction,
|
|
67
|
+
untracked,
|
|
68
|
+
values,
|
|
69
|
+
when
|
|
70
|
+
} = epos.libs.mobx;
|
|
71
|
+
export {
|
|
72
|
+
$mobx,
|
|
73
|
+
FlowCancellationError,
|
|
74
|
+
ObservableMap,
|
|
75
|
+
ObservableSet,
|
|
76
|
+
Reaction,
|
|
77
|
+
_allowStateChanges,
|
|
78
|
+
_allowStateChangesInsideComputed,
|
|
79
|
+
_allowStateReadsEnd,
|
|
80
|
+
_allowStateReadsStart,
|
|
81
|
+
_autoAction,
|
|
82
|
+
_endAction,
|
|
83
|
+
_getAdministration,
|
|
84
|
+
_getGlobalState,
|
|
85
|
+
_interceptReads,
|
|
86
|
+
_isComputingDerivation,
|
|
87
|
+
_resetGlobalState,
|
|
88
|
+
_startAction,
|
|
89
|
+
action,
|
|
90
|
+
autorun,
|
|
91
|
+
comparer,
|
|
92
|
+
computed,
|
|
93
|
+
configure,
|
|
94
|
+
createAtom,
|
|
95
|
+
defineProperty,
|
|
96
|
+
entries,
|
|
97
|
+
extendObservable,
|
|
98
|
+
flowResult,
|
|
99
|
+
get,
|
|
100
|
+
getAtom,
|
|
101
|
+
getDebugName,
|
|
102
|
+
getDependencyTree,
|
|
103
|
+
getObserverTree,
|
|
104
|
+
has,
|
|
105
|
+
intercept,
|
|
106
|
+
isAction,
|
|
107
|
+
isBoxedObservable,
|
|
108
|
+
isComputed,
|
|
109
|
+
isComputedProp,
|
|
110
|
+
isFlow,
|
|
111
|
+
isFlowCancellationError,
|
|
112
|
+
isObservable,
|
|
113
|
+
isObservableArray,
|
|
114
|
+
isObservableMap,
|
|
115
|
+
isObservableObject,
|
|
116
|
+
isObservableProp,
|
|
117
|
+
isObservableSet,
|
|
118
|
+
keys,
|
|
119
|
+
makeAutoObservable,
|
|
120
|
+
makeObservable,
|
|
121
|
+
observable,
|
|
122
|
+
observe,
|
|
123
|
+
onBecomeObserved,
|
|
124
|
+
onBecomeUnobserved,
|
|
125
|
+
onReactionError,
|
|
126
|
+
override,
|
|
127
|
+
ownKeys,
|
|
128
|
+
reaction,
|
|
129
|
+
remove,
|
|
130
|
+
runInAction,
|
|
131
|
+
set,
|
|
132
|
+
spy,
|
|
133
|
+
toJS,
|
|
134
|
+
trace,
|
|
135
|
+
transaction,
|
|
136
|
+
untracked,
|
|
137
|
+
values,
|
|
138
|
+
when
|
|
139
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var libsReactDom = epos.libs.reactDom;
|
|
2
|
+
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;
|
|
17
|
+
|
|
18
|
+
export { createPortal, libsReactDom as default, flushSync, preconnect, prefetchDNS, preinit, preinitModule, preload, preloadModule, requestFormReset, unstable_batchedUpdates, useFormState, useFormStatus, version };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/libs/libs-react-dom.js
|
|
2
|
+
var libs_react_dom_default = epos.libs.reactDom;
|
|
3
|
+
var {
|
|
4
|
+
createPortal,
|
|
5
|
+
flushSync,
|
|
6
|
+
preconnect,
|
|
7
|
+
prefetchDNS,
|
|
8
|
+
preinit,
|
|
9
|
+
preinitModule,
|
|
10
|
+
preload,
|
|
11
|
+
preloadModule,
|
|
12
|
+
requestFormReset,
|
|
13
|
+
unstable_batchedUpdates,
|
|
14
|
+
useFormState,
|
|
15
|
+
useFormStatus,
|
|
16
|
+
version
|
|
17
|
+
} = epos.libs.reactDom;
|
|
18
|
+
export {
|
|
19
|
+
createPortal,
|
|
20
|
+
libs_react_dom_default as default,
|
|
21
|
+
flushSync,
|
|
22
|
+
preconnect,
|
|
23
|
+
prefetchDNS,
|
|
24
|
+
preinit,
|
|
25
|
+
preinitModule,
|
|
26
|
+
preload,
|
|
27
|
+
preloadModule,
|
|
28
|
+
requestFormReset,
|
|
29
|
+
unstable_batchedUpdates,
|
|
30
|
+
useFormState,
|
|
31
|
+
useFormStatus,
|
|
32
|
+
version
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var libsReact = epos.libs.react;
|
|
2
|
+
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;
|
|
41
|
+
|
|
42
|
+
export { Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, act, cache, cloneElement, createContext, createElement, createRef, libsReact as default, forwardRef, isValidElement, lazy, memo, startTransition, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, version };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// src/libs/libs-react.js
|
|
2
|
+
var libs_react_default = epos.libs.react;
|
|
3
|
+
var {
|
|
4
|
+
act,
|
|
5
|
+
cache,
|
|
6
|
+
Children,
|
|
7
|
+
cloneElement,
|
|
8
|
+
Component,
|
|
9
|
+
createContext,
|
|
10
|
+
createElement,
|
|
11
|
+
createRef,
|
|
12
|
+
forwardRef,
|
|
13
|
+
Fragment,
|
|
14
|
+
isValidElement,
|
|
15
|
+
lazy,
|
|
16
|
+
memo,
|
|
17
|
+
Profiler,
|
|
18
|
+
PureComponent,
|
|
19
|
+
startTransition,
|
|
20
|
+
StrictMode,
|
|
21
|
+
Suspense,
|
|
22
|
+
use,
|
|
23
|
+
useActionState,
|
|
24
|
+
useCallback,
|
|
25
|
+
useContext,
|
|
26
|
+
useDebugValue,
|
|
27
|
+
useDeferredValue,
|
|
28
|
+
useEffect,
|
|
29
|
+
useId,
|
|
30
|
+
useImperativeHandle,
|
|
31
|
+
useInsertionEffect,
|
|
32
|
+
useLayoutEffect,
|
|
33
|
+
useMemo,
|
|
34
|
+
useOptimistic,
|
|
35
|
+
useReducer,
|
|
36
|
+
useRef,
|
|
37
|
+
useState,
|
|
38
|
+
useSyncExternalStore,
|
|
39
|
+
useTransition,
|
|
40
|
+
version
|
|
41
|
+
} = epos.libs.react;
|
|
42
|
+
export {
|
|
43
|
+
Children,
|
|
44
|
+
Component,
|
|
45
|
+
Fragment,
|
|
46
|
+
Profiler,
|
|
47
|
+
PureComponent,
|
|
48
|
+
StrictMode,
|
|
49
|
+
Suspense,
|
|
50
|
+
act,
|
|
51
|
+
cache,
|
|
52
|
+
cloneElement,
|
|
53
|
+
createContext,
|
|
54
|
+
createElement,
|
|
55
|
+
createRef,
|
|
56
|
+
libs_react_default as default,
|
|
57
|
+
forwardRef,
|
|
58
|
+
isValidElement,
|
|
59
|
+
lazy,
|
|
60
|
+
memo,
|
|
61
|
+
startTransition,
|
|
62
|
+
use,
|
|
63
|
+
useActionState,
|
|
64
|
+
useCallback,
|
|
65
|
+
useContext,
|
|
66
|
+
useDebugValue,
|
|
67
|
+
useDeferredValue,
|
|
68
|
+
useEffect,
|
|
69
|
+
useId,
|
|
70
|
+
useImperativeHandle,
|
|
71
|
+
useInsertionEffect,
|
|
72
|
+
useLayoutEffect,
|
|
73
|
+
useMemo,
|
|
74
|
+
useOptimistic,
|
|
75
|
+
useReducer,
|
|
76
|
+
useRef,
|
|
77
|
+
useState,
|
|
78
|
+
useSyncExternalStore,
|
|
79
|
+
useTransition,
|
|
80
|
+
version
|
|
81
|
+
};
|
package/dist/vite.d.ts
ADDED
package/dist/vite.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/vite.ts
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
var libs = {
|
|
4
|
+
"react": resolve(import.meta.dirname, "./libs/libs-react.js"),
|
|
5
|
+
"react/jsx-runtime": resolve(import.meta.dirname, "./libs/libs-react-jsx-runtime.js"),
|
|
6
|
+
"react-dom": resolve(import.meta.dirname, "./libs/libs-react-dom.js"),
|
|
7
|
+
"react-dom/client": resolve(import.meta.dirname, "./libs/libs-react-dom-client.js"),
|
|
8
|
+
"mobx": resolve(import.meta.dirname, "./libs/libs-mobx.js"),
|
|
9
|
+
"mobx-react-lite": resolve(import.meta.dirname, "./libs/libs-mobx-react-lite.js")
|
|
10
|
+
};
|
|
11
|
+
function epos() {
|
|
12
|
+
return {
|
|
13
|
+
name: "epos",
|
|
14
|
+
enforce: "pre",
|
|
15
|
+
resolveId: (source) => libs[source] ?? null
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
var vite_default = epos;
|
|
19
|
+
export {
|
|
20
|
+
vite_default as default,
|
|
21
|
+
epos
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,29 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "epos",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "imkost",
|
|
7
7
|
"description": "",
|
|
8
8
|
"keywords": [],
|
|
9
9
|
"scripts": {
|
|
10
|
+
"dev": "tsup --config ../tsup.config.ts --watch",
|
|
11
|
+
"build": "tsup --config ../tsup.config.ts",
|
|
10
12
|
"lint": "tsc --noEmit",
|
|
11
|
-
"release": "sh -c 'npm version ${1:-minor} && npm publish' --"
|
|
13
|
+
"release": "sh -c 'npm version ${1:-minor} && npm run build && npm publish' --"
|
|
12
14
|
},
|
|
13
15
|
"exports": {
|
|
14
|
-
".":
|
|
15
|
-
|
|
16
|
+
".": {
|
|
17
|
+
"source": "./src/epos.ts",
|
|
18
|
+
"import": "./dist/epos.js",
|
|
19
|
+
"types": "./dist/epos.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./vite": {
|
|
22
|
+
"source": "./src/vite.ts",
|
|
23
|
+
"import": "./dist/vite.js",
|
|
24
|
+
"types": "./dist/vite.d.ts"
|
|
25
|
+
}
|
|
16
26
|
},
|
|
17
27
|
"files": [
|
|
18
|
-
"src"
|
|
28
|
+
"src",
|
|
29
|
+
"dist"
|
|
19
30
|
],
|
|
20
31
|
"dependencies": {
|
|
21
|
-
"@types/chrome": "^0.1.
|
|
22
|
-
"@types/react": "^19.
|
|
23
|
-
"@types/react-dom": "^19.
|
|
32
|
+
"@types/chrome": "^0.1.17",
|
|
33
|
+
"@types/react": "^19.2.0",
|
|
34
|
+
"@types/react-dom": "^19.2.0",
|
|
24
35
|
"mobx": "^6.15.0",
|
|
25
36
|
"mobx-react-lite": "^4.1.1",
|
|
26
|
-
"react": "^19.
|
|
37
|
+
"react": "^19.2.0",
|
|
27
38
|
"yjs": "^13.6.27"
|
|
28
39
|
},
|
|
29
40
|
"devDependencies": {
|
package/src/epos.ts
CHANGED
|
@@ -101,25 +101,27 @@ export interface Epos {
|
|
|
101
101
|
frame: {
|
|
102
102
|
/** Open frame in the background. */
|
|
103
103
|
open(name: string, url: string, attributes?: Record<string, unknown>): Promise<void>
|
|
104
|
-
/**
|
|
104
|
+
/** Close background frame by its name. */
|
|
105
105
|
close(name: string): Promise<void>
|
|
106
|
+
/** Check if background frame with the given name exists. */
|
|
107
|
+
exists(name: string): Promise<boolean>
|
|
106
108
|
/** Get list of all open background frames. */
|
|
107
109
|
list(): Promise<{ name: string; url: string }[]>
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
//
|
|
111
|
-
|
|
112
|
-
/** Get
|
|
112
|
+
// Static
|
|
113
|
+
static: {
|
|
114
|
+
/** Get static file URL. The file must be loaded first via `epos.static.load`. */
|
|
113
115
|
url(path: string): string
|
|
114
|
-
/** Load
|
|
116
|
+
/** Load static file by path. */
|
|
115
117
|
load(path: string): Promise<Blob>
|
|
116
|
-
/** Load all
|
|
118
|
+
/** Load all static files. */
|
|
117
119
|
loadAll(): Promise<Blob[]>
|
|
118
|
-
/** Unload
|
|
120
|
+
/** Unload static file from memory. */
|
|
119
121
|
unload(path: string): void
|
|
120
|
-
/** Unload all
|
|
122
|
+
/** Unload all static files from memory. */
|
|
121
123
|
unloadAll(): void
|
|
122
|
-
/** Get list of all available
|
|
124
|
+
/** Get list of all available static files. */
|
|
123
125
|
list(filter?: { loaded?: boolean }): { path: string; loaded: boolean }[]
|
|
124
126
|
}
|
|
125
127
|
|