@scaleflex/asset-picker 0.2.16 → 0.2.18

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.
@@ -2,7 +2,21 @@
2
2
  "permissions": {
3
3
  "allow": [
4
4
  "Bash(npm run:*)",
5
- "Bash(npm view:*)"
5
+ "Bash(npm view:*)",
6
+ "Bash(git ls-tree:*)",
7
+ "Bash(find . -maxdepth 1 -name .env* -o -name *release* -o -name .git*)",
8
+ "Bash(ls -la vite*.config.ts)",
9
+ "Bash(./scripts/publish-github.sh)",
10
+ "Bash(bash scripts/publish-github.sh 2>&1)",
11
+ "Bash(git remote:*)",
12
+ "Bash(git add:*)",
13
+ "Bash(git commit:*)",
14
+ "Bash(grep:*)",
15
+ "Bash(node:*)",
16
+ "Bash(node -p \"require\\(''./package.json''\\).version\")",
17
+ "Bash(git push:*)",
18
+ "Bash(find /Users/dmitry_stremous/scaleflex/plugins/scaleflex/asset-picker/demo -name *ai-search* -o -name *configuration*)",
19
+ "Bash(npm whoami:*)"
6
20
  ]
7
21
  }
8
22
  }
package/README.md CHANGED
@@ -96,6 +96,8 @@ The npm package contains **only pre-built, minified production files** (`dist/`)
96
96
 
97
97
  ## Installation
98
98
 
99
+ ### npm / yarn / pnpm
100
+
99
101
  ```bash
100
102
  npm install @scaleflex/asset-picker
101
103
  ```
@@ -110,6 +112,16 @@ pnpm add @scaleflex/asset-picker
110
112
 
111
113
  `lit` is bundled with the package. For React usage, you also need `react` and `react-dom` (v18+) as peer dependencies.
112
114
 
115
+ ### CDN
116
+
117
+ No bundler? Add a single script tag:
118
+
119
+ ```html
120
+ <script src="https://cdn.scaleflex.com/asset-picker/0.2.18/asset-picker.min.js"></script>
121
+ ```
122
+
123
+ This auto-registers `<sfx-asset-picker>` — no imports needed. See the [CDN quick start](#cdn-1) below.
124
+
113
125
  ### Package exports
114
126
 
115
127
  | Export path | Description |
@@ -191,6 +203,35 @@ function App() {
191
203
  }
192
204
  ```
193
205
 
206
+ ### CDN
207
+
208
+ ```html
209
+ <!DOCTYPE html>
210
+ <html>
211
+ <head>
212
+ <script src="https://cdn.scaleflex.com/asset-picker/0.2.18/asset-picker.min.js"></script>
213
+ </head>
214
+ <body>
215
+ <sfx-asset-picker></sfx-asset-picker>
216
+ <button onclick="document.querySelector('sfx-asset-picker').open()">Open Picker</button>
217
+
218
+ <script>
219
+ const picker = document.querySelector('sfx-asset-picker');
220
+ picker.config = {
221
+ auth: {
222
+ mode: 'securityTemplate',
223
+ securityTemplateKey: 'YOUR_KEY',
224
+ projectToken: 'YOUR_TOKEN',
225
+ },
226
+ };
227
+ picker.addEventListener('ap-select', (e) => {
228
+ console.log('Selected:', e.detail.assets);
229
+ });
230
+ </script>
231
+ </body>
232
+ </html>
233
+ ```
234
+
194
235
  ---
195
236
 
196
237
  ## Configuration