@fivelab/web-utils 1.0.6 → 1.0.8

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.
@@ -0,0 +1,17 @@
1
+ export type AppendScriptOptions = {
2
+ type?: string;
3
+ async?: boolean;
4
+ defer?: boolean;
5
+ attributes?: Record<string, string>;
6
+ };
7
+ export type AppendStyleOptions = {
8
+ media?: string;
9
+ attributes?: Record<string, string>;
10
+ };
11
+ export type AppendAssetOptions = AppendScriptOptions | AppendStyleOptions;
12
+ export declare function appendScript(src: string, options?: AppendScriptOptions): Promise<HTMLScriptElement>;
13
+ export declare function appendStyle(href: string, options?: AppendStyleOptions): Promise<HTMLLinkElement>;
14
+ export declare function appendAsset(url: string, options?: AppendAssetOptions): Promise<HTMLScriptElement | HTMLLinkElement>;
15
+ export declare const __test__: {
16
+ reset: () => void;
17
+ } | undefined;
@@ -0,0 +1,119 @@
1
+ let scriptsMap = new Map();
2
+ let stylesMap = new Map();
3
+ function findScriptByKey(key) {
4
+ const scripts = document.getElementsByTagName('script');
5
+ return Array.from(scripts).find((e) => e.src === key);
6
+ }
7
+ function findStyleByKey(key) {
8
+ const links = document.getElementsByTagName('link');
9
+ return Array.from(links).find((e) => e.rel === 'stylesheet' && e.href === key);
10
+ }
11
+ function getExtension(url) {
12
+ const clean = url.split('#')[0].split('?')[0]; // eslint-disable-line @typescript-eslint/no-non-null-assertion
13
+ const idx = clean.lastIndexOf('.');
14
+ return idx >= 0 ? clean.slice(idx + 1).toLowerCase() : null;
15
+ }
16
+ function appendScript(src, options = {}) {
17
+ const key = new URL(src, document.baseURI).href;
18
+ const cached = scriptsMap.get(key);
19
+ if (cached) {
20
+ return cached;
21
+ }
22
+ const existing = findScriptByKey(key);
23
+ if (existing) {
24
+ const ready = Promise.resolve(existing);
25
+ scriptsMap.set(key, ready);
26
+ return ready;
27
+ }
28
+ const promise = new Promise((resolve, reject) => {
29
+ const script = document.createElement('script');
30
+ script.src = src;
31
+ script.type = options.type ?? 'text/javascript';
32
+ if (options.async !== undefined) {
33
+ script.async = options.async;
34
+ }
35
+ if (options.defer !== undefined) {
36
+ script.defer = options.defer;
37
+ }
38
+ if (options.attributes) {
39
+ Object.entries(options.attributes).forEach(([k, v]) => script.setAttribute(k, v));
40
+ }
41
+ const cleanup = () => {
42
+ script.removeEventListener('load', onLoad);
43
+ script.removeEventListener('error', onError);
44
+ };
45
+ const onLoad = () => {
46
+ resolve(script);
47
+ cleanup();
48
+ };
49
+ const onError = () => {
50
+ script.remove();
51
+ scriptsMap.delete(key);
52
+ reject(new Error(`Failed to load script: ${src}`));
53
+ cleanup();
54
+ };
55
+ script.addEventListener('load', onLoad);
56
+ script.addEventListener('error', onError);
57
+ document.head.appendChild(script);
58
+ });
59
+ scriptsMap.set(key, promise);
60
+ return promise;
61
+ }
62
+ function appendStyle(href, options = {}) {
63
+ const key = new URL(href, document.baseURI).href;
64
+ const cached = stylesMap.get(key);
65
+ if (cached) {
66
+ return cached;
67
+ }
68
+ const existing = findStyleByKey(key);
69
+ if (existing) {
70
+ const ready = Promise.resolve(existing);
71
+ stylesMap.set(key, ready);
72
+ return ready;
73
+ }
74
+ const promise = new Promise((resolve, reject) => {
75
+ const link = document.createElement('link');
76
+ link.rel = 'stylesheet';
77
+ link.href = href;
78
+ if (options.media) {
79
+ link.media = options.media;
80
+ }
81
+ if (options.attributes) {
82
+ Object.entries(options.attributes).forEach(([k, v]) => link.setAttribute(k, v));
83
+ }
84
+ const onLoad = () => {
85
+ resolve(link);
86
+ };
87
+ const onError = () => {
88
+ link.remove();
89
+ stylesMap.delete(key);
90
+ reject(new Error(`Failed to load stylesheet: ${href}`));
91
+ };
92
+ link.addEventListener('load', onLoad, { once: true });
93
+ link.addEventListener('error', onError, { once: true });
94
+ document.head.appendChild(link);
95
+ });
96
+ stylesMap.set(key, promise);
97
+ return promise;
98
+ }
99
+ function appendAsset(url, options = {}) {
100
+ const ext = getExtension(url);
101
+ if (ext === 'css') {
102
+ return appendStyle(url, options);
103
+ }
104
+ if (ext === 'js' || ext === 'mjs') {
105
+ return appendScript(url, options);
106
+ }
107
+ throw new Error(`Unsupported asset type for "${url}". Expected ".css", ".js" or ".mjs".`);
108
+ }
109
+ const __test__ = import.meta.env?.MODE === 'test'
110
+ ? {
111
+ reset: () => {
112
+ scriptsMap = new Map();
113
+ stylesMap = new Map();
114
+ },
115
+ }
116
+ : undefined;
117
+
118
+ export { __test__, appendAsset, appendScript, appendStyle };
119
+ //# sourceMappingURL=assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.js","sources":["../../src/browser/assets.ts"],"sourcesContent":["export type AppendScriptOptions = {\n type?: string;\n async?: boolean;\n defer?: boolean;\n attributes?: Record<string, string>;\n};\n\nexport type AppendStyleOptions = {\n media?: string;\n attributes?: Record<string, string>;\n};\n\nexport type AppendAssetOptions = | AppendScriptOptions | AppendStyleOptions;\n\nlet scriptsMap = new Map<string, Promise<HTMLScriptElement>>();\nlet stylesMap = new Map<string, Promise<HTMLLinkElement>>();\n\nfunction findScriptByKey(key: string): HTMLScriptElement | undefined {\n const scripts = document.getElementsByTagName('script');\n\n return Array.from(scripts).find((e) => e.src === key);\n}\n\nfunction findStyleByKey(key: string): HTMLLinkElement | undefined {\n const links = document.getElementsByTagName('link');\n\n return Array.from(links).find((e) => e.rel === 'stylesheet' && e.href === key);\n}\n\nfunction getExtension(url: string): string | null {\n const clean = url.split('#')[0]!.split('?')[0]!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n const idx = clean.lastIndexOf('.');\n\n return idx >= 0 ? clean.slice(idx + 1).toLowerCase() : null;\n}\n\nexport function appendScript(src: string, options: AppendScriptOptions = {}): Promise<HTMLScriptElement> {\n const key = new URL(src, document.baseURI).href;\n\n const cached = scriptsMap.get(key);\n\n if (cached) {\n return cached;\n }\n\n const existing = findScriptByKey(key);\n\n if (existing) {\n const ready = Promise.resolve(existing);\n scriptsMap.set(key, ready);\n\n return ready;\n }\n\n const promise: Promise<HTMLScriptElement> = new Promise((resolve, reject) => {\n const script = document.createElement('script');\n\n script.src = src;\n script.type = options.type ?? 'text/javascript';\n\n if (options.async !== undefined) {\n script.async = options.async;\n }\n\n if (options.defer !== undefined) {\n script.defer = options.defer;\n }\n\n if (options.attributes) {\n Object.entries(options.attributes).forEach(([k, v]) => script.setAttribute(k, v));\n }\n\n const cleanup = () => {\n script.removeEventListener('load', onLoad);\n script.removeEventListener('error', onError);\n };\n\n const onLoad = () => {\n resolve(script);\n cleanup();\n };\n\n const onError = () => {\n script.remove();\n scriptsMap.delete(key);\n\n reject(new Error(`Failed to load script: ${src}`));\n\n cleanup();\n };\n\n script.addEventListener('load', onLoad);\n script.addEventListener('error', onError);\n\n document.head.appendChild(script);\n });\n\n scriptsMap.set(key, promise);\n\n return promise;\n}\n\nexport function appendStyle(href: string, options: AppendStyleOptions = {}): Promise<HTMLLinkElement> {\n const key = new URL(href, document.baseURI).href;\n\n const cached = stylesMap.get(key);\n\n if (cached) {\n return cached;\n }\n\n const existing = findStyleByKey(key);\n\n if (existing) {\n const ready = Promise.resolve(existing);\n stylesMap.set(key, ready);\n\n return ready;\n }\n\n const promise = new Promise<HTMLLinkElement>((resolve, reject) => {\n const link = document.createElement('link');\n\n link.rel = 'stylesheet';\n link.href = href;\n\n if (options.media) {\n link.media = options.media;\n }\n\n if (options.attributes) {\n Object.entries(options.attributes).forEach(([k, v]) => link.setAttribute(k, v));\n }\n\n const onLoad = () => {\n resolve(link);\n };\n\n const onError = () => {\n link.remove();\n stylesMap.delete(key);\n\n reject(new Error(`Failed to load stylesheet: ${href}`));\n };\n\n link.addEventListener('load', onLoad, { once: true });\n link.addEventListener('error', onError, { once: true });\n\n document.head.appendChild(link);\n });\n\n stylesMap.set(key, promise);\n\n return promise;\n}\n\nexport function appendAsset(url: string, options: AppendAssetOptions = {}): Promise<HTMLScriptElement | HTMLLinkElement> {\n const ext = getExtension(url);\n\n if (ext === 'css') {\n return appendStyle(url, options as AppendStyleOptions);\n }\n\n if (ext === 'js' || ext === 'mjs') {\n return appendScript(url, options as AppendScriptOptions);\n }\n\n throw new Error(`Unsupported asset type for \"${url}\". Expected \".css\", \".js\" or \".mjs\".`);\n}\n\nexport const __test__ = import.meta.env?.MODE === 'test'\n ? {\n reset: () => {\n scriptsMap = new Map();\n stylesMap = new Map();\n },\n }\n : undefined;\n\n"],"names":[],"mappings":"AAcA,IAAI,UAAU,GAAG,IAAI,GAAG,EAAsC;AAC9D,IAAI,SAAS,GAAG,IAAI,GAAG,EAAoC;AAE3D,SAAS,eAAe,CAAC,GAAW,EAAA;IAChC,MAAM,OAAO,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC;IAEvD,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;AACzD;AAEA,SAAS,cAAc,CAAC,GAAW,EAAA;IAC/B,MAAM,KAAK,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC;IAEnD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,YAAY,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC;AAClF;AAEA,SAAS,YAAY,CAAC,GAAW,EAAA;IAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;IAChD,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;IAElC,OAAO,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI;AAC/D;SAEgB,YAAY,CAAC,GAAW,EAAE,UAA+B,EAAE,EAAA;AACvE,IAAA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G,GAAG,YAAY,CAAC,GAAG,CAAC;AAE7B,IAAA,IAAI,GAAG,KAAK,KAAK,EAAE;AACf,QAAA,OAAO,WAAW,CAAC,GAAG,EAAE,OAA6B,CAAC;IAC1D;IAEA,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,KAAK,EAAE;AAC/B,QAAA,OAAO,YAAY,CAAC,GAAG,EAAE,OAA8B,CAAC;IAC5D;AAEA,IAAA,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,CAAA,oCAAA,CAAsC,CAAC;AAC7F;AAEO,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,KAAK;AAC9C,MAAE;QACE,KAAK,EAAE,MAAK;AACR,YAAA,UAAU,GAAG,IAAI,GAAG,EAAE;AACtB,YAAA,SAAS,GAAG,IAAI,GAAG,EAAE;QACzB,CAAC;AACJ;MACC;;;;"}
@@ -1,3 +1,4 @@
1
+ export * from './assets';
1
2
  export * from './clipboard';
2
3
  export * from './file';
3
4
  export * from './network';
@@ -1,3 +1,4 @@
1
+ export { __test__, appendAsset, appendScript, appendStyle } from './assets.js';
1
2
  export { copyToClipboard } from './clipboard.js';
2
3
  export { readFileAsArrayBuffer } from './file.js';
3
4
  export { getNetworkConnection } from './network.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -2,3 +2,4 @@ export * from './config';
2
2
  export * from './observable';
3
3
  export * from './path';
4
4
  export * from './time';
5
+ export * from './wait';
@@ -2,4 +2,5 @@ export { __test__, getConfig, hasConfig, setConfig } from './config.js';
2
2
  export { Observable } from './observable.js';
3
3
  export { getExtension } from './path.js';
4
4
  export { diffTime } from './time.js';
5
+ export { waitProperty } from './wait.js';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,5 @@
1
+ export type WaitPropertyOptions = {
2
+ timeout?: number;
3
+ interval?: number;
4
+ };
5
+ export declare function waitProperty<T = unknown>(obj: object, key: PropertyKey, options?: WaitPropertyOptions): Promise<T>;
@@ -0,0 +1,21 @@
1
+ function waitProperty(obj, key, options = {}) {
2
+ const { timeout = 5000, interval = 50, } = options;
3
+ return new Promise((resolve, reject) => {
4
+ const start = Date.now();
5
+ const check = () => {
6
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
7
+ resolve(obj[key]); // eslint-disable-line @typescript-eslint/no-explicit-any
8
+ return;
9
+ }
10
+ if (Date.now() - start >= timeout) {
11
+ reject(new Error(`Property "${String(key)}" was not defined within ${timeout}ms.`));
12
+ return;
13
+ }
14
+ setTimeout(check, interval);
15
+ };
16
+ check();
17
+ });
18
+ }
19
+
20
+ export { waitProperty };
21
+ //# sourceMappingURL=wait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait.js","sources":["../../src/core/wait.ts"],"sourcesContent":["export type WaitPropertyOptions = {\n timeout?: number; // ms, default 5000\n interval?: number; // ms, default 50\n};\n\nexport function waitProperty<T = unknown>(obj: object, key: PropertyKey, options: WaitPropertyOptions = {}): Promise<T> {\n const {\n timeout = 5000,\n interval = 50,\n } = options;\n\n return new Promise((resolve, reject) => {\n const start = Date.now();\n\n const check = () => {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n resolve((obj as any)[key] as T); // eslint-disable-line @typescript-eslint/no-explicit-any\n\n return;\n }\n\n if (Date.now() - start >= timeout) {\n reject(new Error(`Property \"${String(key)}\" was not defined within ${timeout}ms.`));\n\n return;\n }\n\n setTimeout(check, interval);\n };\n\n check();\n });\n}\n"],"names":[],"mappings":"AAKM,SAAU,YAAY,CAAc,GAAW,EAAE,GAAgB,EAAE,UAA+B,EAAE,EAAA;IACtG,MAAM,EACF,OAAO,GAAG,IAAI,EACd,QAAQ,GAAG,EAAE,GAChB,GAAG,OAAO;IAEX,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACnC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE;QAExB,MAAM,KAAK,GAAG,MAAK;AACf,YAAA,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;gBAChD,OAAO,CAAE,GAAW,CAAC,GAAG,CAAM,CAAC,CAAC;gBAEhC;YACJ;YAEA,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,OAAO,EAAE;AAC/B,gBAAA,MAAM,CAAC,IAAI,KAAK,CAAC,aAAa,MAAM,CAAC,GAAG,CAAC,CAAA,yBAAA,EAA4B,OAAO,CAAA,GAAA,CAAK,CAAC,CAAC;gBAEnF;YACJ;AAEA,YAAA,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC/B,QAAA,CAAC;AAED,QAAA,KAAK,EAAE;AACX,IAAA,CAAC,CAAC;AACN;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fivelab/web-utils",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The helpers for easy manipulate with dom.",