aetherx-dt-ui 0.1.6 → 0.1.7

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.
@@ -106,6 +106,12 @@ function getStylesContent() {
106
106
  const registryDir = getRegistryDir();
107
107
  return fs.readFileSync(path.join(registryDir, "styles", "base.css"), "utf-8");
108
108
  }
109
+ function getTableCellsContent() {
110
+ const registryDir = getRegistryDir();
111
+ const filePath = path.join(registryDir, "styles", "table-cells.css");
112
+ if (!fs.existsSync(filePath)) return "";
113
+ return fs.readFileSync(filePath, "utf-8");
114
+ }
109
115
  function getLibContent() {
110
116
  const registryDir = getRegistryDir();
111
117
  return fs.readFileSync(path.join(registryDir, "lib", "utils.ts"), "utf-8");
@@ -222,10 +228,6 @@ async function initCommand() {
222
228
  message: "Where should lib utils go?",
223
229
  initialValue: "src/lib",
224
230
  placeholder: "src/lib"
225
- }),
226
- agent: () => p.confirm({
227
- message: "Include AI agent documentation (AGENT.md)?",
228
- initialValue: true
229
231
  })
230
232
  },
231
233
  {
@@ -242,7 +244,7 @@ async function initCommand() {
242
244
  libDir: answers.libDir,
243
245
  stylesDir,
244
246
  installedComponents: [],
245
- agent: answers.agent
247
+ agent: true
246
248
  };
247
249
  const s = p.spinner();
248
250
  writeConfig(config);
@@ -255,6 +257,16 @@ async function initCommand() {
255
257
  "utf-8"
256
258
  );
257
259
  s.stop("base.css copied");
260
+ const tableCellsContent = getTableCellsContent();
261
+ if (tableCellsContent) {
262
+ s.start("Copying table-cells.css...");
263
+ fs.writeFileSync(
264
+ path.join(stylesPath, "table-cells.css"),
265
+ tableCellsContent,
266
+ "utf-8"
267
+ );
268
+ s.stop("table-cells.css copied");
269
+ }
258
270
  s.start("Copying lib/utils.ts...");
259
271
  const libPath = path.resolve(process.cwd(), answers.libDir);
260
272
  fs.mkdirSync(libPath, { recursive: true });
@@ -264,11 +276,9 @@ async function initCommand() {
264
276
  "utf-8"
265
277
  );
266
278
  s.stop("lib/utils.ts copied");
267
- if (answers.agent) {
268
- s.start("Creating AGENT.md...");
269
- createAgentMd();
270
- s.stop("AGENT.md created");
271
- }
279
+ s.start("Creating AGENT.md...");
280
+ createAgentMd();
281
+ s.stop("AGENT.md created");
272
282
  p.note(
273
283
  [
274
284
  `${pc.bold("Next steps:")}`,
@@ -454,6 +464,16 @@ async function updateCommand() {
454
464
  "utf-8"
455
465
  );
456
466
  s.stop("base.css updated");
467
+ const tableCellsContent = getTableCellsContent();
468
+ if (tableCellsContent) {
469
+ s.start("Updating table-cells.css...");
470
+ fs.writeFileSync(
471
+ path.join(stylesPath, "table-cells.css"),
472
+ tableCellsContent,
473
+ "utf-8"
474
+ );
475
+ s.stop("table-cells.css updated");
476
+ }
457
477
  s.start("Updating lib/utils.ts...");
458
478
  const libPath = path.resolve(process.cwd(), config.libDir);
459
479
  fs.mkdirSync(libPath, { recursive: true });
@@ -492,17 +512,15 @@ async function updateCommand() {
492
512
  }
493
513
  }
494
514
  }
495
- if (config.agent) {
496
- s.start("Rebuilding AGENT.md...");
497
- rebuildAgentMd(config);
498
- s.stop("AGENT.md rebuilt");
499
- }
515
+ s.start("Rebuilding AGENT.md...");
516
+ rebuildAgentMd(config);
517
+ s.stop("AGENT.md rebuilt");
500
518
  p.note(
501
519
  [
502
520
  `${pc.green("\u2713")} base.css \u2014 latest design tokens`,
503
521
  `${pc.green("\u2713")} lib/utils.ts \u2014 latest helpers`,
504
- config.agent ? `${pc.green("\u2713")} AGENT.md \u2014 rebuilt with current components` : ""
505
- ].filter(Boolean).join("\n"),
522
+ `${pc.green("\u2713")} AGENT.md \u2014 rebuilt with current components`
523
+ ].join("\n"),
506
524
  "Updated files"
507
525
  );
508
526
  p.outro(pc.green("dt-ui updated successfully!"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aetherx-dt-ui",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Lightweight, customizable Vue components for DT projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -23,6 +23,7 @@ type Locale = 'uz' | 'ru' | 'en'
23
23
  // Built-in i18n — shared across all 23 modules
24
24
  const i18n: Record<Locale, Record<string, string>> = {
25
25
  ru: {
26
+ profile: 'Профиль',
26
27
  appearance: 'Внешний вид',
27
28
  language: 'Язык',
28
29
  logout: 'Выйти',
@@ -31,6 +32,7 @@ const i18n: Record<Locale, Record<string, string>> = {
31
32
  systemTheme: 'Системная',
32
33
  },
33
34
  uz: {
35
+ profile: 'Profil',
34
36
  appearance: 'Tashqi ko\'rinish',
35
37
  language: 'Til',
36
38
  logout: 'Chiqish',
@@ -39,6 +41,7 @@ const i18n: Record<Locale, Record<string, string>> = {
39
41
  systemTheme: 'Tizim',
40
42
  },
41
43
  en: {
44
+ profile: 'Profile',
42
45
  appearance: 'Appearance',
43
46
  language: 'Language',
44
47
  logout: 'Logout',
@@ -149,6 +152,11 @@ onUnmounted(() => {
149
152
  document.removeEventListener('keydown', onKeydown)
150
153
  })
151
154
 
155
+ const openProfile = () => {
156
+ if (props.profileUrl) window.open(props.profileUrl, '_blank')
157
+ close()
158
+ }
159
+
152
160
  const onMenuItemClick = (item: DtProfileMenuItem) => {
153
161
  if (item.href) {
154
162
  window.open(item.href, '_blank')
@@ -186,12 +194,12 @@ const onMenuItemClick = (item: DtProfileMenuItem) => {
186
194
  <div class="dt-profile-modal__menu">
187
195
  <!-- Profile link -->
188
196
  <ul class="dt-profile-modal__list">
189
- <li v-if="profileUrl" class="dt-profile-modal__item" @click="window.open(profileUrl, '_blank'); close()">
197
+ <li v-if="profileUrl" class="dt-profile-modal__item" @click="openProfile">
190
198
  <svg class="dt-profile-modal__icon" width="22" height="22" viewBox="0 0 22 22" fill="none">
191
199
  <circle cx="11" cy="8" r="3.5" stroke="currentColor" stroke-width="1.5"/>
192
200
  <path d="M4.5 18.5C4.5 15 7.36 13 11 13C14.64 13 17.5 15 17.5 18.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
193
201
  </svg>
194
- <span>{{ t('profile') || (locale === 'ru' ? 'Профиль' : locale === 'uz' ? 'Profil' : 'Profile') }}</span>
202
+ <span>{{ t('profile') }}</span>
195
203
  </li>
196
204
  </ul>
197
205
 
@@ -38,8 +38,8 @@ type BadgeSize = 'sm' | 'default'
38
38
 
39
39
  | Size | Padding | Font Size |
40
40
  |------|---------|-----------|
41
- | `sm` | 0.125rem 0.5rem | `--dt-text-xs` |
42
- | `default` | 0.25rem 0.625rem | `--dt-text-sm` |
41
+ | `sm` | 0.125rem 0.375rem | `--dt-text-xs` |
42
+ | `default` | 0.25rem 0.5rem | `--dt-text-xs` |
43
43
 
44
44
  ## Slots
45
45
 
@@ -123,6 +123,7 @@ Fully self-contained profile dropdown with user info, theme switcher, language p
123
123
  | `menuItems` | `DtProfileMenuItem[]` | `[]` | Optional extra menu items specific to the module. |
124
124
  | `isOrganization` | `boolean` | `false` | If true, displays `user.organization_name` instead of personal name. |
125
125
  | `profileUrl` | `string` | `undefined` | URL for the "Profile" link (opens in new tab). If not set, profile link is hidden. |
126
+ | `resourceUrl` | `string` | `undefined` | Base URL for file resources (e.g., `https://resource.dthub.uz/api/file/view-image`). Prepended to `user.logo_url` to build the full avatar URL. |
126
127
 
127
128
  #### DtUser Interface
128
129
 
@@ -255,6 +256,7 @@ const navItems: DtNavItem[] = [
255
256
  :theme="theme"
256
257
  :is-organization="store.isOrganization"
257
258
  profile-url="https://id.dthub.uz/cabinet"
259
+ resource-url="https://resource.dthub.uz/api/file/view-image"
258
260
  @theme-change="setTheme"
259
261
  @locale-change="setLang"
260
262
  @logout="store.logout()"