@luzzle/web.tools 0.0.69 → 0.0.71
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/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -7
- package/dist/src/browser.d.ts +0 -1
- package/dist/src/browser.js +0 -2
- package/dist/src/browser.js.map +0 -1
- package/dist/src/commands/opengraph/html.d.ts +0 -4
- package/dist/src/commands/opengraph/html.js +0 -47
- package/dist/src/commands/opengraph/html.js.map +0 -1
- package/dist/src/commands/opengraph/html.test.d.ts +0 -1
- package/dist/src/commands/opengraph/html.test.js +0 -79
- package/dist/src/commands/opengraph/html.test.js.map +0 -1
- package/dist/src/commands/opengraph/svelte.d.ts +0 -7
- package/dist/src/commands/opengraph/svelte.js +0 -77
- package/dist/src/commands/opengraph/svelte.js.map +0 -1
- package/dist/src/commands/opengraph/svelte.test.d.ts +0 -1
- package/dist/src/commands/opengraph/svelte.test.js +0 -189
- package/dist/src/commands/opengraph/svelte.test.js.map +0 -1
- package/dist/src/commands/opengraph/utils.d.ts +0 -8
- package/dist/src/commands/opengraph/utils.js +0 -136
- package/dist/src/commands/opengraph/utils.js.map +0 -1
- package/dist/src/commands/opengraph/utils.test.d.ts +0 -1
- package/dist/src/commands/opengraph/utils.test.js +0 -215
- package/dist/src/commands/opengraph/utils.test.js.map +0 -1
- package/dist/src/lib/browser.d.ts +0 -55
- package/dist/src/lib/browser.js +0 -52
- package/dist/src/lib/browser.js.map +0 -1
- package/dist/src/lib/browser.test.d.ts +0 -1
- package/dist/src/lib/browser.test.js +0 -67
- package/dist/src/lib/browser.test.js.map +0 -1
- package/dist/src/lib/config/config.d.ts +0 -9
- package/dist/src/lib/config/config.js +0 -56
- package/dist/src/lib/config/config.js.map +0 -1
- package/dist/src/lib/config/config.test.d.ts +0 -1
- package/dist/src/lib/config/config.test.js +0 -71
- package/dist/src/lib/config/config.test.js.map +0 -1
- package/dist/src/lib/config/config.test.ts +0 -88
- package/dist/src/lib/config/config.ts +0 -74
- package/dist/src/lib/config/defaults.json +0 -145
- package/dist/src/lib/config/defaults.yaml +0 -151
- package/dist/src/lib/config/schema.d.ts +0 -172
- package/dist/src/lib/config/schema.js +0 -8
- package/dist/src/lib/config/schema.js.map +0 -1
- package/dist/src/lib/config/schema.json +0 -663
- package/dist/src/lib/config/schema.ts +0 -294
- package/dist/src/lib/config/user-error.config.yaml +0 -2
- package/dist/src/lib/config/user.config.yaml +0 -2
- package/dist/src/lib/deep-merge.d.ts +0 -1
- package/dist/src/lib/deep-merge.js +0 -27
- package/dist/src/lib/deep-merge.js.map +0 -1
- package/dist/src/lib/deep-merge.test.d.ts +0 -1
- package/dist/src/lib/deep-merge.test.js +0 -29
- package/dist/src/lib/deep-merge.test.js.map +0 -1
- package/dist/src/lib/vibrant.d.ts +0 -21
- package/dist/src/lib/vibrant.js +0 -78
- package/dist/src/lib/vibrant.js.map +0 -1
- package/dist/src/lib/vibrant.test.d.ts +0 -1
- package/dist/src/lib/vibrant.test.js +0 -164
- package/dist/src/lib/vibrant.test.js.map +0 -1
- package/dist/src/sdk.d.ts +0 -4
- package/dist/src/sdk.js +0 -4
- package/dist/src/sdk.js.map +0 -1
- package/dist/src/types.d.ts +0 -2
- package/dist/src/types.js +0 -2
- package/dist/src/types.js.map +0 -1
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface Schema {
|
|
9
|
-
url: {
|
|
10
|
-
app: string;
|
|
11
|
-
app_assets: string;
|
|
12
|
-
luzzle_assets: string;
|
|
13
|
-
editor: string;
|
|
14
|
-
};
|
|
15
|
-
text: {
|
|
16
|
-
title: string;
|
|
17
|
-
description: string;
|
|
18
|
-
};
|
|
19
|
-
paths: {
|
|
20
|
-
database: string;
|
|
21
|
-
config?: string;
|
|
22
|
-
};
|
|
23
|
-
content?: {
|
|
24
|
-
block?: {
|
|
25
|
-
root?: string;
|
|
26
|
-
feed?: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
pieces: {
|
|
30
|
-
type: string;
|
|
31
|
-
fields: {
|
|
32
|
-
media?: string;
|
|
33
|
-
title: string;
|
|
34
|
-
summary?: string;
|
|
35
|
-
date_consumed: string;
|
|
36
|
-
tags?: string;
|
|
37
|
-
assets?: string[];
|
|
38
|
-
};
|
|
39
|
-
components?: {
|
|
40
|
-
icon?: string;
|
|
41
|
-
opengraph?: string;
|
|
42
|
-
page?: string;
|
|
43
|
-
};
|
|
44
|
-
}[];
|
|
45
|
-
theme: {
|
|
46
|
-
light: {
|
|
47
|
-
"color-primary"?: string;
|
|
48
|
-
"color-on-primary"?: string;
|
|
49
|
-
"color-primary-container"?: string;
|
|
50
|
-
"color-on-primary-container"?: string;
|
|
51
|
-
"color-secondary"?: string;
|
|
52
|
-
"color-on-secondary"?: string;
|
|
53
|
-
"color-secondary-container"?: string;
|
|
54
|
-
"color-on-secondary-container"?: string;
|
|
55
|
-
"color-tertiary"?: string;
|
|
56
|
-
"color-on-tertiary"?: string;
|
|
57
|
-
"color-tertiary-container"?: string;
|
|
58
|
-
"color-on-tertiary-container"?: string;
|
|
59
|
-
"color-error"?: string;
|
|
60
|
-
"color-on-error"?: string;
|
|
61
|
-
"color-error-container"?: string;
|
|
62
|
-
"color-on-error-container"?: string;
|
|
63
|
-
"color-surface"?: string;
|
|
64
|
-
"color-surface-dim"?: string;
|
|
65
|
-
"color-surface-bright"?: string;
|
|
66
|
-
"color-surface-inverse"?: string;
|
|
67
|
-
"color-on-surface"?: string;
|
|
68
|
-
"color-on-surface-variant"?: string;
|
|
69
|
-
"color-on-surface-inverse"?: string;
|
|
70
|
-
"color-surface-container-lowest"?: string;
|
|
71
|
-
"color-surface-container-low"?: string;
|
|
72
|
-
"color-surface-container"?: string;
|
|
73
|
-
"color-surface-container-high"?: string;
|
|
74
|
-
"color-surface-container-highest"?: string;
|
|
75
|
-
"color-shadow"?: string;
|
|
76
|
-
"color-outline"?: string;
|
|
77
|
-
"color-outline-variant"?: string;
|
|
78
|
-
};
|
|
79
|
-
dark: {
|
|
80
|
-
"color-primary"?: string;
|
|
81
|
-
"color-on-primary"?: string;
|
|
82
|
-
"color-primary-container"?: string;
|
|
83
|
-
"color-on-primary-container"?: string;
|
|
84
|
-
"color-secondary"?: string;
|
|
85
|
-
"color-on-secondary"?: string;
|
|
86
|
-
"color-secondary-container"?: string;
|
|
87
|
-
"color-on-secondary-container"?: string;
|
|
88
|
-
"color-tertiary"?: string;
|
|
89
|
-
"color-on-tertiary"?: string;
|
|
90
|
-
"color-tertiary-container"?: string;
|
|
91
|
-
"color-on-tertiary-container"?: string;
|
|
92
|
-
"color-error"?: string;
|
|
93
|
-
"color-on-error"?: string;
|
|
94
|
-
"color-error-container"?: string;
|
|
95
|
-
"color-on-error-container"?: string;
|
|
96
|
-
"color-surface"?: string;
|
|
97
|
-
"color-surface-dim"?: string;
|
|
98
|
-
"color-surface-bright"?: string;
|
|
99
|
-
"color-surface-inverse"?: string;
|
|
100
|
-
"color-on-surface"?: string;
|
|
101
|
-
"color-on-surface-variant"?: string;
|
|
102
|
-
"color-on-surface-inverse"?: string;
|
|
103
|
-
"color-surface-container-lowest"?: string;
|
|
104
|
-
"color-surface-container-low"?: string;
|
|
105
|
-
"color-surface-container"?: string;
|
|
106
|
-
"color-surface-container-high"?: string;
|
|
107
|
-
"color-surface-container-highest"?: string;
|
|
108
|
-
"color-shadow"?: string;
|
|
109
|
-
"color-outline"?: string;
|
|
110
|
-
"color-outline-variant"?: string;
|
|
111
|
-
};
|
|
112
|
-
globals: {
|
|
113
|
-
"shadow-raised"?: string;
|
|
114
|
-
"font-mono-name"?: string;
|
|
115
|
-
"font-sans-name"?: string;
|
|
116
|
-
"font-sans-url"?: string;
|
|
117
|
-
"font-sans-weight"?: string;
|
|
118
|
-
"font-size-xxs"?: string;
|
|
119
|
-
"font-size-xs"?: string;
|
|
120
|
-
"font-size-small"?: string;
|
|
121
|
-
"font-size-normal"?: string;
|
|
122
|
-
"font-size-medium"?: string;
|
|
123
|
-
"font-size-large"?: string;
|
|
124
|
-
"font-size-xl"?: string;
|
|
125
|
-
"font-size-xxl"?: string;
|
|
126
|
-
"font-size-mobile-responsive-factor"?: number;
|
|
127
|
-
"font-size-root"?: number;
|
|
128
|
-
"font-weight-light"?: number;
|
|
129
|
-
"font-weight-normal"?: number;
|
|
130
|
-
"font-weight-medium"?: number;
|
|
131
|
-
"font-weight-semibold"?: number;
|
|
132
|
-
"font-weight-bold"?: number;
|
|
133
|
-
"radius-none"?: string;
|
|
134
|
-
"radius-small"?: string;
|
|
135
|
-
"radius-medium"?: string;
|
|
136
|
-
"radius-large"?: string;
|
|
137
|
-
"radius-xl"?: string;
|
|
138
|
-
"radius-x2l"?: string;
|
|
139
|
-
"radius-x3l"?: string;
|
|
140
|
-
"radius-x4l"?: string;
|
|
141
|
-
"radius-full"?: string;
|
|
142
|
-
"breakpoint-phone"?: number;
|
|
143
|
-
"breakpoint-tablet"?: number;
|
|
144
|
-
"breakpoint-laptop"?: number;
|
|
145
|
-
"breakpoint-desktop"?: number;
|
|
146
|
-
"space-1"?: string;
|
|
147
|
-
"space-2"?: string;
|
|
148
|
-
"space-3"?: string;
|
|
149
|
-
"space-4"?: string;
|
|
150
|
-
"space-5"?: string;
|
|
151
|
-
"space-6"?: string;
|
|
152
|
-
"space-7"?: string;
|
|
153
|
-
"space-8"?: string;
|
|
154
|
-
"space-9"?: string;
|
|
155
|
-
"space-10"?: string;
|
|
156
|
-
"space-0-5"?: string;
|
|
157
|
-
"space-1-5"?: string;
|
|
158
|
-
"space-2-5"?: string;
|
|
159
|
-
"space-3-5"?: string;
|
|
160
|
-
};
|
|
161
|
-
markdown: {
|
|
162
|
-
sidenote: {
|
|
163
|
-
"sidenote-callout-before-content"?: string;
|
|
164
|
-
"sidenote-callout-after-content"?: string;
|
|
165
|
-
"sidenote-citation-before-content"?: string;
|
|
166
|
-
"sidenote-citation-after-content"?: string;
|
|
167
|
-
};
|
|
168
|
-
code: {
|
|
169
|
-
light:
|
|
170
|
-
| "andromeeda"
|
|
171
|
-
| "aurora-x"
|
|
172
|
-
| "ayu-dark"
|
|
173
|
-
| "catppuccin-frappe"
|
|
174
|
-
| "catppuccin-latte"
|
|
175
|
-
| "catppuccin-macchiato"
|
|
176
|
-
| "catppuccin-mocha"
|
|
177
|
-
| "dark-plus"
|
|
178
|
-
| "dracula"
|
|
179
|
-
| "dracula-soft"
|
|
180
|
-
| "everforest-dark"
|
|
181
|
-
| "everforest-light"
|
|
182
|
-
| "github-dark"
|
|
183
|
-
| "github-dark-default"
|
|
184
|
-
| "github-dark-dimmed"
|
|
185
|
-
| "github-dark-high-contrast"
|
|
186
|
-
| "github-light"
|
|
187
|
-
| "github-light-default"
|
|
188
|
-
| "github-light-high-contrast"
|
|
189
|
-
| "gruvbox-dark-hard"
|
|
190
|
-
| "gruvbox-dark-medium"
|
|
191
|
-
| "gruvbox-dark-soft"
|
|
192
|
-
| "gruvbox-light-hard"
|
|
193
|
-
| "gruvbox-light-medium"
|
|
194
|
-
| "gruvbox-light-soft"
|
|
195
|
-
| "houston"
|
|
196
|
-
| "kanagawa-dragon"
|
|
197
|
-
| "kanagawa-lotus"
|
|
198
|
-
| "kanagawa-wave"
|
|
199
|
-
| "laserwave"
|
|
200
|
-
| "light-plus"
|
|
201
|
-
| "material-theme"
|
|
202
|
-
| "material-theme-darker"
|
|
203
|
-
| "material-theme-lighter"
|
|
204
|
-
| "material-theme-ocean"
|
|
205
|
-
| "material-theme-palenight"
|
|
206
|
-
| "min-dark"
|
|
207
|
-
| "min-light"
|
|
208
|
-
| "monokai"
|
|
209
|
-
| "night-owl"
|
|
210
|
-
| "nord"
|
|
211
|
-
| "one-dark-pro"
|
|
212
|
-
| "one-light"
|
|
213
|
-
| "plastic"
|
|
214
|
-
| "poimandres"
|
|
215
|
-
| "red"
|
|
216
|
-
| "rose-pine"
|
|
217
|
-
| "rose-pine-dawn"
|
|
218
|
-
| "rose-pine-moon"
|
|
219
|
-
| "slack-dark"
|
|
220
|
-
| "slack-ochin"
|
|
221
|
-
| "snazzy-light"
|
|
222
|
-
| "solarized-dark"
|
|
223
|
-
| "solarized-light"
|
|
224
|
-
| "synthwave-84"
|
|
225
|
-
| "tokyo-night"
|
|
226
|
-
| "vesper"
|
|
227
|
-
| "vitesse-black"
|
|
228
|
-
| "vitesse-dark"
|
|
229
|
-
| "vitesse-light";
|
|
230
|
-
dark:
|
|
231
|
-
| "andromeeda"
|
|
232
|
-
| "aurora-x"
|
|
233
|
-
| "ayu-dark"
|
|
234
|
-
| "catppuccin-frappe"
|
|
235
|
-
| "catppuccin-latte"
|
|
236
|
-
| "catppuccin-macchiato"
|
|
237
|
-
| "catppuccin-mocha"
|
|
238
|
-
| "dark-plus"
|
|
239
|
-
| "dracula"
|
|
240
|
-
| "dracula-soft"
|
|
241
|
-
| "everforest-dark"
|
|
242
|
-
| "everforest-light"
|
|
243
|
-
| "github-dark"
|
|
244
|
-
| "github-dark-default"
|
|
245
|
-
| "github-dark-dimmed"
|
|
246
|
-
| "github-dark-high-contrast"
|
|
247
|
-
| "github-light"
|
|
248
|
-
| "github-light-default"
|
|
249
|
-
| "github-light-high-contrast"
|
|
250
|
-
| "gruvbox-dark-hard"
|
|
251
|
-
| "gruvbox-dark-medium"
|
|
252
|
-
| "gruvbox-dark-soft"
|
|
253
|
-
| "gruvbox-light-hard"
|
|
254
|
-
| "gruvbox-light-medium"
|
|
255
|
-
| "gruvbox-light-soft"
|
|
256
|
-
| "houston"
|
|
257
|
-
| "kanagawa-dragon"
|
|
258
|
-
| "kanagawa-lotus"
|
|
259
|
-
| "kanagawa-wave"
|
|
260
|
-
| "laserwave"
|
|
261
|
-
| "light-plus"
|
|
262
|
-
| "material-theme"
|
|
263
|
-
| "material-theme-darker"
|
|
264
|
-
| "material-theme-lighter"
|
|
265
|
-
| "material-theme-ocean"
|
|
266
|
-
| "material-theme-palenight"
|
|
267
|
-
| "min-dark"
|
|
268
|
-
| "min-light"
|
|
269
|
-
| "monokai"
|
|
270
|
-
| "night-owl"
|
|
271
|
-
| "nord"
|
|
272
|
-
| "one-dark-pro"
|
|
273
|
-
| "one-light"
|
|
274
|
-
| "plastic"
|
|
275
|
-
| "poimandres"
|
|
276
|
-
| "red"
|
|
277
|
-
| "rose-pine"
|
|
278
|
-
| "rose-pine-dawn"
|
|
279
|
-
| "rose-pine-moon"
|
|
280
|
-
| "slack-dark"
|
|
281
|
-
| "slack-ochin"
|
|
282
|
-
| "snazzy-light"
|
|
283
|
-
| "solarized-dark"
|
|
284
|
-
| "solarized-light"
|
|
285
|
-
| "synthwave-84"
|
|
286
|
-
| "tokyo-night"
|
|
287
|
-
| "vesper"
|
|
288
|
-
| "vitesse-black"
|
|
289
|
-
| "vitesse-dark"
|
|
290
|
-
| "vitesse-light";
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function deepMerge<T extends object, U extends object>(target: T, source: U): T & U;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export function deepMerge(target, source) {
|
|
2
|
-
const output = { ...target };
|
|
3
|
-
for (const key in source) {
|
|
4
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
5
|
-
const targetValue = output[key];
|
|
6
|
-
const sourceValue = source[key];
|
|
7
|
-
if (sourceValue instanceof Object &&
|
|
8
|
-
!Array.isArray(sourceValue) &&
|
|
9
|
-
targetValue instanceof Object &&
|
|
10
|
-
!Array.isArray(targetValue)) {
|
|
11
|
-
output[key] = deepMerge(targetValue, sourceValue
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
else if (Array.isArray(sourceValue)) {
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
-
output[key] = sourceValue;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
-
output[key] = sourceValue;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return output;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=deep-merge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deep-merge.js","sourceRoot":"","sources":["../../../src/lib/deep-merge.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAqC,MAAS,EAAE,MAAS;IACjF,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAW,CAAA;IAErC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;YACvD,MAAM,WAAW,GAAG,MAAM,CAAC,GAAoB,CAAC,CAAA;YAChD,MAAM,WAAW,GAAG,MAAM,CAAC,GAAc,CAAC,CAAA;YAE1C,IACC,WAAW,YAAY,MAAM;gBAC7B,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;gBAC3B,WAAW,YAAY,MAAM;gBAC7B,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAC1B,CAAC;gBACF,MAAM,CAAC,GAAoB,CAAC,GAAG,SAAS,CACvC,WAAqB,EACrB,WAAqB;gBACrB,8DAA8D;iBACvD,CAAA;YACT,CAAC;iBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;gBACvC,8DAA8D;gBAC9D,MAAM,CAAC,GAAoB,CAAC,GAAG,WAAkB,CAAA;YAClD,CAAC;iBAAM,CAAC;gBACP,8DAA8D;gBAC9D,MAAM,CAAC,GAAoB,CAAC,GAAG,WAAkB,CAAA;YAClD,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAA;AACd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'vitest';
|
|
2
|
-
import { deepMerge } from './deep-merge.js';
|
|
3
|
-
describe('lib/deep-merge', () => {
|
|
4
|
-
test('should merge two simple objects', () => {
|
|
5
|
-
const obj1 = { a: 1, b: 2 };
|
|
6
|
-
const obj2 = { c: 3, d: 4 };
|
|
7
|
-
const result = deepMerge(obj1, obj2);
|
|
8
|
-
expect(result).toEqual({ a: 1, b: 2, c: 3, d: 4 });
|
|
9
|
-
});
|
|
10
|
-
test('should overwrite properties in the first object', () => {
|
|
11
|
-
const obj1 = { a: 1, b: 2 };
|
|
12
|
-
const obj2 = { b: 3, c: 4 };
|
|
13
|
-
const result = deepMerge(obj1, obj2);
|
|
14
|
-
expect(result).toEqual({ a: 1, b: 3, c: 4 });
|
|
15
|
-
});
|
|
16
|
-
test('should merge nested objects', () => {
|
|
17
|
-
const obj1 = { a: 1, b: { c: 2 } };
|
|
18
|
-
const obj2 = { b: { d: 3 } };
|
|
19
|
-
const result = deepMerge(obj1, obj2);
|
|
20
|
-
expect(result).toEqual({ a: 1, b: { c: 2, d: 3 } });
|
|
21
|
-
});
|
|
22
|
-
test('should handle arrays', () => {
|
|
23
|
-
const obj1 = { a: [1, 2] };
|
|
24
|
-
const obj2 = { a: [3, 4] };
|
|
25
|
-
const result = deepMerge(obj1, obj2);
|
|
26
|
-
expect(result).toEqual({ a: [3, 4] });
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=deep-merge.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deep-merge.test.js","sourceRoot":"","sources":["../../../src/lib/deep-merge.test.ts"],"names":[],"m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E,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACjC,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ImageBase, ImageSource } from '@vibrant/image';
|
|
2
|
-
declare class SharpImage extends ImageBase {
|
|
3
|
-
private _image;
|
|
4
|
-
load(image: ImageSource): Promise<ImageBase>;
|
|
5
|
-
clear(): void;
|
|
6
|
-
update(): void;
|
|
7
|
-
getWidth(): number;
|
|
8
|
-
getHeight(): number;
|
|
9
|
-
resize(_: number, __: number, ___: number): void;
|
|
10
|
-
getPixelCount(): number;
|
|
11
|
-
getImageData(): ImageData;
|
|
12
|
-
remove(): void;
|
|
13
|
-
}
|
|
14
|
-
declare function getPalette(image: string | Buffer): Promise<{
|
|
15
|
-
background: string;
|
|
16
|
-
bodyText: string;
|
|
17
|
-
titleText: string;
|
|
18
|
-
accent: string;
|
|
19
|
-
muted: string;
|
|
20
|
-
}>;
|
|
21
|
-
export { getPalette, SharpImage };
|
package/dist/src/lib/vibrant.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Vibrant } from 'node-vibrant/node';
|
|
2
|
-
import { ImageBase } from '@vibrant/image';
|
|
3
|
-
import sharp from 'sharp';
|
|
4
|
-
class SharpImage extends ImageBase {
|
|
5
|
-
_image = {
|
|
6
|
-
width: 0,
|
|
7
|
-
height: 0,
|
|
8
|
-
data: new Uint8ClampedArray(),
|
|
9
|
-
colorSpace: 'srgb',
|
|
10
|
-
};
|
|
11
|
-
async load(image) {
|
|
12
|
-
try {
|
|
13
|
-
let buffer;
|
|
14
|
-
if (typeof image === 'string') {
|
|
15
|
-
if (image.startsWith('http')) {
|
|
16
|
-
const response = await fetch(image);
|
|
17
|
-
buffer = Buffer.from(await response.arrayBuffer());
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
buffer = Buffer.from(image);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
else if (image instanceof Buffer) {
|
|
24
|
-
buffer = image;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return Promise.reject(new Error('Cannot load image from HTMLImageElement in node environment'));
|
|
28
|
-
}
|
|
29
|
-
const { data, info } = await sharp(buffer)
|
|
30
|
-
.resize(200, 200, { fit: 'inside', withoutEnlargement: true })
|
|
31
|
-
.ensureAlpha()
|
|
32
|
-
.raw()
|
|
33
|
-
.toBuffer({ resolveWithObject: true });
|
|
34
|
-
this._image = {
|
|
35
|
-
width: info.width,
|
|
36
|
-
height: info.height,
|
|
37
|
-
data: data,
|
|
38
|
-
colorSpace: 'srgb',
|
|
39
|
-
};
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
return Promise.reject(error);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
clear() { }
|
|
47
|
-
update() { }
|
|
48
|
-
getWidth() {
|
|
49
|
-
return this._image.width;
|
|
50
|
-
}
|
|
51
|
-
getHeight() {
|
|
52
|
-
return this._image.height;
|
|
53
|
-
}
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
55
|
-
resize(_, __, ___) {
|
|
56
|
-
// done in the load step, ignoring any maxDimension or quality options
|
|
57
|
-
}
|
|
58
|
-
getPixelCount() {
|
|
59
|
-
const { width, height } = this._image;
|
|
60
|
-
return width * height;
|
|
61
|
-
}
|
|
62
|
-
getImageData() {
|
|
63
|
-
return this._image;
|
|
64
|
-
}
|
|
65
|
-
remove() { }
|
|
66
|
-
}
|
|
67
|
-
async function getPalette(image) {
|
|
68
|
-
const palette = await new Vibrant(image, { ImageClass: SharpImage }).getPalette();
|
|
69
|
-
return {
|
|
70
|
-
background: palette.DarkVibrant?.hex || '#000000',
|
|
71
|
-
bodyText: palette.DarkVibrant?.bodyTextColor || '#FFFFFF',
|
|
72
|
-
titleText: palette.DarkVibrant?.titleTextColor || '#FFFFFF',
|
|
73
|
-
accent: palette.LightVibrant?.hex || '#FFFFFF',
|
|
74
|
-
muted: palette.Muted?.hex || '#888888',
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export { getPalette, SharpImage };
|
|
78
|
-
//# sourceMappingURL=vibrant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vibrant.js","sourceRoot":"","sources":["../../../src/lib/vibrant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAe,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,UAAW,SAAQ,SAAS;IACzB,MAAM,GAAc;QAC3B,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,IAAI,iBAAiB,EAAE;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vibrant.js';
|
|
3
|
-
import sharp from 'sharp';
|
|
4
|
-
import { Vibrant } from 'node-vibrant/node';
|
|
5
|
-
vi.mock('sharp');
|
|
6
|
-
vi.mock('node-vibrant/node');
|
|
7
|
-
describe('lib/vibrant', () => {
|
|
8
|
-
const mocks = {
|
|
9
|
-
sharp: vi.mocked(sharp),
|
|
10
|
-
fetch: vi.fn(),
|
|
11
|
-
Vibrant: vi.mocked(Vibrant),
|
|
12
|
-
getPalette: vi.spyOn(Vibrant.prototype, 'getPalette'),
|
|
13
|
-
};
|
|
14
|
-
global.fetch = mocks.fetch;
|
|
15
|
-
afterEach(() => {
|
|
16
|
-
vi.resetAllMocks();
|
|
17
|
-
});
|
|
18
|
-
test('should load an image from a URL', async () => {
|
|
19
|
-
const sharpInstance = {
|
|
20
|
-
resize: vi.fn().mockReturnThis(),
|
|
21
|
-
ensureAlpha: vi.fn().mockReturnThis(),
|
|
22
|
-
raw: vi.fn().mockReturnThis(),
|
|
23
|
-
toBuffer: vi
|
|
24
|
-
.fn()
|
|
25
|
-
.mockResolvedValue({ data: Buffer.from([255, 0, 0, 255]), info: { width: 1, height: 1 } }),
|
|
26
|
-
};
|
|
27
|
-
mocks.sharp.mockReturnValue(sharpInstance);
|
|
28
|
-
mocks.fetch.mockResolvedValue({
|
|
29
|
-
arrayBuffer: () => Promise.resolve(Buffer.from('mock-image-data')),
|
|
30
|
-
});
|
|
31
|
-
const image = new SharpImage();
|
|
32
|
-
await image.load('http://example.com/image.png');
|
|
33
|
-
expect(mocks.fetch).toHaveBeenCalledWith('http://example.com/image.png');
|
|
34
|
-
expect(mocks.sharp).toHaveBeenCalled();
|
|
35
|
-
expect(image.getWidth()).toBe(1);
|
|
36
|
-
expect(image.getHeight()).toBe(1);
|
|
37
|
-
});
|
|
38
|
-
test('should load an image from a file path', async () => {
|
|
39
|
-
const sharpInstance = {
|
|
40
|
-
resize: vi.fn().mockReturnThis(),
|
|
41
|
-
ensureAlpha: vi.fn().mockReturnThis(),
|
|
42
|
-
raw: vi.fn().mockReturnThis(),
|
|
43
|
-
toBuffer: vi
|
|
44
|
-
.fn()
|
|
45
|
-
.mockResolvedValue({ data: Buffer.from([255, 0, 0, 255]), info: { width: 1, height: 1 } }),
|
|
46
|
-
};
|
|
47
|
-
mocks.sharp.mockReturnValue(sharpInstance);
|
|
48
|
-
const image = new SharpImage();
|
|
49
|
-
await image.load('path/to/image.png');
|
|
50
|
-
expect(mocks.sharp).toHaveBeenCalled();
|
|
51
|
-
expect(image.getWidth()).toBe(1);
|
|
52
|
-
expect(image.getHeight()).toBe(1);
|
|
53
|
-
});
|
|
54
|
-
test('should load an image from a buffer', async () => {
|
|
55
|
-
const sharpInstance = {
|
|
56
|
-
resize: vi.fn().mockReturnThis(),
|
|
57
|
-
ensureAlpha: vi.fn().mockReturnThis(),
|
|
58
|
-
raw: vi.fn().mockReturnThis(),
|
|
59
|
-
toBuffer: vi
|
|
60
|
-
.fn()
|
|
61
|
-
.mockResolvedValue({ data: Buffer.from([255, 0, 0, 255]), info: { width: 1, height: 1 } }),
|
|
62
|
-
};
|
|
63
|
-
mocks.sharp.mockReturnValue(sharpInstance);
|
|
64
|
-
const buffer = Buffer.from('mock-image-data');
|
|
65
|
-
const image = new SharpImage();
|
|
66
|
-
await image.load(buffer);
|
|
67
|
-
expect(mocks.sharp).toHaveBeenCalledWith(buffer);
|
|
68
|
-
expect(image.getWidth()).toBe(1);
|
|
69
|
-
expect(image.getHeight()).toBe(1);
|
|
70
|
-
});
|
|
71
|
-
test('should reject for unsupported image source', async () => {
|
|
72
|
-
const image = new SharpImage();
|
|
73
|
-
await expect(image.load({})).rejects.toThrow('Cannot load image from HTMLImageElement in node environment');
|
|
74
|
-
});
|
|
75
|
-
test('should handle errors during image loading', async () => {
|
|
76
|
-
const sharpInstance = {
|
|
77
|
-
resize: vi.fn().mockReturnThis(),
|
|
78
|
-
ensureAlpha: vi.fn().mockReturnThis(),
|
|
79
|
-
raw: vi.fn().mockReturnThis(),
|
|
80
|
-
toBuffer: vi.fn().mockRejectedValue(new Error('Test error')),
|
|
81
|
-
};
|
|
82
|
-
mocks.sharp.mockReturnValue(sharpInstance);
|
|
83
|
-
mocks.fetch.mockResolvedValue({
|
|
84
|
-
arrayBuffer: () => Promise.resolve(Buffer.from('mock-image-data')),
|
|
85
|
-
});
|
|
86
|
-
const image = new SharpImage();
|
|
87
|
-
await expect(image.load('http://example.com/image.png')).rejects.toThrow('Test error');
|
|
88
|
-
});
|
|
89
|
-
test('should return pixel count', async () => {
|
|
90
|
-
const sharpInstance = {
|
|
91
|
-
resize: vi.fn().mockReturnThis(),
|
|
92
|
-
ensureAlpha: vi.fn().mockReturnThis(),
|
|
93
|
-
raw: vi.fn().mockReturnThis(),
|
|
94
|
-
toBuffer: vi
|
|
95
|
-
.fn()
|
|
96
|
-
.mockResolvedValue({ data: Buffer.from([255, 0, 0, 255]), info: { width: 1, height: 1 } }),
|
|
97
|
-
};
|
|
98
|
-
mocks.sharp.mockReturnValue(sharpInstance);
|
|
99
|
-
mocks.fetch.mockResolvedValue({
|
|
100
|
-
arrayBuffer: () => Promise.resolve(Buffer.from('mock-image-data')),
|
|
101
|
-
});
|
|
102
|
-
const image = new SharpImage();
|
|
103
|
-
await image.load('http://example.com/image.png');
|
|
104
|
-
expect(image.getPixelCount()).toBe(1);
|
|
105
|
-
});
|
|
106
|
-
test('should return image data', async () => {
|
|
107
|
-
const sharpInstance = {
|
|
108
|
-
resize: vi.fn().mockReturnThis(),
|
|
109
|
-
ensureAlpha: vi.fn().mockReturnThis(),
|
|
110
|
-
raw: vi.fn().mockReturnThis(),
|
|
111
|
-
toBuffer: vi.fn().mockResolvedValue({
|
|
112
|
-
data: new Uint8ClampedArray([255, 0, 0, 255]),
|
|
113
|
-
info: { width: 1, height: 1 },
|
|
114
|
-
}),
|
|
115
|
-
};
|
|
116
|
-
mocks.sharp.mockReturnValue(sharpInstance);
|
|
117
|
-
mocks.fetch.mockResolvedValue({
|
|
118
|
-
arrayBuffer: () => Promise.resolve(Buffer.from('mock-image-data')),
|
|
119
|
-
});
|
|
120
|
-
const image = new SharpImage();
|
|
121
|
-
await image.load('http://example.com/image.png');
|
|
122
|
-
const imageData = image.getImageData();
|
|
123
|
-
expect(imageData.width).toBe(1);
|
|
124
|
-
expect(imageData.height).toBe(1);
|
|
125
|
-
expect(imageData.data).toBeInstanceOf(Uint8ClampedArray);
|
|
126
|
-
});
|
|
127
|
-
test('should have empty methods for coverage', () => {
|
|
128
|
-
const image = new SharpImage();
|
|
129
|
-
image.clear();
|
|
130
|
-
image.update();
|
|
131
|
-
image.resize(1, 2, 3);
|
|
132
|
-
image.remove();
|
|
133
|
-
expect(true).toBe(true);
|
|
134
|
-
});
|
|
135
|
-
test('getPalette should use Vibrant', async () => {
|
|
136
|
-
const mockPalette = {
|
|
137
|
-
DarkVibrant: { hex: 'red', bodyTextColor: 'blue', titleTextColor: 'green' },
|
|
138
|
-
LightVibrant: { hex: 'yellow' },
|
|
139
|
-
Muted: { hex: 'purple' },
|
|
140
|
-
};
|
|
141
|
-
mocks.getPalette.mockResolvedValue(mockPalette);
|
|
142
|
-
const palette = await getPalette('path/to/image.png');
|
|
143
|
-
expect(palette.background).toBe(mockPalette.DarkVibrant?.hex);
|
|
144
|
-
expect(palette.bodyText).toBe(mockPalette.DarkVibrant?.bodyTextColor);
|
|
145
|
-
expect(palette.titleText).toBe(mockPalette.DarkVibrant?.titleTextColor);
|
|
146
|
-
expect(palette.accent).toBe(mockPalette.LightVibrant?.hex);
|
|
147
|
-
expect(palette.muted).toBe(mockPalette.Muted?.hex);
|
|
148
|
-
});
|
|
149
|
-
test('getPalette should use empty palette', async () => {
|
|
150
|
-
const mockPalette = {
|
|
151
|
-
DarkVibrant: {},
|
|
152
|
-
LightVibrant: {},
|
|
153
|
-
Muted: {},
|
|
154
|
-
};
|
|
155
|
-
mocks.getPalette.mockResolvedValue(mockPalette);
|
|
156
|
-
const palette = await getPalette('path/to/image.png');
|
|
157
|
-
expect(palette.background).toBe('#000000');
|
|
158
|
-
expect(palette.bodyText).toBe('#FFFFFF');
|
|
159
|
-
expect(palette.titleText).toBe('#FFFFFF');
|
|
160
|
-
expect(palette.accent).toBe('#FFFFFF');
|
|
161
|
-
expect(palette.muted).toBe('#888888');
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
//# sourceMappingURL=vibrant.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vibrant.test.js","sourceRoot":"","sources":["../../../src/lib/vibrant.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAErD,OAAO,KAAgB,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE3C,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AAChB,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;AAE5B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,MAAM,KAAK,GAAG;QACb,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;QACvB,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE;QACd,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;QAC3B,UAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC;KACrD,CAAA;IAED,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IAE1B,SAAS,CAAC,GAAG,EAAE;QACd,EAAE,CAAC,aAAa,EAAE,CAAA;IACnB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,aAAa,GAAG;YACrB,MAAM,EAAE,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