okai 0.0.43 → 0.0.44
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/icons.js +10 -18
- package/dist/utils.js +12 -0
- package/package.json +1 -1
package/dist/icons.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { splitCase } from './utils.js';
|
1
|
+
import { splitCase, withAliases } from './utils.js';
|
2
2
|
export function getIcon(type) {
|
3
3
|
const words = splitCase(type).split(' ');
|
4
4
|
const candidates = generateCombinations(words).map(x => x.toLowerCase());
|
@@ -41,18 +41,6 @@ export function generateCombinations(words) {
|
|
41
41
|
});
|
42
42
|
return ret;
|
43
43
|
}
|
44
|
-
function withAliases(icons, aliases) {
|
45
|
-
const result = {};
|
46
|
-
Object.keys(icons).forEach(name => {
|
47
|
-
result[name.toLowerCase()] = icons[name].replaceAll('"', `'`);
|
48
|
-
});
|
49
|
-
Object.keys(aliases).forEach(name => {
|
50
|
-
for (const alias of aliases[name]) {
|
51
|
-
result[alias.toLowerCase()] = icons[name].replaceAll('"', `'`);
|
52
|
-
}
|
53
|
-
});
|
54
|
-
return result;
|
55
|
-
}
|
56
44
|
const P = `<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' `;
|
57
45
|
function S(viewbox, body) {
|
58
46
|
return P + `viewBox='${viewbox}'>${body}</svg>`;
|
@@ -199,6 +187,7 @@ export const IconMap = {
|
|
199
187
|
Step: S(`0 0 24 24`, `<path fill='currentColor' d='M19 15q-1.275 0-2.137-.862T16 12t.863-2.137T19 9t2.138.863T22 12t-.862 2.138T19 15M9 17l-1.4-1.425L10.175 13H2v-2h8.175L7.6 8.4L9 7l5 5z'/>`),
|
200
188
|
Animal: S(`0 0 20 20`, `<path fill='currentColor' d='M5.5 4.25c0-1.168.826-2.25 2-2.25s2 1.082 2 2.25s-.826 2.25-2 2.25s-2-1.082-2-2.25M3 4.5c-1.174 0-2 1.082-2 2.25S1.826 9 3 9s2-1.082 2-2.25S4.174 4.5 3 4.5m12 2.25c0-1.168.826-2.25 2-2.25s2 1.082 2 2.25S18.174 9 17 9s-2-1.082-2-2.25m-4.5-2.5c0-1.168.826-2.25 2-2.25s2 1.082 2 2.25s-.826 2.25-2 2.25s-2-1.082-2-2.25M4 14a6 6 0 0 1 12 0c0 .986-.504 1.753-1.21 2.255c-.697.495-1.601.745-2.485.745h-4.61c-.884 0-1.788-.25-2.484-.745C4.504 15.753 4 14.986 4 14'/>`),
|
201
189
|
Mix: S(`0 0 512 512`, `<path fill='currentColor' fill-rule='evenodd' d='m269.264 271.083l70.256 70.25l56.966-.001l-27.57-27.58l30.17-30.17l79.084 79.084l-79.085 79.085l-30.17-30.17L396.487 384H321.83l-82.745-82.74zM399.085 70.248l79.085 79.085l-79.085 79.085l-30.17-30.17l27.572-27.582H339.52L126.17 384H42.667v-42.667h65.813L321.83 128l74.657-.001l-27.572-27.581zM126.17 128l82.745 82.739l-30.179 30.177l-70.256-70.25H42.667V128z'/>`),
|
190
|
+
Solar: S(`0 0 24 24`, `<path fill='currentColor' d='M3.33 16H11v-3H4zM13 16h7.67L20 13h-7zm8.11 2H13v4h9zM2 22h9v-4H2.89zm9-14h2v3h-2zm4.76-.79l1.42-1.42l2.12 2.12l-1.41 1.42zm-11.05.7l2.12-2.12l1.41 1.42l-2.12 2.12zM3 2h3v2H3zm15 0h3v2h-3zm-6 5c2.76 0 5-2.24 5-5H7c0 2.76 2.24 5 5 5'/>`),
|
202
191
|
/** Actions */
|
203
192
|
Completed: S(`0 0 2048 2048`, `<path fill='currentColor' d='M1024 0q141 0 272 36t244 104t207 160t161 207t103 245t37 272q0 141-36 272t-104 244t-160 207t-207 161t-245 103t-272 37q-141 0-272-36t-244-104t-207-160t-161-207t-103-245t-37-272q0-141 36-272t104-244t160-207t207-161T752 37t272-37m603 685l-136-136l-659 659l-275-275l-136 136l411 411z'/>`),
|
204
193
|
Failed: S(`0 0 2048 2048`, `<path fill='currentColor' d='M1024 0q141 0 272 36t244 104t207 160t161 207t103 245t37 272q0 141-36 272t-104 244t-160 207t-207 161t-245 103t-272 37q-141 0-272-36t-244-104t-207-160t-161-207t-103-245t-37-272q0-141 36-272t104-244t160-207t207-161T752 37t272-37m113 1024l342-342l-113-113l-342 342l-342-342l-113 113l342 342l-342 342l113 113l342-342l342 342l113-113z'/>`),
|
@@ -210,7 +199,7 @@ export const IconGroups = {
|
|
210
199
|
Account: ['Profile'],
|
211
200
|
Team: ['Collab', 'Collaboration', 'Role'],
|
212
201
|
Region: ['Country', 'State', 'Province', 'Capital'],
|
213
|
-
Lock: ['Security', 'Padlock', 'Secure'],
|
202
|
+
Lock: ['Security', 'Padlock', 'Secure', 'Permission'],
|
214
203
|
Location: ['Address', 'JobLocation'],
|
215
204
|
Time: ['TimeSlot', 'DateRange'],
|
216
205
|
Feature: ['Amenity'],
|
@@ -219,15 +208,16 @@ export const IconGroups = {
|
|
219
208
|
Listing: ['List', 'JobListing'],
|
220
209
|
Check: ['Require'],
|
221
210
|
Screening: ['PhoneScreen'],
|
211
|
+
Interview: ['Communication'],
|
222
212
|
Artifact: ['Media', 'Image', 'Photo', 'Picture'],
|
223
|
-
Booking: ['Appointment', 'Reservation', 'Schedule'],
|
213
|
+
Booking: ['Appointment', 'Reservation', 'Schedule', 'Availability'],
|
224
214
|
Product: ['Sku', 'Item', 'Restock', 'Stock'],
|
225
215
|
Order: ['Invoice'],
|
226
216
|
LineItem: ['InvoiceItem'],
|
227
217
|
Opportunity: ['Lead', 'Deal'],
|
228
218
|
Connect: ['Interaction', 'Api'],
|
229
219
|
Conversion: ['Convert'],
|
230
|
-
Expense: ['Cost', 'Price', 'Amount', 'Salary'],
|
220
|
+
Expense: ['Cost', 'Price', 'Amount', 'Salary', 'Bill'],
|
231
221
|
Approve: ['Approval'],
|
232
222
|
Refund: ['Return', 'Reimburse'],
|
233
223
|
Library: ['Module'],
|
@@ -255,7 +245,7 @@ export const IconGroups = {
|
|
255
245
|
Review: ['Audit', 'Status'],
|
256
246
|
Comment: ['Feedback'],
|
257
247
|
Vote: ['Rating', 'Rank', 'Score', 'Priority'],
|
258
|
-
Favorite: ['Bookmark', 'Star'],
|
248
|
+
Favorite: ['Bookmark', 'Star', 'Gig'],
|
259
249
|
Logs: ['Detail', 'Details', 'History', 'Log', 'Record', 'Journal', 'Entry', 'Transaction', 'Trace'],
|
260
250
|
PlainText: ['Field'],
|
261
251
|
Ship: ['Shipment'],
|
@@ -264,6 +254,7 @@ export const IconGroups = {
|
|
264
254
|
Attachment: ['File'],
|
265
255
|
News: ['Announcement'],
|
266
256
|
Data: ['Database'],
|
257
|
+
Sales: ['Merchant'],
|
267
258
|
Channel: ['Stream', 'Broadcast', 'Feed', 'Session'],
|
268
259
|
Search: ['Filter', 'Lookup', 'Query', 'Match'],
|
269
260
|
Save: ['Saved', 'Archive', 'Backup', 'Download', 'Export'],
|
@@ -272,11 +263,12 @@ export const IconGroups = {
|
|
272
263
|
Range: ['Span', 'Exchange'],
|
273
264
|
Translate: ['Translation', 'Localization', 'Language'],
|
274
265
|
Portfolio: ['Holding'],
|
275
|
-
Tool: ['Maintenance', 'Support', 'Equipment', 'Build'],
|
266
|
+
Tool: ['Maintenance', 'Support', 'Equipment', 'Build', 'Inverter'],
|
276
267
|
Watch: ['Sight', 'Sighting', 'View', 'Watchlist'],
|
277
268
|
Animal: ['Wildlife', 'Pet', 'Zoo'],
|
278
269
|
Step: ['Progress', 'Stage', 'Phase', 'Milestone'],
|
279
270
|
Mix: ['Blend', 'Combine', 'Merge', 'Mixture'],
|
271
|
+
Hotel: ['Venue'],
|
280
272
|
};
|
281
273
|
export const Icons = withAliases(IconMap, IconGroups);
|
282
274
|
const IconKeys = Object.keys(Icons).sort((a, b) => b.length - a.length);
|
package/dist/utils.js
CHANGED
@@ -266,3 +266,15 @@ export function isBinary(contentType) {
|
|
266
266
|
|| contentType.endsWith('octet-stream')
|
267
267
|
|| contentType.endsWith('compressed'));
|
268
268
|
}
|
269
|
+
export function withAliases(icons, aliases) {
|
270
|
+
const result = {};
|
271
|
+
Object.keys(icons).forEach(name => {
|
272
|
+
result[name.toLowerCase()] = icons[name].replaceAll('"', `'`);
|
273
|
+
});
|
274
|
+
Object.keys(aliases).forEach(name => {
|
275
|
+
for (const alias of aliases[name]) {
|
276
|
+
result[alias.toLowerCase()] = icons[name].replaceAll('"', `'`);
|
277
|
+
}
|
278
|
+
});
|
279
|
+
return result;
|
280
|
+
}
|