phoenix_duskmoon 6.1.3 → 6.3.2

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.
@@ -1,40 +1,42 @@
1
- (() => {
2
- const WebComponentHook = {
3
- mounted() {
4
- const attrs = this.el.attributes;
5
- const phxTarget = attrs["phx-target"].value;
6
- const pushEvent = phxTarget ? (event, payload, callback) => this.pushEventTo(phxTarget, event, payload, callback) : this.pushEvent;
7
- for (var i = 0; i < attrs.length; i++) {
8
- if (/^duskmoon-send-/.test(attrs[i].name)) {
9
- const eventName = attrs[i].name.replace(/^duskmoon-send-/, "");
10
- const [phxEvent, callbackName] = attrs[i].value.split(";");
11
- this.el.addEventListener(eventName, ({ detail }) => {
12
- pushEvent(phxEvent, detail, (e) => {
13
- this[callbackName]?.(e, detail, eventName);
14
- });
1
+ // assets/js/phoenix_duskmoon.js
2
+ var WebComponentHook = {
3
+ mounted() {
4
+ const attrs = this.el.attributes;
5
+ const phxTarget = attrs["phx-target"].value;
6
+ const pushEvent = phxTarget ? (event, payload, callback) => this.pushEventTo(phxTarget, event, payload, callback) : this.pushEvent;
7
+ for (var i = 0;i < attrs.length; i++) {
8
+ if (/^duskmoon-send-/.test(attrs[i].name)) {
9
+ const eventName = attrs[i].name.replace(/^duskmoon-send-/, "");
10
+ const [phxEvent, callbackName] = attrs[i].value.split(";");
11
+ this.el.addEventListener(eventName, ({ detail }) => {
12
+ pushEvent(phxEvent, detail, (e) => {
13
+ this[callbackName]?.(e, detail, eventName);
15
14
  });
16
- }
17
- if (/^duskmoon-receive-/.test(attrs[i].name)) {
18
- const eventName = attrs[i].name.replace(/^duskmoon-receive-/, "");
19
- const handler = attrs[i].value;
20
- this.handleEvent(eventName, (payload) => {
21
- if (handler && this.el[handler]) {
22
- this.el[handler]?.(payload);
23
- } else {
24
- this.el.dispatchEvent(new CustomEvent(eventName, { detail: payload }));
25
- }
26
- });
27
- }
28
- if ("duskmoon-receive" === attrs[i].name) {
29
- const [phxEvent, callbackName] = attrs[i].value.split(";");
30
- this.handleEvent(phxEvent, (payload) => {
31
- this.el[callbackName]?.(payload);
32
- });
33
- }
15
+ });
16
+ }
17
+ if (/^duskmoon-receive-/.test(attrs[i].name)) {
18
+ const eventName = attrs[i].name.replace(/^duskmoon-receive-/, "");
19
+ const handler = attrs[i].value;
20
+ this.handleEvent(eventName, (payload) => {
21
+ if (handler && this.el[handler]) {
22
+ this.el[handler]?.(payload);
23
+ } else {
24
+ this.el.dispatchEvent(new CustomEvent(eventName, { detail: payload }));
25
+ }
26
+ });
27
+ }
28
+ if (attrs[i].name === "duskmoon-receive") {
29
+ const [phxEvent, callbackName] = attrs[i].value.split(";");
30
+ this.handleEvent(phxEvent, (payload) => {
31
+ this.el[callbackName]?.(payload);
32
+ });
34
33
  }
35
34
  }
36
- };
37
- if (window) {
38
- window.__WebComponentHook__ = WebComponentHook;
39
35
  }
40
- })();
36
+ };
37
+ if (window) {
38
+ window.__WebComponentHook__ = WebComponentHook;
39
+ }
40
+ export {
41
+ WebComponentHook
42
+ };
@@ -1,28 +0,0 @@
1
- // See the Tailwind configuration guide for advanced usage
2
- // https://tailwindcss.com/docs/configuration
3
- const plugin = require('tailwindcss/plugin');
4
-
5
- module.exports = {
6
- content: [
7
- './js/**/*.js',
8
- '../lib/phoenix_duskmoon/*.ex',
9
- '../lib/phoenix_duskmoon/**/*.ex'
10
- ],
11
- plugins: [
12
- plugin(function ({ matchUtilities, theme }) {
13
- matchUtilities(
14
- {
15
- 'grid-cols-auto-fill': (value) => ({
16
- gridTemplateColumns: `repeat(auto-fill, minmax(min(${value}, 100%), 1fr))`,
17
- }),
18
- 'grid-cols-auto-fit': (value) => ({
19
- gridTemplateColumns: `repeat(auto-fit, minmax(min(${value}, 100%), 1fr))`,
20
- }),
21
- },
22
- {
23
- values: theme('width', {}),
24
- }
25
- )
26
- })
27
- ]
28
- }