@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,22 +0,0 @@
1
- import React from 'react';
2
- import { DocumentMagnifyingGlassIcon } from '@heroicons/react/24/outline';
3
-
4
- const Header: React.FC = () => {
5
- return (
6
- <header className="bg-white shadow-sm border-b border-gray-200">
7
- <div className="container mx-auto px-4 py-4">
8
- <div className="flex items-center space-x-3">
9
- <DocumentMagnifyingGlassIcon className="h-8 w-8 text-blue-600" />
10
- <div>
11
- <h1 className="text-2xl font-bold text-gray-900">TS-RES Browser</h1>
12
- <p className="text-sm text-gray-600">
13
- Visual tool for loading, browsing, and experimenting with ts-res resources
14
- </p>
15
- </div>
16
- </div>
17
- </div>
18
- </header>
19
- );
20
- };
21
-
22
- export default Header;
@@ -1,108 +0,0 @@
1
- import React, { useState } from 'react';
2
- import {
3
- XMarkIcon,
4
- InformationCircleIcon,
5
- ExclamationTriangleIcon,
6
- XCircleIcon,
7
- CheckCircleIcon,
8
- ChevronUpIcon,
9
- ChevronDownIcon
10
- } from '@heroicons/react/24/outline';
11
-
12
- interface Message {
13
- id: string;
14
- type: 'info' | 'warning' | 'error' | 'success';
15
- message: string;
16
- timestamp: Date;
17
- }
18
-
19
- interface MessagesWindowProps {
20
- messages: Message[];
21
- onClearMessages: () => void;
22
- }
23
-
24
- const MessagesWindow: React.FC<MessagesWindowProps> = ({ messages, onClearMessages }) => {
25
- const [isCollapsed, setIsCollapsed] = useState(false);
26
-
27
- if (messages.length === 0) {
28
- return null;
29
- }
30
-
31
- const getMessageIcon = (type: Message['type']) => {
32
- switch (type) {
33
- case 'info':
34
- return <InformationCircleIcon className="h-5 w-5 text-blue-500" />;
35
- case 'warning':
36
- return <ExclamationTriangleIcon className="h-5 w-5 text-yellow-500" />;
37
- case 'error':
38
- return <XCircleIcon className="h-5 w-5 text-red-500" />;
39
- case 'success':
40
- return <CheckCircleIcon className="h-5 w-5 text-green-500" />;
41
- default:
42
- return <InformationCircleIcon className="h-5 w-5 text-gray-500" />;
43
- }
44
- };
45
-
46
- const getMessageBgColor = (type: Message['type']) => {
47
- switch (type) {
48
- case 'info':
49
- return 'bg-blue-50 border-blue-200';
50
- case 'warning':
51
- return 'bg-yellow-50 border-yellow-200';
52
- case 'error':
53
- return 'bg-red-50 border-red-200';
54
- case 'success':
55
- return 'bg-green-50 border-green-200';
56
- default:
57
- return 'bg-gray-50 border-gray-200';
58
- }
59
- };
60
-
61
- const formatTime = (date: Date) => {
62
- return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
63
- };
64
-
65
- return (
66
- <div className="border-t border-gray-200 bg-white">
67
- {/* Header */}
68
- <div className="flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-200">
69
- <div className="flex items-center space-x-2">
70
- <button onClick={() => setIsCollapsed(!isCollapsed)} className="p-1 hover:bg-gray-200 rounded">
71
- {isCollapsed ? (
72
- <ChevronUpIcon className="h-4 w-4 text-gray-500" />
73
- ) : (
74
- <ChevronDownIcon className="h-4 w-4 text-gray-500" />
75
- )}
76
- </button>
77
- <h3 className="text-sm font-medium text-gray-900">Messages ({messages.length})</h3>
78
- </div>
79
- <button
80
- onClick={onClearMessages}
81
- className="text-xs text-gray-500 hover:text-gray-700 px-2 py-1 rounded hover:bg-gray-200"
82
- >
83
- Clear All
84
- </button>
85
- </div>
86
-
87
- {/* Messages */}
88
- {!isCollapsed && (
89
- <div className="max-h-48 overflow-y-auto">
90
- {messages.map((message) => (
91
- <div
92
- key={message.id}
93
- className={`flex items-start space-x-3 p-3 border-l-4 ${getMessageBgColor(message.type)}`}
94
- >
95
- {getMessageIcon(message.type)}
96
- <div className="flex-1 min-w-0">
97
- <p className="text-sm text-gray-900">{message.message}</p>
98
- <p className="text-xs text-gray-500 mt-1">{formatTime(message.timestamp)}</p>
99
- </div>
100
- </div>
101
- ))}
102
- </div>
103
- )}
104
- </div>
105
- );
106
- };
107
-
108
- export default MessagesWindow;
@@ -1,99 +0,0 @@
1
- import React from 'react';
2
- import {
3
- DocumentArrowUpIcon,
4
- DocumentTextIcon,
5
- FunnelIcon,
6
- CubeIcon,
7
- MagnifyingGlassIcon,
8
- CogIcon,
9
- ArchiveBoxIcon
10
- } from '@heroicons/react/24/outline';
11
- import { Tool } from '../../types/app';
12
-
13
- interface SidebarProps {
14
- selectedTool: Tool;
15
- onToolSelect: (tool: Tool) => void;
16
- }
17
-
18
- const tools = [
19
- {
20
- id: 'import',
21
- name: 'Import Resources',
22
- icon: DocumentArrowUpIcon,
23
- description: 'Import ts-res resource files and directories'
24
- },
25
- {
26
- id: 'source',
27
- name: 'Source Browser',
28
- icon: DocumentTextIcon,
29
- description: 'Browse built resources in alphabetical order'
30
- },
31
- {
32
- id: 'filter',
33
- name: 'Filter Tool',
34
- icon: FunnelIcon,
35
- description: 'Filter resources by context for focused analysis'
36
- },
37
- {
38
- id: 'compiled',
39
- name: 'Compiled Browser',
40
- icon: CubeIcon,
41
- description: 'Navigate compiled resources in tree view'
42
- },
43
- {
44
- id: 'resolution',
45
- name: 'Resolution Viewer',
46
- icon: MagnifyingGlassIcon,
47
- description: 'View resource resolution with qualifiers'
48
- },
49
- {
50
- id: 'configuration',
51
- name: 'Configuration',
52
- icon: CogIcon,
53
- description: 'Manage qualifier types, qualifiers, and resource types'
54
- },
55
- {
56
- id: 'zip-loader',
57
- name: 'ZIP Loader',
58
- icon: ArchiveBoxIcon,
59
- description: 'Load resources from ZIP archive created by CLI'
60
- }
61
- ];
62
-
63
- const Sidebar: React.FC<SidebarProps> = ({ selectedTool, onToolSelect }) => {
64
- return (
65
- <aside className="w-64 bg-white shadow-sm border-r border-gray-200 h-screen overflow-y-auto">
66
- <div className="p-4">
67
- <h2 className="text-lg font-semibold text-gray-900 mb-4">Tools</h2>
68
- <nav className="space-y-2">
69
- {tools.map((tool) => {
70
- const Icon = tool.icon;
71
- const isSelected = selectedTool === tool.id;
72
-
73
- return (
74
- <button
75
- key={tool.id}
76
- onClick={() => onToolSelect(tool.id as Tool)}
77
- className={`w-full text-left p-3 rounded-lg transition-colors ${
78
- isSelected
79
- ? 'bg-blue-50 text-blue-700 border border-blue-200'
80
- : 'hover:bg-gray-50 text-gray-700 border border-transparent'
81
- }`}
82
- >
83
- <div className="flex items-center space-x-3">
84
- <Icon className="h-5 w-5 flex-shrink-0" />
85
- <div className="min-w-0 flex-1">
86
- <div className="font-medium text-sm">{tool.name}</div>
87
- <div className="text-xs text-gray-500 mt-1">{tool.description}</div>
88
- </div>
89
- </div>
90
- </button>
91
- );
92
- })}
93
- </nav>
94
- </div>
95
- </aside>
96
- );
97
- };
98
-
99
- export default Sidebar;