@vibes.diy/use-vibes-base 0.12.0-dev-preview

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.
Files changed (89) hide show
  1. package/LICENSE.md +232 -0
  2. package/README.md +549 -0
  3. package/components/ControlsBar.d.ts +20 -0
  4. package/components/ControlsBar.js +84 -0
  5. package/components/ControlsBar.js.map +1 -0
  6. package/components/ImgGen.css +675 -0
  7. package/components/ImgGen.d.ts +24 -0
  8. package/components/ImgGen.js +256 -0
  9. package/components/ImgGen.js.map +1 -0
  10. package/components/ImgGenUtils/ImgGenDisplay.d.ts +3 -0
  11. package/components/ImgGenUtils/ImgGenDisplay.js +192 -0
  12. package/components/ImgGenUtils/ImgGenDisplay.js.map +1 -0
  13. package/components/ImgGenUtils/ImgGenDisplayPlaceholder.d.ts +3 -0
  14. package/components/ImgGenUtils/ImgGenDisplayPlaceholder.js +90 -0
  15. package/components/ImgGenUtils/ImgGenDisplayPlaceholder.js.map +1 -0
  16. package/components/ImgGenUtils/ImgGenDisplayUtils.d.ts +27 -0
  17. package/components/ImgGenUtils/ImgGenDisplayUtils.js +95 -0
  18. package/components/ImgGenUtils/ImgGenDisplayUtils.js.map +1 -0
  19. package/components/ImgGenUtils/ImgGenError.d.ts +3 -0
  20. package/components/ImgGenUtils/ImgGenError.js +7 -0
  21. package/components/ImgGenUtils/ImgGenError.js.map +1 -0
  22. package/components/ImgGenUtils/ImgGenFileDrop.d.ts +11 -0
  23. package/components/ImgGenUtils/ImgGenFileDrop.js +49 -0
  24. package/components/ImgGenUtils/ImgGenFileDrop.js.map +1 -0
  25. package/components/ImgGenUtils/ImgGenModal.d.ts +24 -0
  26. package/components/ImgGenUtils/ImgGenModal.js +63 -0
  27. package/components/ImgGenUtils/ImgGenModal.js.map +1 -0
  28. package/components/ImgGenUtils/ImgGenModeUtils.d.ts +9 -0
  29. package/components/ImgGenUtils/ImgGenModeUtils.js +48 -0
  30. package/components/ImgGenUtils/ImgGenModeUtils.js.map +1 -0
  31. package/components/ImgGenUtils/ImgGenPromptWaiting.d.ts +11 -0
  32. package/components/ImgGenUtils/ImgGenPromptWaiting.js +36 -0
  33. package/components/ImgGenUtils/ImgGenPromptWaiting.js.map +1 -0
  34. package/components/ImgGenUtils/ImgGenUploadWaiting.d.ts +16 -0
  35. package/components/ImgGenUtils/ImgGenUploadWaiting.js +131 -0
  36. package/components/ImgGenUtils/ImgGenUploadWaiting.js.map +1 -0
  37. package/components/ImgGenUtils/index.d.ts +6 -0
  38. package/components/ImgGenUtils/index.js +7 -0
  39. package/components/ImgGenUtils/index.js.map +1 -0
  40. package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.d.ts +9 -0
  41. package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.js +30 -0
  42. package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.js.map +1 -0
  43. package/components/ImgGenUtils/overlays/ImageOverlay.d.ts +22 -0
  44. package/components/ImgGenUtils/overlays/ImageOverlay.js +8 -0
  45. package/components/ImgGenUtils/overlays/ImageOverlay.js.map +1 -0
  46. package/components/ImgGenUtils/types.d.ts +29 -0
  47. package/components/ImgGenUtils/types.js +2 -0
  48. package/components/ImgGenUtils/types.js.map +1 -0
  49. package/components/ImgGenUtils.d.ts +2 -0
  50. package/components/ImgGenUtils.js +3 -0
  51. package/components/ImgGenUtils.js.map +1 -0
  52. package/components/PromptBar.d.ts +11 -0
  53. package/components/PromptBar.js +23 -0
  54. package/components/PromptBar.js.map +1 -0
  55. package/hooks/image-gen/image-generator.d.ts +11 -0
  56. package/hooks/image-gen/image-generator.js +136 -0
  57. package/hooks/image-gen/image-generator.js.map +1 -0
  58. package/hooks/image-gen/index.d.ts +7 -0
  59. package/hooks/image-gen/index.js +6 -0
  60. package/hooks/image-gen/index.js.map +1 -0
  61. package/hooks/image-gen/types.d.ts +66 -0
  62. package/hooks/image-gen/types.js +2 -0
  63. package/hooks/image-gen/types.js.map +1 -0
  64. package/hooks/image-gen/use-image-gen.d.ts +4 -0
  65. package/hooks/image-gen/use-image-gen.js +544 -0
  66. package/hooks/image-gen/use-image-gen.js.map +1 -0
  67. package/hooks/image-gen/utils.d.ts +20 -0
  68. package/hooks/image-gen/utils.js +159 -0
  69. package/hooks/image-gen/utils.js.map +1 -0
  70. package/hooks/use-image-gen.d.ts +1 -0
  71. package/hooks/use-image-gen.js +2 -0
  72. package/hooks/use-image-gen.js.map +1 -0
  73. package/index.d.ts +22 -0
  74. package/index.js +21 -0
  75. package/index.js.map +1 -0
  76. package/package.json +30 -0
  77. package/tsconfig.json +22 -0
  78. package/utils/base64.d.ts +1 -0
  79. package/utils/base64.js +13 -0
  80. package/utils/base64.js.map +1 -0
  81. package/utils/debug.d.ts +2 -0
  82. package/utils/debug.js +8 -0
  83. package/utils/debug.js.map +1 -0
  84. package/utils/style-utils.d.ts +17 -0
  85. package/utils/style-utils.js +15 -0
  86. package/utils/style-utils.js.map +1 -0
  87. package/utils/styles.d.ts +227 -0
  88. package/utils/styles.js +230 -0
  89. package/utils/styles.js.map +1 -0
@@ -0,0 +1,159 @@
1
+ export const MODULE_STATE = {
2
+ pendingImageGenCalls: new Map(),
3
+ pendingPrompts: new Set(),
4
+ processingRequests: new Set(),
5
+ requestTimestamps: new Map(),
6
+ requestCounter: 0,
7
+ createdDocuments: new Map(), // Track document IDs created for each generation request
8
+ pendingDocumentCreations: new Map(),
9
+ };
10
+ export function cleanupRequestKey(key) {
11
+ MODULE_STATE.pendingImageGenCalls.delete(key);
12
+ MODULE_STATE.processingRequests.delete(key);
13
+ MODULE_STATE.pendingPrompts.delete(key);
14
+ MODULE_STATE.pendingDocumentCreations.delete(key);
15
+ MODULE_STATE.requestTimestamps.delete(key);
16
+ }
17
+ export const cleanupInterval = setInterval(() => {
18
+ const now = Date.now();
19
+ for (const [key, timestamp] of MODULE_STATE.requestTimestamps.entries()) {
20
+ if (now - timestamp > 5 * 60 * 1000) {
21
+ MODULE_STATE.createdDocuments.delete(key);
22
+ cleanupRequestKey(key);
23
+ }
24
+ }
25
+ }, 60000);
26
+ export function hashInput(prompt, options) {
27
+ const inputString = JSON.stringify({
28
+ prompt,
29
+ options,
30
+ });
31
+ let hash = 2166136261;
32
+ for (let i = 0; i < inputString.length; i++) {
33
+ hash ^= inputString.charCodeAt(i);
34
+ hash = Math.imul(hash, 16777619);
35
+ }
36
+ const hashHex = (hash >>> 0).toString(16).padStart(8, '0');
37
+ const requestId = hashHex.slice(0, 12);
38
+ return `${requestId}-${Date.now().toString(36)}`;
39
+ }
40
+ export function base64ToFile(base64Data, filename) {
41
+ const byteString = atob(base64Data);
42
+ const ab = new ArrayBuffer(byteString.length);
43
+ const ia = new Uint8Array(ab);
44
+ for (let i = 0; i < byteString.length; i++) {
45
+ ia[i] = byteString.charCodeAt(i);
46
+ }
47
+ const blob = new Blob([ab], { type: 'image/png' });
48
+ return new File([blob], filename, { type: 'image/png' });
49
+ }
50
+ export function generateVersionId(versionNumber) {
51
+ return `v${versionNumber}`;
52
+ }
53
+ export function getVersionsFromDocument(document) {
54
+ if (document?.versions && document.versions.length > 0) {
55
+ return {
56
+ versions: document.versions,
57
+ currentVersion: document.currentVersion ?? document.versions.length,
58
+ };
59
+ }
60
+ if (document?._files?.image) {
61
+ return {
62
+ versions: [{ id: 'v1', created: document.created || Date.now() }],
63
+ currentVersion: 1,
64
+ };
65
+ }
66
+ return { versions: [], currentVersion: 0 };
67
+ }
68
+ export function generatePromptKey(promptNumber) {
69
+ return `p${promptNumber}`;
70
+ }
71
+ export function getPromptsFromDocument(document) {
72
+ if (document?.prompts && document?.currentPromptKey) {
73
+ return {
74
+ prompts: document.prompts,
75
+ currentPromptKey: document.currentPromptKey,
76
+ };
77
+ }
78
+ if (document?.prompt) {
79
+ return {
80
+ prompts: {
81
+ p1: { text: document.prompt, created: document.created || Date.now() },
82
+ },
83
+ currentPromptKey: 'p1',
84
+ };
85
+ }
86
+ return { prompts: {}, currentPromptKey: '' };
87
+ }
88
+ export function addNewVersion(document, newImageFile, newPrompt) {
89
+ const { versions } = getVersionsFromDocument(document);
90
+ const versionCount = versions.length + 1;
91
+ const newVersionId = generateVersionId(versionCount);
92
+ const { prompts, currentPromptKey } = getPromptsFromDocument(document);
93
+ const updatedPrompts = { ...prompts };
94
+ let updatedCurrentPromptKey = currentPromptKey;
95
+ if (newPrompt && (!currentPromptKey || newPrompt !== prompts[currentPromptKey]?.text)) {
96
+ const promptCount = Object.keys(updatedPrompts).length + 1;
97
+ updatedCurrentPromptKey = generatePromptKey(promptCount);
98
+ updatedPrompts[updatedCurrentPromptKey] = {
99
+ text: newPrompt,
100
+ created: Date.now(),
101
+ };
102
+ }
103
+ else if (!updatedCurrentPromptKey && document.prompt) {
104
+ updatedCurrentPromptKey = 'p1';
105
+ updatedPrompts['p1'] = {
106
+ text: document.prompt,
107
+ created: document.created || Date.now(),
108
+ };
109
+ }
110
+ const updatedFiles = { ...(document._files || {}) };
111
+ updatedFiles[newVersionId] = newImageFile;
112
+ if (versionCount === 1 && document._files?.image) {
113
+ updatedFiles['v1'] = document._files.image;
114
+ delete updatedFiles.image;
115
+ }
116
+ return {
117
+ ...document,
118
+ currentVersion: versionCount - 1, // Make it 0-based
119
+ versions: [
120
+ ...versions,
121
+ {
122
+ id: newVersionId,
123
+ created: Date.now(),
124
+ promptKey: updatedCurrentPromptKey,
125
+ },
126
+ ],
127
+ prompts: updatedPrompts,
128
+ currentPromptKey: updatedCurrentPromptKey,
129
+ _files: updatedFiles,
130
+ };
131
+ }
132
+ export function getRelevantOptions(options) {
133
+ if (!options)
134
+ return {};
135
+ const relevantOptions = {};
136
+ if (options.size)
137
+ relevantOptions.size = options.size;
138
+ if (options.quality)
139
+ relevantOptions.quality = options.quality;
140
+ if (options.model)
141
+ relevantOptions.model = options.model;
142
+ if (options.style)
143
+ relevantOptions.style = options.style;
144
+ return relevantOptions;
145
+ }
146
+ export function generateSafeFilename(promptText) {
147
+ const maxPromptChars = 40;
148
+ const cleanedPrompt = promptText
149
+ .toLowerCase()
150
+ .replace(/[^a-z0-9\s-]/g, '')
151
+ .replace(/\s+/g, '-')
152
+ .substring(0, maxPromptChars)
153
+ .replace(/-+$/g, '');
154
+ const now = new Date();
155
+ const datePart = `${now.getFullYear()}${String(now.getMonth() + 1).padStart(2, '0')}${String(now.getDate()).padStart(2, '0')}`;
156
+ const timePart = `${String(now.getHours()).padStart(2, '0')}${String(now.getMinutes()).padStart(2, '0')}`;
157
+ return `${cleanedPrompt}-${datePart}-${timePart}.png`;
158
+ }
159
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../jsr/hooks/image-gen/utils.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,oBAAoB,EAAE,IAAI,GAAG,EAAE;IAC/B,cAAc,EAAE,IAAI,GAAG,EAAE;IACzB,kBAAkB,EAAE,IAAI,GAAG,EAAE;IAC7B,iBAAiB,EAAE,IAAI,GAAG,EAAE;IAC5B,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,IAAI,GAAG,EAAE,EAAE,yDAAyD;IACtF,wBAAwB,EAAE,IAAI,GAAG,EAAE;CACpC,CAAC;AAGF,MAAM,UAAU,iBAAiB,CAAC,GAAW,EAAE;IAC7C,YAAY,CAAC,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC9C,YAAY,CAAC,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5C,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAExC,YAAY,CAAC,wBAAwB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAGlD,YAAY,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAAA,CAC5C;AAGD,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG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,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAC7F,CAAC,EACD,GAAG,CACJ,EAAE,CAAC;IAGJ,OAAO,GAAG,aAAa,IAAI,QAAQ,IAAI,QAAQ,MAAM,CAAC;AAAA,CACvD"}
@@ -0,0 +1 @@
1
+ export * from './image-gen/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './image-gen/index.js';
2
+ //# sourceMappingURL=use-image-gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-image-gen.js","sourceRoot":"","sources":["../../jsr/hooks/use-image-gen.ts"],"names":[],"mappings":"AAMA,cAAc,sBAAsB,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { fireproof, useFireproof as originalUseFireproof, ImgFile } from 'use-fireproof';
2
+ export { fireproof, ImgFile };
3
+ export type * as Fireproof from 'use-fireproof';
4
+ export declare const useFireproof: typeof originalUseFireproof;
5
+ import { callAI } from 'call-ai';
6
+ export { callAI, callAI as callAi };
7
+ export type * as CallAI from 'call-ai';
8
+ export { default as ImgGen } from './components/ImgGen.js';
9
+ export type { ImgGenProps } from './components/ImgGen.js';
10
+ export { ControlsBar } from './components/ControlsBar.js';
11
+ export { PromptBar } from './components/PromptBar.js';
12
+ export { useImageGen, hashInput } from './hooks/image-gen/index.js';
13
+ export { type ImgGenClasses, defaultClasses } from './utils/style-utils.js';
14
+ export { base64ToFile } from './utils/base64.js';
15
+ export { ImageOverlay } from './components/ImgGenUtils/overlays/ImageOverlay.js';
16
+ export { ImgGenDisplay } from './components/ImgGenUtils/ImgGenDisplay.js';
17
+ export { ImgGenModal } from './components/ImgGenUtils/ImgGenModal.js';
18
+ export { ImgGenDisplayPlaceholder } from './components/ImgGenUtils/ImgGenDisplayPlaceholder.js';
19
+ export { MODULE_STATE } from './hooks/image-gen/utils.js';
20
+ export { addNewVersion } from './hooks/image-gen/utils.js';
21
+ export { type ImageDocument } from './hooks/image-gen/types.js';
22
+ export { type UseImageGenOptions, type UseImageGenResult, type PartialImageDocument, } from './hooks/image-gen/types.js';
package/index.js ADDED
@@ -0,0 +1,21 @@
1
+ import { fireproof, useFireproof as originalUseFireproof, ImgFile } from 'use-fireproof';
2
+ export { fireproof, ImgFile };
3
+ export const useFireproof = (...args) => {
4
+ console.log('Using vibes-customized useFireproof');
5
+ return originalUseFireproof(...args);
6
+ };
7
+ import { callAI } from 'call-ai';
8
+ export { callAI, callAI as callAi };
9
+ export { default as ImgGen } from './components/ImgGen.js';
10
+ export { ControlsBar } from './components/ControlsBar.js';
11
+ export { PromptBar } from './components/PromptBar.js';
12
+ export { useImageGen, hashInput } from './hooks/image-gen/index.js';
13
+ export { defaultClasses } from './utils/style-utils.js';
14
+ export { base64ToFile } from './utils/base64.js';
15
+ export { ImageOverlay } from './components/ImgGenUtils/overlays/ImageOverlay.js';
16
+ export { ImgGenDisplay } from './components/ImgGenUtils/ImgGenDisplay.js';
17
+ export { ImgGenModal } from './components/ImgGenUtils/ImgGenModal.js';
18
+ export { ImgGenDisplayPlaceholder } from './components/ImgGenUtils/ImgGenDisplayPlaceholder.js';
19
+ export { MODULE_STATE } from './hooks/image-gen/utils.js';
20
+ export { addNewVersion } from './hooks/image-gen/utils.js';
21
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,IAAI,oBAAoB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAO9B,MAAM,CAAC,MAAM,YAAY,GAAgC,CACvD,GAAG,IAA6C,EAChD,EAAE,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACnD,OAAO,oBAAoB,CAAC,GAAG,IAAI,CAAC,CAAC;AAAA,CACtC,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,MAAM,EAAE,CAAC;AAMpC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAI3D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,EAAsB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG5E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAGhG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@vibes.diy/use-vibes-base",
3
+ "version": "0.12.0-dev-preview",
4
+ "type": "module",
5
+ "description": "Core components and utilities for use-vibes (internal workspace package)",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./index.d.ts",
9
+ "import": "./index.js"
10
+ }
11
+ },
12
+ "license": "Apache-2.0",
13
+ "dependencies": {
14
+ "call-ai": "^0.12.0-dev-preview",
15
+ "use-fireproof": "^0.23.7",
16
+ "uuid": "^11.1.0"
17
+ },
18
+ "peerDependencies": {
19
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
20
+ },
21
+ "devDependencies": {
22
+ "@fireproof/core-cli": "^0.23.11",
23
+ "@types/react": "^19.1.0",
24
+ "@types/react-dom": "^19.1.2",
25
+ "typescript": "^5.8.2"
26
+ },
27
+ "scripts": {
28
+ "build": "core-cli tsc"
29
+ }
30
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "extends": [
3
+ "/home/runner/work/vibes.diy/vibes.diy/tsconfig.dist.json"
4
+ ],
5
+ "compilerOptions": {
6
+ "outDir": "../npm/",
7
+ "noEmit": false
8
+ },
9
+ "include": [
10
+ "**/*",
11
+ "**/*"
12
+ ],
13
+ "exclude": [
14
+ "../tests/**/*",
15
+ "node_modules",
16
+ "dist",
17
+ "node_modules",
18
+ "dist",
19
+ ".git",
20
+ ".vscode"
21
+ ]
22
+ }
@@ -0,0 +1 @@
1
+ export declare function base64ToFile(base64Data: string, filename?: string, mimeType?: string): File;
@@ -0,0 +1,13 @@
1
+ export function base64ToFile(base64Data, filename = 'generated-image.png', mimeType = 'image/png') {
2
+ const base64Content = base64Data.includes('base64,')
3
+ ? base64Data.split('base64,')[1]
4
+ : base64Data;
5
+ const binaryStr = atob(base64Content);
6
+ const bytes = new Uint8Array(binaryStr.length);
7
+ for (let i = 0; i < binaryStr.length; i++) {
8
+ bytes[i] = binaryStr.charCodeAt(i);
9
+ }
10
+ const blob = new Blob([bytes], { type: mimeType });
11
+ return new File([blob], filename, { type: mimeType });
12
+ }
13
+ //# sourceMappingURL=base64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../jsr/utils/base64.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAC1B,UAAkB,EAClB,QAAQ,GAAG,qBAAqB,EAChC,QAAQ,GAAG,WAAW,EAChB;IAEN,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC;QAClD,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC,UAAU,CAAC;IAGf,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;IAGtC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAGD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACnD,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACvD"}
@@ -0,0 +1,2 @@
1
+ export declare const isDebug: () => boolean;
2
+ export declare function logDebug(...args: unknown[]): void;
package/utils/debug.js ADDED
@@ -0,0 +1,8 @@
1
+ export const isDebug = () => Boolean(import.meta.env?.DEV) &&
2
+ (typeof window === 'undefined' || localStorage.getItem('debugDelete') === '1');
3
+ export function logDebug(...args) {
4
+ if (isDebug()) {
5
+ console.log(...args);
6
+ }
7
+ }
8
+ //# sourceMappingURL=debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../jsr/utils/debug.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,GAAY,EAAE,CACnC,OAAO,CAAE,OAAO,IAA+C,CAAC,GAAG,EAAE,GAAG,CAAC;IACzE,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC;AAEjF,MAAM,UAAU,QAAQ,CAAC,GAAG,IAAe,EAAE;IAC3C,IAAI,OAAO,EAAE,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,CAAC;AAAA,CACF"}
@@ -0,0 +1,17 @@
1
+ export declare function combineClasses(...classes: (string | boolean | null | undefined)[]): string;
2
+ export interface ImgGenClasses {
3
+ readonly root: string;
4
+ readonly container: string;
5
+ readonly image: string;
6
+ readonly overlay: string;
7
+ readonly progress: string;
8
+ readonly placeholder: string;
9
+ readonly error: string;
10
+ readonly controls: string;
11
+ readonly button: string;
12
+ readonly prompt: string;
13
+ readonly deleteOverlay: string;
14
+ readonly dropZone: string;
15
+ readonly uploadWaiting: string;
16
+ }
17
+ export declare const defaultClasses: Partial<ImgGenClasses>;
@@ -0,0 +1,15 @@
1
+ export function combineClasses(...classes) {
2
+ const validClasses = classes.filter(Boolean);
3
+ const allClasses = [...validClasses];
4
+ validClasses.forEach((cls) => {
5
+ if (cls.startsWith('imggen-')) {
6
+ const legacyClass = cls.replace('imggen-', 'img-gen-');
7
+ if (!allClasses.includes(legacyClass)) {
8
+ allClasses.push(legacyClass);
9
+ }
10
+ }
11
+ });
12
+ return allClasses.join(' ');
13
+ }
14
+ export const defaultClasses = {};
15
+ //# sourceMappingURL=style-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style-utils.js","sourceRoot":"","sources":["../../jsr/utils/style-utils.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,cAAc,CAAC,GAAG,OAAgD,EAAU;IAE1F,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAa,CAAC;IAGzD,MAAM,UAAU,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;IAGrC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;QAC5B,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAE9B,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAEvD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;gBACtC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;IAAA,CACF,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAAA,CAC7B;AAqCD,MAAM,CAAC,MAAM,cAAc,GAA2B,EAAE,CAAC"}
@@ -0,0 +1,227 @@
1
+ export declare const imgGenTheme: {
2
+ readonly colors: {
3
+ readonly text: "#333";
4
+ readonly background: "#333333";
5
+ readonly overlayBg: "rgba(255, 255, 255, 0.5)";
6
+ readonly accent: "#0066cc";
7
+ readonly flash: "#fe0";
8
+ readonly errorBg: "rgba(0, 0, 0, 0.7)";
9
+ readonly errorBorder: "#ff6666";
10
+ readonly errorText: "#ff6666";
11
+ readonly errorTextBody: "#ffffff";
12
+ readonly buttonBg: "rgba(255, 255, 255, 0.7)";
13
+ readonly deleteHover: "#ff3333";
14
+ };
15
+ readonly dimensions: {
16
+ readonly borderRadius: "8px";
17
+ readonly padding: "8px";
18
+ readonly buttonSize: "28px";
19
+ readonly progressHeight: "8px";
20
+ };
21
+ readonly typography: {
22
+ readonly fontSize: "14px";
23
+ readonly fontWeight: "bold";
24
+ readonly lineHeight: "1.5";
25
+ };
26
+ readonly effects: {
27
+ readonly blurRadius: "4px";
28
+ readonly transitionSpeed: "0.2s";
29
+ readonly shadow: "0 4px 8px rgba(0, 0, 0, 0.2)";
30
+ };
31
+ };
32
+ export declare const imgGenStyles: {
33
+ readonly root: {
34
+ readonly position: "relative";
35
+ readonly maxWidth: "100%";
36
+ readonly overflow: "hidden";
37
+ };
38
+ readonly container: {
39
+ readonly position: "relative";
40
+ readonly width: "100%";
41
+ readonly height: "100%";
42
+ };
43
+ readonly imageContainer: {
44
+ readonly position: "relative";
45
+ readonly width: "100%";
46
+ readonly overflow: "hidden";
47
+ };
48
+ readonly image: {
49
+ readonly width: "100%";
50
+ readonly height: "auto";
51
+ readonly display: "block";
52
+ };
53
+ readonly overlay: {
54
+ readonly position: "absolute";
55
+ readonly bottom: 0;
56
+ readonly left: 0;
57
+ readonly right: 0;
58
+ readonly padding: "8px";
59
+ readonly backgroundColor: "rgba(255, 255, 255, 0.5)";
60
+ readonly backdropFilter: "blur(4px)";
61
+ readonly transition: "opacity 0.2s ease";
62
+ readonly zIndex: 10;
63
+ readonly display: "flex";
64
+ readonly flexDirection: "column";
65
+ };
66
+ readonly topLine: {
67
+ readonly display: "flex";
68
+ readonly alignItems: "center";
69
+ readonly justifyContent: "space-between";
70
+ readonly width: "100%";
71
+ };
72
+ readonly prompt: {
73
+ readonly width: "100%";
74
+ readonly padding: "4px";
75
+ readonly marginBottom: "8px";
76
+ };
77
+ readonly promptText: {
78
+ readonly color: "#333";
79
+ readonly width: "100%";
80
+ readonly textAlign: "center";
81
+ readonly fontWeight: "bold";
82
+ readonly padding: "2px";
83
+ readonly cursor: "pointer";
84
+ };
85
+ readonly promptInput: {
86
+ readonly width: "100%";
87
+ readonly boxSizing: "border-box";
88
+ readonly padding: "6px 8px";
89
+ readonly border: "1px solid #ccc";
90
+ readonly borderRadius: "4px";
91
+ readonly fontSize: "14px";
92
+ readonly fontWeight: "bold";
93
+ readonly color: "#333";
94
+ readonly backgroundColor: "white";
95
+ };
96
+ readonly controls: {
97
+ readonly display: "flex";
98
+ readonly alignItems: "center";
99
+ readonly justifyContent: "space-between";
100
+ readonly width: "100%";
101
+ readonly paddingTop: "2px";
102
+ };
103
+ readonly controlGroup: {
104
+ readonly display: "flex";
105
+ readonly gap: "6px";
106
+ readonly alignItems: "center";
107
+ };
108
+ readonly button: {
109
+ readonly background: "rgba(255, 255, 255, 0.7)";
110
+ readonly borderRadius: "50%";
111
+ readonly width: "28px";
112
+ readonly height: "28px";
113
+ readonly display: "flex";
114
+ readonly alignItems: "center";
115
+ readonly justifyContent: "center";
116
+ readonly border: "none";
117
+ readonly cursor: "pointer";
118
+ readonly opacity: 0.5;
119
+ readonly transition: "opacity 0.2s ease";
120
+ readonly padding: 0;
121
+ readonly fontSize: "14px";
122
+ readonly color: "#333";
123
+ };
124
+ readonly progressContainer: {
125
+ readonly position: "absolute";
126
+ readonly top: 0;
127
+ readonly left: 0;
128
+ readonly right: 0;
129
+ readonly zIndex: 50;
130
+ };
131
+ readonly progress: {
132
+ readonly position: "absolute";
133
+ readonly top: 0;
134
+ readonly left: 0;
135
+ readonly height: "8px";
136
+ readonly backgroundColor: "#0066cc";
137
+ readonly transition: "width 0.3s ease-in-out";
138
+ readonly zIndex: 11;
139
+ };
140
+ readonly placeholder: {
141
+ readonly width: "100%";
142
+ readonly height: "100%";
143
+ readonly backgroundColor: "#333333";
144
+ readonly position: "relative";
145
+ readonly overflow: "hidden";
146
+ readonly display: "flex";
147
+ readonly alignItems: "center";
148
+ readonly justifyContent: "center";
149
+ readonly boxSizing: "border-box";
150
+ };
151
+ readonly statusText: {
152
+ readonly width: "100%";
153
+ readonly textAlign: "center";
154
+ readonly fontSize: "14px";
155
+ readonly color: "#333";
156
+ readonly opacity: 0.7;
157
+ readonly padding: "8px 0";
158
+ };
159
+ readonly errorContainer: {
160
+ readonly backgroundColor: "#222";
161
+ readonly aspectRatio: "1 / 1";
162
+ readonly display: "flex";
163
+ readonly flexDirection: "column";
164
+ readonly justifyContent: "center";
165
+ readonly alignItems: "center";
166
+ readonly padding: "1rem";
167
+ readonly width: "100%";
168
+ readonly borderRadius: "8px";
169
+ readonly overflow: "hidden";
170
+ };
171
+ readonly error: {
172
+ readonly backgroundColor: "#000";
173
+ readonly color: "#ff6666";
174
+ readonly padding: "1.5rem";
175
+ readonly borderRadius: "8px";
176
+ readonly border: "1px solid #ff6666";
177
+ readonly boxShadow: "0 4px 8px rgba(0, 0, 0, 0.2)";
178
+ readonly maxWidth: "80%";
179
+ readonly display: "flex";
180
+ readonly flexDirection: "column";
181
+ readonly justifyContent: "center";
182
+ readonly alignItems: "center";
183
+ readonly textAlign: "center";
184
+ };
185
+ readonly errorTitle: {
186
+ readonly color: "#ff6666";
187
+ readonly marginTop: 0;
188
+ readonly fontWeight: "bold";
189
+ readonly fontSize: "18px";
190
+ readonly marginBottom: "12px";
191
+ readonly textAlign: "center";
192
+ };
193
+ readonly errorMessage: {
194
+ readonly whiteSpace: "pre-wrap";
195
+ readonly color: "#ffffff";
196
+ readonly fontSize: "14px";
197
+ readonly lineHeight: "1.5";
198
+ readonly textAlign: "left";
199
+ readonly fontFamily: "monospace, sans-serif";
200
+ readonly marginBottom: 0;
201
+ };
202
+ readonly promptInputEditMode: {
203
+ readonly border: "2px solid #0066cc";
204
+ readonly padding: "6px 10px";
205
+ readonly borderRadius: "6px";
206
+ };
207
+ readonly truncate: {
208
+ readonly whiteSpace: "nowrap";
209
+ readonly overflow: "hidden";
210
+ readonly textOverflow: "ellipsis";
211
+ };
212
+ };
213
+ export declare function createStyledVariant(baseStyle: Record<string, any>, variants?: Record<string, any>): Record<string, any>;
214
+ export declare const styleUtils: {
215
+ hover: (styles: Record<string, any>) => {
216
+ "&:hover": Record<string, any>;
217
+ };
218
+ disabled: (styles: Record<string, any>) => {
219
+ "&:disabled": Record<string, any>;
220
+ };
221
+ mediaQuery: (query: string, styles: Record<string, any>) => {
222
+ [x: string]: Record<string, any>;
223
+ };
224
+ transition: (properties: string[], duration?: string) => {
225
+ transition: string;
226
+ };
227
+ };