Skip to content

Commit

Permalink
update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
1cg committed Dec 23, 2024
1 parent fd4a00c commit e799252
Show file tree
Hide file tree
Showing 9 changed files with 7,093 additions and 4,148 deletions.
2,253 changes: 1,421 additions & 832 deletions dist/idiomorph-ext.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/idiomorph-ext.min.js

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions dist/idiomorph-htmx.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
(function(){
function createMorphConfig(swapStyle) {
if (swapStyle === 'morph' || swapStyle === 'morph:outerHTML') {
return {morphStyle: 'outerHTML'}
} else if (swapStyle === 'morph:innerHTML') {
return {morphStyle: 'innerHTML'}
} else if (swapStyle.startsWith("morph:")) {
return Function("return (" + swapStyle.slice(6) + ")")();
}
(function () {
function createMorphConfig(swapStyle) {
if (swapStyle === "morph" || swapStyle === "morph:outerHTML") {
return { morphStyle: "outerHTML" };
} else if (swapStyle === "morph:innerHTML") {
return { morphStyle: "innerHTML" };
} else if (swapStyle.startsWith("morph:")) {
return Function("return (" + swapStyle.slice(6) + ")")();
}
}

htmx.defineExtension('morph', {
isInlineSwap: function(swapStyle) {
let config = createMorphConfig(swapStyle);
return config?.morphStyle === "outerHTML" || config?.morphStyle == null;
},
handleSwap: function (swapStyle, target, fragment) {
let config = createMorphConfig(swapStyle);
if (config) {
return Idiomorph.morph(target, fragment.children, config);
}
}
});
})()
htmx.defineExtension("morph", {
isInlineSwap: function (swapStyle) {
let config = createMorphConfig(swapStyle);
return config?.morphStyle === "outerHTML" || config?.morphStyle == null;
},
handleSwap: function (swapStyle, target, fragment) {
let config = createMorphConfig(swapStyle);
if (config) {
return Idiomorph.morph(target, fragment.children, config);
}
},
});
})();
Loading

0 comments on commit e799252

Please sign in to comment.