@cocreate/events 1.13.8 → 1.14.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [1.14.1](https://github.com/CoCreate-app/CoCreate-events/compare/v1.14.0...v1.14.1) (2023-11-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * meta name typo ([5d896fb](https://github.com/CoCreate-app/CoCreate-events/commit/5d896fb644f5f005c4a7a91f15caab63ee3aed9a))
7
+ * removed unused code ([9a302bc](https://github.com/CoCreate-app/CoCreate-events/commit/9a302bcc92ee35117029772c9fe1d638d75ea881))
8
+ * update host ([bd0d438](https://github.com/CoCreate-app/CoCreate-events/commit/bd0d4381d5ab2d5c7069d9489c9d400830ec81e5))
9
+
10
+ # [1.14.0](https://github.com/CoCreate-app/CoCreate-events/compare/v1.13.8...v1.14.0) (2023-11-03)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * favicon.ico path ([d4dd07c](https://github.com/CoCreate-app/CoCreate-events/commit/d4dd07c2532b9bb2c69f50770165a0daa73ce2cb))
16
+ * update dependencies to the lates versions ([bca4417](https://github.com/CoCreate-app/CoCreate-events/commit/bca44178630f52bced0864850228da8310630958))
17
+
18
+
19
+ ### Features
20
+
21
+ * trigger prefix event on target elements ([f8a96df](https://github.com/CoCreate-app/CoCreate-events/commit/f8a96dff58771fc2cd91653cb9281443b54c1599))
22
+
1
23
  ## [1.13.8](https://github.com/CoCreate-app/CoCreate-events/compare/v1.13.7...v1.13.8) (2023-10-25)
2
24
 
3
25
 
@@ -12,8 +12,7 @@ module.exports = {
12
12
  "pathname": "/docs/events/index.html",
13
13
  "src": "{{./docs/index.html}}",
14
14
  "host": [
15
- "*",
16
- "general.cocreate.app"
15
+ "*"
17
16
  ],
18
17
  "directory": "events",
19
18
  "content-type": "{{content-type}}",
package/demo/click.html CHANGED
@@ -6,9 +6,9 @@
6
6
  <!-- CoCreate Favicon -->
7
7
  <link
8
8
  rel="icon"
9
- href="https://cdn.cocreate.app/favicon.ico"
10
- type="image/ico"
11
- sizes="16x16" />
9
+ type="image/png"
10
+ sizes="32x32"
11
+ href="../assets/favicon.ico" />
12
12
 
13
13
  <!-- Custom CSS -->
14
14
  <style type="text/css">
package/demo/index.html CHANGED
@@ -6,9 +6,9 @@
6
6
  <!-- CoCreate Favicon -->
7
7
  <link
8
8
  rel="icon"
9
- href="https://cdn.cocreate.app/favicon.ico"
10
- type="image/ico"
11
- sizes="16x16" />
9
+ type="image/png"
10
+ sizes="32x32"
11
+ href="../assets/favicon.ico" />
12
12
 
13
13
  <!-- Custom CSS -->
14
14
  <style type="text/css">
@@ -6,9 +6,9 @@
6
6
  <!-- CoCreate Favicon -->
7
7
  <link
8
8
  rel="icon"
9
- href="https://cdn.cocreate.app/favicon.ico"
10
- type="image/ico"
11
- sizes="16x16" />
9
+ type="image/png"
10
+ sizes="32x32"
11
+ href="../assets/favicon.ico" />
12
12
 
13
13
  <!-- Custom CSS -->
14
14
  <style type="text/css">
@@ -6,9 +6,9 @@
6
6
  <!-- CoCreate Favicon -->
7
7
  <link
8
8
  rel="icon"
9
- href="https://cdn.cocreate.app/favicon.ico"
10
- type="image/ico"
11
- sizes="16x16" />
9
+ type="image/png"
10
+ sizes="32x32"
11
+ href="../assets/favicon.ico" />
12
12
  <!-- Custom CSS -->
13
13
  <style type="text/css">
14
14
  .test {
@@ -6,9 +6,9 @@
6
6
  <!-- CoCreate Favicon -->
7
7
  <link
8
8
  rel="icon"
9
- href="https://cdn.cocreate.app/favicon.ico"
10
- type="image/ico"
11
- sizes="16x16" />
9
+ type="image/png"
10
+ sizes="32x32"
11
+ href="../assets/favicon.ico" />
12
12
  <link rel="manifest" href="/manifest.webmanifest" />
13
13
  </head>
14
14
  <body>
package/docs/index.html CHANGED
@@ -11,10 +11,10 @@
11
11
  sizes="32x32"
12
12
  href="https://cocreate.app/images/favicon.ico" />
13
13
  <meta
14
- key="description"
14
+ name="description"
15
15
  content="A simple HTML5 and pure javascript component. Easy configuration using HTML5 attributes or Javscript api and highly styleable." />
16
16
  <meta
17
- key="keywords"
17
+ name="keywords"
18
18
  content="helper classes, utility classes, css framework, css library, inline style classes" />
19
19
  <meta name="robots" content="index,follow" />
20
20
  <meta
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/events",
3
- "version": "1.13.8",
3
+ "version": "1.14.1",
4
4
  "description": "A simple events component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "events",
@@ -58,9 +58,9 @@
58
58
  "webpack-log": "^3.0.1"
59
59
  },
60
60
  "dependencies": {
61
- "@cocreate/actions": "^1.12.0",
62
- "@cocreate/element-prototype": "^1.11.7",
63
- "@cocreate/observer": "^1.11.6",
64
- "@cocreate/utils": "^1.26.1"
61
+ "@cocreate/actions": "^1.12.1",
62
+ "@cocreate/element-prototype": "^1.11.8",
63
+ "@cocreate/observer": "^1.11.7",
64
+ "@cocreate/utils": "^1.26.2"
65
65
  }
66
66
  }
package/src/index.js CHANGED
@@ -20,12 +20,11 @@
20
20
  // you must obtain a commercial license from CoCreate LLC.
21
21
  // For details, visit <https://cocreate.app/licenses/> or contact us at sales@cocreate.app.
22
22
 
23
- import { queryElements } from '@cocreate/utils';
23
+ import { queryElements, checkMediaQueries } from '@cocreate/utils';
24
24
  import action from '@cocreate/actions';
25
25
  import observer from '@cocreate/observer';
26
26
  import '@cocreate/element-prototype';
27
27
 
28
-
29
28
  const CoCreateEvents = {
30
29
 
31
30
  init: function (prefix, events) {
@@ -122,10 +121,8 @@ const CoCreateEvents = {
122
121
  this.elements.set(el, prefixes)
123
122
  } else if (!prefixes[prefix]) {
124
123
  prefixes[prefix] = { events }
125
- } else {
124
+ } else
126
125
  isEventable = false
127
- // events = //prefixes[prefix].events
128
- }
129
126
 
130
127
  let customEvents = el.getAttribute(`${prefix}-events`)
131
128
  if (customEvents) {
@@ -237,7 +234,11 @@ const CoCreateEvents = {
237
234
  if (!values || values.length == 0)
238
235
  return;
239
236
 
240
- let targetAttribute = element.getAttribute(`${prefix}-attribute`) || 'class';
237
+ let targetAttribute = element.getAttribute(`${prefix}-attribute`);
238
+ // targetAttribute = checkMediaQueries(targetAttribute)
239
+ // if (targetAttribute === false)
240
+ // return
241
+
241
242
  let targetText = element.getAttribute(`${prefix}-text`);
242
243
  let targetHtml = element.getAttribute(`${prefix}-html`);
243
244
  let targetKey = element.getAttribute(`${prefix}-key`);
@@ -253,6 +254,10 @@ const CoCreateEvents = {
253
254
 
254
255
  groupValues = groupValues.map(x => x.trim());
255
256
  let groupAttribute = el.getAttribute(`${prefix}-attribute`) || 'class';
257
+ // groupAttribute = checkMediaQueries(groupAttribute)
258
+ // if (!groupAttribute)
259
+ // return
260
+
256
261
  let groupKey = el.getAttribute(`${prefix}-key`)
257
262
 
258
263
  // el.removeAttribute(prefix)
@@ -270,8 +275,12 @@ const CoCreateEvents = {
270
275
  if (targetElements === false)
271
276
  targetElements = [element]
272
277
 
273
- for (let i = 0; i < targetElements.length; i++)
274
- this.setValue(prefix, targetElements[i], targetAttribute, values, targetKey)
278
+ for (let i = 0; i < targetElements.length; i++) {
279
+ if (!targetAttribute && targetAttribute !== '' && ['click', 'focus', 'blur'].includes(prefix)) {
280
+ targetElements[i][prefix]()
281
+ } else
282
+ this.setValue(prefix, targetElements[i], targetAttribute, values, targetKey)
283
+ }
275
284
 
276
285
  document.dispatchEvent(new CustomEvent(`${prefix}End`, {
277
286
  detail: {}