Skip to content

Commit

Permalink
Add gulp as build system to generate UMD wrapper also for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
xhaggi committed Jun 8, 2023
1 parent 066013c commit 22181c7
Show file tree
Hide file tree
Showing 70 changed files with 17,017 additions and 8,113 deletions.
20 changes: 19 additions & 1 deletion dist/ext/ajax-header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

htmx.defineExtension('ajax-header', {
onEvent: function (name, evt) {
if (name === "htmx:configRequest") {
evt.detail.headers['X-Requested-With'] = 'XMLHttpRequest';
}
}
});
});
return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/ajax-header.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/ajax-header.min.js.gz
Binary file not shown.
20 changes: 19 additions & 1 deletion dist/ext/alpine-morph.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

htmx.defineExtension('alpine-morph', {
isInlineSwap: function (swapStyle) {
return swapStyle === 'morph';
Expand All @@ -13,4 +28,7 @@ htmx.defineExtension('alpine-morph', {
}
}
}
});
});
return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/alpine-morph.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/alpine-morph.min.js.gz
Binary file not shown.
20 changes: 19 additions & 1 deletion dist/ext/class-tools.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

(function () {

function splitOnWhitespace(trigger) {
Expand Down Expand Up @@ -89,4 +104,7 @@
}
}
});
})();
})();
return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/class-tools.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/class-tools.min.js.gz
Binary file not shown.
19 changes: 19 additions & 0 deletions dist/ext/client-side-templates.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

htmx.defineExtension('client-side-templates', {
transformResponse : function(text, xhr, elt) {

Expand Down Expand Up @@ -35,3 +50,7 @@ htmx.defineExtension('client-side-templates', {
return text;
}
});

return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/client-side-templates.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/client-side-templates.min.js.gz
Binary file not shown.
19 changes: 19 additions & 0 deletions dist/ext/debug.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

htmx.defineExtension('debug', {
onEvent: function (name, evt) {
if (console.debug) {
Expand All @@ -9,3 +24,7 @@ htmx.defineExtension('debug', {
}
}
});

return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/debug.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/debug.min.js.gz
Binary file not shown.
20 changes: 19 additions & 1 deletion dist/ext/disable-element.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

"use strict";

// Disable Submit Button
Expand All @@ -13,4 +28,7 @@ htmx.defineExtension('disable-element', {
targetElement.disabled = false;
}
}
});
});
return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/disable-element.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/disable-element.min.js.gz
Binary file not shown.
19 changes: 19 additions & 0 deletions dist/ext/event-header.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

(function(){
function stringifyEvent(event) {
var obj = {};
Expand Down Expand Up @@ -35,3 +50,7 @@
}
});
})();

return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/event-header.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/event-header.min.js.gz
Binary file not shown.
20 changes: 19 additions & 1 deletion dist/ext/head-support.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

//==========================================================
// head-support.js
//
Expand Down Expand Up @@ -138,4 +153,7 @@
}
});

})()
})()
return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/head-support.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/head-support.min.js.gz
Binary file not shown.
19 changes: 19 additions & 0 deletions dist/ext/include-vals.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

(function(){

function mergeObjects(obj1, obj2) {
Expand All @@ -22,3 +37,7 @@
}
});
})();

return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/include-vals.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/include-vals.min.js.gz
Binary file not shown.
20 changes: 19 additions & 1 deletion dist/ext/json-enc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

htmx.defineExtension('json-enc', {
onEvent: function (name, evt) {
if (name === "htmx:configRequest") {
Expand All @@ -9,4 +24,7 @@ htmx.defineExtension('json-enc', {
xhr.overrideMimeType('text/json');
return (JSON.stringify(parameters));
}
});
});
return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/json-enc.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/json-enc.min.js.gz
Binary file not shown.
19 changes: 19 additions & 0 deletions dist/ext/loading-states.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

;(function () {
let loadingStatesUndoQueue = []

Expand Down Expand Up @@ -177,3 +192,7 @@
},
})
})()

return htmx;

}));
1 change: 1 addition & 0 deletions dist/ext/loading-states.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/ext/loading-states.min.js.gz
Binary file not shown.
19 changes: 19 additions & 0 deletions dist/ext/method-override.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['htmx.org'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('htmx.org'));
} else {
// Browser globals (root is window)
factory(root.htmx);
}
}(typeof self !== 'undefined' ? self : this, function (htmx) {

htmx.defineExtension('method-override', {
onEvent: function (name, evt) {
if (name === "htmx:configRequest") {
Expand All @@ -9,3 +24,7 @@ htmx.defineExtension('method-override', {
}
}
});

return htmx;

}));
Loading

0 comments on commit 22181c7

Please sign in to comment.