@llmnative/react 0.1.1 → 1.0.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 +387 -364
- package/bin/cli.js +117 -98
- package/dist/index.css +1 -1
- package/dist/index.js +21 -823
- package/dist/index.mjs +14246 -9296
- package/dist/style.css +1 -0
- package/dist/types/src/App.d.ts +72 -14
- package/dist/types/src/Config.d.ts +28 -5
- package/dist/types/src/Global.d.ts +2 -2
- package/dist/types/src/I18n.d.ts +185 -0
- package/dist/types/src/Theme.d.ts +153 -81
- package/dist/types/src/auth.d.ts +13 -1
- package/dist/types/src/components/Component.d.ts +13 -27
- package/dist/types/src/components/ErrorBoundary.d.ts +30 -0
- package/dist/types/src/components/blocks/Brand.d.ts +4 -4
- package/dist/types/src/components/blocks/Breadcrumbs.d.ts +50 -4
- package/dist/types/src/components/blocks/Carousel.d.ts +5 -5
- package/dist/types/src/components/blocks/Dropdown.d.ts +26 -20
- package/dist/types/src/components/blocks/ListCard.d.ts +31 -0
- package/dist/types/src/components/blocks/Menu.d.ts +13 -16
- package/dist/types/src/components/blocks/Notifications.d.ts +8 -3
- package/dist/types/src/components/blocks/ProviderSwitcher.d.ts +63 -0
- package/dist/types/src/components/blocks/Search.d.ts +2 -2
- package/dist/types/src/components/blocks/SideNav.d.ts +45 -0
- package/dist/types/src/components/blocks/ThemeSwitcher.d.ts +24 -0
- package/dist/types/src/components/blocks/Toolbar.d.ts +19 -0
- package/dist/types/src/components/index.d.ts +27 -6
- package/dist/types/src/components/types.d.ts +10 -3
- package/dist/types/src/components/ui/Alert.d.ts +16 -4
- package/dist/types/src/components/ui/Badge.d.ts +6 -5
- package/dist/types/src/components/ui/Buttons.d.ts +13 -12
- package/dist/types/src/components/ui/Card.d.ts +8 -7
- package/dist/types/src/components/ui/Code.d.ts +1 -1
- package/dist/types/src/components/ui/Gallery.d.ts +13 -14
- package/dist/types/src/components/ui/GridSystem.d.ts +1 -1
- package/dist/types/src/components/ui/Icon.d.ts +3 -1
- package/dist/types/src/components/ui/Image.d.ts +1 -1
- package/dist/types/src/components/ui/ImageAvatar.d.ts +1 -1
- package/dist/types/src/components/ui/Loader.d.ts +1 -1
- package/dist/types/src/components/ui/LocaleSwitcher.d.ts +14 -0
- package/dist/types/src/components/ui/Modal.d.ts +42 -15
- package/dist/types/src/components/ui/Pagination.d.ts +14 -3
- package/dist/types/src/components/ui/Percentage.d.ts +5 -5
- package/dist/types/src/components/ui/Repeat.d.ts +15 -6
- package/dist/types/src/components/ui/Tab.d.ts +29 -2
- package/dist/types/src/components/ui/TabDynamic.d.ts +4 -3
- package/dist/types/src/components/ui/Table.d.ts +15 -14
- package/dist/types/src/components/ui/fields/CodeEditor.d.ts +43 -0
- package/dist/types/src/components/ui/fields/ContextMenu.d.ts +38 -0
- package/dist/types/src/components/ui/fields/Crop.d.ts +4 -2
- package/dist/types/src/components/ui/fields/ImageField.d.ts +31 -0
- package/dist/types/src/components/ui/fields/Input.d.ts +43 -14
- package/dist/types/src/components/ui/fields/Prompt.d.ts +2 -31
- package/dist/types/src/components/ui/fields/RichText.d.ts +86 -0
- package/dist/types/src/components/ui/fields/Select.d.ts +13 -10
- package/dist/types/src/components/ui/fields/Upload.d.ts +37 -2
- package/dist/types/src/components/ui/fields/UploadCSV.d.ts +2 -0
- package/dist/types/src/components/ui/useRecordSelection.d.ts +1 -2
- package/dist/types/src/components/widgets/Form.d.ts +80 -43
- package/dist/types/src/components/widgets/ImageEditor.d.ts +4 -5
- package/dist/types/src/components/widgets/MarkdownReader.d.ts +4 -4
- package/dist/types/src/components/widgets/Prompt.d.ts +71 -23
- package/dist/types/src/components/widgets/TabDynamic.d.ts +4 -3
- package/dist/types/src/components/widgets/form-controller.d.ts +42 -0
- package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/GridDB.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/GridTableView.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/types.d.ts +77 -27
- package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +4 -8
- package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +2 -2
- package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +1 -2
- package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +2 -2
- package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +4 -5
- package/dist/types/src/components/widgets/grid-core/utils.d.ts +11 -3
- package/dist/types/src/conf/Prompt.d.ts +1 -1
- package/dist/types/src/conf/i18n/ar.d.ts +2 -0
- package/dist/types/src/conf/i18n/de.d.ts +2 -0
- package/dist/types/src/conf/i18n/en.d.ts +2 -0
- package/dist/types/src/conf/i18n/index.d.ts +6 -0
- package/dist/types/src/conf/i18n/it.d.ts +2 -0
- package/dist/types/src/conf/i18n/ru.d.ts +2 -0
- package/dist/types/src/conf/i18n/zh.d.ts +2 -0
- package/dist/types/src/constant.d.ts +1 -1
- package/dist/types/src/index.d.ts +38 -13
- package/dist/types/src/libs/converter.d.ts +4 -4
- package/dist/types/src/libs/editorHeight.d.ts +12 -0
- package/dist/types/src/libs/fetch.d.ts +4 -4
- package/dist/types/src/libs/imageBuilder.d.ts +63 -14
- package/dist/types/src/libs/imageVariants.d.ts +35 -0
- package/dist/types/src/libs/index.d.ts +1 -4
- package/dist/types/src/libs/promptUtils.d.ts +24 -0
- package/dist/types/src/libs/sanitizer.d.ts +2 -2
- package/dist/types/src/libs/utils.d.ts +9 -10
- package/dist/types/src/pages/index.d.ts +0 -2
- package/dist/types/src/providers/ProviderConfiguration.d.ts +6 -0
- package/dist/types/src/providers/ProviderRegistryContext.d.ts +51 -0
- package/dist/types/src/providers/ProviderSession.d.ts +68 -0
- package/dist/types/src/providers/ai/AIProvider.d.ts +57 -0
- package/dist/types/src/providers/ai/AIProviderContext.d.ts +13 -0
- package/dist/types/src/providers/ai/anthropic.d.ts +2 -0
- package/dist/types/src/providers/ai/deepseek.d.ts +1 -0
- package/dist/types/src/providers/ai/gemini.d.ts +2 -0
- package/dist/types/src/providers/ai/glm.d.ts +1 -0
- package/dist/types/src/providers/ai/index.d.ts +9 -134
- package/dist/types/src/providers/ai/mistral.d.ts +1 -0
- package/dist/types/src/providers/ai/openai.d.ts +1 -0
- package/dist/types/src/providers/ai/openaiCompatible.d.ts +17 -0
- package/dist/types/src/providers/ai/opencode.d.ts +2 -0
- package/dist/types/src/providers/ai/openrouter.d.ts +1 -0
- package/dist/types/src/providers/ai/shared.d.ts +46 -0
- package/dist/types/src/providers/api/ApiProvider.d.ts +43 -0
- package/dist/types/src/providers/api/direct.d.ts +14 -0
- package/dist/types/src/providers/api/firebase.d.ts +14 -0
- package/dist/types/src/providers/api/mock.d.ts +7 -0
- package/dist/types/src/providers/api/supabase.d.ts +14 -0
- package/dist/types/src/providers/auth/AuthProvider.d.ts +2 -2
- package/dist/types/src/providers/auth/firebase/FirebaseAuthProvider.d.ts +26 -0
- package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +2 -2
- package/dist/types/src/providers/auth/supabase/SupabaseAuthProvider.d.ts +48 -0
- package/dist/types/src/providers/credentials/CredentialsProvider.d.ts +3 -0
- package/dist/types/src/providers/credentials/CredentialsProviderContext.d.ts +12 -0
- package/dist/types/src/providers/credentials/google/GoogleServiceAccountProvider.d.ts +8 -0
- package/dist/types/src/providers/data/DataProvider.d.ts +27 -1
- package/dist/types/src/providers/data/firebase.d.ts +5 -4
- package/dist/types/src/providers/data/firestore.d.ts +38 -0
- package/dist/types/src/providers/data/mock.d.ts +8 -1
- package/dist/types/src/providers/data/supabase.d.ts +36 -10
- package/dist/types/src/providers/firebase-init.d.ts +15 -4
- package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +1 -1
- package/dist/types/src/providers/manifest.d.ts +20 -14
- package/dist/types/src/providers/proxy/index.d.ts +7 -0
- package/dist/types/src/providers/proxy/vite.d.ts +3 -0
- package/dist/types/src/providers/scrape/index.d.ts +2 -1
- package/dist/types/src/providers/seo/google/keyword.d.ts +6 -1
- package/dist/types/src/providers/storage/StorageProvider.d.ts +155 -4
- package/dist/types/src/providers/storage/dropbox.d.ts +3 -3
- package/dist/types/src/providers/storage/firebase.d.ts +38 -7
- package/dist/types/src/providers/storage/supabase.d.ts +47 -7
- package/dist/types/src/providers/supabase-init.d.ts +35 -0
- package/dist/types/src/types/FormFields.d.ts +4 -2
- package/dist/types/src/types/FormSchema.d.ts +29 -0
- package/dist/types/themes/tokyo-night-light.d.ts +3 -0
- package/dist/types/themes/tokyo-night.d.ts +3 -0
- package/dist/types/themes/vscode-dark-plus.d.ts +3 -0
- package/dist/types/themes/vscode-light-plus.d.ts +3 -0
- package/dist/vite.js +1 -0
- package/dist/vite.mjs +54 -0
- package/package.json +40 -9
- package/scripts/cli/proxy-templates/cloudflare.ts +34 -0
- package/scripts/cli/proxy-templates/express.ts +77 -0
- package/scripts/cli/proxy-templates/nextjs-app.ts +42 -0
- package/scripts/cli/proxy-templates/nextjs-pages.ts +41 -0
- package/scripts/cli/proxy-templates/scaffold.json +33 -0
- package/scripts/cli/setup-devtools.js +155 -85
- package/scripts/cli/setup-project.js +618 -484
- package/themes/cyber.ts +469 -405
- package/themes/default.ts +469 -405
- package/themes/flat.ts +469 -405
- package/themes/tokyo-night-light.ts +38 -0
- package/themes/tokyo-night.ts +38 -0
- package/themes/vscode-dark-plus.ts +29 -0
- package/themes/vscode-light-plus.ts +29 -0
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/types/src/components/FormEnhancer.d.ts +0 -26
- package/dist/types/src/components/Template.d.ts +0 -18
- package/dist/types/src/components/ui/fields/AssistantAI.d.ts +0 -23
- package/dist/types/src/components/ui/fields/Command.d.ts +0 -15
- package/dist/types/src/components/ui/fields/ImageUrl.d.ts +0 -7
- package/dist/types/src/libs/cache.d.ts +0 -9
- package/dist/types/src/libs/database.d.ts +0 -3
- package/dist/types/src/libs/log.d.ts +0 -2
- package/dist/types/src/libs/seo.d.ts +0 -8
- package/dist/types/src/libs/storage.d.ts +0 -2
- package/dist/types/src/pages/Blog.d.ts +0 -3
- package/dist/types/src/pages/BlogPost.d.ts +0 -16
- package/dist/types/src/pages/Helper.d.ts +0 -8
- package/dist/types/src/providers/auth/google/apis/auth.d.ts +0 -4
- package/dist/types/src/types/Block.d.ts +0 -4
- package/dist/types/src/types/Section.d.ts +0 -4
package/bin/cli.js
CHANGED
|
@@ -1,99 +1,118 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
const SCRIPT_PATH = '../scripts/cli';
|
|
6
|
-
const [,, cmd] = process.argv;
|
|
7
|
-
const args = process.argv.slice(3);
|
|
8
|
-
|
|
9
|
-
function printGeneralHelp() {
|
|
10
|
-
console.log(`
|
|
11
|
-
LLM Native CLI
|
|
12
|
-
|
|
13
|
-
Available commands:
|
|
14
|
-
|
|
15
|
-
create - Generates a Vite + React project scaffold
|
|
16
|
-
devtools - Generates Vite, TypeScript, and PostCSS config only
|
|
17
|
-
version - Prints the installed @llmnative/react version
|
|
18
|
-
help - Displays this help message
|
|
19
|
-
|
|
20
|
-
Examples:
|
|
21
|
-
npx @llmnative/react create
|
|
22
|
-
npx @llmnative/react create --yes --provider=mock
|
|
23
|
-
npx @llmnative/react create --
|
|
24
|
-
npx @llmnative/react
|
|
25
|
-
npx @llmnative/react
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
provider
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
--
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
--firebase
|
|
53
|
-
--
|
|
54
|
-
--
|
|
55
|
-
--
|
|
56
|
-
--
|
|
57
|
-
--
|
|
58
|
-
--firebase-
|
|
59
|
-
--firebase-
|
|
60
|
-
--
|
|
61
|
-
--
|
|
62
|
-
--
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
case '
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const SCRIPT_PATH = '../scripts/cli';
|
|
6
|
+
const [,, cmd] = process.argv;
|
|
7
|
+
const args = process.argv.slice(3);
|
|
8
|
+
|
|
9
|
+
function printGeneralHelp() {
|
|
10
|
+
console.log(`
|
|
11
|
+
LLM Native CLI
|
|
12
|
+
|
|
13
|
+
Available commands:
|
|
14
|
+
|
|
15
|
+
create - Generates a Vite + React project scaffold
|
|
16
|
+
devtools - Generates Vite, TypeScript, and PostCSS config only
|
|
17
|
+
version - Prints the installed @llmnative/react version
|
|
18
|
+
help - Displays this help message
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
npx @llmnative/react create
|
|
22
|
+
npx @llmnative/react create --yes --provider=mock
|
|
23
|
+
npx @llmnative/react create --yes --provider=mock --ai-provider=openai
|
|
24
|
+
npx @llmnative/react create --yes --provider=mock --proxy-provider=viteDevProxy
|
|
25
|
+
npx @llmnative/react create --help
|
|
26
|
+
npx @llmnative/react devtools
|
|
27
|
+
npx @llmnative/react version
|
|
28
|
+
`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function printCreateHelp() {
|
|
32
|
+
console.log(`
|
|
33
|
+
LLM Native create
|
|
34
|
+
|
|
35
|
+
Usage:
|
|
36
|
+
npx llmnative create
|
|
37
|
+
npx llmnative create --yes --name=my-app --provider=mock
|
|
38
|
+
|
|
39
|
+
Interactive prompts:
|
|
40
|
+
project name
|
|
41
|
+
data provider: firebase | supabase | mock | custom
|
|
42
|
+
ai provider: none | openai | gemini | anthropic | mistral
|
|
43
|
+
proxy provider: none | vite | express | nextjs-app | nextjs-pages | cloudflare
|
|
44
|
+
icon provider: lucide | phosphor
|
|
45
|
+
theme: default | flat | cyber
|
|
46
|
+
provider credentials for Firebase, Supabase or the selected AI provider
|
|
47
|
+
|
|
48
|
+
Options:
|
|
49
|
+
--yes
|
|
50
|
+
--reset
|
|
51
|
+
--name=<name>
|
|
52
|
+
--provider=<firebase|supabase|mock|custom>
|
|
53
|
+
--ai-provider=<none|openai|gemini|anthropic|mistral>
|
|
54
|
+
--proxy-provider=<none|vite|express|nextjs-app|nextjs-pages|cloudflare>
|
|
55
|
+
--icon-provider=<lucide|phosphor>
|
|
56
|
+
--theme=<default|flat|cyber>
|
|
57
|
+
--hosting=<site|n>
|
|
58
|
+
--firebase-api-key=<value>
|
|
59
|
+
--firebase-auth-domain=<value>
|
|
60
|
+
--firebase-database-url=<value>
|
|
61
|
+
--firebase-project-id=<value>
|
|
62
|
+
--firebase-storage-bucket=<value>
|
|
63
|
+
--firebase-messaging-sender-id=<value>
|
|
64
|
+
--firebase-app-id=<value>
|
|
65
|
+
--firebase-measurement-id=<value>
|
|
66
|
+
--google-client-id=<value>
|
|
67
|
+
--supabase-url=<value>
|
|
68
|
+
--supabase-anon-key=<value>
|
|
69
|
+
--openai-api-key=<value>
|
|
70
|
+
--openrouter-api-key=<value>
|
|
71
|
+
--opencode-api-key=<value>
|
|
72
|
+
--gemini-api-key=<value>
|
|
73
|
+
--anthropic-api-key=<value>
|
|
74
|
+
--deepseek-api-key=<value>
|
|
75
|
+
--mistral-api-key=<value>
|
|
76
|
+
|
|
77
|
+
Generated files:
|
|
78
|
+
.env (filled with values from prompts/flags)
|
|
79
|
+
.env.example (same structure, all values empty — commit this)
|
|
80
|
+
|
|
81
|
+
Generated env variables:
|
|
82
|
+
VITE_PROVIDER, VITE_AI_PROVIDER, VITE_ICON_PROVIDER, VITE_THEME
|
|
83
|
+
VITE_PROXY_PROVIDER, VITE_PROXY_ENABLED (route is fixed: /api/proxy)
|
|
84
|
+
VITE_FIREBASE_* (apikey, authDomain, databaseURL, projectId, storageBucket, messagingSenderId, appId, measurementId)
|
|
85
|
+
VITE_GOOGLE_CLIENT_ID, VITE_GOOGLE_SCOPE
|
|
86
|
+
VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY
|
|
87
|
+
VITE_DROPBOX_CLIENT_ID, VITE_DROPBOX_ROOT_PATH
|
|
88
|
+
VITE_OPENAI_API_KEY, VITE_OPENROUTER_API_KEY, VITE_OPENCODE_API_KEY
|
|
89
|
+
VITE_GEMINI_API_KEY, VITE_ANTHROPIC_API_KEY, VITE_DEEPSEEK_API_KEY, VITE_MISTRAL_API_KEY
|
|
90
|
+
VITE_OPENAI_COMPATIBLE_BASE_URL, VITE_OPENAI_COMPATIBLE_API_KEY
|
|
91
|
+
`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
switch (cmd) {
|
|
95
|
+
case 'create':
|
|
96
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
97
|
+
printCreateHelp();
|
|
98
|
+
} else {
|
|
99
|
+
require(`${SCRIPT_PATH}/setup-project`).scaffoldProject();
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
|
|
103
|
+
case 'devtools':
|
|
104
|
+
require(`${SCRIPT_PATH}/setup-devtools`).setupDevTools();
|
|
105
|
+
break;
|
|
106
|
+
|
|
107
|
+
case 'version':
|
|
108
|
+
case '--version':
|
|
109
|
+
case '-v':
|
|
110
|
+
const pkg = require(path.join(__dirname, '../package.json'));
|
|
111
|
+
console.log(`@llmnative/react version: ${pkg.version}`);
|
|
112
|
+
break;
|
|
113
|
+
|
|
114
|
+
case 'help':
|
|
115
|
+
default:
|
|
116
|
+
printGeneralHelp();
|
|
117
|
+
break;
|
|
118
|
+
}
|