solara 0.4.0 → 0.5.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.
- checksums.yaml +4 -4
- data/solara/lib/.DS_Store +0 -0
- data/solara/lib/core/.DS_Store +0 -0
- data/solara/lib/core/brands/brand_switcher.rb +58 -1
- data/solara/lib/core/dashboard/brand/BrandDetail.js +34 -2
- data/solara/lib/core/dashboard/brand/BrandDetailController.js +23 -233
- data/solara/lib/core/dashboard/brand/BrandDetailModel.js +13 -5
- data/solara/lib/core/dashboard/brand/BrandDetailView.js +16 -200
- data/solara/lib/core/dashboard/brand/SectionsFormManager.js +232 -0
- data/solara/lib/core/dashboard/brand/brand.html +187 -177
- data/solara/lib/core/dashboard/brand/source/BrandLocalSource.js +2 -5
- data/solara/lib/core/dashboard/brand/source/BrandRemoteSource.js +36 -133
- data/solara/lib/core/dashboard/brands/Brands.js +31 -0
- data/solara/lib/core/dashboard/brands/BrandsController.js +0 -5
- data/solara/lib/core/dashboard/brands/BrandsView.js +2 -2
- data/solara/lib/core/dashboard/brands/brands.html +71 -52
- data/solara/lib/core/dashboard/component/AliasesBottomSheet.js +6 -6
- data/solara/lib/core/dashboard/component/BrandOptionsBottomSheet.js +4 -4
- data/solara/lib/core/dashboard/component/ConfirmationDialog.js +15 -10
- data/solara/lib/core/dashboard/component/EditJsonSheet.js +160 -0
- data/solara/lib/core/dashboard/component/MessageBottomSheet.js +5 -5
- data/solara/lib/core/dashboard/component/OnboardBrandBottomSheet.js +5 -3
- data/solara/lib/core/dashboard/handler/base_handler.rb +1 -0
- data/solara/lib/core/dashboard/handler/edit_section_handler.rb +1 -5
- data/solara/lib/core/doctor/schema/brand_configurations.json +0 -8
- data/solara/lib/core/doctor/schema/platform/global/resources_manifest.json +30 -0
- data/solara/lib/core/doctor/schema/platform/json_manifest.json +57 -0
- data/solara/lib/core/doctor/validator/template/android_template_validation_config.yml +35 -1
- data/solara/lib/core/doctor/validator/template/flutter_template_validation_config.yml +30 -1
- data/solara/lib/core/doctor/validator/template/ios_template_validation_config.yml +35 -1
- data/solara/lib/core/doctor/validator/template/template_validator.rb +9 -9
- data/solara/lib/core/scripts/brand_config_manager.rb +1 -1
- data/solara/lib/core/scripts/brand_configurations_manager.rb +41 -0
- data/solara/lib/core/scripts/code_generator.rb +342 -118
- data/solara/lib/core/scripts/file_path.rb +21 -1
- data/solara/lib/core/scripts/gitignore_manager.rb +11 -3
- data/solara/lib/core/scripts/json_manifest_processor.rb +95 -0
- data/solara/lib/core/scripts/platform/ios/infoplist_string_catalog_manager.rb +11 -1
- data/solara/lib/core/scripts/resource_manifest_processor.rb +151 -0
- data/solara/lib/core/scripts/solara_status_manager.rb +1 -1
- data/solara/lib/core/scripts/theme_generator.rb +21 -242
- data/solara/lib/core/solara_configurator.rb +1 -1
- data/solara/lib/core/template/brands/global/resources_manifest.json +10 -0
- data/solara/lib/core/template/brands/json/Json-Manifest.md +61 -0
- data/solara/lib/core/template/brands/json/json_manifest.json +18 -0
- data/solara/lib/core/template/brands/shared/theme.json +213 -29
- data/solara/lib/core/template/config/android_template_config.json +50 -0
- data/solara/lib/core/template/config/flutter_template_config.json +35 -0
- data/solara/lib/core/template/config/ios_template_config.json +50 -0
- data/solara/lib/core/template/configurations.json +46 -0
- data/solara/lib/core/template/project_template_generator.rb +2 -0
- data/solara/lib/solara/version.rb +1 -1
- data/solara/lib/solara.rb +19 -0
- metadata +13 -4
- data/solara/lib/core/dashboard/component/AddFieldSheet.js +0 -175
- data/solara/lib/core/dashboard/handler/brand_configurations_manager.rb +0 -73
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Malek Kamel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- solara/lib/core/dashboard/brand/BrandDetailModel.js
|
177
177
|
- solara/lib/core/dashboard/brand/BrandDetailView.js
|
178
178
|
- solara/lib/core/dashboard/brand/InfoPlistStringCatalogManager.js
|
179
|
+
- solara/lib/core/dashboard/brand/SectionsFormManager.js
|
179
180
|
- solara/lib/core/dashboard/brand/brand.html
|
180
181
|
- solara/lib/core/dashboard/brand/source/BrandLocalSource.js
|
181
182
|
- solara/lib/core/dashboard/brand/source/BrandRemoteSource.js
|
@@ -184,17 +185,16 @@ files:
|
|
184
185
|
- solara/lib/core/dashboard/brands/BrandsModel.js
|
185
186
|
- solara/lib/core/dashboard/brands/BrandsView.js
|
186
187
|
- solara/lib/core/dashboard/brands/brands.html
|
187
|
-
- solara/lib/core/dashboard/component/AddFieldSheet.js
|
188
188
|
- solara/lib/core/dashboard/component/AliasesBottomSheet.js
|
189
189
|
- solara/lib/core/dashboard/component/BrandOptionsBottomSheet.js
|
190
190
|
- solara/lib/core/dashboard/component/ConfirmationDialog.js
|
191
|
+
- solara/lib/core/dashboard/component/EditJsonSheet.js
|
191
192
|
- solara/lib/core/dashboard/component/MessageBottomSheet.js
|
192
193
|
- solara/lib/core/dashboard/component/OnboardBrandBottomSheet.js
|
193
194
|
- solara/lib/core/dashboard/dashboard_manager.rb
|
194
195
|
- solara/lib/core/dashboard/dashboard_server.rb
|
195
196
|
- solara/lib/core/dashboard/handler/base_handler.rb
|
196
197
|
- solara/lib/core/dashboard/handler/brand_alisases_handler.rb
|
197
|
-
- solara/lib/core/dashboard/handler/brand_configurations_manager.rb
|
198
198
|
- solara/lib/core/dashboard/handler/brand_details_handler.rb
|
199
199
|
- solara/lib/core/dashboard/handler/brand_icon_handler.rb
|
200
200
|
- solara/lib/core/dashboard/handler/brands_handler.rb
|
@@ -221,9 +221,11 @@ files:
|
|
221
221
|
- solara/lib/core/doctor/schema/brand_configurations.json
|
222
222
|
- solara/lib/core/doctor/schema/platform/android/android_config.json
|
223
223
|
- solara/lib/core/doctor/schema/platform/android/android_signing.json
|
224
|
+
- solara/lib/core/doctor/schema/platform/global/resources_manifest.json
|
224
225
|
- solara/lib/core/doctor/schema/platform/ios/InfoPlist.xcstrings
|
225
226
|
- solara/lib/core/doctor/schema/platform/ios/ios_config.json
|
226
227
|
- solara/lib/core/doctor/schema/platform/ios/ios_signing.json
|
228
|
+
- solara/lib/core/doctor/schema/platform/json_manifest.json
|
227
229
|
- solara/lib/core/doctor/schema/platform/shared/brand_config.json
|
228
230
|
- solara/lib/core/doctor/schema/platform/shared/theme.json
|
229
231
|
- solara/lib/core/doctor/validator/brand_settings_validator.rb
|
@@ -237,6 +239,7 @@ files:
|
|
237
239
|
- solara/lib/core/doctor/validator/template/template_validator.rb
|
238
240
|
- solara/lib/core/doctor/validator/validation_strategy.rb
|
239
241
|
- solara/lib/core/scripts/brand_config_manager.rb
|
242
|
+
- solara/lib/core/scripts/brand_configurations_manager.rb
|
240
243
|
- solara/lib/core/scripts/brand_exporter.rb
|
241
244
|
- solara/lib/core/scripts/brand_importer.rb
|
242
245
|
- solara/lib/core/scripts/brand_offboarder.rb
|
@@ -248,6 +251,7 @@ files:
|
|
248
251
|
- solara/lib/core/scripts/folder_copier.rb
|
249
252
|
- solara/lib/core/scripts/gitignore_manager.rb
|
250
253
|
- solara/lib/core/scripts/interactive_file_system_validator.rb
|
254
|
+
- solara/lib/core/scripts/json_manifest_processor.rb
|
251
255
|
- solara/lib/core/scripts/platform/android/android_manifest_switcher.rb
|
252
256
|
- solara/lib/core/scripts/platform/android/android_strings_switcher.rb
|
253
257
|
- solara/lib/core/scripts/platform/android/gradle_switcher.rb
|
@@ -261,6 +265,7 @@ files:
|
|
261
265
|
- solara/lib/core/scripts/platform/ios/xcode_project_manager.rb
|
262
266
|
- solara/lib/core/scripts/platform/ios/xcode_project_switcher.rb
|
263
267
|
- solara/lib/core/scripts/project_settings_manager.rb
|
268
|
+
- solara/lib/core/scripts/resource_manifest_processor.rb
|
264
269
|
- solara/lib/core/scripts/solara_logger.rb
|
265
270
|
- solara/lib/core/scripts/solara_settings_manager.rb
|
266
271
|
- solara/lib/core/scripts/solara_status_manager.rb
|
@@ -285,6 +290,7 @@ files:
|
|
285
290
|
- solara/lib/core/template/brands/android/res/mipmap-xxxhdpi/ic_launcher_round.png
|
286
291
|
- solara/lib/core/template/brands/android/res/values/strings.xml
|
287
292
|
- solara/lib/core/template/brands/brands.json
|
293
|
+
- solara/lib/core/template/brands/global/resources_manifest.json
|
288
294
|
- solara/lib/core/template/brands/ios/InfoPlist.xcstrings
|
289
295
|
- solara/lib/core/template/brands/ios/ios_config.json
|
290
296
|
- solara/lib/core/template/brands/ios/ios_signing.json
|
@@ -324,12 +330,15 @@ files:
|
|
324
330
|
- solara/lib/core/template/brands/ios/xcassets/AppIcon.appiconset/88.png
|
325
331
|
- solara/lib/core/template/brands/ios/xcassets/AppIcon.appiconset/92.png
|
326
332
|
- solara/lib/core/template/brands/ios/xcassets/AppIcon.appiconset/Contents.json
|
333
|
+
- solara/lib/core/template/brands/json/Json-Manifest.md
|
334
|
+
- solara/lib/core/template/brands/json/json_manifest.json
|
327
335
|
- solara/lib/core/template/brands/shared/.DS_Store
|
328
336
|
- solara/lib/core/template/brands/shared/brand_config.json
|
329
337
|
- solara/lib/core/template/brands/shared/theme.json
|
330
338
|
- solara/lib/core/template/config/android_template_config.json
|
331
339
|
- solara/lib/core/template/config/flutter_template_config.json
|
332
340
|
- solara/lib/core/template/config/ios_template_config.json
|
341
|
+
- solara/lib/core/template/configurations.json
|
333
342
|
- solara/lib/core/template/project_template_generator.rb
|
334
343
|
- solara/lib/platform_detector.rb
|
335
344
|
- solara/lib/solara.rb
|
@@ -1,175 +0,0 @@
|
|
1
|
-
class AddFieldSheet extends HTMLElement {
|
2
|
-
constructor() {
|
3
|
-
super();
|
4
|
-
this.onSubmit = null;
|
5
|
-
this.inputType = null;
|
6
|
-
|
7
|
-
this.attachShadow({mode: 'open'});
|
8
|
-
this.render();
|
9
|
-
|
10
|
-
this.addFieldSheet = this.shadowRoot.querySelector('#addFieldSheet');
|
11
|
-
this.overlay = this.shadowRoot.getElementById('overlay');
|
12
|
-
|
13
|
-
this.shadowRoot.querySelector('#addFieldForm').onsubmit = (e) => this.handleSubmit(e);
|
14
|
-
this.shadowRoot.querySelector('#colorPicker').oninput = (e) => this.updateFieldValue(e);
|
15
|
-
this.overlay.onclick = () => this.hideAddFieldForm();
|
16
|
-
}
|
17
|
-
|
18
|
-
render() {
|
19
|
-
this.shadowRoot.innerHTML = `
|
20
|
-
<style>
|
21
|
-
.bottom-sheet {
|
22
|
-
position: fixed;
|
23
|
-
bottom: -100%;
|
24
|
-
left: 0;
|
25
|
-
right: 0;
|
26
|
-
background-color: white;
|
27
|
-
padding: 21px;
|
28
|
-
box-shadow: 0 -3.5px 14px rgba(0, 0, 0, 0.2);
|
29
|
-
transition: bottom 0.3s ease-out;
|
30
|
-
z-index: 1000;
|
31
|
-
border-top-left-radius: 17.5px;
|
32
|
-
border-top-right-radius: 17.5px;
|
33
|
-
height: 42vh;
|
34
|
-
max-height: 350px;
|
35
|
-
overflow-y: auto;
|
36
|
-
max-width: 420px;
|
37
|
-
margin: 0 auto;
|
38
|
-
}
|
39
|
-
.bottom-sheet.show {
|
40
|
-
bottom: 0;
|
41
|
-
}
|
42
|
-
.bottom-sheet h3 {
|
43
|
-
color: var(--primary-color);
|
44
|
-
margin-top: 0;
|
45
|
-
margin-bottom: 14px;
|
46
|
-
font-size: 16.8px;
|
47
|
-
}
|
48
|
-
.overlay {
|
49
|
-
display: none;
|
50
|
-
position: fixed;
|
51
|
-
top: 0;
|
52
|
-
left: 0;
|
53
|
-
right: 0;
|
54
|
-
bottom: 0;
|
55
|
-
background: rgba(0, 0, 0, 0.5);
|
56
|
-
z-index: 999;
|
57
|
-
}
|
58
|
-
.show {
|
59
|
-
display: block;
|
60
|
-
}
|
61
|
-
.form-group {
|
62
|
-
margin-bottom: 14px;
|
63
|
-
}
|
64
|
-
.form-group label {
|
65
|
-
display: block;
|
66
|
-
margin-bottom: 5.6px;
|
67
|
-
font-weight: bold;
|
68
|
-
font-size: 11.2px;
|
69
|
-
}
|
70
|
-
.form-group input {
|
71
|
-
width: 100%;
|
72
|
-
padding: 8.4px;
|
73
|
-
border: 1px solid var(--border-color);
|
74
|
-
border-radius: 2.8px;
|
75
|
-
font-size: 11.2px;
|
76
|
-
}
|
77
|
-
.add-field-button {
|
78
|
-
width: 100%;
|
79
|
-
padding: 10.5px;
|
80
|
-
font-size: 12.6px;
|
81
|
-
background-color: var(--primary-color);
|
82
|
-
color: white;
|
83
|
-
border: none;
|
84
|
-
border-radius: 2.8px;
|
85
|
-
cursor: pointer;
|
86
|
-
transition: background-color 0.3s ease;
|
87
|
-
}
|
88
|
-
.add-field-button:hover {
|
89
|
-
background-color: #3A7BC8;
|
90
|
-
}
|
91
|
-
.color-picker-container {
|
92
|
-
display: none;
|
93
|
-
margin-top: 7px;
|
94
|
-
}
|
95
|
-
#colorPicker {
|
96
|
-
-webkit-appearance: none;
|
97
|
-
border: none;
|
98
|
-
width: 100%;
|
99
|
-
height: 42px;
|
100
|
-
cursor: pointer;
|
101
|
-
border-radius: 2.8px;
|
102
|
-
}
|
103
|
-
#colorPicker::-webkit-color-swatch {
|
104
|
-
border: none;
|
105
|
-
border-radius: 2.8px;
|
106
|
-
}
|
107
|
-
</style>
|
108
|
-
|
109
|
-
<div id="overlay" class="overlay"></div>
|
110
|
-
<div class="bottom-sheet" id="addFieldSheet">
|
111
|
-
<h3>Add New Field</h3>
|
112
|
-
<form id="addFieldForm">
|
113
|
-
<div class="form-group">
|
114
|
-
<label for="fieldName">Field Name</label>
|
115
|
-
<input type="text" id="fieldName" name="fieldName" required>
|
116
|
-
</div>
|
117
|
-
<div class="form-group">
|
118
|
-
<label for="fieldValue">Field Value</label>
|
119
|
-
<input type="text" id="fieldValue" name="fieldValue" required>
|
120
|
-
<div class="color-picker-container">
|
121
|
-
<input type="color" id="colorPicker" name="colorPicker">
|
122
|
-
</div>
|
123
|
-
</div>
|
124
|
-
<button type="submit" class="add-field-button">Add Field</button>
|
125
|
-
</form>
|
126
|
-
</div>
|
127
|
-
`;
|
128
|
-
}
|
129
|
-
|
130
|
-
show(inputType, onSubmit) {
|
131
|
-
this.onSubmit = onSubmit;
|
132
|
-
this.inputType = inputType;
|
133
|
-
const fieldName = this.shadowRoot.querySelector('#fieldName');
|
134
|
-
const fieldValue = this.shadowRoot.querySelector('#fieldValue');
|
135
|
-
const colorPickerContainer = this.shadowRoot.querySelector('.color-picker-container');
|
136
|
-
|
137
|
-
fieldName.value = '';
|
138
|
-
fieldValue.value = '';
|
139
|
-
colorPickerContainer.style.display = inputType === 'color' ? 'block' : 'none';
|
140
|
-
|
141
|
-
this.addFieldSheet.style.display = 'block';
|
142
|
-
this.overlay.classList.add('show');
|
143
|
-
setTimeout(() => this.addFieldSheet.classList.add('show'), 10);
|
144
|
-
}
|
145
|
-
|
146
|
-
hideAddFieldForm() {
|
147
|
-
this.addFieldSheet.classList.remove('show');
|
148
|
-
this.overlay.classList.remove('show');
|
149
|
-
setTimeout(() => {
|
150
|
-
this.addFieldSheet.style.display = 'none';
|
151
|
-
}, 300);
|
152
|
-
}
|
153
|
-
|
154
|
-
handleSubmit(e) {
|
155
|
-
e.preventDefault();
|
156
|
-
const fieldName = this.shadowRoot.querySelector('#fieldName').value;
|
157
|
-
let defaultValue = this.shadowRoot.querySelector('#fieldValue').value;
|
158
|
-
|
159
|
-
if (this.inputType === 'color' && !defaultValue.startsWith('#')) {
|
160
|
-
defaultValue = '#' + defaultValue;
|
161
|
-
}
|
162
|
-
|
163
|
-
if (this.onSubmit) {
|
164
|
-
this.onSubmit(fieldName, defaultValue);
|
165
|
-
}
|
166
|
-
this.hideAddFieldForm();
|
167
|
-
}
|
168
|
-
|
169
|
-
updateFieldValue(event) {
|
170
|
-
const fieldValue = this.shadowRoot.querySelector('#fieldValue');
|
171
|
-
fieldValue.value = event.target.value;
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
customElements.define('add-field-sheet', AddFieldSheet);
|
@@ -1,73 +0,0 @@
|
|
1
|
-
class BrandConfigurationsManager
|
2
|
-
|
3
|
-
def initialize(brand_key)
|
4
|
-
@brand_key = brand_key
|
5
|
-
end
|
6
|
-
|
7
|
-
def template_with_key(key)
|
8
|
-
templates.select { |section| section[:key] === key }.first
|
9
|
-
end
|
10
|
-
|
11
|
-
def templates
|
12
|
-
[
|
13
|
-
{
|
14
|
-
key: 'brand_config.json',
|
15
|
-
name: 'Brand Configuration',
|
16
|
-
input_type: 'text',
|
17
|
-
path: FilePath.brand_config(@brand_key)
|
18
|
-
},
|
19
|
-
{
|
20
|
-
key: 'theme.json',
|
21
|
-
name: 'Theme Configuration',
|
22
|
-
input_type: 'color',
|
23
|
-
path: FilePath.brand_theme(@brand_key)
|
24
|
-
},
|
25
|
-
{
|
26
|
-
key: 'android_config.json',
|
27
|
-
name: 'Android Configuration',
|
28
|
-
input_type: 'text',
|
29
|
-
path: FilePath.android_brand_config(@brand_key)
|
30
|
-
},
|
31
|
-
{
|
32
|
-
key: 'android_signing.json',
|
33
|
-
name: 'Android Signing',
|
34
|
-
input_type: 'text',
|
35
|
-
path: FilePath.brand_signing(@brand_key, Platform::Android)
|
36
|
-
},
|
37
|
-
{
|
38
|
-
key: 'ios_config.json',
|
39
|
-
name: 'iOS Configuration',
|
40
|
-
input_type: 'text',
|
41
|
-
path: FilePath.ios_config(@brand_key)
|
42
|
-
},
|
43
|
-
{
|
44
|
-
key: 'ios_signing.json',
|
45
|
-
name: 'iOS Signing',
|
46
|
-
input_type: 'text',
|
47
|
-
path: FilePath.brand_signing(@brand_key, Platform::IOS)
|
48
|
-
}
|
49
|
-
]
|
50
|
-
end
|
51
|
-
|
52
|
-
def create
|
53
|
-
config_templates = templates
|
54
|
-
|
55
|
-
config_templates.map do |template|
|
56
|
-
create_config_item(
|
57
|
-
template[:key],
|
58
|
-
template[:name],
|
59
|
-
template[:input_type],
|
60
|
-
template[:path].tap { |p| File.expand_path(p) }
|
61
|
-
)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def create_config_item(key, name, input_type, path)
|
66
|
-
{
|
67
|
-
key: key,
|
68
|
-
name: name,
|
69
|
-
inputType: input_type,
|
70
|
-
content: JSON.parse(File.read(path)),
|
71
|
-
}
|
72
|
-
end
|
73
|
-
end
|