@cocreate/events 1.27.4 → 1.28.0

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.
@@ -22,13 +22,13 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  steps:
24
24
  - name: Checkout
25
- uses: actions/checkout@v3
25
+ uses: actions/checkout@v4
26
26
  - name: Setup Node.js
27
- uses: actions/setup-node@v3
27
+ uses: actions/setup-node@v4
28
28
  with:
29
- node-version: 14
29
+ node-version: 22 # Required for the latest semantic-release plugins
30
30
  - name: Semantic Release
31
- uses: cycjimmy/semantic-release-action@v3
31
+ uses: cycjimmy/semantic-release-action@v4 # Update to v4 for better Node 20+ support
32
32
  id: semantic
33
33
  with:
34
34
  extra_plugins: |
@@ -36,9 +36,8 @@ jobs:
36
36
  @semantic-release/git
37
37
  @semantic-release/github
38
38
  env:
39
- GITHUB_TOKEN: "${{ secrets.GITHUB }}"
39
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # Use the built-in token if possible
40
40
  NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
41
41
  outputs:
42
42
  new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
43
43
  new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
44
-
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [1.28.0](https://github.com/CoCreate-app/CoCreate-events/compare/v1.27.4...v1.28.0) (2026-01-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update worklow ([e8f4c2d](https://github.com/CoCreate-app/CoCreate-events/commit/e8f4c2dc8c3a799adf0be238bab5a4ed9ac08915))
7
+
8
+
9
+ ### Features
10
+
11
+ * once attribute for intersectionObserver ([e58bfee](https://github.com/CoCreate-app/CoCreate-events/commit/e58bfeec8122a176179ec1b9a03557dbe80765d8))
12
+
1
13
  ## [1.27.4](https://github.com/CoCreate-app/CoCreate-events/compare/v1.27.3...v1.27.4) (2025-10-11)
2
14
 
3
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/events",
3
- "version": "1.27.4",
3
+ "version": "1.28.0",
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",
package/src/index.js CHANGED
@@ -245,6 +245,10 @@ const CoCreateEvents = {
245
245
  ? threshold.filter((value) => value >= 0 && value <= 1)
246
246
  : [0];
247
247
 
248
+ // Returns true if attribute is present AND does not equal "false"
249
+ const onceAttr = el.getAttribute(`${prefix}-once`);
250
+ const once = onceAttr !== null && onceAttr !== "false";
251
+
248
252
  // Create IntersectionObserver
249
253
  const intersectionObserver = new IntersectionObserver(
250
254
  (entries) => {
@@ -274,6 +278,10 @@ const CoCreateEvents = {
274
278
  // entry.intersectionRatio
275
279
  // }
276
280
  );
281
+ // Disconnect if once is true
282
+ if (once) {
283
+ intersectionObserver.unobserve(entry.target);
284
+ }
277
285
  }
278
286
  });
279
287
  },