@dropi/ui 0.1.48 → 0.1.49
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/cjs/dropi-alert-modal.cjs.entry.js +14 -37
- package/dist/cjs/dropi-empty-state.cjs.entry.js +87 -10
- package/dist/collection/components/dropi-alert-modal/dropi-alert-modal.js +24 -65
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.js +24 -23
- package/dist/collection/utils/illustration-map.generated.js +73 -0
- package/dist/collection/utils/lottie-map.generated.js +10 -0
- package/dist/components/dropi-alert-modal.js +1 -1
- package/dist/components/dropi-empty-state.js +1 -1
- package/dist/components/p-B9-h_ikq.js +1 -0
- package/dist/components/p-B9rJd-Rf.js +1 -0
- package/dist/components/p-CCZ6rIo5.js +1 -0
- package/dist/components/p-D7GP-lmt.js +1 -0
- package/dist/components/p-DYAsdhfM.js +1 -0
- package/dist/components/p-Dnx3uXgo.js +1 -0
- package/dist/components/p-RQjw5hdz.js +1 -0
- package/dist/docs.json +31 -45
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/p-0086fbc8.entry.js +1 -0
- package/dist/dropi-ui/p-04cd97a1.entry.js +1 -0
- package/dist/dropi-ui/p-11b83d87.entry.js +1 -0
- package/dist/dropi-ui/p-1c3a5cee.entry.js +1 -0
- package/dist/dropi-ui/p-3d7a3ea5.entry.js +1 -0
- package/dist/dropi-ui/p-68891c64.entry.js +1 -0
- package/dist/dropi-ui/p-ca7c025d.entry.js +1 -0
- package/dist/dropi-ui/p-ed4bd1cc.entry.js +1 -0
- package/dist/esm/dropi-alert-modal.entry.js +15 -38
- package/dist/esm/dropi-empty-state.entry.js +88 -11
- package/dist/types/components/dropi-alert-modal/dropi-alert-modal.d.ts +1 -39
- package/dist/types/components/dropi-empty-state/dropi-empty-state.d.ts +7 -13
- package/dist/types/components.d.ts +8 -105
- package/dist/types/utils/illustration-map.generated.d.ts +1 -0
- package/dist/types/utils/lottie-map.generated.d.ts +1 -0
- package/hydrate/index.js +101 -60
- package/hydrate/index.mjs +101 -60
- package/package.json +1 -1
- package/scripts/generate-illustration-map.js +37 -0
- package/scripts/generate-lottie-map.js +49 -0
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Generates src/utils/illustration-map.generated.ts from public/assets/icons/ilustration/
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const STATES = ['default', 'loading', 'sorry', 'love', 'success', 'error', 'warning', 'info'];
|
|
7
|
+
const srcDir = path.join(__dirname, '..', 'public', 'assets', 'icons', 'ilustration');
|
|
8
|
+
const outFile = path.join(__dirname, '..', 'src', 'utils', 'illustration-map.generated.ts');
|
|
9
|
+
|
|
10
|
+
const entries = [];
|
|
11
|
+
|
|
12
|
+
for (const state of STATES) {
|
|
13
|
+
const file = path.join(srcDir, `${state}.svg`);
|
|
14
|
+
if (!fs.existsSync(file)) {
|
|
15
|
+
console.warn(`⚠️ Missing illustration: ${state}.svg — skipping`);
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const svg = fs.readFileSync(file, 'utf8').replace(/`/g, '\\`').replace(/\$/g, '\\$');
|
|
19
|
+
entries.push(` '${state}': \`${svg}\``);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (entries.length === 0) {
|
|
23
|
+
console.error('❌ No illustration files found in', srcDir);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const output = `// Auto-generated by scripts/generate-illustration-map.js — DO NOT EDIT
|
|
28
|
+
// Source: public/assets/icons/ilustration/ (${entries.length} illustrations)
|
|
29
|
+
export const ILLUSTRATION_MAP: Record<string, string> = {
|
|
30
|
+
${entries.join(',\n')}
|
|
31
|
+
};
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const dir = path.dirname(outFile);
|
|
35
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
36
|
+
fs.writeFileSync(outFile, output);
|
|
37
|
+
console.log(`✅ Generated ${entries.length} illustrations → src/utils/illustration-map.generated.ts`);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Generates src/utils/lottie-map.generated.ts from public/assets/lottie-files/
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// Keys match dropi-alert-modal's lottieMap; values are the JSON file names
|
|
7
|
+
const ENTRIES = [
|
|
8
|
+
{ key: 'question', file: 'question.json' },
|
|
9
|
+
{ key: 'warning', file: 'warning.json' },
|
|
10
|
+
{ key: 'success', file: 'success.json' },
|
|
11
|
+
{ key: 'error', file: 'failure.json' },
|
|
12
|
+
{ key: 'loading', file: 'loading.json' },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const srcDir = path.join(__dirname, '..', 'public', 'assets', 'lottie-files');
|
|
16
|
+
const outFile = path.join(__dirname, '..', 'src', 'utils', 'lottie-map.generated.ts');
|
|
17
|
+
|
|
18
|
+
const lines = [];
|
|
19
|
+
|
|
20
|
+
for (const { key, file } of ENTRIES) {
|
|
21
|
+
const filePath = path.join(srcDir, file);
|
|
22
|
+
if (!fs.existsSync(filePath)) {
|
|
23
|
+
console.warn(`⚠️ Missing lottie file: ${file} — skipping`);
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
// Store as a minified JSON string to avoid runtime JSON.stringify cost
|
|
27
|
+
const json = JSON.stringify(JSON.parse(fs.readFileSync(filePath, 'utf8')));
|
|
28
|
+
// Escape backticks and template literal dollar signs
|
|
29
|
+
const escaped = json.replace(/`/g, '\\`').replace(/\$/g, '\\$');
|
|
30
|
+
lines.push(` '${key}': \`${escaped}\``);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (lines.length === 0) {
|
|
34
|
+
console.error('❌ No lottie files found in', srcDir);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const output = `// Auto-generated by scripts/generate-lottie-map.js — DO NOT EDIT
|
|
39
|
+
// Source: public/assets/lottie-files/ (${lines.length} animations)
|
|
40
|
+
// Passed as JSON string to lottie-player's src attribute.
|
|
41
|
+
export const LOTTIE_MAP: Record<string, string> = {
|
|
42
|
+
${lines.join(',\n')}
|
|
43
|
+
};
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const dir = path.dirname(outFile);
|
|
47
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
48
|
+
fs.writeFileSync(outFile, output);
|
|
49
|
+
console.log(`✅ Generated ${lines.length} lottie animations → src/utils/lottie-map.generated.ts`);
|