@hybridly/utils 0.4.5 → 0.5.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.cjs +5 -24
- package/dist/index.d.cts +3 -5
- package/dist/index.d.mts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.mjs +5 -23
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -98,28 +98,13 @@ class Modal {
|
|
|
98
98
|
</div>
|
|
99
99
|
`, id);
|
|
100
100
|
}
|
|
101
|
-
static
|
|
101
|
+
static forViewComponent(component, id) {
|
|
102
102
|
return new Modal(`
|
|
103
103
|
<style>${style()}</style>
|
|
104
104
|
<div class="h-full text-center flex">
|
|
105
105
|
<div class="m-auto">
|
|
106
106
|
<div class="text-5xl font-thin">Error</div>
|
|
107
|
-
<div class="opacity-30 text-lg font-thin m-1">The specified
|
|
108
|
-
<div class="m-2 flex justify-center text-xl opacity-30 underline underline-dotted">${component}</div>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
`, id);
|
|
112
|
-
}
|
|
113
|
-
static domainsDisabled(component, id) {
|
|
114
|
-
return new Modal(`
|
|
115
|
-
<style>${style()}</style>
|
|
116
|
-
<div class="h-full text-center flex">
|
|
117
|
-
<div class="m-auto">
|
|
118
|
-
<div class="text-5xl font-thin">Error</div>
|
|
119
|
-
<div class="opacity-30 text-lg font-thin m-1">
|
|
120
|
-
A domain-based page component was specificed, but domains are disabled. <br />
|
|
121
|
-
Set <code>domains</code> to <code>true</code> in <a class="underline underline-dotted" href="https://hybridly.dev/configuration/architecture.html#domains"><code>hybridly.config.ts</code></a>.
|
|
122
|
-
</div>
|
|
107
|
+
<div class="opacity-30 text-lg font-thin m-1">The specified view component does not exist.</div>
|
|
123
108
|
<div class="m-2 flex justify-center text-xl opacity-30 underline underline-dotted">${component}</div>
|
|
124
109
|
</div>
|
|
125
110
|
</div>
|
|
@@ -212,11 +197,8 @@ class Modal {
|
|
|
212
197
|
function showResponseErrorModal(response) {
|
|
213
198
|
return Modal.fromException(response, "non-hybrid-response");
|
|
214
199
|
}
|
|
215
|
-
function
|
|
216
|
-
return Modal.
|
|
217
|
-
}
|
|
218
|
-
function showDomainsDisabledErrorModal(response) {
|
|
219
|
-
return Modal.domainsDisabled(response, `domains-disabled-${response}`);
|
|
200
|
+
function showViewComponentErrorModal(response) {
|
|
201
|
+
return Modal.forViewComponent(response, `view-component-${response}`);
|
|
220
202
|
}
|
|
221
203
|
function htmlStyle() {
|
|
222
204
|
return `
|
|
@@ -407,9 +389,8 @@ exports.objectToFormData = objectToFormData;
|
|
|
407
389
|
exports.random = random;
|
|
408
390
|
exports.removeTrailingSlash = removeTrailingSlash;
|
|
409
391
|
exports.setValueAtPath = setValueAtPath;
|
|
410
|
-
exports.showDomainsDisabledErrorModal = showDomainsDisabledErrorModal;
|
|
411
|
-
exports.showPageComponentErrorModal = showPageComponentErrorModal;
|
|
412
392
|
exports.showResponseErrorModal = showResponseErrorModal;
|
|
393
|
+
exports.showViewComponentErrorModal = showViewComponentErrorModal;
|
|
413
394
|
exports.unsetPropertyAtPath = unsetPropertyAtPath;
|
|
414
395
|
exports.value = value;
|
|
415
396
|
exports.when = when;
|
package/dist/index.d.cts
CHANGED
|
@@ -25,15 +25,13 @@ declare class Modal {
|
|
|
25
25
|
private animationDurationInMs;
|
|
26
26
|
constructor(html: string, id: string);
|
|
27
27
|
static fromException(response: string, id: string): Modal;
|
|
28
|
-
static
|
|
29
|
-
static domainsDisabled(component: string, id: string): Modal;
|
|
28
|
+
static forViewComponent(component: string, id: string): Modal;
|
|
30
29
|
initializeDOM(): false | undefined;
|
|
31
30
|
show(): void;
|
|
32
31
|
destroy(): void;
|
|
33
32
|
}
|
|
34
33
|
declare function showResponseErrorModal(response: string): Modal;
|
|
35
|
-
declare function
|
|
36
|
-
declare function showDomainsDisabledErrorModal(response: string): Modal;
|
|
34
|
+
declare function showViewComponentErrorModal(response: string): Modal;
|
|
37
35
|
|
|
38
36
|
declare function random(length?: number): string;
|
|
39
37
|
/** Simple pattern matching util. */
|
|
@@ -82,4 +80,4 @@ declare const debug: {
|
|
|
82
80
|
adapter: (name: string, ...args: any[]) => void;
|
|
83
81
|
};
|
|
84
82
|
|
|
85
|
-
export { type FormDataConvertible, type RequestData, debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, setValueAtPath,
|
|
83
|
+
export { type FormDataConvertible, type RequestData, debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, setValueAtPath, showResponseErrorModal, showViewComponentErrorModal, unsetPropertyAtPath, value, when };
|
package/dist/index.d.mts
CHANGED
|
@@ -25,15 +25,13 @@ declare class Modal {
|
|
|
25
25
|
private animationDurationInMs;
|
|
26
26
|
constructor(html: string, id: string);
|
|
27
27
|
static fromException(response: string, id: string): Modal;
|
|
28
|
-
static
|
|
29
|
-
static domainsDisabled(component: string, id: string): Modal;
|
|
28
|
+
static forViewComponent(component: string, id: string): Modal;
|
|
30
29
|
initializeDOM(): false | undefined;
|
|
31
30
|
show(): void;
|
|
32
31
|
destroy(): void;
|
|
33
32
|
}
|
|
34
33
|
declare function showResponseErrorModal(response: string): Modal;
|
|
35
|
-
declare function
|
|
36
|
-
declare function showDomainsDisabledErrorModal(response: string): Modal;
|
|
34
|
+
declare function showViewComponentErrorModal(response: string): Modal;
|
|
37
35
|
|
|
38
36
|
declare function random(length?: number): string;
|
|
39
37
|
/** Simple pattern matching util. */
|
|
@@ -82,4 +80,4 @@ declare const debug: {
|
|
|
82
80
|
adapter: (name: string, ...args: any[]) => void;
|
|
83
81
|
};
|
|
84
82
|
|
|
85
|
-
export { type FormDataConvertible, type RequestData, debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, setValueAtPath,
|
|
83
|
+
export { type FormDataConvertible, type RequestData, debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, setValueAtPath, showResponseErrorModal, showViewComponentErrorModal, unsetPropertyAtPath, value, when };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,15 +25,13 @@ declare class Modal {
|
|
|
25
25
|
private animationDurationInMs;
|
|
26
26
|
constructor(html: string, id: string);
|
|
27
27
|
static fromException(response: string, id: string): Modal;
|
|
28
|
-
static
|
|
29
|
-
static domainsDisabled(component: string, id: string): Modal;
|
|
28
|
+
static forViewComponent(component: string, id: string): Modal;
|
|
30
29
|
initializeDOM(): false | undefined;
|
|
31
30
|
show(): void;
|
|
32
31
|
destroy(): void;
|
|
33
32
|
}
|
|
34
33
|
declare function showResponseErrorModal(response: string): Modal;
|
|
35
|
-
declare function
|
|
36
|
-
declare function showDomainsDisabledErrorModal(response: string): Modal;
|
|
34
|
+
declare function showViewComponentErrorModal(response: string): Modal;
|
|
37
35
|
|
|
38
36
|
declare function random(length?: number): string;
|
|
39
37
|
/** Simple pattern matching util. */
|
|
@@ -82,4 +80,4 @@ declare const debug: {
|
|
|
82
80
|
adapter: (name: string, ...args: any[]) => void;
|
|
83
81
|
};
|
|
84
82
|
|
|
85
|
-
export { type FormDataConvertible, type RequestData, debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, setValueAtPath,
|
|
83
|
+
export { type FormDataConvertible, type RequestData, debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, setValueAtPath, showResponseErrorModal, showViewComponentErrorModal, unsetPropertyAtPath, value, when };
|
package/dist/index.mjs
CHANGED
|
@@ -90,28 +90,13 @@ class Modal {
|
|
|
90
90
|
</div>
|
|
91
91
|
`, id);
|
|
92
92
|
}
|
|
93
|
-
static
|
|
93
|
+
static forViewComponent(component, id) {
|
|
94
94
|
return new Modal(`
|
|
95
95
|
<style>${style()}</style>
|
|
96
96
|
<div class="h-full text-center flex">
|
|
97
97
|
<div class="m-auto">
|
|
98
98
|
<div class="text-5xl font-thin">Error</div>
|
|
99
|
-
<div class="opacity-30 text-lg font-thin m-1">The specified
|
|
100
|
-
<div class="m-2 flex justify-center text-xl opacity-30 underline underline-dotted">${component}</div>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
`, id);
|
|
104
|
-
}
|
|
105
|
-
static domainsDisabled(component, id) {
|
|
106
|
-
return new Modal(`
|
|
107
|
-
<style>${style()}</style>
|
|
108
|
-
<div class="h-full text-center flex">
|
|
109
|
-
<div class="m-auto">
|
|
110
|
-
<div class="text-5xl font-thin">Error</div>
|
|
111
|
-
<div class="opacity-30 text-lg font-thin m-1">
|
|
112
|
-
A domain-based page component was specificed, but domains are disabled. <br />
|
|
113
|
-
Set <code>domains</code> to <code>true</code> in <a class="underline underline-dotted" href="https://hybridly.dev/configuration/architecture.html#domains"><code>hybridly.config.ts</code></a>.
|
|
114
|
-
</div>
|
|
99
|
+
<div class="opacity-30 text-lg font-thin m-1">The specified view component does not exist.</div>
|
|
115
100
|
<div class="m-2 flex justify-center text-xl opacity-30 underline underline-dotted">${component}</div>
|
|
116
101
|
</div>
|
|
117
102
|
</div>
|
|
@@ -204,11 +189,8 @@ class Modal {
|
|
|
204
189
|
function showResponseErrorModal(response) {
|
|
205
190
|
return Modal.fromException(response, "non-hybrid-response");
|
|
206
191
|
}
|
|
207
|
-
function
|
|
208
|
-
return Modal.
|
|
209
|
-
}
|
|
210
|
-
function showDomainsDisabledErrorModal(response) {
|
|
211
|
-
return Modal.domainsDisabled(response, `domains-disabled-${response}`);
|
|
192
|
+
function showViewComponentErrorModal(response) {
|
|
193
|
+
return Modal.forViewComponent(response, `view-component-${response}`);
|
|
212
194
|
}
|
|
213
195
|
function htmlStyle() {
|
|
214
196
|
return `
|
|
@@ -389,4 +371,4 @@ const debug = {
|
|
|
389
371
|
adapter: (name, ...args) => makeDebugger("hybridly:adapter").extend(name)(args.shift(), ...args)
|
|
390
372
|
};
|
|
391
373
|
|
|
392
|
-
export { debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, setValueAtPath,
|
|
374
|
+
export { debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, setValueAtPath, showResponseErrorModal, showViewComponentErrorModal, unsetPropertyAtPath, value, when };
|