cocooned 1.4.1 → 2.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92137d75843c047e0aa1ffe5f385217e4ead03225356dc69d205320f948baa06
4
- data.tar.gz: 4ad82cd191b91ed1d6f313fac56a66b6824bc0c2a0f11056247048d33988d92a
3
+ metadata.gz: ec9d29b69c096e2ef655c9c346bbfa67fe6ae1b8f134a5b445a3ddafd65944b6
4
+ data.tar.gz: b0ba0335e01269a60ae779869766d0d7272041ff44cc9c13b76665761407203f
5
5
  SHA512:
6
- metadata.gz: 02d0e6ea881b5459fa00cb87b8dcba12947805a6bc5a428f0660106dc9d7b0495e18937c50f5fc8fd15d27f994aa0ca5dfe830bfbb22051fbbf7d3a54795041b
7
- data.tar.gz: b8a0a3a01e109ab0654fcb3b2aaaf8c166a6292f9ea90459ad88b0fe510ce6aac471f134e169395b9882c43bab79df9bc7cca04bcda13996e0d0f678da02c754
6
+ metadata.gz: cd621114abef804aa4fbadf97c444af62f576cfa611ca29a29a9d23945a14e505a87ca3dc5a58839a66d456177b571aa979fe691dc3664453628286d678c4245
7
+ data.tar.gz: 113d6f92fb2ae9b16f9e6df82afa972bd19d530c0ca64f9f31de5a6d04303dec10a4d11b388be0c808f73155f819a5b16892f1e12c6ed695987ad04edf849405
data/CHANGELOG.md ADDED
@@ -0,0 +1,184 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## Version 2.0.1 (2023-03-20)
10
+
11
+ ### Fixed
12
+
13
+ * Webpack compatibility (#39)
14
+
15
+ ## Version 2.0.0 (2023-03-07)
16
+
17
+ * Drop support for Rails < 6.0
18
+
19
+ ### Breaking changes
20
+
21
+ #### Features dropped without any replacements
22
+
23
+ * Use of a function as `data-association-insertion-node` on add triggers support have been dropped (#18)
24
+ As HTML dataset are `DOMStringMap`, they only support strings as values. The only way to use a function to loop up for insertion node on an add trigger was to use jQuery (ex: `$(addTrigger).data('association-insertion-node', (add) => {})`).
25
+ * `data-remove-timeout` on remove triggers (#18)
26
+ Items are now removed at the end of their hiding animation.
27
+
28
+ #### Events listener now use `CustomEvent`s (#17)
29
+
30
+ Cocooned events have been rewritten around `CustomEvent`s and standard `addEventListener` / `dispatchEvent`.
31
+ You should either rewrite your event binding with `addEventListener` or change your jQuery ones as follow:
32
+
33
+ ```diff
34
+ - $(element).on('cocooned:event', (e, node, cocooned) => {
35
+ + $(element).on('cocooned:event', e => {
36
+ + { node, cocooned } = e.detail // Use nodes in 'cocooned:before-reindex' / 'cocooned:after-reindex' events
37
+ })
38
+ ```
39
+
40
+ ### Deprecations
41
+
42
+ These features are now deprecated and emit a warning message:
43
+
44
+ * `:insertion_traversal` option on `cocooned_add_item_link` (#18)
45
+ Use a more specific selector as `data-association-insertion-node` (set through `:insertion_node`) instead.
46
+ * Importing `@notus.sh/cocooned/cocooned` in your JavaScript files (#22)
47
+ Import Cocooned from either `@notus.sh/cocooned`, `@notus.sh/cocooned/jquery` or `@notus.sh/cocooned/src/cocooned/cocooned` instead.
48
+
49
+ These features are now deprecated but don't emit any warning message (sorry):
50
+
51
+ * Containers identified only by the `data-cocooned-options` attribute (#26)
52
+ Use the `cocooned_container` helper in your forms.
53
+ * Containers identified only by the `.cocooned-item` class (#26)
54
+ Use the `cocooned_item` helper in your forms.
55
+
56
+ These features were already deprecated but now emit a warning message:
57
+
58
+ * `link_to_add_association` (replaced by `cocooned_add_item_link`)
59
+ * `link_to_remove_association` (replaced by `cocooned_remove_item_link`)
60
+ * The `cocoon` I18n namespace (replaced by `cocooned`)
61
+ * `:render_option` option on `cocooned_add_item_link` / `link_to_add_association`
62
+ Use `:form_options` and/or `:locals` instead.
63
+
64
+ These features were already deprecated but (still) don't emit any warning message (sorry):
65
+
66
+ * Events in `cocoon` namespace (replaced by `cocooned`)
67
+ * Triggers only identified by Cocoon classes (`.add_fields`, `.remove_fields`)
68
+ * Cocoon auto-start logic (non-identified containers)
69
+
70
+ All deprecated features will be removed in the next major release.
71
+
72
+ ### Added
73
+
74
+ * Add support for association scoped label to `cocooned_move_item_up_link` and `cocooned_move_item_down_link` (#11)
75
+ * Replace dependency to jQuery by an optional jQuery integration (#22)
76
+ * Introduce `cocooned_container` and `cocooned_item` helpers to ease forms markup construction (#26)
77
+ * Allow to choose between links or buttons for triggers (#27)
78
+ * Use Web Animation API for animations instead of CSS / jQuery (#29)
79
+
80
+ ### Fixed
81
+
82
+ * Compatibility with Rails >= 7.0
83
+ * Compatibility with Ruby >= 3.1
84
+
85
+ ### Changed
86
+
87
+ * Rewrite JavaScript tests suite with [Jest](https://jestjs.io/) (#2) (replace Jasmine, now deprecated)
88
+ * Reorganize JavaScript code and tests into the `npm` folder (#5)
89
+ * Rewrite JavaScript code to use ESM modules (#6) and modern ECMAScript idioms (#7, #14)
90
+ * Integrate deprecation messages with ActiveSupport::Deprecation (#9)
91
+ * Refactor helpers as tag classes (#10)
92
+ * Use HTML `<template>` instead of a data-attribute to pass subform template to JavaScript (#12)
93
+ * Split JavaScript monolith into smaller classes with minimal public API (#8, #18, #21)
94
+ * Isolate and unit test Cocoon compatibility code (#23)
95
+ * Use data-attributes instead of classes to hook JavaScript on (#26)
96
+ * Switch from Travis CI to Github actions (#30)
97
+ * Add Ruby 3.2 to CI (#32)
98
+ * Adapt NPM packaging scripts (#35)
99
+
100
+ ## Version 1.4.1 (2022-08-08)
101
+
102
+ * Compatibility with Rails 7.0
103
+
104
+ ## Version 1.4.0 (2021-08-15)
105
+
106
+ ### Breaking changes
107
+
108
+ * Drop support for Rails < 5.0 and Ruby < 2.5
109
+ * Pass the original browser event to all event handlers _via_ e.originalEvent. (See [jQuery Event object](https://api.jquery.com/category/events/event-object/)).
110
+
111
+ ### Backported (from cocoon 1.2.15)
112
+
113
+ * Add support for @hotwired/turbo (thanks @entretechno-jeremiah in [nathanvda/cocoon#600](https://github.com/nathanvda/cocoon/pull/600))
114
+
115
+ ### Fixed
116
+
117
+ * Prevent side effects on options passed to view helpers.
118
+ * Prevent event propagation to parent elements (thanks @ashmill23 in [nathanvda/cocoon#560](https://github.com/nathanvda/cocoon/pull/560) and @zmagod in [nathanvda/cocoon#536](https://github.com/nathanvda/cocoon/pull/536))
119
+
120
+ ### Changed
121
+
122
+ * Use form builder to add the hidden `_destroy` field instead of `hidden_field` (thanks @rradonic in [nathanvda/cocoon#559](https://github.com/nathanvda/cocoon/pull/559))
123
+ * Update deprecation warnings to postpone compatibility drop with the original `cocoon` to 3.0 (instead of 2.0)
124
+
125
+ ## Version 1.3.2 (2019-04-05)
126
+
127
+ ### Backported (from cocoon 1.2.13)
128
+
129
+ * Compatibility with Mongoid 7+ (thanks @startouf in [nathanvda/cocoon#527](https://github.com/nathanvda/cocoon/pull/527))
130
+
131
+ ## Version 1.3.1 (2018-08-24)
132
+
133
+ ### Changed
134
+
135
+ * Use UMD pattern to load the Cocooned module
136
+ * Now publish packages on both rubygems.org and npmjs.com (fixes [nathanvda/cocoon#452](https://github.com/nathanvda/cocoon/issue/452), [nathanvda/cocoon#555](https://github.com/nathanvda/cocoon/issue/555))
137
+
138
+ ## Version 1.3.0 (2018-08-17)
139
+
140
+ ### Breaking changes
141
+
142
+ * Drop support for Ruby 1.9 (thanks @simi)
143
+ * Drop support for Rubinius, Ruby < 2.2 and Rails < 4.0
144
+ * Drop support for custom wrapper class on item containers
145
+ Originaly supported _via_ an option on `link_to_remove_association`.
146
+
147
+ ### Deprecated
148
+
149
+ The gem has been renamed to `cocooned`:
150
+
151
+ * `link_to_add_association` has been renamed `cocooned_add_item_link`
152
+ * Generated add links class `add_fields` has been renamed `cocooned-add`
153
+ * `link_to_remove_association` has been renamed `cocooned_remove_item_link`
154
+ * Generated remove links class `remove_fields` has been renamed `cocooned-remove`
155
+ * `cocoon:*` and `*.cocoon` Javascript events have been renamed to `cocooned:*` and `*.cocooned`
156
+ (ex: `cocooned:before-insert`, `click.cocooned`)
157
+ * The `cocoon` i18n scope have been renamed to `cocooned`
158
+ * The `.nested-fields` default item wrapper class have been renamed to `cocooned-item`
159
+
160
+ Other deprecations:
161
+
162
+ * `link_to_add_association`/`cocooned_add_item_link` no longer require a `:render_options` hash to pass locals to the nested partial
163
+
164
+ ### Added
165
+
166
+ * Automatically remove `required` attributes on destroyed elements (thanks @markkhair in [nathanvda/cocoon#496](https://github.com/nathanvda/cocoon/pull/496), fixes [nathanvda/cocoon#386](https://github.com/nathanvda/cocoon/issue/386))
167
+ * Add extra properties on events (thanks @ayaman)
168
+ * Add a basic package.json to be used with Webpack (thanks @dmfrancisco in [nathanvda/cocoon#454](https://github.com/nathanvda/cocoon/pull/454))
169
+ * Namespace click handlers (thanks @chrise86 in [nathanvda/cocoon#310](https://github.com/nathanvda/cocoon/pull/310))
170
+
171
+ ### Fixed
172
+
173
+ * Compatibility with jQuery 3 (thanks @mstmfm in [nathanvda/cocoon#379](https://github.com/nathanvda/cocoon/pull/379))
174
+
175
+ ### Changed
176
+
177
+ * Refactor cocoon javascript as a self-contained object with same functionalities
178
+ * Remove Jeweller (thanks @brixen, @tlynam)
179
+
180
+ ---
181
+
182
+ For changes prior to 1.3.0 (from 1.0.0 to 1.2.11), please refer to the [cocoon changelog](https://github.com/nathanvda/cocoon/blob/master/History.md).
183
+
184
+ Many thanks to [all contributors to the original gem](https://github.com/nathanvda/cocoon/graphs/contributors).