@aptly-as/sdk-web 0.0.1

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/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # Aptly web sdk
2
+
3
+ Helper classes for building aptly web applications.
4
+
5
+ * Media handling (srcSet and css media queries)
6
+
7
+ ## Installation
8
+ ```
9
+ yarn
10
+ npm install
11
+ ```
12
+
13
+ ## Development
14
+ Link with `yarn link` then run
15
+ ```
16
+ yarn start
17
+ ```
@@ -0,0 +1,20 @@
1
+ export class AptlyMedia {
2
+ constructor(cloudinaryId) {
3
+ this.cloudinaryId = cloudinaryId;
4
+ }
5
+ srcSet(url, options) {
6
+ if (!url)
7
+ return undefined;
8
+ const cloudUrl = typeof url === 'object'
9
+ ? url.url || url.src || url.image : url;
10
+ if (!cloudUrl)
11
+ return undefined;
12
+ const option = new Set([...options]);
13
+ option.add('f_auto');
14
+ const urlOptions = [...option].join(',');
15
+ if (cloudUrl.startsWith('http')) {
16
+ return cloudUrl.replace(/\/(v[^\/]*)\//, `/${urlOptions}/`);
17
+ }
18
+ return `https://res.cloudinary.com/${this._config.media.cloudinaryKey}/image/upload/${urlOptions}/${cloudUrl}`;
19
+ }
20
+ }
@@ -0,0 +1,2 @@
1
+ export * from './media/Media.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './media/Media.js';
@@ -0,0 +1,22 @@
1
+ import { AptlyMediaSrc } from "@aptly-as/types";
2
+ import { ImageSizes } from './media.sets.js';
3
+ import { MediaOption } from './media.options.js';
4
+ export * from './media.options.js';
5
+ declare type AptlyMediaUrl = AptlyMediaSrc | string | undefined;
6
+ interface SrcSetProps {
7
+ src: string;
8
+ srcSet: string;
9
+ sizes: string;
10
+ }
11
+ export declare class Media {
12
+ private cloudinaryKey;
13
+ constructor(cloudinaryKey: string);
14
+ srcSet(url: AptlyMediaUrl, width: ImageSizes, baseOptions?: MediaOption[]): SrcSetProps | undefined;
15
+ css(url: AptlyMediaUrl, width: ImageSizes, baseOptions?: MediaOption[]): string | undefined;
16
+ private getSrcSetsAndOptions;
17
+ private getOptions;
18
+ private areaOptions;
19
+ private createSrcWithOptions;
20
+ private getUrl;
21
+ }
22
+ //# sourceMappingURL=Media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Media.d.ts","sourceRoot":"","sources":["../../lib/media/Media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAyB,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAE/C,cAAc,oBAAoB,CAAC;AAInC,aAAK,aAAa,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAExD,UAAU,WAAW;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,KAAK;IACJ,OAAO,CAAC,aAAa;gBAAb,aAAa,EAAE,MAAM;IAIzC,MAAM,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,GAAE,WAAW,EAAO,GAAG,WAAW,GAAG,SAAS;IAoBvG,GAAG,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,GAAE,WAAW,EAAO,GAAG,MAAM,GAAG,SAAS;IA8B/F,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,MAAM;CAQf"}
@@ -0,0 +1,89 @@
1
+ import { getImageSets } from './media.sets.js';
2
+ export * from './media.options.js';
3
+ export class Media {
4
+ constructor(cloudinaryKey) {
5
+ this.cloudinaryKey = cloudinaryKey;
6
+ }
7
+ srcSet(url, width, baseOptions = []) {
8
+ const opts = this.getSrcSetsAndOptions(url, width, baseOptions);
9
+ if (!opts)
10
+ return opts;
11
+ const { src, sets, options, area } = opts;
12
+ const [srcSet, sizes] = sets.reduce(([_sets, _sizes], x, i) => {
13
+ _sets.push(`${this.createSrcWithOptions(src, x.width, options, area)} ${x.width}w`);
14
+ const min = sets[i - 1] ? sets[i - 1].maxWidth : 0;
15
+ const max = x.maxWidth;
16
+ _sizes.push(max
17
+ ? `(min-width: ${min}px) and (max-width: ${max}px) ${x.width}px`
18
+ : `(min-width: ${min}px) ${x.width}px`);
19
+ return [_sets, _sizes];
20
+ }, [[], []]);
21
+ return { src, srcSet: srcSet.join(','), sizes: sizes.join(',') };
22
+ }
23
+ css(url, width, baseOptions = []) {
24
+ const opts = this.getSrcSetsAndOptions(url, width, baseOptions);
25
+ if (!opts)
26
+ return opts;
27
+ const { src, sets, options, area } = opts;
28
+ return sets.map((x, i) => {
29
+ const url = this.createSrcWithOptions(src, x.width, options, area);
30
+ const url2x = this.createSrcWithOptions(src, x.width2x, options, area);
31
+ const min = sets[i - 1] ? sets[i - 1].maxWidth : 0;
32
+ const max = x.maxWidth;
33
+ return max
34
+ ? `
35
+ @media all and (min-width: ${min}px) and (max-width: ${max}px) {
36
+ background-image: url("${url}");
37
+ }
38
+ @media all and (min-width: ${min}px) and (max-width: ${max}px)
39
+ and (-webkit-min-device-pixel-ratio: 2) {
40
+ background-image: url("${url2x}");
41
+ }
42
+ `
43
+ : `
44
+ background-image: url("${url}");
45
+ @media all and (min-width: ${min}px) and (-webkit-min-device-pixel-ratio: 2) {
46
+ background-image: url("${url2x}");
47
+ }
48
+ `;
49
+ }).join(`
50
+ `);
51
+ }
52
+ getSrcSetsAndOptions(url, width, baseOptions) {
53
+ if (!url)
54
+ return undefined;
55
+ const src = this.getUrl(url);
56
+ if (!src)
57
+ return undefined;
58
+ const sets = getImageSets(width);
59
+ const { options, area } = typeof url === 'object'
60
+ ? this.getOptions(baseOptions, url)
61
+ : { options: baseOptions, area: '' };
62
+ return { src, sets, options, area };
63
+ }
64
+ getOptions(baseOptions, media) {
65
+ const options = baseOptions;
66
+ const areaOptions = this.areaOptions(media);
67
+ return { options, area: areaOptions };
68
+ }
69
+ areaOptions(media) {
70
+ if (media?.area) {
71
+ const { width = 1980, height = 1080, x = 0, y = 0 } = media.area;
72
+ return `w_${width},h_${height},x_${x},y_${y},c_crop/`;
73
+ }
74
+ return '';
75
+ }
76
+ createSrcWithOptions(cloudUrl, width, urlOptions, areaOptions) {
77
+ const replace = [`w_${width}`, ...urlOptions].join(',');
78
+ return cloudUrl.replace(/\/(v[^\/]*)\//, `/${areaOptions}${replace}/`);
79
+ }
80
+ getUrl(url) {
81
+ if (!url)
82
+ return undefined;
83
+ const cloudUrl = typeof url === 'object'
84
+ ? url.url || url.src || url.image : url;
85
+ if (!cloudUrl)
86
+ return undefined;
87
+ return cloudUrl.startsWith('http') ? cloudUrl : `https://res.cloudinary.com/${this.cloudinaryKey}/image/upload/vOptions/${cloudUrl}`;
88
+ }
89
+ }
@@ -0,0 +1,7 @@
1
+ export declare type MediaOptionFormats = 'f_auto';
2
+ export declare type MediaOptionCrop = 'c_fill' | 'c_fit' | 'c_pad' | 'c_crop';
3
+ export declare type MediaOptionHeight = `h_${number}`;
4
+ export declare type MediaOption = MediaOptionFormats | MediaOptionCrop | MediaOptionHeight;
5
+ export declare const mediaThumbnail: MediaOption[];
6
+ export declare const mediaBackground: MediaOption[];
7
+ //# sourceMappingURL=media.options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.options.d.ts","sourceRoot":"","sources":["../../lib/media/media.options.ts"],"names":[],"mappings":"AACA,oBAAY,kBAAkB,GAAG,QAAQ,CAAC;AAC1C,oBAAY,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AACtE,oBAAY,iBAAiB,GAAG,KAAK,MAAM,EAAE,CAAC;AAC9C,oBAAY,WAAW,GACnB,kBAAkB,GAClB,eAAe,GACf,iBAAiB,CAAC;AAEtB,eAAO,MAAM,cAAc,EAAE,WAAW,EAAwB,CAAC;AACjE,eAAO,MAAM,eAAe,EAAE,WAAW,EAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const mediaThumbnail = ['f_auto', 'c_pad'];
2
+ export const mediaBackground = ['f_auto', 'c_fill'];
@@ -0,0 +1,8 @@
1
+ export declare type ImageSizes = 40 | 80 | 160 | 320 | 540 | 720 | 1080;
2
+ export interface ImageSet {
3
+ width: number;
4
+ width2x: number;
5
+ maxWidth?: number;
6
+ }
7
+ export declare function getImageSets(width: ImageSizes): ImageSet[];
8
+ //# sourceMappingURL=media.sets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.sets.d.ts","sourceRoot":"","sources":["../../lib/media/media.sets.ts"],"names":[],"mappings":"AACA,oBAAY,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAChE,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA2BD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,EAAE,CAY1D"}
@@ -0,0 +1,34 @@
1
+ const IMAGE_SIZES_LARGE = [
2
+ { width: 540, width2x: 1080, maxWidth: 500 },
3
+ { width: 720, width2x: 1440, maxWidth: 720 },
4
+ { width: 1080, width2x: 2160, maxWidth: 1080 },
5
+ { width: 1440, width2x: 2880, maxWidth: 1440 },
6
+ { width: 1920, width2x: 3840, maxWidth: 1920 },
7
+ { width: 2560, width2x: 3840 }
8
+ ];
9
+ const IMAGE_SIZES_MEDIUM = [
10
+ { width: 320, width2x: 540, maxWidth: 500 },
11
+ { width: 540, width2x: 1080, maxWidth: 500 },
12
+ { width: 720, width2x: 1440 }
13
+ ];
14
+ const IMAGE_SIZES_SMALL = [
15
+ { width: 320, width2x: 540, maxWidth: 500 },
16
+ { width: 540, width2x: 1080 }
17
+ ];
18
+ const IMAGE_SIZES_TINY = [{ width: 320, width2x: 640 }];
19
+ const IMAGE_SIZES_PREVIEW = [{ width: 160, width2x: 320 }];
20
+ const IMAGE_SIZES_LARGE_ICON = [{ width: 80, width2x: 160 }];
21
+ const IMAGE_SIZES_ICON = [{ width: 40, width2x: 80 }];
22
+ export function getImageSets(width) {
23
+ switch (width) {
24
+ case 1080: return IMAGE_SIZES_LARGE;
25
+ case 720: return IMAGE_SIZES_MEDIUM;
26
+ case 540: return IMAGE_SIZES_SMALL;
27
+ case 320: return IMAGE_SIZES_TINY;
28
+ case 160: return IMAGE_SIZES_PREVIEW;
29
+ case 80: return IMAGE_SIZES_LARGE_ICON;
30
+ case 40: return IMAGE_SIZES_ICON;
31
+ default:
32
+ return IMAGE_SIZES_LARGE;
33
+ }
34
+ }
@@ -0,0 +1,8 @@
1
+ export declare type ImageSizes = 40 | 80 | 160 | 320 | 540 | 720 | 1080;
2
+ export interface ImageSize {
3
+ width: number;
4
+ width2x: number;
5
+ maxWidth?: number;
6
+ }
7
+ export declare function getImageSet(width: ImageSizes): ImageSize[];
8
+ //# sourceMappingURL=media.sets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.sets.d.ts","sourceRoot":"","sources":["../lib/media.sets.ts"],"names":[],"mappings":"AACA,oBAAY,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAChE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA2BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,CAU1D"}
@@ -0,0 +1,32 @@
1
+ const IMAGE_SIZES_LARGE = [
2
+ { width: 540, width2x: 1080, maxWidth: 500 },
3
+ { width: 720, width2x: 1440, maxWidth: 720 },
4
+ { width: 1080, width2x: 2160, maxWidth: 1080 },
5
+ { width: 1440, width2x: 2880, maxWidth: 1440 },
6
+ { width: 1920, width2x: 3840, maxWidth: 1920 },
7
+ { width: 2560, width2x: 3840 }
8
+ ];
9
+ const IMAGE_SIZES_MEDIUM = [
10
+ { width: 540, width2x: 1080, maxWidth: 500 },
11
+ { width: 640, width2x: 1280, maxWidth: 720 },
12
+ { width: 720, width2x: 1440 }
13
+ ];
14
+ const IMAGE_SIZES_SMALL = [
15
+ { width: 320, width2x: 540, maxWidth: 500 },
16
+ { width: 540, width2x: 1080 }
17
+ ];
18
+ const IMAGE_SIZES_TINY = [{ width: 320, width2x: 640 }];
19
+ const IMAGE_SIZES_PREVIEW = [{ width: 160, width2x: 320 }];
20
+ const IMAGE_SIZES_LARGE_ICON = [{ width: 80, width2x: 160 }];
21
+ const IMAGE_SIZES_ICON = [{ width: 40, width2x: 80 }];
22
+ export function getImageSet(width) {
23
+ switch (width) {
24
+ case 1080: return IMAGE_SIZES_LARGE;
25
+ case 720: return IMAGE_SIZES_MEDIUM;
26
+ case 540: return IMAGE_SIZES_SMALL;
27
+ case 320: return IMAGE_SIZES_TINY;
28
+ case 160: return IMAGE_SIZES_PREVIEW;
29
+ case 80: return IMAGE_SIZES_LARGE_ICON;
30
+ case 40: return IMAGE_SIZES_ICON;
31
+ }
32
+ }
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2021.full.d.ts","../lib/aptlymedia.ts","../lib/index.ts","../lib/media.sets.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"927cb2b60048e1395b183bf74b2b80a75bdb1dbe384e1d9fac654313ea2fb136","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"e8c9f4e445a489991ca1a4232667de3ac36b07ba75ea335971fbeacf2d26fe67","affectsGlobalScope":true},"0ce99fa68940b918945c445a958e2568a5b7593f7e3a0eeef9f0f79d45651b91","c68626ee37565055766419fd639ebadbf393ee156ade89ee4e4424c071637f7c","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","bd05c666a7f2c18390a517984d674325c12b7f1824d9d1f9b7fc5bfa18c29522"],"options":{"declaration":true,"declarationMap":true,"esModuleInterop":true,"jsx":2,"module":99,"noImplicitAny":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","removeComments":true,"skipLibCheck":true,"strict":true,"target":8},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[[48,[{"file":"../lib/aptlymedia.ts","start":51,"length":12,"messageText":"Property 'cloudinaryId' is declared but its value is never read.","category":1,"code":6138,"reportsUnnecessary":true},{"file":"../lib/aptlymedia.ts","start":99,"length":13,"messageText":"Cannot find name 'AptlyMediaSrc'.","category":1,"code":2304},{"file":"../lib/aptlymedia.ts","start":592,"length":7,"code":2339,"category":1,"messageText":"Property '_config' does not exist on type 'AptlyMedia'."}]],49,50,9,10,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,34,35,36,37,7,42,38,39,40,41,8,47,46,43,44,45,1,12,11]},"version":"4.5.5"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@aptly-as/sdk-web",
3
+ "version": "0.0.1",
4
+ "description": "Aptly SDK library for web applications",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "source": "lib/index.html",
8
+ "engines": {
9
+ "node": ">14.0.0 <17.0.0"
10
+ },
11
+ "scripts": {
12
+ "start": "tsc --incremental --watch",
13
+ "build": "tsc",
14
+ "test:watch": "mocha --parallel --watch",
15
+ "test:active": "mocha --watch --parallel --grep active:",
16
+ "test": "mocha",
17
+ "prepublish": "yarn build"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "author": "Emil Andreas Olsen <emil@aptly.as>",
23
+ "license": "ISC",
24
+ "devDependencies": {
25
+ "@aptly-as/types": "*",
26
+ "@types/chai": "^4.3.0",
27
+ "@types/mocha": "^9.1.0",
28
+ "@types/node": "^17.0.21",
29
+ "chai": "^4.3.6",
30
+ "husky": "^7.0.4",
31
+ "lint-staged": "^12.3.4",
32
+ "mocha": "^9.2.1",
33
+ "prettier": "^2.5.1",
34
+ "source-map-support": "^0.5.21",
35
+ "ts-node": "^10.5.0",
36
+ "typescript": "^4.5.5"
37
+ },
38
+ "dependencies": {},
39
+ "peerDependencies": {
40
+ "@aptly-as/types": "*"
41
+ },
42
+ "lint-staged": {
43
+ "**/*": "prettier --write --ignore-unknown"
44
+ }
45
+ }