adnbn 0.1.2 → 0.2.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 +28 -29
- package/dist/NativeLocale-BwVCqh2v.d.mts +25 -0
- package/dist/NativeLocale-C_gjXClM.d.ts +25 -0
- package/dist/cli/index.cjs +1184 -456
- package/dist/cli/index.cjs.map +1 -1
- package/dist/index.cjs +9 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -45
- package/dist/index.d.ts +2 -45
- package/dist/index.js +11 -29
- package/dist/index.js.map +1 -1
- package/dist/locale/index.cjs +39 -1
- package/dist/locale/index.cjs.map +1 -1
- package/dist/locale/index.d.mts +46 -3
- package/dist/locale/index.d.ts +46 -3
- package/dist/locale/index.js +36 -2
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/react/index.d.mts +2 -1
- package/dist/locale/react/index.d.ts +2 -1
- package/dist/{NativeLocale-lgR6wNj3.d.mts → locale-Do4kUmgC.d.mts} +1 -23
- package/dist/{NativeLocale-lgR6wNj3.d.ts → locale-Do4kUmgC.d.ts} +1 -23
- package/dist/offscreen/index.cjs +41 -43
- package/dist/offscreen/index.cjs.map +1 -1
- package/dist/offscreen/index.js +41 -43
- package/dist/offscreen/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,53 +9,52 @@
|
|
|
9
9
|
|
|
10
10
|
### Core Concept
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
- **Single code base**: maintain one set of source files for all extensions.
|
|
13
|
+
- **Flexibility**: supports both multi-package setups (multiple extensions in one repository) and standalone projects.
|
|
14
|
+
- **Modern workflow**: automatic merging of styles, scripts, content scripts, and background scripts.
|
|
15
15
|
|
|
16
16
|
### Supported Platforms & Manifests
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
- **Browsers**: Chrome, Firefox, Opera, Safari, Edge.
|
|
19
|
+
- **Manifest Versions**: Manifest V2 and V3.
|
|
20
20
|
|
|
21
21
|
### Entry Points
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
- **Background Page**
|
|
24
|
+
- **Content Scripts**
|
|
25
|
+
- **Commands**
|
|
26
|
+
- **Localization**
|
|
27
|
+
- **Icons**
|
|
28
|
+
- **Messages**
|
|
29
|
+
- **Services**
|
|
30
|
+
- **Relay**
|
|
31
|
+
- **Offscreen**
|
|
32
|
+
- **Popup**
|
|
33
|
+
- **Sidebar**
|
|
34
34
|
|
|
35
35
|
### Plugins
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
- **Extensibility via Plugins**: write modules for background pages, content scripts, and any supported entry points.
|
|
38
|
+
- **Automatic Integration**: plugins are automatically included in the build process and update the manifest.
|
|
39
39
|
|
|
40
40
|
### Services & Relay
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
- **Services**: class-based layer for background interactions without boilerplate. Service methods are available across all extension layers via simple calls.
|
|
43
|
+
- **Relay**: similar mechanism for content pages, bypassing CSP and getUserGesture restrictions by leveraging scripting contexts.
|
|
45
44
|
|
|
46
45
|
### Offscreen
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
- **Manifest V2**: offscreen support via `<iframe>` within the Background Page.
|
|
48
|
+
- **Manifest V3**: native Offscreen API.
|
|
50
49
|
|
|
51
50
|
### Benefits
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
- 🔌 **Plugin Architecture**: easily extend functionality and add features without modifying the core framework.
|
|
53
|
+
- 🔧 **Faster Development**: minimal configuration and boilerplate.
|
|
54
|
+
- 🌐 **Cross-Platform**: write code once; run everywhere regardless of browser or manifest version.
|
|
55
|
+
- 🔄 **Scalable**: seamlessly add new layers and entry points.
|
|
56
|
+
- 🚀 **Modern Design**: cutting-edge architecture following best practices for extension publishing.
|
|
58
57
|
|
|
59
58
|
---
|
|
60
59
|
|
|
61
|
-
>
|
|
60
|
+
> _This framework is under active development. Detailed documentation and usage examples will be available soon on the official website._
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { L as LocaleStructure, f as LocaleProvider, a as Language, c as LocaleNonPluralKeys, d as LocaleSubstitutionsFor, e as LocalePluralKeys } from './locale-Do4kUmgC.mjs';
|
|
2
|
+
|
|
3
|
+
declare abstract class export_default<S extends LocaleStructure> implements LocaleProvider<S> {
|
|
4
|
+
abstract lang(): Language;
|
|
5
|
+
abstract keys(): Set<keyof S>;
|
|
6
|
+
abstract languages(): Set<Language>;
|
|
7
|
+
protected abstract value(key: keyof S & string): string | undefined;
|
|
8
|
+
trans<K extends LocaleNonPluralKeys<S>>(key: K, substitutions?: LocaleSubstitutionsFor<S, K>): string;
|
|
9
|
+
choice<K extends LocalePluralKeys<S>>(key: K, count: number, substitutions?: LocaleSubstitutionsFor<S, K>): string;
|
|
10
|
+
get<K extends keyof S & string>(key: K, substitutions?: LocaleSubstitutionsFor<S, K>): string;
|
|
11
|
+
private getPluralIndex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface LocaleNativeStructure extends LocaleStructure {
|
|
15
|
+
}
|
|
16
|
+
declare class NativeLocale extends export_default<LocaleNativeStructure> {
|
|
17
|
+
private static instance?;
|
|
18
|
+
static getInstance<S extends LocaleStructure = LocaleNativeStructure>(): LocaleProvider<S>;
|
|
19
|
+
lang(): Language;
|
|
20
|
+
keys(): Set<keyof LocaleNativeStructure>;
|
|
21
|
+
languages(): Set<Language>;
|
|
22
|
+
protected value(key: Extract<keyof LocaleNativeStructure, string>): string | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { type LocaleNativeStructure as L, NativeLocale as N, export_default as e };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { L as LocaleStructure, f as LocaleProvider, a as Language, c as LocaleNonPluralKeys, d as LocaleSubstitutionsFor, e as LocalePluralKeys } from './locale-Do4kUmgC.js';
|
|
2
|
+
|
|
3
|
+
declare abstract class export_default<S extends LocaleStructure> implements LocaleProvider<S> {
|
|
4
|
+
abstract lang(): Language;
|
|
5
|
+
abstract keys(): Set<keyof S>;
|
|
6
|
+
abstract languages(): Set<Language>;
|
|
7
|
+
protected abstract value(key: keyof S & string): string | undefined;
|
|
8
|
+
trans<K extends LocaleNonPluralKeys<S>>(key: K, substitutions?: LocaleSubstitutionsFor<S, K>): string;
|
|
9
|
+
choice<K extends LocalePluralKeys<S>>(key: K, count: number, substitutions?: LocaleSubstitutionsFor<S, K>): string;
|
|
10
|
+
get<K extends keyof S & string>(key: K, substitutions?: LocaleSubstitutionsFor<S, K>): string;
|
|
11
|
+
private getPluralIndex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface LocaleNativeStructure extends LocaleStructure {
|
|
15
|
+
}
|
|
16
|
+
declare class NativeLocale extends export_default<LocaleNativeStructure> {
|
|
17
|
+
private static instance?;
|
|
18
|
+
static getInstance<S extends LocaleStructure = LocaleNativeStructure>(): LocaleProvider<S>;
|
|
19
|
+
lang(): Language;
|
|
20
|
+
keys(): Set<keyof LocaleNativeStructure>;
|
|
21
|
+
languages(): Set<Language>;
|
|
22
|
+
protected value(key: Extract<keyof LocaleNativeStructure, string>): string | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { type LocaleNativeStructure as L, NativeLocale as N, export_default as e };
|