@gallop.software/studio 1.0.6 → 1.1.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/dist/index.d.mts CHANGED
@@ -7,21 +7,27 @@ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
7
7
  */
8
8
  declare function StudioButton(): _emotion_react_jsx_runtime.JSX.Element | null;
9
9
 
10
+ /**
11
+ * Dimensions tuple [width, height]
12
+ */
13
+ type Dimensions = [number, number];
10
14
  /**
11
15
  * Meta entry - works for images and non-images
12
- * Images have w, h, b (after processing)
13
- * c is the index into _cdns array (omit if not on CDN)
16
+ * o: original dimensions, b: blurhash, c: CDN index
17
+ * sm/md/lg/f: thumbnail dimensions (presence implies processed)
14
18
  */
15
19
  interface MetaEntry {
16
- w?: number;
17
- h?: number;
20
+ o?: Dimensions;
18
21
  b?: string;
19
- p?: 1;
22
+ sm?: Dimensions;
23
+ md?: Dimensions;
24
+ lg?: Dimensions;
25
+ f?: Dimensions;
20
26
  c?: number;
21
27
  }
22
28
  /**
23
- * Meta schema - keyed by path from public folder (legacy type)
24
- * Example: { "/portfolio/photo.jpg": { w: 2400, h: 1600, b: "..." } }
29
+ * Meta schema - keyed by path from public folder
30
+ * Example: { "/portfolio/photo.jpg": { o: [2400, 1600], b: "...", sm: [300, 200], ... } }
25
31
  */
26
32
  type LeanMeta = Record<string, MetaEntry>;
27
33
  type LeanImageEntry = MetaEntry;
package/dist/index.d.ts CHANGED
@@ -7,21 +7,27 @@ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
7
7
  */
8
8
  declare function StudioButton(): _emotion_react_jsx_runtime.JSX.Element | null;
9
9
 
10
+ /**
11
+ * Dimensions tuple [width, height]
12
+ */
13
+ type Dimensions = [number, number];
10
14
  /**
11
15
  * Meta entry - works for images and non-images
12
- * Images have w, h, b (after processing)
13
- * c is the index into _cdns array (omit if not on CDN)
16
+ * o: original dimensions, b: blurhash, c: CDN index
17
+ * sm/md/lg/f: thumbnail dimensions (presence implies processed)
14
18
  */
15
19
  interface MetaEntry {
16
- w?: number;
17
- h?: number;
20
+ o?: Dimensions;
18
21
  b?: string;
19
- p?: 1;
22
+ sm?: Dimensions;
23
+ md?: Dimensions;
24
+ lg?: Dimensions;
25
+ f?: Dimensions;
20
26
  c?: number;
21
27
  }
22
28
  /**
23
- * Meta schema - keyed by path from public folder (legacy type)
24
- * Example: { "/portfolio/photo.jpg": { w: 2400, h: 1600, b: "..." } }
29
+ * Meta schema - keyed by path from public folder
30
+ * Example: { "/portfolio/photo.jpg": { o: [2400, 1600], b: "...", sm: [300, 200], ... } }
25
31
  */
26
32
  type LeanMeta = Record<string, MetaEntry>;
27
33
  type LeanImageEntry = MetaEntry;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkWJJHVPLTjs = require('./chunk-WJJHVPLT.js');
5
+ var _chunkVSOTEQ7Xjs = require('./chunk-VSOTEQ7X.js');
6
6
 
7
7
 
8
8
 
@@ -182,5 +182,5 @@ function LoadingState() {
182
182
 
183
183
 
184
184
 
185
- exports.StudioButton = StudioButton; exports.getAllThumbnailPaths = _chunkWJJHVPLTjs.getAllThumbnailPaths; exports.getThumbnailPath = _chunkWJJHVPLTjs.getThumbnailPath;
185
+ exports.StudioButton = StudioButton; exports.getAllThumbnailPaths = _chunkVSOTEQ7Xjs.getAllThumbnailPaths; exports.getThumbnailPath = _chunkVSOTEQ7Xjs.getThumbnailPath;
186
186
  //# sourceMappingURL=index.js.map
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getAllThumbnailPaths,
4
4
  getThumbnailPath
5
- } from "./chunk-FDWPNRNZ.mjs";
5
+ } from "./chunk-CIS6B4SP.mjs";
6
6
  import {
7
7
  baseReset,
8
8
  colors,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gallop.software/studio",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "description": "Media manager for Gallop templates - upload, process, and sync images to CDN",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["/**\n * Meta entry - works for images and non-images\n * Images have w, h, b (after processing)\n * c is the index into _cdns array (omit if not on CDN)\n */\nexport interface MetaEntry {\n w?: number // original width (images only)\n h?: number // original height (images only)\n b?: string // blurhash (images only, after processing)\n p?: 1 // processed (has thumbnails and blurhash)\n c?: number // CDN index - index into _cdns array (omit if not on CDN)\n}\n\n/**\n * Full meta schema including special keys\n * _cdns: Array of CDN base URLs\n * Other keys: file paths from public folder\n */\nexport interface FullMeta {\n _cdns?: string[] // Array of CDN base URLs\n [key: string]: MetaEntry | string[] | undefined\n}\n\n/**\n * Meta schema - keyed by path from public folder (legacy type)\n * Example: { \"/portfolio/photo.jpg\": { w: 2400, h: 1600, b: \"...\" } }\n */\nexport type LeanMeta = Record<string, MetaEntry>\n\n// Legacy alias for compatibility\nexport type LeanImageEntry = MetaEntry\n\n/**\n * File/folder item for browser\n */\nexport interface FileItem {\n name: string\n path: string\n type: 'file' | 'folder'\n size?: number\n dimensions?: { width: number; height: number }\n isProcessed?: boolean\n cdnPushed?: boolean\n cdnBaseUrl?: string // CDN base URL when pushed to cloud\n isRemote?: boolean // true if CDN URL doesn't match R2 (external import)\n isProtected?: boolean // true for images folder and its contents (cannot select/modify)\n // Folder-specific properties\n fileCount?: number\n totalSize?: number\n // For showing thumbnails - path to -sm version if exists\n thumbnail?: string\n // Whether a processed thumbnail exists\n hasThumbnail?: boolean\n}\n\n/**\n * Studio configuration\n */\nexport interface StudioConfig {\n r2AccountId?: string\n r2AccessKeyId?: string\n r2SecretAccessKey?: string\n r2BucketName?: string\n r2PublicUrl?: string\n thumbnailSizes?: {\n small: number\n medium: number\n large: number\n }\n}\n\n/**\n * Get thumbnail path from original image path\n */\nexport function getThumbnailPath(originalPath: string, size: 'sm' | 'md' | 'lg' | 'full'): string {\n if (size === 'full') {\n const ext = originalPath.match(/\\.\\w+$/)?.[0] || '.jpg'\n const base = originalPath.replace(/\\.\\w+$/, '')\n const outputExt = ext.toLowerCase() === '.png' ? '.png' : '.jpg'\n return `/images${base}${outputExt}`\n }\n const ext = originalPath.match(/\\.\\w+$/)?.[0] || '.jpg'\n const base = originalPath.replace(/\\.\\w+$/, '')\n const outputExt = ext.toLowerCase() === '.png' ? '.png' : '.jpg'\n return `/images${base}-${size}${outputExt}`\n}\n\n/**\n * Get all thumbnail paths for an image\n */\nexport function getAllThumbnailPaths(originalPath: string): string[] {\n return [\n getThumbnailPath(originalPath, 'full'),\n getThumbnailPath(originalPath, 'lg'),\n getThumbnailPath(originalPath, 'md'),\n getThumbnailPath(originalPath, 'sm'),\n ]\n}\n"],"mappings":";AA0EO,SAAS,iBAAiB,cAAsB,MAA2C;AAChG,MAAI,SAAS,QAAQ;AACnB,UAAMA,OAAM,aAAa,MAAM,QAAQ,IAAI,CAAC,KAAK;AACjD,UAAMC,QAAO,aAAa,QAAQ,UAAU,EAAE;AAC9C,UAAMC,aAAYF,KAAI,YAAY,MAAM,SAAS,SAAS;AAC1D,WAAO,UAAUC,KAAI,GAAGC,UAAS;AAAA,EACnC;AACA,QAAM,MAAM,aAAa,MAAM,QAAQ,IAAI,CAAC,KAAK;AACjD,QAAM,OAAO,aAAa,QAAQ,UAAU,EAAE;AAC9C,QAAM,YAAY,IAAI,YAAY,MAAM,SAAS,SAAS;AAC1D,SAAO,UAAU,IAAI,IAAI,IAAI,GAAG,SAAS;AAC3C;AAKO,SAAS,qBAAqB,cAAgC;AACnE,SAAO;AAAA,IACL,iBAAiB,cAAc,MAAM;AAAA,IACrC,iBAAiB,cAAc,IAAI;AAAA,IACnC,iBAAiB,cAAc,IAAI;AAAA,IACnC,iBAAiB,cAAc,IAAI;AAAA,EACrC;AACF;","names":["ext","base","outputExt"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/chrisb/Sites/studio/dist/chunk-WJJHVPLT.js","../src/types.ts"],"names":["ext","base","outputExt"],"mappings":"AAAA;AC0EO,SAAS,gBAAA,CAAiB,YAAA,EAAsB,IAAA,EAA2C;AAChG,EAAA,GAAA,CAAI,KAAA,IAAS,MAAA,EAAQ;AACnB,IAAA,MAAMA,KAAAA,kBAAM,YAAA,mBAAa,KAAA,mBAAM,QAAQ,CAAA,4BAAA,CAAI,CAAC,IAAA,GAAK,MAAA;AACjD,IAAA,MAAMC,MAAAA,EAAO,YAAA,CAAa,OAAA,CAAQ,QAAA,EAAU,EAAE,CAAA;AAC9C,IAAA,MAAMC,WAAAA,EAAYF,IAAAA,CAAI,WAAA,CAAY,EAAA,IAAM,OAAA,EAAS,OAAA,EAAS,MAAA;AAC1D,IAAA,OAAO,CAAA,OAAA,EAAUC,KAAI,CAAA,EAAA;AACvB,EAAA;AACyB,EAAA;AACZ,EAAA;AACS,EAAA;AACG,EAAA;AAC3B;AAKgB;AACP,EAAA;AACY,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACnB,EAAA;AACF;AD5E2B;AACA;AACA;AACA;AACA","file":"/Users/chrisb/Sites/studio/dist/chunk-WJJHVPLT.js","sourcesContent":[null,"/**\n * Meta entry - works for images and non-images\n * Images have w, h, b (after processing)\n * c is the index into _cdns array (omit if not on CDN)\n */\nexport interface MetaEntry {\n w?: number // original width (images only)\n h?: number // original height (images only)\n b?: string // blurhash (images only, after processing)\n p?: 1 // processed (has thumbnails and blurhash)\n c?: number // CDN index - index into _cdns array (omit if not on CDN)\n}\n\n/**\n * Full meta schema including special keys\n * _cdns: Array of CDN base URLs\n * Other keys: file paths from public folder\n */\nexport interface FullMeta {\n _cdns?: string[] // Array of CDN base URLs\n [key: string]: MetaEntry | string[] | undefined\n}\n\n/**\n * Meta schema - keyed by path from public folder (legacy type)\n * Example: { \"/portfolio/photo.jpg\": { w: 2400, h: 1600, b: \"...\" } }\n */\nexport type LeanMeta = Record<string, MetaEntry>\n\n// Legacy alias for compatibility\nexport type LeanImageEntry = MetaEntry\n\n/**\n * File/folder item for browser\n */\nexport interface FileItem {\n name: string\n path: string\n type: 'file' | 'folder'\n size?: number\n dimensions?: { width: number; height: number }\n isProcessed?: boolean\n cdnPushed?: boolean\n cdnBaseUrl?: string // CDN base URL when pushed to cloud\n isRemote?: boolean // true if CDN URL doesn't match R2 (external import)\n isProtected?: boolean // true for images folder and its contents (cannot select/modify)\n // Folder-specific properties\n fileCount?: number\n totalSize?: number\n // For showing thumbnails - path to -sm version if exists\n thumbnail?: string\n // Whether a processed thumbnail exists\n hasThumbnail?: boolean\n}\n\n/**\n * Studio configuration\n */\nexport interface StudioConfig {\n r2AccountId?: string\n r2AccessKeyId?: string\n r2SecretAccessKey?: string\n r2BucketName?: string\n r2PublicUrl?: string\n thumbnailSizes?: {\n small: number\n medium: number\n large: number\n }\n}\n\n/**\n * Get thumbnail path from original image path\n */\nexport function getThumbnailPath(originalPath: string, size: 'sm' | 'md' | 'lg' | 'full'): string {\n if (size === 'full') {\n const ext = originalPath.match(/\\.\\w+$/)?.[0] || '.jpg'\n const base = originalPath.replace(/\\.\\w+$/, '')\n const outputExt = ext.toLowerCase() === '.png' ? '.png' : '.jpg'\n return `/images${base}${outputExt}`\n }\n const ext = originalPath.match(/\\.\\w+$/)?.[0] || '.jpg'\n const base = originalPath.replace(/\\.\\w+$/, '')\n const outputExt = ext.toLowerCase() === '.png' ? '.png' : '.jpg'\n return `/images${base}-${size}${outputExt}`\n}\n\n/**\n * Get all thumbnail paths for an image\n */\nexport function getAllThumbnailPaths(originalPath: string): string[] {\n return [\n getThumbnailPath(originalPath, 'full'),\n getThumbnailPath(originalPath, 'lg'),\n getThumbnailPath(originalPath, 'md'),\n getThumbnailPath(originalPath, 'sm'),\n ]\n}\n"]}