@luzzle/web.utils 0.0.11 → 0.0.12
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/package.json +3 -4
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/assets.d.ts +0 -17
- package/dist/src/lib/assets.js +0 -52
- package/dist/src/lib/assets.js.map +0 -1
- package/dist/src/lib/assets.test.d.ts +0 -1
- package/dist/src/lib/assets.test.js +0 -67
- package/dist/src/lib/assets.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/sqlite.d.ts +0 -22
- package/dist/src/lib/sqlite.js +0 -2
- package/dist/src/lib/sqlite.js.map +0 -1
- package/dist/src/lib/types.d.ts +0 -42
- package/dist/src/lib/types.js +0 -2
- package/dist/src/lib/types.js.map +0 -1
- package/dist/src/lib/vibrant.d.ts +0 -16
- 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 -150
- package/dist/src/lib/vibrant.test.js.map +0 -1
- package/dist/src/server.d.ts +0 -3
- package/dist/src/server.js +0 -4
- package/dist/src/server.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +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":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC/B,IAAI,CAAC,iCAAiC,EAAE,GAAG,EAAE;QAC5C,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC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AAC,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"}
|
package/dist/src/lib/sqlite.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface WebPieces {
|
|
2
|
-
id: string;
|
|
3
|
-
title: string;
|
|
4
|
-
slug: string;
|
|
5
|
-
file_path: string;
|
|
6
|
-
note?: string;
|
|
7
|
-
date_updated?: number;
|
|
8
|
-
date_added: number;
|
|
9
|
-
date_consumed?: number;
|
|
10
|
-
type: string;
|
|
11
|
-
media?: string;
|
|
12
|
-
json_metadata: string;
|
|
13
|
-
summary?: string;
|
|
14
|
-
keywords?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface WebPieceTags {
|
|
17
|
-
piece_slug: string;
|
|
18
|
-
piece_type: string;
|
|
19
|
-
piece_id: string;
|
|
20
|
-
tag: string;
|
|
21
|
-
slug: string;
|
|
22
|
-
}
|
package/dist/src/lib/sqlite.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../../../src/lib/sqlite.ts"],"names":[],"mappings":""}
|
package/dist/src/lib/types.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { WebPieces, WebPieceTags } from "./sqlite.js";
|
|
2
|
-
type PieceIconProps = {
|
|
3
|
-
piece: WebPieces;
|
|
4
|
-
metadata: Record<string, unknown>;
|
|
5
|
-
tags: string[];
|
|
6
|
-
size: {
|
|
7
|
-
width: number;
|
|
8
|
-
height?: number;
|
|
9
|
-
};
|
|
10
|
-
lazy?: boolean;
|
|
11
|
-
helpers: PieceComponentHelpers;
|
|
12
|
-
};
|
|
13
|
-
type PieceIconPalette = {
|
|
14
|
-
accent?: string;
|
|
15
|
-
background?: string;
|
|
16
|
-
bodyText?: string;
|
|
17
|
-
muted?: string;
|
|
18
|
-
titleText?: string;
|
|
19
|
-
};
|
|
20
|
-
type PieceComponentHelpers = {
|
|
21
|
-
getPieceUrl: () => string;
|
|
22
|
-
getPieceImageUrl: (image: string, minWidth: number, format: 'jpg' | 'avif') => string;
|
|
23
|
-
};
|
|
24
|
-
type PieceOpengraphProps = {
|
|
25
|
-
metadata: Record<string, unknown>;
|
|
26
|
-
tags: string[];
|
|
27
|
-
piece: WebPieces;
|
|
28
|
-
size: {
|
|
29
|
-
width: number;
|
|
30
|
-
height: number;
|
|
31
|
-
};
|
|
32
|
-
palette?: PieceIconPalette;
|
|
33
|
-
helpers: PieceComponentHelpers;
|
|
34
|
-
};
|
|
35
|
-
type PiecePageProps = {
|
|
36
|
-
piece: WebPieces;
|
|
37
|
-
metadata: Record<string, unknown>;
|
|
38
|
-
tags: Partial<WebPieceTags>[];
|
|
39
|
-
html_note: string | null;
|
|
40
|
-
helpers: PieceComponentHelpers;
|
|
41
|
-
};
|
|
42
|
-
export { type PieceIconProps, type PieceIconPalette, type PieceComponentHelpers, type PieceOpengraphProps, type PiecePageProps, };
|
package/dist/src/lib/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ImageBase, ImageSource } from '@vibrant/image';
|
|
2
|
-
import { PieceIconPalette } from './types.js';
|
|
3
|
-
declare class SharpImage extends ImageBase {
|
|
4
|
-
private _image;
|
|
5
|
-
load(image: ImageSource): Promise<ImageBase>;
|
|
6
|
-
clear(): void;
|
|
7
|
-
update(): void;
|
|
8
|
-
getWidth(): number;
|
|
9
|
-
getHeight(): number;
|
|
10
|
-
resize(_: number, __: number, ___: number): void;
|
|
11
|
-
getPixelCount(): number;
|
|
12
|
-
getImageData(): ImageData;
|
|
13
|
-
remove(): void;
|
|
14
|
-
}
|
|
15
|
-
declare function getPalette(image: string | Buffer): Promise<PieceIconPalette>;
|
|
16
|
-
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,
|
|
71
|
-
bodyText: palette.DarkVibrant?.bodyTextColor,
|
|
72
|
-
titleText: palette.DarkVibrant?.titleTextColor,
|
|
73
|
-
accent: palette.LightVibrant?.hex,
|
|
74
|
-
muted: palette.Muted?.hex,
|
|
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;AAGzB,MAAM,UAAW,SAAQ,SAAS;IACzB,MAAM,GAAc;QAC3B,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,IAAI,iBAAiB,E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