@scaleflex/asset-picker 0.1.0 → 0.2.0
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/CHANGELOG.md +21 -5
- package/README.md +20 -10
- package/dist/{asset-picker-BA876lMW.js → asset-picker-CSsp_Huy.js} +2246 -1972
- package/dist/{asset-picker-BbEOZw7O.cjs → asset-picker-DBOWNXd-.cjs} +898 -723
- package/dist/asset-picker.d.ts +26 -1
- package/dist/asset-picker.d.ts.map +1 -1
- package/dist/components/filters/ap-filter-metadata.d.ts.map +1 -1
- package/dist/components/filters/ap-filter-size.d.ts.map +1 -1
- package/dist/components/filters/ap-filters-bar.d.ts +1 -0
- package/dist/components/filters/ap-filters-bar.d.ts.map +1 -1
- package/dist/components/filters/shared/filter-styles.d.ts.map +1 -1
- package/dist/components/header/ap-header.d.ts.map +1 -1
- package/dist/components/header/ap-regional-settings.d.ts.map +1 -1
- package/dist/components/modal/ap-modal.d.ts.map +1 -1
- package/dist/components/preview/ap-preview-panel.d.ts +1 -0
- package/dist/components/preview/ap-preview-panel.d.ts.map +1 -1
- package/dist/components/selection/ap-selection-bar.d.ts +0 -1
- package/dist/components/selection/ap-selection-bar.d.ts.map +1 -1
- package/dist/components/shared/ap-checkbox.d.ts +2 -0
- package/dist/components/shared/ap-checkbox.d.ts.map +1 -1
- package/dist/components/shared/ap-dropdown.d.ts.map +1 -1
- package/dist/components/shared/ap-icon.d.ts.map +1 -1
- package/dist/components/toolbar/ap-content-toolbar.d.ts +2 -0
- package/dist/components/toolbar/ap-content-toolbar.d.ts.map +1 -1
- package/dist/components/views/ap-asset-card.d.ts.map +1 -1
- package/dist/components/views/ap-asset-row.d.ts.map +1 -1
- package/dist/components/views/ap-list-view.d.ts.map +1 -1
- package/dist/define.cjs +1 -1
- package/dist/define.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +5 -5
- package/dist/services/filters.service.d.ts.map +1 -1
- package/dist/types/config.types.d.ts +55 -0
- package/dist/types/config.types.d.ts.map +1 -1
- package/dist/utils/brand-color.d.ts.map +1 -1
- package/package.json +7 -2
- package/dist/controllers/keyboard.controller.d.ts +0 -10
- package/dist/controllers/keyboard.controller.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,24 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.0] - 2026-03-22
|
|
11
|
+
|
|
10
12
|
### Added
|
|
11
13
|
|
|
14
|
+
- `@scaleflex/uploader` integration with drop zone and upload panel
|
|
15
|
+
- Uploader uses built-in header with back button; close (X) button in modal mode
|
|
12
16
|
- Select-all functionality for asset selection
|
|
13
17
|
- Stats endpoint integration
|
|
14
18
|
- Tags filter with suggested and other tags from API
|
|
15
|
-
-
|
|
19
|
+
- Resolution info on asset cards
|
|
20
|
+
- Custom theming example
|
|
21
|
+
- GitHub Pages demo with centered layout and auth UX
|
|
16
22
|
|
|
17
23
|
### Changed
|
|
18
24
|
|
|
25
|
+
- Adopted Scaleflex design system with oklch color tokens across all components
|
|
26
|
+
- Polished header: search sizing, close button, box-shadow replaced with border-bottom
|
|
27
|
+
- Styled filter system: rounded pinned chips, accent backgrounds, icon colors, Clear filters button
|
|
28
|
+
- Styled selection bar: primary background, outline Confirm button
|
|
29
|
+
- Styled dropdowns: metadata field selector, regional settings, filter options
|
|
30
|
+
- Styled list view: checkbox borders, header labels, type column color
|
|
31
|
+
- Increased asset checkbox size to 22x22px in grid and list views
|
|
32
|
+
- Used Lucide icons for checkboxes, calendar, grid view, and select button
|
|
19
33
|
- Improved filter UX: temporary chips, search focus, "Clear all" placement, and outside click handling
|
|
20
|
-
- Improved sort system
|
|
21
|
-
-
|
|
22
|
-
- SVG preview rendering
|
|
34
|
+
- Improved sort system, filter validation, and debounced filter application
|
|
35
|
+
- SVG preview rendering improvements
|
|
23
36
|
|
|
24
37
|
### Fixed
|
|
25
38
|
|
|
26
39
|
- Filter popover overflowing right edge of widget
|
|
27
40
|
- Filter popover not closing on filters-bar empty area click
|
|
41
|
+
- Size filter inputs overlapping
|
|
42
|
+
- List view checkboxes rendering at exact 22x22px with border-box sizing
|
|
43
|
+
- Metadata field selector dropdown being clipped at the top
|
|
28
44
|
- Approval filter and filter constants
|
|
29
45
|
- Date presets and serialization
|
|
30
46
|
- Filter component UX issues
|
|
@@ -35,7 +51,7 @@ Initial release.
|
|
|
35
51
|
|
|
36
52
|
### Added
|
|
37
53
|
|
|
38
|
-
- `<asset-picker>` web component built with Lit 3 and Shadow DOM
|
|
54
|
+
- `<sfx-asset-picker>` web component built with Lit 3 and Shadow DOM
|
|
39
55
|
- Reactive store-based state management with `StoreController`
|
|
40
56
|
- Asset browsing with grid and list view modes
|
|
41
57
|
- Folder navigation with breadcrumb trail
|
package/README.md
CHANGED
|
@@ -14,9 +14,18 @@
|
|
|
14
14
|
<p align="center">
|
|
15
15
|
<a href="https://www.npmjs.com/package/@scaleflex/asset-picker"><img src="https://img.shields.io/npm/v/@scaleflex/asset-picker.svg?style=flat-square" alt="npm version"></a>
|
|
16
16
|
<a href="https://www.npmjs.com/package/@scaleflex/asset-picker"><img src="https://img.shields.io/npm/dm/@scaleflex/asset-picker.svg?style=flat-square" alt="npm downloads"></a>
|
|
17
|
+
<a href="https://bundlephobia.com/package/@scaleflex/asset-picker"><img src="https://img.shields.io/bundlephobia/minzip/@scaleflex/asset-picker?style=flat-square" alt="bundle size"></a>
|
|
17
18
|
<img src="https://img.shields.io/badge/license-proprietary-red?style=flat-square" alt="license">
|
|
18
19
|
</p>
|
|
19
20
|
|
|
21
|
+
<p align="center">
|
|
22
|
+
<a href="https://scaleflex.github.io/asset-picker/">Live Demo</a> |
|
|
23
|
+
<a href="https://scaleflex.github.io/asset-picker/#/docs/getting-started">Documentation</a> |
|
|
24
|
+
<a href="https://scaleflex.github.io/asset-picker/#/examples/basic">Examples</a> |
|
|
25
|
+
<a href="https://www.npmjs.com/package/@scaleflex/asset-picker">npm</a> |
|
|
26
|
+
<a href="https://www.scaleflex.com/page/digital-asset-management">Scaleflex DAM</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
20
29
|
---
|
|
21
30
|
|
|
22
31
|
## Table of Contents
|
|
@@ -57,7 +66,7 @@ The npm package contains **only pre-built, minified production files** (`dist/`)
|
|
|
57
66
|
|
|
58
67
|
## Features
|
|
59
68
|
|
|
60
|
-
- **Framework-agnostic** — standard `<asset-picker>` custom element, works in any stack
|
|
69
|
+
- **Framework-agnostic** — standard `<sfx-asset-picker>` custom element, works in any stack
|
|
61
70
|
- **First-class React wrapper** — `forwardRef` component with controlled `open` prop and imperative ref
|
|
62
71
|
- **Two auth modes** — session tokens or security templates
|
|
63
72
|
- **Grid & list views** — switchable with persistent user preference
|
|
@@ -104,7 +113,7 @@ pnpm add @scaleflex/asset-picker
|
|
|
104
113
|
|---|---|
|
|
105
114
|
| `@scaleflex/asset-picker` | `AssetPicker` class + all TypeScript types |
|
|
106
115
|
| `@scaleflex/asset-picker/react` | React wrapper component |
|
|
107
|
-
| `@scaleflex/asset-picker/define` | Side-effect import — registers `<asset-picker>` custom element |
|
|
116
|
+
| `@scaleflex/asset-picker/define` | Side-effect import — registers `<sfx-asset-picker>` custom element |
|
|
108
117
|
|
|
109
118
|
Both ESM (`import`) and CJS (`require`) builds are provided.
|
|
110
119
|
|
|
@@ -115,14 +124,14 @@ Both ESM (`import`) and CJS (`require`) builds are provided.
|
|
|
115
124
|
### Vanilla JS / Web Component
|
|
116
125
|
|
|
117
126
|
```html
|
|
118
|
-
<asset-picker></asset-picker>
|
|
127
|
+
<sfx-asset-picker></sfx-asset-picker>
|
|
119
128
|
|
|
120
129
|
<script type="module">
|
|
121
130
|
// 1. Register the custom element (once)
|
|
122
131
|
import '@scaleflex/asset-picker/define';
|
|
123
132
|
|
|
124
133
|
// 2. Grab the element
|
|
125
|
-
const picker = document.querySelector('asset-picker');
|
|
134
|
+
const picker = document.querySelector('sfx-asset-picker');
|
|
126
135
|
|
|
127
136
|
// 3. Configure
|
|
128
137
|
picker.config = {
|
|
@@ -228,14 +237,15 @@ Use when your backend already manages Scaleflex sessions.
|
|
|
228
237
|
| `defaultViewMode` | `'grid' \| 'list'` | `'grid'` | Initial view mode |
|
|
229
238
|
| `defaultSortBy` | `SortBy` | `'created_at'` | Initial sort field (see table below) |
|
|
230
239
|
| `defaultSortDirection` | `'asc' \| 'desc'` | `'desc'` | Initial sort direction |
|
|
231
|
-
| `
|
|
240
|
+
| `tabs` | `TabKey[]` | `['assets', 'folders']` | Tabs to show. If only one, the dropdown is hidden |
|
|
232
241
|
| `enabledFilters` | `FilterKey[]` | all | Restrict which filters appear in the toolbar |
|
|
233
|
-
| `
|
|
234
|
-
| `rootFolderUuid` | `string` | `undefined` | Start browsing from a specific folder UUID |
|
|
242
|
+
| `rootFolderPath` | `string` | `'/'` | Start browsing from a specific folder path (e.g. `'/marketing/banners/'`) |
|
|
235
243
|
| `showMetadata` | `boolean` | `true` | Show metadata sections in the preview panel |
|
|
236
244
|
| `brandColor` | `string` | from API | Brand accent colour as hex (e.g. `'#3b82f6'`). Overrides the API-fetched value |
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
245
|
+
| `rememberLastFolder` | `boolean` | `false` | Persist the last browsed folder and restore on next open |
|
|
246
|
+
| `rememberLastView` | `boolean` | `false` | Persist the last used view mode (grid/list) and restore on next open |
|
|
247
|
+
| `defaultFilters` | `FiltersInput` | `undefined` | Filters pre-applied on open. User can modify/remove |
|
|
248
|
+
| `forcedFilters` | `FiltersInput` | `undefined` | Filters always active. Shown as locked chips the user cannot remove |
|
|
239
249
|
| `onSelect` | `(assets: Asset[]) => void` | `undefined` | Callback when assets are selected |
|
|
240
250
|
| `onCancel` | `() => void` | `undefined` | Callback when the picker is cancelled |
|
|
241
251
|
|
|
@@ -399,7 +409,7 @@ If not set, the picker uses the brand colour configured in your Scaleflex projec
|
|
|
399
409
|
|
|
400
410
|
### CSS Custom Properties
|
|
401
411
|
|
|
402
|
-
For fine-grained control, override these CSS custom properties on the `<asset-picker>` element or any ancestor. All variables use the `--ap-` prefix.
|
|
412
|
+
For fine-grained control, override these CSS custom properties on the `<sfx-asset-picker>` element or any ancestor. All variables use the `--ap-` prefix.
|
|
403
413
|
|
|
404
414
|
#### Colours
|
|
405
415
|
|