okai 0.0.45 → 0.0.46
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 +45 -18
- package/dist/ts-once.js +1 -1
- package/dist/ts-parser.js +45 -4
- package/dist/utils.js +142 -0
- package/package.json +1 -1
package/dist/icons.js
CHANGED
@@ -60,7 +60,7 @@ export const IconMap = {
|
|
60
60
|
/** Admin */
|
61
61
|
Dashboard: P + `viewBox='0 0 24 24' fill='none' stroke-width='1.5' stroke='currentColor'><path stroke-linecap='round' stroke-linejoin='round' d='M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25' /></svg>`,
|
62
62
|
Stats: S(`0 0 24 24`, `<path fill='currentColor' d='M8.143 15.857H5.57V9.43h2.572v6.428zm5.143 0h-2.572V3h2.572v12.857zm5.142 0h-2.571v-9h2.571v9z'/><path fill='currentColor' fill-rule='evenodd' d='M21 20.714H3v-2h18v2z' clip-rule='evenodd'/>`),
|
63
|
-
|
63
|
+
Log: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 12h8m-8 6h8M13 6h8M3 12h1m-1 6h1M3 6h1m4 6h1m-1 6h1M8 6h1'/>`),
|
64
64
|
Project: S(`0 0 24 24`, `<circle cx='12' cy='6' r='1' fill='currentColor'/><path fill='currentColor' d='M6 17h12v2H6zm4-5.17l2.792 2.794l3.932-3.935L18 12V8h-4l1.31 1.275l-2.519 2.519L10 9l-4 4l1.414 1.414z'/><path fill='currentColor' d='M19 3h-3.298a5 5 0 0 0-.32-.425l-.01-.012a4.43 4.43 0 0 0-2.89-1.518a2.6 2.6 0 0 0-.964 0a4.43 4.43 0 0 0-2.89 1.518l-.01.012a5 5 0 0 0-.32.424V3H5a3.003 3.003 0 0 0-3 3v14a3.003 3.003 0 0 0 3 3h14a3.003 3.003 0 0 0 3-3V6a3.003 3.003 0 0 0-3-3m1 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h4.55a2.5 2.5 0 0 1 4.9 0H19a1 1 0 0 1 1 1Z'/>`),
|
65
65
|
Task: S(`0 0 32 32`, `<path fill='currentColor' d='M10.293 5.293L7 8.586L5.707 7.293L4.293 8.707L7 11.414l4.707-4.707zM14 7v2h14V7zm0 8v2h14v-2zm0 8v2h14v-2z'/>`),
|
66
66
|
/** Security */
|
@@ -162,6 +162,7 @@ export const IconMap = {
|
|
162
162
|
Ticket: S('0 0 24 24', `<path fill='currentColor' d='M4 4a2 2 0 0 0-2 2v4a2 2 0 0 1 2 2a2 2 0 0 1-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2zm0 2h16v2.54c-1.24.71-2 2.03-2 3.46s.76 2.75 2 3.46V18H4v-2.54c1.24-.71 2-2.03 2-3.46s-.76-2.75-2-3.46z'/>`),
|
163
163
|
Favorite: S('0 0 24 24', `<path fill='currentColor' d='M12 2.5a1 1 0 0 1 .894.553l2.58 5.158l5.67.824a1 1 0 0 1 .554 1.706l-4.127 4.024l.928 5.674a1 1 0 0 1-1.455 1.044L12 18.807l-5.044 2.676a1 1 0 0 1-1.455-1.044l.928-5.674l-4.127-4.024a1 1 0 0 1 .554-1.706l5.67-.824l2.58-5.158A1 1 0 0 1 12 2.5m0 3.236l-1.918 3.836a1 1 0 0 1-.75.543l-4.184.608l3.05 2.973a1 1 0 0 1 .289.878L7.8 18.771l3.731-1.98a1 1 0 0 1 .938 0l3.731 1.98l-.687-4.197a1 1 0 0 1 .289-.877l3.05-2.974l-4.183-.608a1 1 0 0 1-.75-.543z'/>`),
|
164
164
|
Email: S('0 0 24 24', `<path fill='currentColor' d='M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2zm-2 0l-8 5l-8-5zm0 12H4V8l8 5l8-5z'/>`),
|
165
|
+
Inbox: S('0 0 24 24', `<path fill='currentColor' d='M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14v-3h-3q-.75.95-1.787 1.475T12 18t-2.212-.525T8 16H5zm7-3q.95 0 1.725-.55T14.8 14H19V5H5v9h4.2q.3.9 1.075 1.45T12 16m-7 3h14z'/>`),
|
165
166
|
News: S('0 0 20 20', `<path fill='currentColor' d='M3 6c0-1.1.9-2 2-2h8l4-4h2v16h-2l-4-4H5a2 2 0 0 1-2-2H1V6zm8 9v5H8l-1.67-5H5v-2h8v2z'/>`),
|
166
167
|
Search: S('0 0 24 24', `<path fill='currentColor' d='m19.6 21l-6.3-6.3q-.75.6-1.725.95T9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l6.3 6.3zM9.5 14q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14'/>`),
|
167
168
|
Save: S('0 0 24 24', `<path fill='currentColor' d='M7 19v-6h10v6h2V7.828L16.172 5H5v14zM4 3h13l4 4v13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m5 12v4h6v-4z'/>`),
|
@@ -194,34 +195,48 @@ export const IconMap = {
|
|
194
195
|
Rack: S(`0 0 36 36`, `<path fill='currentColor' d='M2 22h32v-8H2Zm8-5h14v2H10Zm-4 0h2v2H6Z' class='clr-i-solid clr-i-solid-path-1'/><path fill='currentColor' d='M32 4H4a2 2 0 0 0-2 2v6h32V6a2 2 0 0 0-2-2M8 9H6V7h2Zm16 0H10V7h14Z' class='clr-i-solid clr-i-solid-path-2'/><path fill='currentColor' d='M2 30a2 2 0 0 0 2 2h28a2 2 0 0 0 2-2v-6H2Zm8-3h14v2H10Zm-4 0h2v2H6Z' class='clr-i-solid clr-i-solid-path-3'/><path fill='none' d='M0 0h36v36H0z'/>`),
|
195
196
|
Sample: S(`0 0 256 256`, `<path fill='currentColor' d='M224 67.3a35.8 35.8 0 0 0-11.26-25.66c-14-13.28-36.72-12.78-50.62 1.13L138.8 66.2a24 24 0 0 0-33.14.77l-5 5a16 16 0 0 0 0 22.64l2 2.06l-51 51a39.75 39.75 0 0 0-10.53 38l-8 18.41A13.65 13.65 0 0 0 36 219.29a15.9 15.9 0 0 0 17.71 3.36L71.24 215a39.9 39.9 0 0 0 37.05-10.75l51-51l2.06 2.06a16 16 0 0 0 22.62 0l5-5a24 24 0 0 0 .74-33.18l23.75-23.87A35.75 35.75 0 0 0 224 67.3M138 152H70.07l44-44l33.94 34Z'/>`),
|
196
197
|
Kid: S(`0 0 24 24`, `<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' color='currentColor'><circle cx='12' cy='12' r='10'/><path d='M14 5.738s-1.115.5-1.898.119c-.956-.466-1.903-2.41-.01-3.857M8.009 9H8m8 0h-.009M8 15a5 5 0 0 0 4 2a5 5 0 0 0 4-2'/></g>`),
|
197
|
-
Class: S(`0 0 24 24`, `<g fill='currentColor'><path d='M3 3h18v4.385h-2V5H5v9h4.333v2H3z'/><path d='M12.684 10.287C13.558 11.212 14.303 12 16 12h2a2 2 0 0 1 2 2v1a2 2 0 0 1-1 1.732V22h-3v-8c-2.617 0-3.956-1.45-4.84-2.405a14 14 0 0 0-.367-.388l1.414-1.414q.249.25.477.494M19 9.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0'/></g>`),
|
198
198
|
Doctor: S(`0 0 24 24`, `<path fill='currentColor' d='M14.84 16.26C17.86 16.83 20 18.29 20 20v2H4v-2c0-1.71 2.14-3.17 5.16-3.74L12 21zM8 8h8v2a4 4 0 0 1-4 4a4 4 0 0 1-4-4zm0-1l.41-4.1a1 1 0 0 1 1-.9h5.19c.51 0 .94.39.99.9L16 7zm4-4h-1v1h-1v1h1v1h1V5h1V4h-1z'/>`),
|
199
199
|
Prescription: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 19V3h4.5a4.5 4.5 0 1 1 0 9H6m13 9l-9-9m3 9l6-6'/>`),
|
200
200
|
Card: S(`0 0 24 24`, `<path fill='currentColor' d='M2 4h20v16H2zm18 14V6H4v12z'/>`),
|
201
|
+
Column: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 5v14M9 5v14M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1'/>`),
|
202
|
+
Dock: S(`0 0 24 24`, `<path fill='currentColor' d='M12.707 3.293a1 1 0 0 0-1.414 0l-3.5 3.5a1 1 0 0 0 1.414 1.414L11 6.414V15a1 1 0 1 0 2 0V6.414l1.793 1.793a1 1 0 1 0 1.414-1.414zM4 12.75a.75.75 0 0 1 .75-.75H9a1 1 0 1 0 0-2H4.75A2.75 2.75 0 0 0 2 12.75v4.5A2.75 2.75 0 0 0 4.75 20h14.5A2.75 2.75 0 0 0 22 17.25v-4.5A2.75 2.75 0 0 0 19.25 10H15a1 1 0 1 0 0 2h4.25a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75H4.75a.75.75 0 0 1-.75-.75z'/>`),
|
203
|
+
Match: S(`0 0 24 24`, `<path fill='currentColor' d='M9 19.4q-2.025-.8-3.338-2.512T4.076 13H6.1q.225 1.325.975 2.425T9 17.2zm2 2.6v-9h4.5l1 1.5H22V22zM2 11V2h4.5l1 1.5H13V11zm16 1q0-1.625-.8-3.012T15 6.8V4.6q2.275.925 3.638 2.938T20 12z'/>`),
|
204
|
+
Education: S(`0 0 16 16`, `<path fill='none' stroke='currentColor' d='M12.5 6v5.5s-2.926 1-4.5 1s-4.5-1-4.5-1V6M14 5L8 2.5L2 5l6 3zm0 0v4.5' stroke-width='1'/>`),
|
205
|
+
Contract: S(`0 0 24 24`, `<path fill='currentColor' d='M11.846 21H6q-.846 0-1.423-.577T4 19v-2.77h3V3h13v6.577l-1 1V4H8v12.23h5.346l-1.5 1.5zm2.385 0v-2.21l5.96-5.934l2.184 2.21L16.441 21zm-4.846-9.846v-1h8.23v1zm0-2.77v-1h8.23v1zm10.806 7.632l.925-.956l-.925-.944l-.95.95z'/>`),
|
206
|
+
Agent: S(`0 0 24 24`, `<circle cx='9' cy='13' r='1' fill='currentColor'/><circle cx='15' cy='13' r='1' fill='currentColor'/><path fill='currentColor' d='M18 11.03A6.04 6.04 0 0 0 12.05 6c-3.03 0-6.29 2.51-6.03 6.45a8.07 8.07 0 0 0 4.86-5.89c1.31 2.63 4 4.44 7.12 4.47'/><path fill='currentColor' d='M20.99 12c-.11-5.37-4.31-9-8.99-9c-4.61 0-8.85 3.53-8.99 9H2v6h3v-5.81c0-3.83 2.95-7.18 6.78-7.29a7.007 7.007 0 0 1 7.22 7V19h-8v2h10v-3h1v-6z'/>`),
|
207
|
+
Key: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-width='2' d='M10 13v3h3v3h3v2l2 2h5v-4L12.74 8.74C12.91 8.19 13 7.6 13 7c0-3.31-2.69-6-6-6S1 3.69 1 7a6.005 6.005 0 0 0 8.47 5.47zM6 7a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z'/>`),
|
208
|
+
Complaint: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16.996 9.013h.008m0-2.004V4.505M22 6.792c0 2.646-2.24 4.792-5.004 4.792q-.488 0-.968-.09c-.23-.043-.344-.064-.425-.052c-.08.012-.194.072-.42.194a3.25 3.25 0 0 1-2.114.329c.274-.338.46-.743.543-1.177c.05-.265-.074-.523-.26-.712a4.67 4.67 0 0 1-1.36-3.284c0-2.646 2.24-4.792 5.004-4.792S22 4.146 22 6.792M7.502 22H4.718c-.323 0-.648-.046-.945-.173c-.966-.415-1.457-.964-1.685-1.307a.54.54 0 0 1 .03-.631c1.12-1.488 3.716-2.386 5.384-2.386M7.507 22h2.783c.324 0 .648-.046.945-.173c.967-.415 1.457-.964 1.686-1.307a.54.54 0 0 0-.03-.631c-1.12-1.488-3.716-2.386-5.384-2.386m2.778-5.214a2.776 2.776 0 0 1-2.778 2.772a2.776 2.776 0 0 1-2.78-2.772a2.776 2.776 0 0 1 2.78-2.773a2.776 2.776 0 0 1 2.778 2.773' color='currentColor'/>`),
|
209
|
+
Cart: S(`0 0 24 24`, `<g fill='none'><circle cx='7.5' cy='18.5' r='1.5' fill='currentColor'/><circle cx='16.5' cy='18.5' r='1.5' fill='currentColor'/><path stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 5h2l.6 3m0 0L7 15h10l2-7z'/></g>`),
|
210
|
+
Genre: S(`0 0 24 24`, `<path fill='currentColor' d='M10 18q1.25 0 2.125-.875T13 15V8h3V6h-4.5v6.4q-.35-.2-.725-.3T10 12q-1.25 0-2.125.875T7 15t.875 2.125T10 18m2 4q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22'/>`),
|
211
|
+
Signature: S(`0 0 24 24`, `<path fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M22 12.634c-4 3.512-4.572-2.013-6.65-1.617c-2.35.447-3.85 5.428-2.35 5.428s-.5-5.945-2.5-3.89s-2.64 4.74-4.265 2.748C-1.5 5.813 5-1.15 8.163 3.457C10.165 6.373 6.5 16.977 2 22m7-1h10' color='currentColor'/>`),
|
201
212
|
/** Actions */
|
202
213
|
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'/>`),
|
203
214
|
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'/>`),
|
215
|
+
Paginate: S(`0 0 24 24`, `<path fill='currentColor' d='m7 18l-1.4-1.4l4.6-4.6l-4.6-4.6L7 6l6 6zm9 0V6h2v12z'/>`),
|
204
216
|
};
|
205
217
|
export const IconGroups = {
|
206
218
|
User: ['AppUser', 'Author'],
|
207
|
-
Contact: ['Customer', 'Client', 'Manager', 'Employee', 'Applicant', 'Candidate', 'Staff'],
|
208
|
-
|
209
|
-
|
219
|
+
Contact: ['Customer', 'Client', 'Manager', 'Employee', 'Applicant', 'Candidate', 'Staff', 'Counselor'],
|
220
|
+
Guest: ['Individual', 'Person', 'Single'],
|
221
|
+
Anon: ['Counterparty', 'Personal', 'Participant'],
|
222
|
+
Company: ['Organization', 'Conference', 'City', 'Warehouse', 'Vendor'],
|
210
223
|
Account: ['Profile'],
|
211
224
|
Team: ['Collab', 'Collaboration', 'Role'],
|
225
|
+
Signup: ['Survey', 'Questionnaire', 'Agreement', 'Registration'],
|
212
226
|
Region: ['Country', 'State', 'Province', 'Capital'],
|
213
|
-
Lock: ['Security', 'Padlock', 'Secure', 'Permission'],
|
227
|
+
Lock: ['Security', 'Padlock', 'Secure', 'Permission', 'Auth'],
|
214
228
|
Location: ['Address', 'JobLocation'],
|
215
|
-
Time: ['TimeSlot', 'DateRange'],
|
216
|
-
Feature: ['Amenity'],
|
217
|
-
Application: ['JobApplication', 'Patient'],
|
229
|
+
Time: ['TimeSlot', 'DateRange', 'Shift', 'TourDate'],
|
230
|
+
Feature: ['Amenity', 'Claim'],
|
231
|
+
Application: ['JobApplication', 'Patient', 'Resume'],
|
218
232
|
Project: ['Campaign'],
|
219
233
|
Listing: ['List', 'JobListing', 'Attribute', 'Set'],
|
220
234
|
Check: ['Require'],
|
221
235
|
Screening: ['PhoneScreen'],
|
222
236
|
Interview: ['Communication'],
|
223
237
|
Artifact: ['Media', 'Image', 'Photo', 'Picture'],
|
224
|
-
Booking: ['Appointment', 'Reservation', 'Schedule', 'Availability'],
|
238
|
+
Booking: ['Appointment', 'Reservation', 'Schedule', 'Availability', 'Calendar'],
|
239
|
+
Room: ['Meeting', 'Conference'],
|
225
240
|
Product: ['Sku', 'Item', 'Restock', 'Stock'],
|
226
241
|
Order: ['Invoice'],
|
227
242
|
LineItem: ['InvoiceItem'],
|
@@ -232,9 +247,9 @@ export const IconGroups = {
|
|
232
247
|
Approve: ['Approval'],
|
233
248
|
Refund: ['Return', 'Reimburse'],
|
234
249
|
Library: ['Module'],
|
235
|
-
Page: ['Article', 'Document'],
|
250
|
+
Page: ['Article', 'Document', 'Recipe', 'Info', 'Quote'],
|
236
251
|
Policy: ['Privacy', 'CompanyPolicy'],
|
237
|
-
Gift: ['Benefit', 'Service', 'Share', 'Sharing', 'Reward', 'Discount'],
|
252
|
+
Gift: ['Benefit', 'Service', 'Share', 'Sharing', 'Reward', 'Discount', 'Donation', 'GiftCard', 'Testimony', 'Testimonial'],
|
238
253
|
Deduct: ['Deduction'],
|
239
254
|
Tax: ['Taxes'],
|
240
255
|
Tag: ['Label'],
|
@@ -246,20 +261,20 @@ export const IconGroups = {
|
|
246
261
|
HtmlFormat: ['RichHtml'],
|
247
262
|
Alert: ['Notification'],
|
248
263
|
Enroll: ['Enrollment', 'Lesson', 'Access'],
|
249
|
-
Actual: ['Request'],
|
264
|
+
Actual: ['Request', 'Position'],
|
250
265
|
Pay: ['Paystub'],
|
251
266
|
Post: ['Posting'],
|
252
267
|
Content: ['Website', 'Blog', 'Template', 'LandingPage', 'Portal', 'Workspace', 'Layout'],
|
253
268
|
Menu: ['Nav', 'Form', 'MenuList', 'Section'],
|
254
269
|
Skill: ['Qualification', 'Certification', 'Experience', 'Training', 'Requirement', 'Bid'],
|
255
|
-
Analytics: ['Level', 'Metric', 'Kpi', 'Goal', 'Objective', 'Chart', 'Finance', 'Analysis'],
|
270
|
+
Analytics: ['Level', 'Metric', 'Kpi', 'Goal', 'Objective', 'Chart', 'Finance', 'Analysis', 'Financial', 'Nasdaq', 'Dow', 'Asx', 'Ndx', 'Snp', 'Nikkei'],
|
256
271
|
Review: ['Audit', 'Status'],
|
257
272
|
Comment: ['Feedback'],
|
258
273
|
Vote: ['Rating', 'Rank', 'Score', 'Priority'],
|
259
274
|
Favorite: ['Bookmark', 'Star', 'Gig'],
|
260
|
-
|
275
|
+
Log: ['Detail', 'Details', 'History', 'Record', 'Journal', 'Entry', 'Transaction', 'Trace'],
|
261
276
|
PlainText: ['Field'],
|
262
|
-
Ship: ['Shipment'],
|
277
|
+
Ship: ['Shipment', 'Boat', 'Cargo'],
|
263
278
|
Setting: ['Adjustment', 'Config', 'Configuration', 'Setup', 'Option'],
|
264
279
|
Activity: ['Movement'],
|
265
280
|
Attachment: ['File'],
|
@@ -279,11 +294,23 @@ export const IconGroups = {
|
|
279
294
|
Animal: ['Wildlife', 'Pet', 'Zoo'],
|
280
295
|
Step: ['Progress', 'Stage', 'Phase', 'Milestone'],
|
281
296
|
Mix: ['Blend', 'Combine', 'Merge', 'Mixture', 'Variant', 'Integration'],
|
282
|
-
Hotel: ['Venue'],
|
297
|
+
Hotel: ['Venue', 'Accommodation'],
|
298
|
+
Coupon: ['Tour', 'Promo', 'Promotion', 'Voucher'],
|
283
299
|
B: ['Brand'],
|
284
300
|
Kid: ['Kindergarten', 'Child', 'Children'],
|
285
|
-
Class: ['Course', 'Lesson', 'Training', 'Classroom', 'Curriculum'],
|
286
301
|
Card: ['Rectangle'],
|
302
|
+
Match: ['Matched', 'Matching'],
|
303
|
+
Source: ['Ingredient', 'Material'],
|
304
|
+
Course: ['Class', 'Classroom', 'Lesson', 'Training', 'Curriculum', 'Scholar', 'Professor', 'Teacher'],
|
305
|
+
Education: ['School', 'University', 'College', 'Institution', 'Academy', 'Study', 'Learning', 'Knowledge', 'Research', 'Science', 'Student', 'Pupil', 'Learner', 'Graduate', 'Alumni', 'Degree', 'Diploma', 'Certificate', 'Credential', 'Qualification', 'Syllabus'],
|
306
|
+
Quiz: ['Inquiry'],
|
307
|
+
Answer: ['Chat'],
|
308
|
+
Key: ['License', 'Token'],
|
309
|
+
Agent: ['Tenant'],
|
310
|
+
Paginate: ['Pagination'],
|
311
|
+
Supplier: ['Delivery'],
|
312
|
+
Cart: ['Shopping'],
|
313
|
+
Genre: ['Category', 'Music'],
|
287
314
|
};
|
288
315
|
export const Icons = withAliases(IconMap, IconGroups);
|
289
316
|
const IconKeys = Object.keys(Icons).sort((a, b) => b.length - a.length);
|
package/dist/ts-once.js
CHANGED
@@ -166,7 +166,7 @@ export function addCustomInputs(cls) {
|
|
166
166
|
"price", "cost", "total", "salary", "balance", "tax", "fee"
|
167
167
|
];
|
168
168
|
for (const prop of cls.properties ?? []) {
|
169
|
-
if (currencyTypeProps.some(x => prop.name.toLowerCase().includes(x))) {
|
169
|
+
if (currencyTypeProps.some(x => prop.name.toLowerCase().includes(x)) && (prop.type === 'number' || prop.type === 'decimal' || prop.type === 'double')) {
|
170
170
|
if (!prop.annotations)
|
171
171
|
prop.annotations = [];
|
172
172
|
prop.annotations.push({
|
package/dist/ts-parser.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { lastLeftPart, lastRightPart, leftPart, rightPart, trimEnd, trimStart } from "./utils.js";
|
1
|
+
import { lastLeftPart, lastRightPart, leftPart, parseJsObject, rightPart, trimEnd, trimStart } from "./utils.js";
|
2
2
|
export class TypeScriptParser {
|
3
3
|
static CONFIG_TYPE_PATTERN = /export\s+type\s+Config\s*=\s*{([^}]+)}/;
|
4
4
|
static CONFIG_PROPERTY_PATTERN = /(\w+)\s*:\s*("[^"]*"|'[^']*')/g;
|
@@ -352,7 +352,9 @@ export class TypeScriptParser {
|
|
352
352
|
this.classes = [];
|
353
353
|
this.interfaces = [];
|
354
354
|
this.enums = [];
|
355
|
-
|
355
|
+
let src = sourceCode;
|
356
|
+
src = convertJsDocComments(src);
|
357
|
+
src = removeMultilineComments(src);
|
356
358
|
// const src = sourceCode
|
357
359
|
this.parseConfigType(src);
|
358
360
|
this.parseDefaultExport(src);
|
@@ -390,8 +392,7 @@ export function parseAnnotation(annotation) {
|
|
390
392
|
// Parse each argument
|
391
393
|
const parsedArgs = rawArgs.map(arg => {
|
392
394
|
if (arg.startsWith('{')) {
|
393
|
-
|
394
|
-
return (new Function(`return ${arg}`))();
|
395
|
+
return parseJsObject(arg);
|
395
396
|
}
|
396
397
|
else if (arg.startsWith('"') || arg.startsWith("'") || arg.startsWith("`")) {
|
397
398
|
// Parse strings
|
@@ -416,6 +417,7 @@ export function parseAnnotation(annotation) {
|
|
416
417
|
return to;
|
417
418
|
}
|
418
419
|
catch (e) {
|
420
|
+
console.log('Failed to parse annotation:', e);
|
419
421
|
return null;
|
420
422
|
}
|
421
423
|
}
|
@@ -563,3 +565,42 @@ export function removeMultilineComments(src) {
|
|
563
565
|
}
|
564
566
|
return result;
|
565
567
|
}
|
568
|
+
export function convertJsDocComments(src) {
|
569
|
+
if (!src || !src.includes('/*')) {
|
570
|
+
return src;
|
571
|
+
}
|
572
|
+
let result = src;
|
573
|
+
// Convert multi-line JSDoc block comments (/**...*/)
|
574
|
+
result = result.replace(/\/\*\*[\s\n]+(\s*\*[\s\n]+.*?[\s\n]+)*?\s*\*\//gs, (match, _, offset) => {
|
575
|
+
// Find the indentation level of the line that contains or follows the comment
|
576
|
+
const lines = src.substring(0, offset + match.length).split('\n');
|
577
|
+
const commentEndLineIndex = lines.length - 1;
|
578
|
+
const nextLineIndex = commentEndLineIndex + 1;
|
579
|
+
// Try to find the indentation from the line following the comment
|
580
|
+
let indent = '';
|
581
|
+
if (nextLineIndex < src.split('\n').length) {
|
582
|
+
const nextLine = src.split('\n')[nextLineIndex];
|
583
|
+
const nextLineIndent = nextLine.match(/^(\s*)/)?.[1] || '';
|
584
|
+
indent = nextLineIndent;
|
585
|
+
}
|
586
|
+
else {
|
587
|
+
// Fallback to the first non-empty line in the comment
|
588
|
+
const firstLine = match.split('\n').find(line => line.trim() !== '');
|
589
|
+
indent = firstLine?.match(/^(\s*)/)?.[1] || '';
|
590
|
+
}
|
591
|
+
// Process each line of the comment, ensuring consistent indentation for all lines
|
592
|
+
const commentLines = match.split('\n')
|
593
|
+
.slice(1, -1) // Remove first (/**) and last (*/) lines
|
594
|
+
.map(line => {
|
595
|
+
// Remove * prefix from each line and convert to // comment
|
596
|
+
const content = line.replace(/^\s*\*\s?/, '').trimEnd();
|
597
|
+
return content.length > 0 ? `${indent}// ${content}` : `${indent}//`;
|
598
|
+
});
|
599
|
+
return commentLines.join('\n');
|
600
|
+
});
|
601
|
+
// Convert single-line JSDoc comments (/** ... */)
|
602
|
+
result = result.replace(/\/\*\*\s+(.*?)\s+\*\//g, '// $1');
|
603
|
+
// Convert inline JSDoc comments after statements
|
604
|
+
result = result.replace(/(.+?)\s+\/\*\*\s+(.*?)\s+\*\//g, '$1 // $2');
|
605
|
+
return result;
|
606
|
+
}
|
package/dist/utils.js
CHANGED
@@ -278,3 +278,145 @@ export function withAliases(icons, aliases) {
|
|
278
278
|
});
|
279
279
|
return result;
|
280
280
|
}
|
281
|
+
export function isCloudflareWorker() {
|
282
|
+
// Use a safe approach that works at both build and runtime
|
283
|
+
// Check for Worker-specific globals without directly referencing types
|
284
|
+
// that would cause build errors
|
285
|
+
const hasWorkerAPIs = typeof self !== 'undefined' &&
|
286
|
+
typeof caches !== 'undefined' &&
|
287
|
+
typeof addEventListener !== 'undefined' &&
|
288
|
+
'fetch' in self;
|
289
|
+
// Check for Node-specific features safely
|
290
|
+
const hasNodeFeatures = () => {
|
291
|
+
try {
|
292
|
+
// Check for global object without direct reference
|
293
|
+
return typeof globalThis !== 'undefined' &&
|
294
|
+
// Check for process without direct reference that would error in CF
|
295
|
+
!!globalThis.process;
|
296
|
+
}
|
297
|
+
catch {
|
298
|
+
return false;
|
299
|
+
}
|
300
|
+
};
|
301
|
+
// Check for service worker context safely
|
302
|
+
const isServiceWorkerContext = () => {
|
303
|
+
try {
|
304
|
+
return typeof self !== 'undefined' &&
|
305
|
+
self.constructor.name === 'ServiceWorkerGlobalScope';
|
306
|
+
}
|
307
|
+
catch {
|
308
|
+
return false;
|
309
|
+
}
|
310
|
+
};
|
311
|
+
// Return true if we have Worker indicators and don't have Node indicators
|
312
|
+
return hasWorkerAPIs && isServiceWorkerContext() && !hasNodeFeatures();
|
313
|
+
}
|
314
|
+
export function parseJsObject(js) {
|
315
|
+
if (isCloudflareWorker()) {
|
316
|
+
return safeJsObject(js);
|
317
|
+
}
|
318
|
+
// Parse object literals
|
319
|
+
try {
|
320
|
+
return (new Function(`return ${js}`))();
|
321
|
+
}
|
322
|
+
catch (e) {
|
323
|
+
// Cloudflare workers don't support eval or new Function
|
324
|
+
return safeJsObject(js);
|
325
|
+
}
|
326
|
+
}
|
327
|
+
export function safeJsObject(jsStr) {
|
328
|
+
let result = '';
|
329
|
+
let i = 0;
|
330
|
+
// State tracking
|
331
|
+
let inString = false;
|
332
|
+
let quoteType = null; // ' or "
|
333
|
+
let depth = 0;
|
334
|
+
const peek = (n = 1) => i + n < jsStr.length ? jsStr[i + n] : '';
|
335
|
+
while (i < jsStr.length) {
|
336
|
+
const char = jsStr[i];
|
337
|
+
const nextChar = peek();
|
338
|
+
const prevChar = i > 0 ? jsStr[i - 1] : '';
|
339
|
+
// Handle string boundaries
|
340
|
+
if ((char === '"' || char === "'") && prevChar !== '\\') {
|
341
|
+
if (!inString) {
|
342
|
+
// Starting a string
|
343
|
+
inString = true;
|
344
|
+
quoteType = char;
|
345
|
+
result += '"'; // Always use double quotes for JSON
|
346
|
+
}
|
347
|
+
else if (char === quoteType) {
|
348
|
+
// Ending a string
|
349
|
+
inString = false;
|
350
|
+
quoteType = null;
|
351
|
+
result += '"';
|
352
|
+
}
|
353
|
+
else {
|
354
|
+
// A quote character inside a string of a different type
|
355
|
+
result += char;
|
356
|
+
}
|
357
|
+
i++;
|
358
|
+
continue;
|
359
|
+
}
|
360
|
+
// Handle escaped characters in strings
|
361
|
+
if (inString && char === '\\') {
|
362
|
+
if (nextChar === quoteType) {
|
363
|
+
// Convert escaped quote to JSON format
|
364
|
+
result += '\\"';
|
365
|
+
i += 2;
|
366
|
+
continue;
|
367
|
+
}
|
368
|
+
else {
|
369
|
+
// Pass through other escape sequences
|
370
|
+
result += char;
|
371
|
+
i++;
|
372
|
+
continue;
|
373
|
+
}
|
374
|
+
}
|
375
|
+
// When not in a string, handle object/array syntax
|
376
|
+
if (!inString) {
|
377
|
+
// Track nesting depth
|
378
|
+
if (char === '{' || char === '[') {
|
379
|
+
depth++;
|
380
|
+
result += char;
|
381
|
+
i++;
|
382
|
+
continue;
|
383
|
+
}
|
384
|
+
else if (char === '}' || char === ']') {
|
385
|
+
depth--;
|
386
|
+
result += char;
|
387
|
+
i++;
|
388
|
+
continue;
|
389
|
+
}
|
390
|
+
// Handle property keys - match unquoted keys followed by colon
|
391
|
+
if (depth > 0 && /[a-zA-Z0-9_$]/.test(char)) {
|
392
|
+
let keyBuffer = '';
|
393
|
+
let j = i;
|
394
|
+
// Collect the potential key name
|
395
|
+
while (j < jsStr.length && /[a-zA-Z0-9_$]/.test(jsStr[j])) {
|
396
|
+
keyBuffer += jsStr[j];
|
397
|
+
j++;
|
398
|
+
}
|
399
|
+
// Skip whitespace
|
400
|
+
let k = j;
|
401
|
+
while (k < jsStr.length && /\s/.test(jsStr[k]))
|
402
|
+
k++;
|
403
|
+
// If followed by a colon, it's a property key
|
404
|
+
if (k < jsStr.length && jsStr[k] === ':') {
|
405
|
+
result += `"${keyBuffer}"`; // Add quoted key to result
|
406
|
+
i = k; // Move to the colon position
|
407
|
+
continue;
|
408
|
+
}
|
409
|
+
}
|
410
|
+
}
|
411
|
+
// Default: add character to result
|
412
|
+
result += char;
|
413
|
+
i++;
|
414
|
+
}
|
415
|
+
// Validate and return
|
416
|
+
try {
|
417
|
+
return JSON.parse(result);
|
418
|
+
}
|
419
|
+
catch (e) {
|
420
|
+
throw new Error(`Failed to produce valid JSON: ${e.message}`);
|
421
|
+
}
|
422
|
+
}
|