@dxtmisha/scripts 0.4.5 → 0.4.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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/scripts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Development scripts and CLI tools for DXT UI projects - automated component generation, library building and project management tools",
|
|
7
7
|
"keywords": [
|
|
@@ -48,7 +48,7 @@ export class LibraryExport {
|
|
|
48
48
|
* @param path filename/ имя файла
|
|
49
49
|
*/
|
|
50
50
|
protected isExport(path: string | string[]): boolean {
|
|
51
|
-
return !this.getFile(path).match(UI_FLAG_NOT_EXPORT)
|
|
51
|
+
return !PropertiesFile.joinPath(path).match('.test.') && !this.getFile(path).match(UI_FLAG_NOT_EXPORT)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -114,8 +114,9 @@ export class PropertiesToLink extends PropertiesToAbstract {
|
|
|
114
114
|
this.addIgnore(data.value)
|
|
115
115
|
}
|
|
116
116
|
} else {
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
// TODO: зачем это надо?
|
|
118
|
+
// expect = true
|
|
119
|
+
// break
|
|
119
120
|
}
|
|
120
121
|
} else if (
|
|
121
122
|
isObjectNotArray(item.value)
|
|
@@ -131,29 +131,101 @@ Document structure (strict):
|
|
|
131
131
|
|
|
132
132
|
**3. Special sections (if present):**
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
134
|
+
Instead of simply listing Props, describe **specific component capabilities**.
|
|
135
|
+
|
|
136
|
+
Each section should:
|
|
137
|
+
- Have a second-level heading (`##`) describing the capability, not just the prop name
|
|
138
|
+
- Briefly explain the purpose and behavior of the functionality
|
|
139
|
+
- List related properties (if there are several)
|
|
140
|
+
- Describe property interaction with each other and their effect on the component
|
|
141
|
+
- Include usage examples with code
|
|
142
|
+
|
|
143
|
+
**Capability description format:**
|
|
138
144
|
|
|
139
|
-
Example of complex prop description:
|
|
140
145
|
```md
|
|
141
|
-
##
|
|
142
|
-
|
|
146
|
+
## Capability Name
|
|
147
|
+
|
|
148
|
+
Brief description of the capability and its purpose (1-2 paragraphs).
|
|
149
|
+
|
|
150
|
+
**Properties:** (if several related properties)
|
|
151
|
+
|
|
152
|
+
- `propName` — property description
|
|
153
|
+
- `propName2` — property description
|
|
154
|
+
|
|
155
|
+
**Possible values:** (for enum/union types)
|
|
156
|
+
|
|
157
|
+
- `'value1'` — value description and its behavior
|
|
158
|
+
- `'value2'` — value description and its behavior
|
|
159
|
+
|
|
160
|
+
Additional description of behavior, property interaction, features, and limitations.
|
|
143
161
|
|
|
144
|
-
|
|
162
|
+
[code examples]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Examples of correct capability descriptions:**
|
|
145
166
|
|
|
146
|
-
|
|
167
|
+
```md
|
|
168
|
+
## Header Position Animation
|
|
147
169
|
|
|
148
|
-
|
|
170
|
+
The `animationHeadPosition` property defines the behavior of the Head area during show/hide animations.
|
|
149
171
|
|
|
150
172
|
**Possible values:**
|
|
151
|
-
|
|
152
|
-
- `'
|
|
153
|
-
- `'
|
|
154
|
-
|
|
173
|
+
|
|
174
|
+
- `'top'` — keeps Head at the top during transition (default)
|
|
175
|
+
- `'toBottom'` — animates Head down along with content
|
|
176
|
+
|
|
177
|
+
Synchronizes header movement with content animation using CSS transforms for smooth transitions.
|
|
178
|
+
|
|
179
|
+
[code example]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```md
|
|
183
|
+
## Navigation and Arrows
|
|
184
|
+
|
|
185
|
+
Properties `arrowCarousel`, `arrowStepper`, `disabledPrevious`, `disabledNext`, and `align` are designed for managing built-in navigation elements and content alignment.
|
|
186
|
+
|
|
187
|
+
**Properties:**
|
|
188
|
+
|
|
189
|
+
- `arrowCarousel` — enables navigation arrows (left/right) for switching elements
|
|
190
|
+
- `arrowStepper` — enables numeric step buttons (minus/plus)
|
|
191
|
+
- `disabledPrevious` — disables left button (back/minus)
|
|
192
|
+
- `disabledNext` — disables right button (forward/plus)
|
|
193
|
+
- `align` — horizontal content alignment (`left`, `center`, `right`)
|
|
194
|
+
|
|
195
|
+
Properties work together: only one arrow mode is active — if `arrowCarousel = true`, `arrowStepper` mode is ignored and vice versa.
|
|
196
|
+
|
|
197
|
+
[code example]
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```md
|
|
201
|
+
## Outline Buttons
|
|
202
|
+
|
|
203
|
+
Button component supports outline mode via the `outline` property. In this mode, buttons have a minimalist visual style with transparent background and colored border:
|
|
204
|
+
|
|
205
|
+
- **Minimalist design** - suitable for interfaces requiring reduced visual load
|
|
206
|
+
- **Transparent background** - maintains clean appearance while remaining interactive
|
|
207
|
+
- **Hover feedback** - background appears on hover for better user interaction
|
|
208
|
+
|
|
209
|
+
Outline mode is especially useful for creating tertiary actions and secondary options.
|
|
210
|
+
|
|
211
|
+
[code example]
|
|
155
212
|
```
|
|
156
213
|
|
|
214
|
+
**When NOT to describe Props in separate sections:**
|
|
215
|
+
|
|
216
|
+
- Simple boolean/string/number properties without complex logic — JSDoc comments in types are sufficient
|
|
217
|
+
- Properties with obvious behavior (e.g., `disabled`, `label`, `placeholder`)
|
|
218
|
+
- Single independent properties without interaction with others
|
|
219
|
+
|
|
220
|
+
**When to describe capabilities in separate sections:**
|
|
221
|
+
|
|
222
|
+
- Properties with complex interaction logic (e.g., `cancel` and `cancelShow`)
|
|
223
|
+
- Groups of related properties working together (e.g., navigation arrows)
|
|
224
|
+
- Properties with multiple operation modes (e.g., `adaptive` with different values)
|
|
225
|
+
- Properties affecting other component parts or having priority over others
|
|
226
|
+
- Component display modes (e.g., `primary`, `secondary`, `outline`)
|
|
227
|
+
- CSS classes for behavior control
|
|
228
|
+
|
|
157
229
|
**4. Mandatory sections (if present in component):**
|
|
158
230
|
|
|
159
231
|
**Expose methods/properties:**
|
|
@@ -274,39 +346,45 @@ Component uses special CSS classes for behavior control:
|
|
|
274
346
|
|
|
275
347
|
Where `*` is the component class name (e.g., `d1-window`, `m3-window`).
|
|
276
348
|
|
|
277
|
-
##
|
|
278
|
-
### `adaptive`
|
|
349
|
+
## Header Position Animation
|
|
279
350
|
|
|
280
|
-
|
|
351
|
+
The `animationHeadPosition` property defines the behavior of the Head area during show/hide animations.
|
|
281
352
|
|
|
282
|
-
**
|
|
353
|
+
**Possible values:**
|
|
283
354
|
|
|
284
|
-
|
|
355
|
+
- `'top'` — keeps Head at the top during transition (default)
|
|
356
|
+
- `'toBottom'` — animates Head down along with content
|
|
285
357
|
|
|
286
|
-
|
|
287
|
-
- `'modal'` — modal window in screen center
|
|
288
|
-
- `'menu'` — dropdown menu attached to element
|
|
289
|
-
- `'actionSheet'` — bottom panel for mobile devices
|
|
290
|
-
- `'static'` — static mode without overlay
|
|
358
|
+
Synchronizes header movement with content animation using CSS transforms for smooth transitions.
|
|
291
359
|
|
|
292
|
-
|
|
360
|
+
```html
|
|
361
|
+
<template>
|
|
362
|
+
<Window v-model:open="isOpen" :animationHeadPosition="'toBottom'">
|
|
363
|
+
<template #default>
|
|
364
|
+
<p>Window content</p>
|
|
365
|
+
<button @click="isOpen = false">Close</button>
|
|
366
|
+
</template>
|
|
367
|
+
</Window>
|
|
368
|
+
</template>
|
|
369
|
+
```
|
|
293
370
|
|
|
294
|
-
|
|
371
|
+
## Navigation and Arrows
|
|
295
372
|
|
|
296
|
-
|
|
297
|
-
- `open: boolean` — window open state
|
|
373
|
+
Properties `arrowCarousel`, `arrowStepper`, `disabledPrevious`, `disabledNext`, and `align` are designed for managing built-in navigation elements and content alignment.
|
|
298
374
|
|
|
299
|
-
|
|
300
|
-
<script setup>
|
|
301
|
-
import { ref } from 'vue'
|
|
375
|
+
**Properties:**
|
|
302
376
|
|
|
303
|
-
|
|
304
|
-
|
|
377
|
+
- `arrowCarousel` — enables navigation arrows (left/right) for switching elements
|
|
378
|
+
- `arrowStepper` — enables numeric step buttons (minus/plus)
|
|
379
|
+
- `disabledPrevious` — disables left button (back/minus)
|
|
380
|
+
- `disabledNext` — disables right button (forward/plus)
|
|
381
|
+
- `align` — horizontal content alignment (`left`, `center`, `right`)
|
|
305
382
|
|
|
306
|
-
|
|
307
|
-
<button @click="isOpen = true">Open</button>
|
|
383
|
+
Properties work together: only one arrow mode is active — if `arrowCarousel = true`, `arrowStepper` mode is ignored and vice versa.
|
|
308
384
|
|
|
309
|
-
|
|
385
|
+
```html
|
|
386
|
+
<template>
|
|
387
|
+
<Window v-model:open="isOpen" :arrowCarousel="true" :align="'center'">
|
|
310
388
|
<template #default>
|
|
311
389
|
<p>Window content</p>
|
|
312
390
|
<button @click="isOpen = false">Close</button>
|
|
@@ -315,6 +393,22 @@ const isOpen = ref(false)
|
|
|
315
393
|
</template>
|
|
316
394
|
```
|
|
317
395
|
|
|
396
|
+
## Outline Buttons
|
|
397
|
+
|
|
398
|
+
Button component supports outline mode via the `outline` property. In this mode, buttons have a minimalist visual style with transparent background and colored border:
|
|
399
|
+
|
|
400
|
+
- **Minimalist design** - suitable for interfaces requiring reduced visual load
|
|
401
|
+
- **Transparent background** - maintains clean appearance while remaining interactive
|
|
402
|
+
- **Hover feedback** - background appears on hover for better user interaction
|
|
403
|
+
|
|
404
|
+
Outline mode is especially useful for creating tertiary actions and secondary options.
|
|
405
|
+
|
|
406
|
+
```html
|
|
407
|
+
<template>
|
|
408
|
+
<Button outline @click="handleClick">Click me</Button>
|
|
409
|
+
</template>
|
|
410
|
+
```
|
|
411
|
+
|
|
318
412
|
## Expose Methods
|
|
319
413
|
### `id`
|
|
320
414
|
|
|
@@ -133,29 +133,101 @@ export const WithIcon: Story = {
|
|
|
133
133
|
|
|
134
134
|
**3. Специальные разделы (если есть):**
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
-
|
|
136
|
+
Вместо простого перечисления Props, описывай **конкретные возможности компонента**.
|
|
137
|
+
|
|
138
|
+
Каждый раздел должен:
|
|
139
|
+
- Иметь заголовок второго уровня (`##`), описывающий возможность, а не просто название prop
|
|
140
|
+
- Кратко объяснять назначение и поведение функциональности
|
|
141
|
+
- Перечислять связанные свойства (если их несколько)
|
|
142
|
+
- Описывать взаимодействие свойств между собой и их влияние на компонент
|
|
143
|
+
- Включать примеры использования с кодом
|
|
144
|
+
|
|
145
|
+
**Формат описания возможности:**
|
|
140
146
|
|
|
141
|
-
Пример описания сложного prop:
|
|
142
147
|
```md
|
|
143
|
-
##
|
|
144
|
-
|
|
148
|
+
## Название возможности
|
|
149
|
+
|
|
150
|
+
Краткое описание возможности и её назначения (1-2 абзаца).
|
|
151
|
+
|
|
152
|
+
**Свойства:** (если несколько связанных свойств)
|
|
153
|
+
|
|
154
|
+
- `propName` — описание свойства
|
|
155
|
+
- `propName2` — описание свойства
|
|
156
|
+
|
|
157
|
+
**Возможные значения:** (для enum/union типов)
|
|
158
|
+
|
|
159
|
+
- `'value1'` — описание значения и его поведения
|
|
160
|
+
- `'value2'` — описание значения и его поведения
|
|
145
161
|
|
|
146
|
-
|
|
162
|
+
Дополнительное описание поведения, взаимодействия свойств, особенностей и ограничений.
|
|
147
163
|
|
|
148
|
-
|
|
164
|
+
[примеры кода]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Примеры правильного описания возможностей:**
|
|
168
|
+
|
|
169
|
+
```md
|
|
170
|
+
## Анимация позиции заголовка
|
|
149
171
|
|
|
150
|
-
|
|
172
|
+
Свойство `animationHeadPosition` определяет поведение области Head во время анимаций показа/скрытия.
|
|
151
173
|
|
|
152
174
|
**Возможные значения:**
|
|
153
|
-
|
|
154
|
-
- `'
|
|
155
|
-
- `'
|
|
156
|
-
|
|
175
|
+
|
|
176
|
+
- `'top'` — сохраняет Head вверху во время перехода (по умолчанию)
|
|
177
|
+
- `'toBottom'` — анимирует Head вниз вместе с контентом
|
|
178
|
+
|
|
179
|
+
Синхронизирует движение заголовка с анимацией контента, используя CSS-трансформации для плавных переходов.
|
|
180
|
+
|
|
181
|
+
[код примера]
|
|
157
182
|
```
|
|
158
183
|
|
|
184
|
+
```md
|
|
185
|
+
## Навигация и стрелки
|
|
186
|
+
|
|
187
|
+
Свойства `arrowCarousel`, `arrowStepper`, `disabledPrevious`, `disabledNext` и `align` предназначены для управления встроенными элементами навигации и выравнивания содержимого.
|
|
188
|
+
|
|
189
|
+
**Свойства:**
|
|
190
|
+
|
|
191
|
+
- `arrowCarousel` — включает стрелки навигации (влево/вправо) для переключения элементов
|
|
192
|
+
- `arrowStepper` — включает числовые шаговые кнопки (минус/плюс)
|
|
193
|
+
- `disabledPrevious` — отключает левую кнопку (назад/минус)
|
|
194
|
+
- `disabledNext` — отключает правую кнопку (вперёд/плюс)
|
|
195
|
+
- `align` — горизонтальное выравнивание содержимого (`left`, `center`, `right`)
|
|
196
|
+
|
|
197
|
+
Свойства работают совместно: активен только один режим стрелок — если `arrowCarousel = true`, режим `arrowStepper` игнорируется и наоборот.
|
|
198
|
+
|
|
199
|
+
[код примера]
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
```md
|
|
203
|
+
## Контурные кнопки (outline)
|
|
204
|
+
|
|
205
|
+
Компонент Button поддерживает контурный режим через свойство `outline`. В этом режиме кнопки имеют минималистичный визуальный стиль с прозрачным фоном и цветной границей:
|
|
206
|
+
|
|
207
|
+
- **Минималистичный дизайн** - подходит для интерфейсов, требующих сниженной визуальной нагрузки
|
|
208
|
+
- **Прозрачный фон** - поддерживает чистый внешний вид, оставаясь интерактивными
|
|
209
|
+
- **Обратная связь при наведении** - фон появляется при наведении
|
|
210
|
+
|
|
211
|
+
Outline режим особенно полезен для создания третичных действий и второстепенных опций.
|
|
212
|
+
|
|
213
|
+
[код примера]
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Когда НЕ нужно описывать Props отдельными разделами:**
|
|
217
|
+
|
|
218
|
+
- Простые boolean/string/number свойства без сложной логики — достаточно JSDoc комментариев в типах
|
|
219
|
+
- Свойства с очевидным поведением (например, `disabled`, `label`, `placeholder`)
|
|
220
|
+
- Единичные независимые свойства без взаимодействия с другими
|
|
221
|
+
|
|
222
|
+
**Когда НУЖНО описывать возможности отдельными разделами:**
|
|
223
|
+
|
|
224
|
+
- Свойства со сложной логикой взаимодействия (например, `cancel` и `cancelShow`)
|
|
225
|
+
- Группы связанных свойств, работающих вместе (например, стрелки навигации)
|
|
226
|
+
- Свойства с несколькими режимами работы (например, `adaptive` с разными значениями)
|
|
227
|
+
- Свойства, влияющие на другие части компонента или имеющие приоритет над другими
|
|
228
|
+
- Режимы отображения компонента (например, `primary`, `secondary`, `outline`)
|
|
229
|
+
- CSS классы для управления поведением
|
|
230
|
+
|
|
159
231
|
**4. Обязательные секции (если присутствуют в компоненте):**
|
|
160
232
|
|
|
161
233
|
**Expose методы/свойства:**
|
|
@@ -276,45 +348,63 @@ Window управляет отображением контента поверх
|
|
|
276
348
|
|
|
277
349
|
Где `*` — название класса компонента (например, `d1-window`, `m3-window`).
|
|
278
350
|
|
|
279
|
-
##
|
|
280
|
-
### `adaptive`
|
|
351
|
+
## Анимация позиции заголовка
|
|
281
352
|
|
|
282
|
-
|
|
353
|
+
Свойство `animationHeadPosition` определяет поведение области Head во время анимаций показа/скрытия.
|
|
283
354
|
|
|
284
|
-
|
|
355
|
+
**Возможные значения:**
|
|
285
356
|
|
|
286
|
-
|
|
357
|
+
- `'top'` — сохраняет Head вверху во время перехода (по умолчанию)
|
|
358
|
+
- `'toBottom'` — анимирует Head вниз вместе с контентом
|
|
287
359
|
|
|
288
|
-
|
|
289
|
-
- `'modal'` — модальное окно по центру экрана
|
|
290
|
-
- `'menu'` — выпадающее меню, привязанное к элементу
|
|
291
|
-
- `'actionSheet'` — нижняя панель для мобильных устройств
|
|
292
|
-
- `'static'` — статичный режим без оверлея
|
|
360
|
+
Синхронизирует движение заголовка с анимацией контента, используя CSS-трансформации для плавных переходов.
|
|
293
361
|
|
|
294
|
-
|
|
362
|
+
```html
|
|
363
|
+
<Window
|
|
364
|
+
v-slot:default="{ animationHeadPosition }"
|
|
365
|
+
:style="{ '--head-animation': animationHeadPosition }"
|
|
366
|
+
>
|
|
367
|
+
<Header>Заголовок</Header>
|
|
368
|
+
<Content>Содержимое</Content>
|
|
369
|
+
</Window>
|
|
370
|
+
```
|
|
295
371
|
|
|
296
|
-
|
|
372
|
+
## Навигация и стрелки
|
|
297
373
|
|
|
298
|
-
|
|
299
|
-
|
|
374
|
+
Свойства `arrowCarousel`, `arrowStepper`, `disabledPrevious`, `disabledNext` и `align` предназначены для управления встроенными элементами навигации и выравнивания содержимого.
|
|
375
|
+
|
|
376
|
+
**Свойства:**
|
|
377
|
+
|
|
378
|
+
- `arrowCarousel` — включает стрелки навигации (влево/вправо) для переключения элементов
|
|
379
|
+
- `arrowStepper` — включает числовые шаговые кнопки (минус/плюс)
|
|
380
|
+
- `disabledPrevious` — отключает левую кнопку (назад/минус)
|
|
381
|
+
- `disabledNext` — отключает правую кнопку (вперёд/плюс)
|
|
382
|
+
- `align` — горизонтальное выравнивание содержимого (`left`, `center`, `right`)
|
|
383
|
+
|
|
384
|
+
Свойства работают совместно: активен только один режим стрелок — если `arrowCarousel = true`, режим `arrowStepper` игнорируется и наоборот.
|
|
300
385
|
|
|
301
386
|
```html
|
|
302
|
-
<
|
|
303
|
-
|
|
387
|
+
<Window
|
|
388
|
+
v-slot:default="{ arrowCarousel, arrowStepper }"
|
|
389
|
+
:arrow-carousel="arrowCarousel"
|
|
390
|
+
:arrow-stepper="arrowStepper"
|
|
391
|
+
>
|
|
392
|
+
<Content>Содержимое</Content>
|
|
393
|
+
</Window>
|
|
394
|
+
```
|
|
304
395
|
|
|
305
|
-
|
|
306
|
-
</script>
|
|
396
|
+
## Контурные кнопки (outline)
|
|
307
397
|
|
|
308
|
-
|
|
309
|
-
<button @click="isOpen = true">Открыть</button>
|
|
398
|
+
Компонент Button поддерживает контурный режим через свойство `outline`. В этом режиме кнопки имеют минималистичный визуальный стиль с прозрачным фоном и цветной границей:
|
|
310
399
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
400
|
+
- **Минималистичный дизайн** - подходит для интерфейсов, требующих сниженной визуальной нагрузки
|
|
401
|
+
- **Прозрачный фон** - поддерживает чистый внешний вид, оставаясь интерактивными
|
|
402
|
+
- **Обратная связь при наведении** - фон появляется при наведении
|
|
403
|
+
|
|
404
|
+
Outline режим особенно полезен для создания третичных действий и второстепенных опций.
|
|
405
|
+
|
|
406
|
+
```html
|
|
407
|
+
<Button outline>Контурная кнопка</Button>
|
|
318
408
|
```
|
|
319
409
|
|
|
320
410
|
## Expose методы
|