@fgv/ts-res-browser 5.0.0-2 → 5.0.0-21

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.
Files changed (99) hide show
  1. package/cli.js +132 -21
  2. package/dist/bundle.js +1 -1
  3. package/dist/bundle.js.LICENSE.txt +11 -1
  4. package/package.json +42 -36
  5. package/.rush/temp/587277bfc395406ad444e989b6c309b9698f534c.tar.log +0 -15
  6. package/.rush/temp/chunked-rush-logs/ts-res-browser.build.chunks.jsonl +0 -35
  7. package/.rush/temp/operation/build/all.log +0 -35
  8. package/.rush/temp/operation/build/log-chunks.jsonl +0 -35
  9. package/.rush/temp/operation/build/state.json +0 -3
  10. package/.rush/temp/shrinkwrap-deps.json +0 -1225
  11. package/TS_RES_BROWSER_PLAN.md +0 -689
  12. package/babel.config.js +0 -17
  13. package/config/jest.config.json +0 -13
  14. package/config/rig.json +0 -16
  15. package/postcss.config.js +0 -3
  16. package/public/index.html +0 -15
  17. package/rush-logs/ts-res-browser.build.cache.log +0 -3
  18. package/rush-logs/ts-res-browser.build.log +0 -35
  19. package/src/App.tsx +0 -274
  20. package/src/cli.ts +0 -44
  21. package/src/components/common/FileImporter.tsx +0 -143
  22. package/src/components/common/NavigationWarningModal.tsx +0 -62
  23. package/src/components/layout/AppLayout.tsx +0 -46
  24. package/src/components/layout/Header.tsx +0 -22
  25. package/src/components/layout/MessagesWindow.tsx +0 -108
  26. package/src/components/layout/Sidebar.tsx +0 -99
  27. package/src/components/tools/CompiledBrowser.tsx +0 -949
  28. package/src/components/tools/ConfigurationTool.tsx +0 -1405
  29. package/src/components/tools/FilterTool.tsx +0 -1114
  30. package/src/components/tools/ImportTool.tsx +0 -249
  31. package/src/components/tools/ResolutionViewer.tsx +0 -1672
  32. package/src/components/tools/SourceBrowser.tsx +0 -496
  33. package/src/components/tools/ZipLoader.tsx +0 -302
  34. package/src/hooks/useAppState.ts +0 -111
  35. package/src/hooks/useFileImport.ts +0 -86
  36. package/src/hooks/useNavigationWarning.ts +0 -67
  37. package/src/hooks/useResourceManager.ts +0 -295
  38. package/src/hooks/useUrlParams.ts +0 -56
  39. package/src/index.css +0 -38
  40. package/src/main.tsx +0 -16
  41. package/src/types/app.ts +0 -70
  42. package/src/types/fileSystemAccess.d.ts +0 -94
  43. package/src/utils/browserFileTreeAccessors.ts +0 -245
  44. package/src/utils/fileImport.ts +0 -336
  45. package/src/utils/fileTreeConverter.ts +0 -160
  46. package/src/utils/filterResources.ts +0 -677
  47. package/src/utils/tsResIntegration.ts +0 -467
  48. package/src/utils/urlParams.ts +0 -238
  49. package/src/utils/zip/browserZipFileTreeAccessors.ts +0 -385
  50. package/tailwind.config.js +0 -21
  51. package/test-data/README.md +0 -184
  52. package/test-data/config-variations/README.md +0 -64
  53. package/test-data/config-variations/composition-terminology.json +0 -112
  54. package/test-data/config-variations/enterprise-complex.json +0 -129
  55. package/test-data/config-variations/gaming-app.json +0 -87
  56. package/test-data/config-variations/high-priority-language.json +0 -65
  57. package/test-data/config-variations/minimal-basic.json +0 -37
  58. package/test-data/config-variations/qualifier-default-values.json +0 -71
  59. package/test-data/config-variations/territory-first.json +0 -68
  60. package/test-data/config-variations/territory-hierarchy-test.json +0 -31
  61. package/test-data/config-variations/territory-hierarchy-unconstrained.json +0 -32
  62. package/test-data/default-matching-test/greeting.res.json +0 -83
  63. package/test-data/default-matching-test/only-defaults.res.json +0 -48
  64. package/test-data/sample-project/package.json +0 -27
  65. package/test-data/sample-project/src/resources/app-config.json +0 -27
  66. package/test-data/sample-project/src/resources/app.json +0 -177
  67. package/test-data/sample-project/src/resources/config/app.env=development.json +0 -21
  68. package/test-data/sample-project/src/resources/config/app.json +0 -21
  69. package/test-data/sample-project/src/resources/config/app.platform=mobile.json +0 -23
  70. package/test-data/sample-project/src/resources/feature-flags.json +0 -23
  71. package/test-data/sample-project/src/resources/home=CA/common.json +0 -16
  72. package/test-data/sample-project/src/resources/images/density=hdpi.json +0 -29
  73. package/test-data/sample-project/src/resources/images/home.json +0 -29
  74. package/test-data/sample-project/src/resources/images/logout.json +0 -14
  75. package/test-data/sample-project/src/resources/images/settings.json +0 -14
  76. package/test-data/sample-project/src/resources/images/ui-icons.json +0 -29
  77. package/test-data/sample-project/src/resources/images/user.density=hdpi.json +0 -14
  78. package/test-data/sample-project/src/resources/images/user.json +0 -14
  79. package/test-data/sample-project/src/resources/lang=en-US/common.json +0 -15
  80. package/test-data/sample-project/src/resources/language=en-CA/ui-terms.json +0 -19
  81. package/test-data/sample-project/src/resources/language=en-GB/ui-terms.json +0 -30
  82. package/test-data/sample-project/src/resources/language=fr-CA/ui-terms.json +0 -25
  83. package/test-data/sample-project/src/resources/language=nl-BE/ui-terms.json +0 -17
  84. package/test-data/sample-project/src/resources/region=europe/feature-flags.json +0 -17
  85. package/test-data/sample-project/src/resources/region=north-america/feature-flags.json +0 -18
  86. package/test-data/sample-project/src/resources/strings/dashboard.home=CA,language=fr.json +0 -20
  87. package/test-data/sample-project/src/resources/strings/dashboard.json +0 -18
  88. package/test-data/sample-project/src/resources/strings/dashboard.role=admin.json +0 -23
  89. package/test-data/sample-project/src/resources/strings/dashboard.role=user.json +0 -21
  90. package/test-data/sample-project/src/resources/strings/language=en-US.json +0 -16
  91. package/test-data/sample-project/src/resources/strings.json +0 -78
  92. package/test-data/sample-project/src/resources/territory=BE/app-config.json +0 -19
  93. package/test-data/sample-project/src/resources/territory=CA/app-config.json +0 -21
  94. package/test-data/sample-project/src/resources/territory=GB/app-config.json +0 -25
  95. package/test-data/sample-project/src/resources/territory=NL/app-config.json +0 -25
  96. package/test-data/sample-project/src/resources/ui-terms.json +0 -96
  97. package/test-data/sample-project/src/resources-config.json +0 -111
  98. package/tsconfig.json +0 -27
  99. package/webpack.config.js +0 -60
@@ -1,83 +0,0 @@
1
- {
2
- "id": "greeting",
3
- "resourceType": "json",
4
- "candidates": [
5
- {
6
- "json": {
7
- "message": "Hello! (Regular Match)",
8
- "type": "regular",
9
- "context": "exact match for en-US/US"
10
- },
11
- "conditions": {
12
- "language": "en-US",
13
- "territory": "US"
14
- }
15
- },
16
- {
17
- "json": {
18
- "message": "Hello! (Default Language Match)",
19
- "type": "default-lang",
20
- "context": "matches fr via default but territory exact"
21
- },
22
- "conditions": [
23
- {
24
- "qualifierName": "language",
25
- "value": "fr",
26
- "scoreAsDefault": 0.8
27
- },
28
- {
29
- "qualifierName": "territory",
30
- "value": "US"
31
- }
32
- ]
33
- },
34
- {
35
- "json": {
36
- "message": "Hello! (Default Territory Match)",
37
- "type": "default-territory",
38
- "context": "language exact but territory via default"
39
- },
40
- "conditions": [
41
- {
42
- "qualifierName": "language",
43
- "value": "en-US"
44
- },
45
- {
46
- "qualifierName": "territory",
47
- "value": "CA",
48
- "scoreAsDefault": 0.7
49
- }
50
- ]
51
- },
52
- {
53
- "json": {
54
- "message": "Hello! (Pure Default Match)",
55
- "type": "pure-default",
56
- "context": "both qualifiers match via defaults only"
57
- },
58
- "conditions": [
59
- {
60
- "qualifierName": "language",
61
- "value": "de",
62
- "scoreAsDefault": 0.6
63
- },
64
- {
65
- "qualifierName": "territory",
66
- "value": "DE",
67
- "scoreAsDefault": 0.5
68
- }
69
- ]
70
- },
71
- {
72
- "json": {
73
- "message": "Hello! (No Match)",
74
- "type": "no-match",
75
- "context": "should not match the test context"
76
- },
77
- "conditions": {
78
- "language": "ja",
79
- "territory": "JP"
80
- }
81
- }
82
- ]
83
- }
@@ -1,48 +0,0 @@
1
- {
2
- "id": "only-defaults",
3
- "resourceType": "json",
4
- "candidates": [
5
- {
6
- "json": {
7
- "message": "Fallback French",
8
- "priority": "high",
9
- "type": "fallback-1"
10
- },
11
- "conditions": [
12
- {
13
- "qualifierName": "language",
14
- "value": "fr",
15
- "scoreAsDefault": 0.9
16
- }
17
- ]
18
- },
19
- {
20
- "json": {
21
- "message": "Fallback German",
22
- "priority": "medium",
23
- "type": "fallback-2"
24
- },
25
- "conditions": [
26
- {
27
- "qualifierName": "language",
28
- "value": "de",
29
- "scoreAsDefault": 0.8
30
- }
31
- ]
32
- },
33
- {
34
- "json": {
35
- "message": "Fallback Spanish",
36
- "priority": "low",
37
- "type": "fallback-3"
38
- },
39
- "conditions": [
40
- {
41
- "qualifierName": "language",
42
- "value": "es",
43
- "scoreAsDefault": 0.7
44
- }
45
- ]
46
- }
47
- ]
48
- }
@@ -1,27 +0,0 @@
1
- {
2
- "name": "ts-res-sample-project",
3
- "version": "1.0.0",
4
- "description": "Sample project demonstrating ts-res resource management",
5
- "scripts": {
6
- "build": "ts-res-compile",
7
- "dev": "ts-res-compile --watch",
8
- "clean": "rimraf dist compiled"
9
- },
10
- "dependencies": {
11
- "@fgv/ts-res": "workspace:*",
12
- "@fgv/ts-utils": "workspace:*"
13
- },
14
- "devDependencies": {
15
- "@fgv/ts-res-cli": "workspace:*",
16
- "rimraf": "^5.0.0"
17
- },
18
- "keywords": [
19
- "ts-res",
20
- "resources",
21
- "localization",
22
- "i18n",
23
- "configuration"
24
- ],
25
- "author": "TS-RES Team",
26
- "license": "MIT"
27
- }
@@ -1,27 +0,0 @@
1
- {
2
- "resources": {
3
- "app-config": {
4
- "resourceTypeName": "json",
5
- "candidates": [
6
- {
7
- "json": {
8
- "currency": "USD",
9
- "dateFormat": "MM/DD/YYYY",
10
- "timeFormat": "12h",
11
- "numberFormat": "en-US",
12
- "measurement": "imperial",
13
- "phoneFormat": "+1 (###) ###-####",
14
- "supportEmail": "support@example.com",
15
- "supportPhone": "+1-800-555-0123",
16
- "legalEntity": "Example Corp",
17
- "privacyPolicy": "https://example.com/privacy",
18
- "termsOfService": "https://example.com/terms"
19
- },
20
- "conditions": {
21
- "territory": "US"
22
- }
23
- }
24
- ]
25
- }
26
- }
27
- }
@@ -1,177 +0,0 @@
1
- {
2
- "resources": {
3
- "config": {
4
- "resourceTypeName": "json",
5
- "candidates": [
6
- {
7
- "json": {
8
- "app_name": "Sample Application",
9
- "version": "1.0.0",
10
- "api_url": "https://api.example.com",
11
- "timeout": 30000,
12
- "max_retries": 3,
13
- "debug": false,
14
- "features": {
15
- "authentication": true,
16
- "notifications": true,
17
- "analytics": true
18
- }
19
- }
20
- },
21
- {
22
- "json": {
23
- "app_name": "Sample Application (DEV)",
24
- "version": "1.0.0-dev",
25
- "api_url": "https://dev-api.example.com",
26
- "timeout": 10000,
27
- "max_retries": 1,
28
- "debug": true,
29
- "features": {
30
- "authentication": true,
31
- "notifications": false,
32
- "analytics": false
33
- }
34
- },
35
- "conditions": {
36
- "env": "development"
37
- }
38
- },
39
- {
40
- "json": {
41
- "app_name": "Sample Mobile App",
42
- "version": "1.0.0",
43
- "api_url": "https://mobile-api.example.com",
44
- "timeout": 15000,
45
- "max_retries": 2,
46
- "debug": false,
47
- "features": {
48
- "authentication": true,
49
- "notifications": true,
50
- "analytics": true,
51
- "offline_mode": true,
52
- "push_notifications": true
53
- }
54
- },
55
- "conditions": {
56
- "platform": "mobile"
57
- }
58
- }
59
- ]
60
- }
61
- },
62
- "children": {
63
- "ui": {
64
- "resources": {
65
- "dashboard": {
66
- "resourceTypeName": "json",
67
- "candidates": [
68
- {
69
- "json": {
70
- "title": "Dashboard",
71
- "overview": "Overview",
72
- "stats": "Statistics",
73
- "recent_activity": "Recent Activity",
74
- "notifications": "Notifications",
75
- "settings": "Settings",
76
- "profile": "Profile",
77
- "logout": "Logout"
78
- }
79
- },
80
- {
81
- "json": {
82
- "title": "User Dashboard",
83
- "overview": "My Overview",
84
- "stats": "My Statistics",
85
- "recent_activity": "My Recent Activity",
86
- "notifications": "My Notifications",
87
- "settings": "My Settings",
88
- "profile": "My Profile",
89
- "logout": "Sign Out",
90
- "help": "Help & Support",
91
- "tutorials": "Tutorials",
92
- "account_info": "Account Information"
93
- },
94
- "conditions": {
95
- "role": "user"
96
- }
97
- },
98
- {
99
- "json": {
100
- "title": "Admin Dashboard",
101
- "overview": "System Overview",
102
- "stats": "System Statistics",
103
- "recent_activity": "System Activity",
104
- "notifications": "System Notifications",
105
- "settings": "System Settings",
106
- "profile": "Admin Profile",
107
- "logout": "Admin Logout",
108
- "user_management": "User Management",
109
- "system_logs": "System Logs",
110
- "monitoring": "System Monitoring",
111
- "reports": "Reports",
112
- "maintenance": "Maintenance Mode"
113
- },
114
- "conditions": {
115
- "role": "admin"
116
- }
117
- }
118
- ]
119
- }
120
- },
121
- "children": {
122
- "icons": {
123
- "resources": {
124
- "home": {
125
- "resourceTypeName": "json",
126
- "candidates": [
127
- {
128
- "json": {
129
- "path": "/assets/icons/home.svg",
130
- "alt": "Home icon",
131
- "width": 24,
132
- "height": 24
133
- }
134
- },
135
- {
136
- "json": {
137
- "path": "/assets/icons/home@2x.svg",
138
- "alt": "Home icon",
139
- "width": 48,
140
- "height": 48
141
- },
142
- "conditions": {
143
- "density": "hdpi"
144
- }
145
- }
146
- ]
147
- },
148
- "user": {
149
- "resourceTypeName": "json",
150
- "candidates": [
151
- {
152
- "json": {
153
- "path": "/assets/icons/user.svg",
154
- "alt": "User icon",
155
- "width": 24,
156
- "height": 24
157
- }
158
- },
159
- {
160
- "json": {
161
- "path": "/assets/icons/user@2x.svg",
162
- "alt": "User icon",
163
- "width": 48,
164
- "height": 48
165
- },
166
- "conditions": {
167
- "density": "hdpi"
168
- }
169
- }
170
- ]
171
- }
172
- }
173
- }
174
- }
175
- }
176
- }
177
- }
@@ -1,21 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "app",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "app_name": "Sample Application (DEV)",
8
- "version": "1.0.0-dev",
9
- "api_url": "https://dev-api.example.com",
10
- "timeout": 10000,
11
- "max_retries": 1,
12
- "debug": true,
13
- "features": {
14
- "authentication": true,
15
- "notifications": false,
16
- "analytics": false
17
- }
18
- }
19
- }
20
- ]
21
- }
@@ -1,21 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "app",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "app_name": "Sample Application",
8
- "version": "1.0.0",
9
- "api_url": "https://api.example.com",
10
- "timeout": 30000,
11
- "max_retries": 3,
12
- "debug": false,
13
- "features": {
14
- "authentication": true,
15
- "notifications": true,
16
- "analytics": true
17
- }
18
- }
19
- }
20
- ]
21
- }
@@ -1,23 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "app",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "app_name": "Sample Mobile App",
8
- "version": "1.0.0",
9
- "api_url": "https://mobile-api.example.com",
10
- "timeout": 15000,
11
- "max_retries": 2,
12
- "debug": false,
13
- "features": {
14
- "authentication": true,
15
- "notifications": true,
16
- "analytics": true,
17
- "offline_mode": true,
18
- "push_notifications": true
19
- }
20
- }
21
- }
22
- ]
23
- }
@@ -1,23 +0,0 @@
1
- {
2
- "resources": {
3
- "feature-flags": {
4
- "resourceTypeName": "json",
5
- "candidates": [
6
- {
7
- "json": {
8
- "betaFeatures": false,
9
- "advancedSearch": true,
10
- "socialLogin": true,
11
- "realTimeNotifications": true,
12
- "darkMode": false,
13
- "analytics": true,
14
- "chatSupport": false,
15
- "multiLanguage": true,
16
- "adminPanel": false,
17
- "apiAccess": false
18
- }
19
- }
20
- ]
21
- }
22
- }
23
- }
@@ -1,16 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "common",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "welcome": "Welcome to Canada",
8
- "hello": "Hello, eh!",
9
- "goodbye": "Goodbye",
10
- "timezone": "America/Toronto",
11
- "currency": "CAD",
12
- "measurement": "Metric"
13
- }
14
- }
15
- ]
16
- }
@@ -1,29 +0,0 @@
1
- {
2
- "resources": [
3
- {
4
- "id": "logout.logout",
5
- "resourceTypeName": "json",
6
- "candidates": [
7
- {
8
- "json": {
9
- "path": "/assets/icons/logout@2x.svg",
10
- "alt": "Logout icon",
11
- "width": 48,
12
- "height": 48
13
- }
14
- }
15
- ]
16
- }
17
- ],
18
- "candidates": [
19
- {
20
- "id": "settings.settings",
21
- "json": {
22
- "path": "/assets/icons/settings@2x.svg",
23
- "alt": "Settings icon",
24
- "width": 48,
25
- "height": 48
26
- }
27
- }
28
- ]
29
- }
@@ -1,29 +0,0 @@
1
- {
2
- "resources": [
3
- {
4
- "id": "home",
5
- "resourceTypeName": "json",
6
- "candidates": [
7
- {
8
- "json": {
9
- "path": "/assets/icons/home.svg",
10
- "alt": "Home icon",
11
- "width": 24,
12
- "height": 24
13
- }
14
- },
15
- {
16
- "json": {
17
- "path": "/assets/icons/home@2x.svg",
18
- "alt": "Home icon",
19
- "width": 48,
20
- "height": 48
21
- },
22
- "conditions": {
23
- "density": "hdpi"
24
- }
25
- }
26
- ]
27
- }
28
- ]
29
- }
@@ -1,14 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "logout",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "path": "/assets/icons/logout.svg",
8
- "alt": "Logout icon",
9
- "width": 24,
10
- "height": 24
11
- }
12
- }
13
- ]
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "settings",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "path": "/assets/icons/settings.svg",
8
- "alt": "Settings icon",
9
- "width": 24,
10
- "height": 24
11
- }
12
- }
13
- ]
14
- }
@@ -1,29 +0,0 @@
1
- {
2
- "resources": [
3
- {
4
- "id": "notification",
5
- "resourceTypeName": "json",
6
- "candidates": [
7
- {
8
- "json": {
9
- "path": "/assets/icons/notification.svg",
10
- "alt": "Notification icon",
11
- "width": 24,
12
- "height": 24
13
- }
14
- },
15
- {
16
- "json": {
17
- "path": "/assets/icons/notification@2x.svg",
18
- "alt": "Notification icon",
19
- "width": 48,
20
- "height": 48
21
- },
22
- "conditions": {
23
- "density": "hdpi"
24
- }
25
- }
26
- ]
27
- }
28
- ]
29
- }
@@ -1,14 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "user",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "path": "/assets/icons/user@2x.svg",
8
- "alt": "User icon",
9
- "width": 48,
10
- "height": 48
11
- }
12
- }
13
- ]
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "user",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "path": "/assets/icons/user.svg",
8
- "alt": "User icon",
9
- "width": 24,
10
- "height": 24
11
- }
12
- }
13
- ]
14
- }
@@ -1,15 +0,0 @@
1
- {
2
- "candidates": [
3
- {
4
- "id": "common",
5
- "resourceTypeName": "json",
6
- "json": {
7
- "welcome": "Welcome to the United States version",
8
- "hello": "Hello there",
9
- "goodbye": "Goodbye",
10
- "timezone": "America/New_York",
11
- "measurement": "Imperial"
12
- }
13
- }
14
- ]
15
- }
@@ -1,19 +0,0 @@
1
- {
2
- "resources": {
3
- "ui-terms": {
4
- "resourceTypeName": "json",
5
- "candidates": [
6
- {
7
- "json": {
8
- "ShoppingCart": "Shopping cart",
9
- "ZipCode": "Postal code",
10
- "Color": "Colour",
11
- "Favorite": "Favourite",
12
- "Email": "Courriel"
13
- },
14
- "isPartial": true
15
- }
16
- ]
17
- }
18
- }
19
- }