Skip to content

Commit

Permalink
fix: compatability with svg
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBLT committed Feb 21, 2024
1 parent b8e6b03 commit 55a60ab
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
5 changes: 0 additions & 5 deletions packages/@hec.js/api/lib/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ export class API {
const response = await route.fetch(apiRequest, this.#context);

if (response) {

if (route.contentType && !route.contentType.includes('*')) {
response.headers.set('content-type', route.contentType);
}

return response;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@hec.js/ui/dist/hec.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/@hec.js/ui/dist/hec.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/@hec.js/ui/lib/src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { dataRoutePlugin } from "./plugins/data-route.js";

/**
* @template [T=HTMLElement]
* @type { Plugin<HTMLElement | HTMLInputElement>[] }
* @type { Plugin<HTMLElement | HTMLInputElement | SVGElement>[] }
*/
export const plugins = [
dataForPlugin,
Expand Down
5 changes: 2 additions & 3 deletions packages/@hec.js/ui/lib/src/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ export function templateByNode(template, props = {}) {
setPropsOf(node, props);
}

if (node instanceof HTMLElement) {

if (node instanceof HTMLElement || node instanceof SVGElement) {

setPropsOf(node, props);

Expand Down Expand Up @@ -149,7 +148,7 @@ export function templateByNode(template, props = {}) {
}

/**
* @param { HTMLElement } node
* @param { HTMLElement | SVGElement } node
* @param { {[key: string]: any } } props
*/
export const executeNodeAttributesTemplate = (node, props) => {
Expand Down

0 comments on commit 55a60ab

Please sign in to comment.