okai 0.0.42 → 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 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>`;
@@ -195,8 +183,11 @@ export const IconMap = {
195
183
  Help: S(`0 0 24 24`, `<path fill='currentColor' d='M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8s-8-3.589-8-8s3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10s10-4.477 10-10S17.523 2 12 2m4 8a4 4 0 0 0-8 0h2c0-1.103.897-2 2-2s2 .897 2 2s-.897 2-2 2a1 1 0 0 0-1 1v2h2v-1.141A3.99 3.99 0 0 0 16 10m-3 6h-2v2h2z'/>`),
196
184
  Watch: S(`0 0 24 24`, `<path fill='currentColor' d='M11 6h2v7h-2zM9 20a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-5l2-9h4v7a1 1 0 0 1-1 1zm1-15H7V3h3zm5 15v-6a1 1 0 0 1-1-1V6h4l2 9v5a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1M14 5V3h3v2z'/>`),
197
185
  Food: S(`0 0 24 24`, `<path fill='currentColor' d='M18.06 23h1.66c.84 0 1.53-.65 1.63-1.47L23 5.05h-5V1h-1.97v4.05h-4.97l.3 2.34c1.71.47 3.31 1.32 4.27 2.26c1.44 1.42 2.43 2.89 2.43 5.29zM1 22v-1h15.03v1c0 .54-.45 1-1.03 1H2c-.55 0-1-.46-1-1m15.03-7C16.03 7 1 7 1 15zM1 17h15v2H1z'/>`),
186
+ Docker: S(`0 0 24 24`, `<path fill='currentColor' d='M12.988 11.321h-2.035V9.448h2.035zm0-6.363h-2.035v1.906h2.035zm2.455 4.554h-2.035v1.842h2.035zM10.566 7.22H8.53v1.873h2.034zm2.422 0h-2.035v1.873h2.035zm8.689 3.133c-.452-.323-1.486-.42-2.261-.258c-.097-.775-.55-1.421-1.26-2.003l-.452-.258l-.258.452c-.55.872-.743 2.326-.13 3.262a3.4 3.4 0 0 1-1.485.356H2.07c-.259 1.582.193 3.682 1.356 5.103c1.13 1.357 2.907 2.035 5.168 2.035c4.91 0 8.592-2.26 10.272-6.395c.646 0 2.132 0 2.875-1.422c.032-.032.226-.42.258-.549zm-15.989-.84H3.621v1.842h2.035V9.512zm2.423 0H6.076v1.842H8.11zm2.454 0H8.532v1.842h2.034zM8.111 7.22H6.076v1.873H8.11z'/>`),
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'/>`),
198
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'/>`),
199
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'/>`),
200
191
  /** Actions */
201
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'/>`),
202
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'/>`),
@@ -208,7 +199,7 @@ export const IconGroups = {
208
199
  Account: ['Profile'],
209
200
  Team: ['Collab', 'Collaboration', 'Role'],
210
201
  Region: ['Country', 'State', 'Province', 'Capital'],
211
- Lock: ['Security', 'Padlock', 'Secure'],
202
+ Lock: ['Security', 'Padlock', 'Secure', 'Permission'],
212
203
  Location: ['Address', 'JobLocation'],
213
204
  Time: ['TimeSlot', 'DateRange'],
214
205
  Feature: ['Amenity'],
@@ -217,15 +208,16 @@ export const IconGroups = {
217
208
  Listing: ['List', 'JobListing'],
218
209
  Check: ['Require'],
219
210
  Screening: ['PhoneScreen'],
220
- Artifact: ['Media'],
221
- Booking: ['Appointment', 'Reservation', 'Schedule'],
211
+ Interview: ['Communication'],
212
+ Artifact: ['Media', 'Image', 'Photo', 'Picture'],
213
+ Booking: ['Appointment', 'Reservation', 'Schedule', 'Availability'],
222
214
  Product: ['Sku', 'Item', 'Restock', 'Stock'],
223
215
  Order: ['Invoice'],
224
216
  LineItem: ['InvoiceItem'],
225
217
  Opportunity: ['Lead', 'Deal'],
226
218
  Connect: ['Interaction', 'Api'],
227
219
  Conversion: ['Convert'],
228
- Expense: ['Cost', 'Price', 'Amount', 'Salary'],
220
+ Expense: ['Cost', 'Price', 'Amount', 'Salary', 'Bill'],
229
221
  Approve: ['Approval'],
230
222
  Refund: ['Return', 'Reimburse'],
231
223
  Library: ['Module'],
@@ -253,7 +245,7 @@ export const IconGroups = {
253
245
  Review: ['Audit', 'Status'],
254
246
  Comment: ['Feedback'],
255
247
  Vote: ['Rating', 'Rank', 'Score', 'Priority'],
256
- Favorite: ['Bookmark', 'Star'],
248
+ Favorite: ['Bookmark', 'Star', 'Gig'],
257
249
  Logs: ['Detail', 'Details', 'History', 'Log', 'Record', 'Journal', 'Entry', 'Transaction', 'Trace'],
258
250
  PlainText: ['Field'],
259
251
  Ship: ['Shipment'],
@@ -262,6 +254,7 @@ export const IconGroups = {
262
254
  Attachment: ['File'],
263
255
  News: ['Announcement'],
264
256
  Data: ['Database'],
257
+ Sales: ['Merchant'],
265
258
  Channel: ['Stream', 'Broadcast', 'Feed', 'Session'],
266
259
  Search: ['Filter', 'Lookup', 'Query', 'Match'],
267
260
  Save: ['Saved', 'Archive', 'Backup', 'Download', 'Export'],
@@ -270,9 +263,12 @@ export const IconGroups = {
270
263
  Range: ['Span', 'Exchange'],
271
264
  Translate: ['Translation', 'Localization', 'Language'],
272
265
  Portfolio: ['Holding'],
273
- Tool: ['Maintenance', 'Support'],
266
+ Tool: ['Maintenance', 'Support', 'Equipment', 'Build', 'Inverter'],
274
267
  Watch: ['Sight', 'Sighting', 'View', 'Watchlist'],
275
268
  Animal: ['Wildlife', 'Pet', 'Zoo'],
269
+ Step: ['Progress', 'Stage', 'Phase', 'Milestone'],
270
+ Mix: ['Blend', 'Combine', 'Merge', 'Mixture'],
271
+ Hotel: ['Venue'],
276
272
  };
277
273
  export const Icons = withAliases(IconMap, IconGroups);
278
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
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "okai",
3
3
  "type": "module",
4
- "version": "0.0.42",
4
+ "version": "0.0.44",
5
5
  "bin": "./dist/okai.js",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",