tera-system-ui 0.0.12 → 0.0.13
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/components/brand-logo/BrandLogo.svelte +31 -31
- package/dist/components/button/Button.svelte +49 -49
- package/dist/components/combobox/Combobox.svelte +8 -8
- package/dist/components/command/command.scss +72 -72
- package/dist/components/command/components/Command.svelte +120 -120
- package/dist/components/command/components/CommandEmpty.svelte +30 -30
- package/dist/components/command/components/CommandGroup.svelte +110 -110
- package/dist/components/command/components/CommandInput.svelte +92 -92
- package/dist/components/command/components/CommandItem.svelte +110 -110
- package/dist/components/command/components/CommandList.svelte +56 -56
- package/dist/components/command/components/CommandLoading.svelte +28 -28
- package/dist/components/command/components/CommandSeparator.svelte +21 -21
- package/dist/components/dialog/Dialog.js +4 -4
- package/dist/components/dialog/Dialog.svelte +106 -106
- package/dist/components/dialog/dialog.scss +85 -81
- package/dist/components/header/Header.svelte +36 -36
- package/dist/components/header/header.scss +19 -19
- package/dist/components/icons/IconArrowBigRightFilled.svelte +10 -10
- package/dist/components/icons/IconBook.svelte +10 -10
- package/dist/components/icons/IconBookmarkPlus.svelte +10 -10
- package/dist/components/icons/IconCalculator.svelte +10 -10
- package/dist/components/icons/IconCheck.svelte +10 -10
- package/dist/components/icons/IconChevronDown.svelte +10 -10
- package/dist/components/icons/IconCopy.svelte +10 -10
- package/dist/components/icons/IconCopyCheckFilled.svelte +10 -10
- package/dist/components/icons/IconHamburger.svelte +10 -10
- package/dist/components/icons/IconLanguage.svelte +10 -10
- package/dist/components/icons/IconLoader2.svelte +10 -10
- package/dist/components/icons/IconMoon.svelte +10 -10
- package/dist/components/icons/IconPointFilled.svelte +10 -10
- package/dist/components/icons/IconSearch.svelte +10 -10
- package/dist/components/icons/IconSun.svelte +10 -10
- package/dist/components/icons/IconSwitchHorizontal.svelte +10 -10
- package/dist/components/icons/IconSwitchVertical.svelte +10 -10
- package/dist/components/icons/IconTransform.svelte +10 -10
- package/dist/components/icons/IconX.svelte +10 -10
- package/dist/components/input/Input.svelte +24 -24
- package/dist/components/language-picker-button/LanguagePickerButton.svelte +109 -109
- package/dist/components/light-dark-toggle/LightDarkToggle.svelte +36 -36
- package/dist/components/popover/Popover.svelte +136 -136
- package/dist/components/popover-responsive/PopoverResponsive.svelte +87 -87
- package/dist/components/side-navigation/SideNavigation.svelte +113 -113
- package/dist/components/side-navigation/SideNavigationItem.svelte +17 -17
- package/dist/components/side-navigation/SideNavigationLayout.svelte +19 -19
- package/dist/components/side-navigation/sidenav.scss +149 -149
- package/dist/components/tera-ui-context/TeraUiContext.svelte +28 -28
- package/dist/themes/scrollbar.scss +37 -37
- package/package.json +1 -1
- package/scripts/add-component-template.js +120 -120
- package/scripts/generate-ts-index.js +136 -136
- package/dist/paraglide/.prettierignore +0 -3
- package/dist/paraglide/messages/de.d.ts +0 -1
- package/dist/paraglide/messages/de.js +0 -18
- package/dist/paraglide/messages/en.d.ts +0 -1
- package/dist/paraglide/messages/en.js +0 -18
- package/dist/paraglide/messages/es.d.ts +0 -1
- package/dist/paraglide/messages/es.js +0 -18
- package/dist/paraglide/messages/fr.d.ts +0 -1
- package/dist/paraglide/messages/fr.js +0 -18
- package/dist/paraglide/messages/it.d.ts +0 -1
- package/dist/paraglide/messages/it.js +0 -18
- package/dist/paraglide/messages/pt.d.ts +0 -1
- package/dist/paraglide/messages/pt.js +0 -18
- package/dist/paraglide/messages/ru.d.ts +0 -1
- package/dist/paraglide/messages/ru.js +0 -18
- package/dist/paraglide/messages/vi.d.ts +0 -1
- package/dist/paraglide/messages/vi.js +0 -18
- package/dist/paraglide/messages.d.ts +0 -3
- package/dist/paraglide/messages.js +0 -38
- package/dist/paraglide/runtime.d.ts +0 -52
- package/dist/paraglide/runtime.js +0 -141
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
|
|
3
|
-
import path from "path";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Recursively finds all "index.ts" files in the given folder path.
|
|
8
|
-
* @param {string} folderPath - The root directory to start the search.
|
|
9
|
-
* @returns {Array} - List of objects containing `filePath` and `content` of each "index.ts" file.
|
|
10
|
-
*/
|
|
11
|
-
function findIndexFiles(folderPath) {
|
|
12
|
-
const result = [];
|
|
13
|
-
|
|
14
|
-
function searchFolder(currentPath) {
|
|
15
|
-
const filesAndDirs = fs.readdirSync(currentPath);
|
|
16
|
-
|
|
17
|
-
for (const item of filesAndDirs) {
|
|
18
|
-
const itemPath = path.join(currentPath, item);
|
|
19
|
-
const stats = fs.statSync(itemPath);
|
|
20
|
-
|
|
21
|
-
if (stats.isDirectory()) {
|
|
22
|
-
// Recursively search in subdirectories
|
|
23
|
-
searchFolder(itemPath);
|
|
24
|
-
} else if (item === "index.ts") {
|
|
25
|
-
// Read file content if the file is "index.ts"
|
|
26
|
-
const content = fs.readFileSync(itemPath, "utf-8");
|
|
27
|
-
result.push({filePath: itemPath, content});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
searchFolder(folderPath);
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Extracts export names from a given JavaScript file content.
|
|
39
|
-
* @param {string} filePath - The path to the JavaScript file.
|
|
40
|
-
* @returns {Array} - An array of export names.
|
|
41
|
-
*/
|
|
42
|
-
function extractExportNames(filePath) {
|
|
43
|
-
const fileContent = fs.readFileSync(filePath, "utf-8");
|
|
44
|
-
const exportNames = [];
|
|
45
|
-
|
|
46
|
-
// Regular expressions to match the export names
|
|
47
|
-
const defaultExportRegex = /export\s*{\s*default\s+as\s+(\w+)/g;
|
|
48
|
-
const namedExportRegex = /export\s*{(\w+)\s*}/g;
|
|
49
|
-
|
|
50
|
-
let match;
|
|
51
|
-
|
|
52
|
-
// Find all matches for `export { default as ... }`
|
|
53
|
-
while ((match = defaultExportRegex.exec(fileContent)) !== null) {
|
|
54
|
-
exportNames.push(match[1]);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Find all matches for `export { namedExport }`
|
|
58
|
-
while ((match = namedExportRegex.exec(fileContent)) !== null) {
|
|
59
|
-
exportNames.push(match[1]);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return exportNames;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Recursively finds all files in a given folder path that match the name pattern.
|
|
68
|
-
* @param {string} folderPath - The root directory to start the search.
|
|
69
|
-
* @param {RegExp} namePattern - The regular expression pattern to match file names.
|
|
70
|
-
* @returns {Array} - List of file names that match the pattern.
|
|
71
|
-
*/
|
|
72
|
-
function findFilesByPattern(folderPath, namePattern) {
|
|
73
|
-
const result = [];
|
|
74
|
-
|
|
75
|
-
function searchFolder(currentPath) {
|
|
76
|
-
const filesAndDirs = fs.readdirSync(currentPath);
|
|
77
|
-
|
|
78
|
-
for (const item of filesAndDirs) {
|
|
79
|
-
const itemPath = path.join(currentPath, item);
|
|
80
|
-
const stats = fs.statSync(itemPath);
|
|
81
|
-
|
|
82
|
-
if (stats.isDirectory()) {
|
|
83
|
-
// Recursively search in subdirectories
|
|
84
|
-
searchFolder(itemPath);
|
|
85
|
-
} else if (namePattern.test(item)) {
|
|
86
|
-
// If the file name matches the pattern, add to result
|
|
87
|
-
result.push(item);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
searchFolder(folderPath);
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const GLOBAL_INDEX_PATH = "../src/lib/index.ts"
|
|
97
|
-
const COMPONENTS_PATH = "../src/lib/components"
|
|
98
|
-
const ICON_COMPONENTS_PATH = "../src/lib/components/icons"
|
|
99
|
-
|
|
100
|
-
const iconComponentsFileList = findFilesByPattern(ICON_COMPONENTS_PATH, /^Icon\w*\.svelte$/);
|
|
101
|
-
|
|
102
|
-
// generate icon index
|
|
103
|
-
const importSvelteComponentTemplate = `export {default as Component} from './Component.svelte'`;
|
|
104
|
-
const importComponentTemplate = `export {Component} from 'path'`;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
(() => {
|
|
108
|
-
let content = ''
|
|
109
|
-
iconComponentsFileList.forEach(file => {
|
|
110
|
-
let componentName = file.replace('.svelte', '')
|
|
111
|
-
content += importSvelteComponentTemplate.replaceAll('Component', componentName);
|
|
112
|
-
content += `\n`
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
fs.writeFileSync(ICON_COMPONENTS_PATH + '/index.ts', content, 'utf8');
|
|
116
|
-
})();
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
(() => {
|
|
120
|
-
const indexFileList = findIndexFiles(COMPONENTS_PATH);
|
|
121
|
-
let content = ''
|
|
122
|
-
|
|
123
|
-
indexFileList.forEach(file => {
|
|
124
|
-
let components = extractExportNames(file.filePath)
|
|
125
|
-
if (components.length === 0) return
|
|
126
|
-
|
|
127
|
-
let importFromPath = './components/' + file.filePath.split(`\\components\\`)[1].replace('\\index.ts', '');
|
|
128
|
-
|
|
129
|
-
content += importComponentTemplate.replace('path', importFromPath)
|
|
130
|
-
.replace('Component', components.join(', '));
|
|
131
|
-
content += '\n';
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
console.log(content)
|
|
135
|
-
fs.writeFileSync(GLOBAL_INDEX_PATH, content, 'utf8');
|
|
136
|
-
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Recursively finds all "index.ts" files in the given folder path.
|
|
8
|
+
* @param {string} folderPath - The root directory to start the search.
|
|
9
|
+
* @returns {Array} - List of objects containing `filePath` and `content` of each "index.ts" file.
|
|
10
|
+
*/
|
|
11
|
+
function findIndexFiles(folderPath) {
|
|
12
|
+
const result = [];
|
|
13
|
+
|
|
14
|
+
function searchFolder(currentPath) {
|
|
15
|
+
const filesAndDirs = fs.readdirSync(currentPath);
|
|
16
|
+
|
|
17
|
+
for (const item of filesAndDirs) {
|
|
18
|
+
const itemPath = path.join(currentPath, item);
|
|
19
|
+
const stats = fs.statSync(itemPath);
|
|
20
|
+
|
|
21
|
+
if (stats.isDirectory()) {
|
|
22
|
+
// Recursively search in subdirectories
|
|
23
|
+
searchFolder(itemPath);
|
|
24
|
+
} else if (item === "index.ts") {
|
|
25
|
+
// Read file content if the file is "index.ts"
|
|
26
|
+
const content = fs.readFileSync(itemPath, "utf-8");
|
|
27
|
+
result.push({filePath: itemPath, content});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
searchFolder(folderPath);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Extracts export names from a given JavaScript file content.
|
|
39
|
+
* @param {string} filePath - The path to the JavaScript file.
|
|
40
|
+
* @returns {Array} - An array of export names.
|
|
41
|
+
*/
|
|
42
|
+
function extractExportNames(filePath) {
|
|
43
|
+
const fileContent = fs.readFileSync(filePath, "utf-8");
|
|
44
|
+
const exportNames = [];
|
|
45
|
+
|
|
46
|
+
// Regular expressions to match the export names
|
|
47
|
+
const defaultExportRegex = /export\s*{\s*default\s+as\s+(\w+)/g;
|
|
48
|
+
const namedExportRegex = /export\s*{(\w+)\s*}/g;
|
|
49
|
+
|
|
50
|
+
let match;
|
|
51
|
+
|
|
52
|
+
// Find all matches for `export { default as ... }`
|
|
53
|
+
while ((match = defaultExportRegex.exec(fileContent)) !== null) {
|
|
54
|
+
exportNames.push(match[1]);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Find all matches for `export { namedExport }`
|
|
58
|
+
while ((match = namedExportRegex.exec(fileContent)) !== null) {
|
|
59
|
+
exportNames.push(match[1]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return exportNames;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Recursively finds all files in a given folder path that match the name pattern.
|
|
68
|
+
* @param {string} folderPath - The root directory to start the search.
|
|
69
|
+
* @param {RegExp} namePattern - The regular expression pattern to match file names.
|
|
70
|
+
* @returns {Array} - List of file names that match the pattern.
|
|
71
|
+
*/
|
|
72
|
+
function findFilesByPattern(folderPath, namePattern) {
|
|
73
|
+
const result = [];
|
|
74
|
+
|
|
75
|
+
function searchFolder(currentPath) {
|
|
76
|
+
const filesAndDirs = fs.readdirSync(currentPath);
|
|
77
|
+
|
|
78
|
+
for (const item of filesAndDirs) {
|
|
79
|
+
const itemPath = path.join(currentPath, item);
|
|
80
|
+
const stats = fs.statSync(itemPath);
|
|
81
|
+
|
|
82
|
+
if (stats.isDirectory()) {
|
|
83
|
+
// Recursively search in subdirectories
|
|
84
|
+
searchFolder(itemPath);
|
|
85
|
+
} else if (namePattern.test(item)) {
|
|
86
|
+
// If the file name matches the pattern, add to result
|
|
87
|
+
result.push(item);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
searchFolder(folderPath);
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const GLOBAL_INDEX_PATH = "../src/lib/index.ts"
|
|
97
|
+
const COMPONENTS_PATH = "../src/lib/components"
|
|
98
|
+
const ICON_COMPONENTS_PATH = "../src/lib/components/icons"
|
|
99
|
+
|
|
100
|
+
const iconComponentsFileList = findFilesByPattern(ICON_COMPONENTS_PATH, /^Icon\w*\.svelte$/);
|
|
101
|
+
|
|
102
|
+
// generate icon index
|
|
103
|
+
const importSvelteComponentTemplate = `export {default as Component} from './Component.svelte'`;
|
|
104
|
+
const importComponentTemplate = `export {Component} from 'path'`;
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
(() => {
|
|
108
|
+
let content = ''
|
|
109
|
+
iconComponentsFileList.forEach(file => {
|
|
110
|
+
let componentName = file.replace('.svelte', '')
|
|
111
|
+
content += importSvelteComponentTemplate.replaceAll('Component', componentName);
|
|
112
|
+
content += `\n`
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
fs.writeFileSync(ICON_COMPONENTS_PATH + '/index.ts', content, 'utf8');
|
|
116
|
+
})();
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
(() => {
|
|
120
|
+
const indexFileList = findIndexFiles(COMPONENTS_PATH);
|
|
121
|
+
let content = ''
|
|
122
|
+
|
|
123
|
+
indexFileList.forEach(file => {
|
|
124
|
+
let components = extractExportNames(file.filePath)
|
|
125
|
+
if (components.length === 0) return
|
|
126
|
+
|
|
127
|
+
let importFromPath = './components/' + file.filePath.split(`\\components\\`)[1].replace('\\index.ts', '');
|
|
128
|
+
|
|
129
|
+
content += importComponentTemplate.replace('path', importFromPath)
|
|
130
|
+
.replace('Component', components.join(', '));
|
|
131
|
+
content += '\n';
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
console.log(content)
|
|
135
|
+
fs.writeFileSync(GLOBAL_INDEX_PATH, content, 'utf8');
|
|
136
|
+
|
|
137
137
|
})()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function text_select_language(): string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file contains language specific message functions for tree-shaking.
|
|
4
|
-
*
|
|
5
|
-
*! WARNING: Only import messages from this file if you want to manually
|
|
6
|
-
*! optimize your bundle. Else, import from the `messages.js` file.
|
|
7
|
-
*
|
|
8
|
-
* Your bundler will (in the future) automatically replace the index function
|
|
9
|
-
* with a language specific message function in the build step.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const text_select_language = () => `Sprache auswählen`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function text_select_language(): string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file contains language specific message functions for tree-shaking.
|
|
4
|
-
*
|
|
5
|
-
*! WARNING: Only import messages from this file if you want to manually
|
|
6
|
-
*! optimize your bundle. Else, import from the `messages.js` file.
|
|
7
|
-
*
|
|
8
|
-
* Your bundler will (in the future) automatically replace the index function
|
|
9
|
-
* with a language specific message function in the build step.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const text_select_language = () => `Select language`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function text_select_language(): string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file contains language specific message functions for tree-shaking.
|
|
4
|
-
*
|
|
5
|
-
*! WARNING: Only import messages from this file if you want to manually
|
|
6
|
-
*! optimize your bundle. Else, import from the `messages.js` file.
|
|
7
|
-
*
|
|
8
|
-
* Your bundler will (in the future) automatically replace the index function
|
|
9
|
-
* with a language specific message function in the build step.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const text_select_language = () => `Seleccionar idioma`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function text_select_language(): string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file contains language specific message functions for tree-shaking.
|
|
4
|
-
*
|
|
5
|
-
*! WARNING: Only import messages from this file if you want to manually
|
|
6
|
-
*! optimize your bundle. Else, import from the `messages.js` file.
|
|
7
|
-
*
|
|
8
|
-
* Your bundler will (in the future) automatically replace the index function
|
|
9
|
-
* with a language specific message function in the build step.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const text_select_language = () => `Sélectionner la langue`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function text_select_language(): string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file contains language specific message functions for tree-shaking.
|
|
4
|
-
*
|
|
5
|
-
*! WARNING: Only import messages from this file if you want to manually
|
|
6
|
-
*! optimize your bundle. Else, import from the `messages.js` file.
|
|
7
|
-
*
|
|
8
|
-
* Your bundler will (in the future) automatically replace the index function
|
|
9
|
-
* with a language specific message function in the build step.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const text_select_language = () => `Seleziona la lingua`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function text_select_language(): string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file contains language specific message functions for tree-shaking.
|
|
4
|
-
*
|
|
5
|
-
*! WARNING: Only import messages from this file if you want to manually
|
|
6
|
-
*! optimize your bundle. Else, import from the `messages.js` file.
|
|
7
|
-
*
|
|
8
|
-
* Your bundler will (in the future) automatically replace the index function
|
|
9
|
-
* with a language specific message function in the build step.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const text_select_language = () => `Selecionar idioma`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function text_select_language(): string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file contains language specific message functions for tree-shaking.
|
|
4
|
-
*
|
|
5
|
-
*! WARNING: Only import messages from this file if you want to manually
|
|
6
|
-
*! optimize your bundle. Else, import from the `messages.js` file.
|
|
7
|
-
*
|
|
8
|
-
* Your bundler will (in the future) automatically replace the index function
|
|
9
|
-
* with a language specific message function in the build step.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const text_select_language = () => `Выберите язык`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function text_select_language(): string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file contains language specific message functions for tree-shaking.
|
|
4
|
-
*
|
|
5
|
-
*! WARNING: Only import messages from this file if you want to manually
|
|
6
|
-
*! optimize your bundle. Else, import from the `messages.js` file.
|
|
7
|
-
*
|
|
8
|
-
* Your bundler will (in the future) automatically replace the index function
|
|
9
|
-
* with a language specific message function in the build step.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const text_select_language = () => `Chọn ngôn ngữ`
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import { languageTag } from "./runtime.js"
|
|
3
|
-
import * as de from "./messages/de.js"
|
|
4
|
-
import * as en from "./messages/en.js"
|
|
5
|
-
import * as es from "./messages/es.js"
|
|
6
|
-
import * as fr from "./messages/fr.js"
|
|
7
|
-
import * as pt from "./messages/pt.js"
|
|
8
|
-
import * as vi from "./messages/vi.js"
|
|
9
|
-
import * as ru from "./messages/ru.js"
|
|
10
|
-
import * as it from "./messages/it.js"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* This message has been compiled by [inlang paraglide](https://inlang.com/m/gerre34r/library-inlang-paraglideJs).
|
|
15
|
-
*
|
|
16
|
-
* - Don't edit the message's code. Use [Sherlock (VS Code extension)](https://inlang.com/m/r7kp499g/app-inlang-ideExtension),
|
|
17
|
-
* the [web editor](https://inlang.com/m/tdozzpar/app-inlang-finkLocalizationEditor) instead, or edit the translation files manually.
|
|
18
|
-
*
|
|
19
|
-
* - The params are NonNullable<unknown> because the inlang SDK does not provide information on the type of a param (yet).
|
|
20
|
-
*
|
|
21
|
-
* @param {{}} params
|
|
22
|
-
* @param {{ languageTag?: "de" | "en" | "es" | "fr" | "pt" | "vi" | "ru" | "it" }} options
|
|
23
|
-
* @returns {string}
|
|
24
|
-
*/
|
|
25
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
26
|
-
export const text_select_language = (params = {}, options = {}) => {
|
|
27
|
-
return {
|
|
28
|
-
de: de.text_select_language,
|
|
29
|
-
en: en.text_select_language,
|
|
30
|
-
es: es.text_select_language,
|
|
31
|
-
fr: fr.text_select_language,
|
|
32
|
-
it: it.text_select_language,
|
|
33
|
-
pt: pt.text_select_language,
|
|
34
|
-
ru: ru.text_select_language,
|
|
35
|
-
vi: vi.text_select_language
|
|
36
|
-
}[options.languageTag ?? languageTag()]()
|
|
37
|
-
}
|
|
38
|
-
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if something is an available language tag.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* if (isAvailableLanguageTag(params.locale)) {
|
|
6
|
-
* setLanguageTag(params.locale)
|
|
7
|
-
* } else {
|
|
8
|
-
* setLanguageTag("en")
|
|
9
|
-
* }
|
|
10
|
-
*
|
|
11
|
-
* @param {any} thing
|
|
12
|
-
* @returns {thing is AvailableLanguageTag}
|
|
13
|
-
*/
|
|
14
|
-
export function isAvailableLanguageTag(thing: any): thing is AvailableLanguageTag;
|
|
15
|
-
/**
|
|
16
|
-
* The project's source language tag.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* if (newlySelectedLanguageTag === sourceLanguageTag){
|
|
20
|
-
* // do nothing as the source language tag is the default language
|
|
21
|
-
* return
|
|
22
|
-
* }
|
|
23
|
-
*/
|
|
24
|
-
export const sourceLanguageTag: "en";
|
|
25
|
-
/**
|
|
26
|
-
* The project's available language tags.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* if (availableLanguageTags.includes(userSelectedLanguageTag) === false){
|
|
30
|
-
* throw new Error("Language tag not available")
|
|
31
|
-
* }
|
|
32
|
-
*/
|
|
33
|
-
export const availableLanguageTags: readonly ["de", "en", "es", "fr", "pt", "vi", "ru", "it"];
|
|
34
|
-
/**
|
|
35
|
-
* Get the current language tag.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* if (languageTag() === "de"){
|
|
39
|
-
* console.log("Germany 🇩🇪")
|
|
40
|
-
* } else if (languageTag() === "nl"){
|
|
41
|
-
* console.log("Netherlands 🇳🇱")
|
|
42
|
-
* }
|
|
43
|
-
*
|
|
44
|
-
* @type {() => AvailableLanguageTag}
|
|
45
|
-
*/
|
|
46
|
-
export let languageTag: () => AvailableLanguageTag;
|
|
47
|
-
export function setLanguageTag(tag: AvailableLanguageTag | (() => AvailableLanguageTag)): void;
|
|
48
|
-
export function onSetLanguageTag(fn: (languageTag: AvailableLanguageTag) => void): void;
|
|
49
|
-
/**
|
|
50
|
-
* A language tag that is available in the project.
|
|
51
|
-
*/
|
|
52
|
-
export type AvailableLanguageTag = (typeof availableLanguageTags)[number];
|